private void KickTankard(SpaceBehavior space) { WaitToArriveTask waitTask = new WaitToArriveTask(transform, new TwoDLoc(GridLoc.x, GridLoc.z)); Transform localTankard = Services.Board.GetTankardInSpace(GridLoc); Debug.Assert(localTankard != null, "Didn't find local tankard."); MoveObjectTask moveTask = new MoveObjectTask(localTankard, new TwoDLoc(GridLoc.x, GridLoc.z), new TwoDLoc(space.GridLocation.x, space.GridLocation.z)); DamageRemotelyTask damageTask = new DamageRemotelyTask(new TwoDLoc(space.GridLocation.x, space.GridLocation.z), drinkDamage, this); waitTask.Then(moveTask); moveTask.Then(damageTask); space.Tankard = true; Services.Board.GetSpace(GridLoc.x, GridLoc.z).Tankard = false; localTankard.GetComponent <TankardBehavior>().GridLoc = new TwoDLoc(space.GridLocation.x, space.GridLocation.z); Services.Tasks.AddTask(waitTask); Services.UI.OpponentStatement(KICK_MSG); Services.Events.Unregister <InputEvent>(ChooseTankardKick); Services.Board.HighlightAllAroundSpace(GridLoc.x, GridLoc.z, BoardBehavior.OnOrOff.Off); }
void Awake() { moveObjectTask = gameObject.AddComponent <MoveObjectTask>(); stageCreateTask = gameObject.AddComponent <StageCreateTask>(); uiTask = gameObject.AddComponent <GameUiTask>(); mapObjects = new List <MapObject>(); stageCreateTask.MapDataCreate(GetPath.Txt + "/" + stageName, mapObjects, ref stageData); Special = new SpecialObject(); textEvent = false; eventCount = 0; controllerTask = GetComponent <ControllerTask>(); drawFloorTask = GetComponent <DrawingFloorTask>(); }