mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-21 09:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,52 @@
|
||||
package room
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
|
||||
public class RoomObject_SocialTrigger extends RoomObject
|
||||
{
|
||||
|
||||
private var _currentStage:int;
|
||||
|
||||
private var _stages:Array;
|
||||
|
||||
private var _totalCount:int;
|
||||
|
||||
public function RoomObject_SocialTrigger(mc:MovieClip)
|
||||
{
|
||||
super(mc);
|
||||
this._stages = mc.stages;
|
||||
this.clearCount();
|
||||
this.update();
|
||||
}
|
||||
|
||||
public function clearCount() : void
|
||||
{
|
||||
this._totalCount = 0;
|
||||
}
|
||||
|
||||
public function incCount() : void
|
||||
{
|
||||
++this._totalCount;
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(var newStage:int = 0; i < this._stages.length; )
|
||||
{
|
||||
if(this._totalCount < this._stages[i].total)
|
||||
{
|
||||
break;
|
||||
}
|
||||
newStage = i;
|
||||
i++;
|
||||
}
|
||||
if(this._currentStage != newStage)
|
||||
{
|
||||
this._currentStage = newStage;
|
||||
_mc.gotoAndPlay(this._stages[this._currentStage].label);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user