mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
54 lines
1.1 KiB
ActionScript
54 lines
1.1 KiB
ActionScript
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(param1:MovieClip)
|
|
{
|
|
super(param1);
|
|
_stages = param1.stages;
|
|
clearCount();
|
|
update();
|
|
}
|
|
|
|
public function clearCount() : void
|
|
{
|
|
_totalCount = 0;
|
|
}
|
|
|
|
public function incCount() : void
|
|
{
|
|
_totalCount = _totalCount + 1;
|
|
}
|
|
|
|
public function update() : void
|
|
{
|
|
var _loc2_:int = 0;
|
|
var _loc1_:* = 0;
|
|
while(_loc2_ < _stages.length)
|
|
{
|
|
if(_totalCount < _stages[_loc2_].total)
|
|
{
|
|
break;
|
|
}
|
|
_loc1_ = _loc2_;
|
|
_loc2_++;
|
|
}
|
|
if(_currentStage != _loc1_)
|
|
{
|
|
_currentStage = _loc1_;
|
|
_mc.gotoAndPlay(_stages[_currentStage].label);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|