public SingleActionCommand(string name, string description, Image image, IBattleAction action)
 {
     Name = name;
     Image = image;
     Description = description;
     _action = action;
 }
示例#2
0
 public WarMagicData(string name, string description, IBattleAction action, int expandMP, int area, int range)
 {
     this.Name = name;
     this.Description = description;
     this.Action = action;
     this.ExpandMP = expandMP;
     this.Area = area;
     this.Range = range;
 }
 public void StartPlayback()
 {
     this.SetDefaultPlaybackScale();
     Service.Get <UXController>().HUD.UpdateCurrentReplaySpeedUI();
     Service.Get <UXController>().HUD.ShowReplayTimer();
     this.battleController.PrepareWorldForBattle();
     Service.Get <EventManager>().SendEvent(EventId.EquipmentBuffShaderRemove, GameConstants.EQUIPMENT_SHADER_DELAY_REPLAY);
     this.battleController.StartBattle();
     this.eventManager.RegisterObserver(this, EventId.EntityKilled, EventPriority.Default);
     this.eventManager.RegisterObserver(this, EventId.BattleEndProcessing, EventPriority.Default);
     this.playbackBattleAttr = new BattleAttributes();
     this.recordBattleAttr   = this.CurrentBattleRecord.BattleAttributes;
     this.timers             = new uint[this.CurrentBattleRecord.BattleActions.Count];
     for (int i = 0; i < this.CurrentBattleRecord.BattleActions.Count; i++)
     {
         IBattleAction battleAction = this.CurrentBattleRecord.BattleActions[i];
         TimerDelegate callback;
         if (!this.actionCallbacks.TryGetValue(battleAction.ActionId, out callback))
         {
             callback = new TimerDelegate(this.DefaultActionCallback);
         }
         this.timers[i] = this.timerManager.CreateSimTimer(battleAction.Time + 1u, false, callback, battleAction);
     }
 }
示例#4
0
        private static IBattleAction CreateBattleAction(string actionId, object action)
        {
            IBattleAction result = null;

            switch (actionId)
            {
            case "TroopPlaced":
                result = (new TroopPlacedAction().FromObject(action) as TroopPlacedAction);
                break;

            case "SpecialAttackDeployed":
                result = (new SpecialAttackDeployedAction().FromObject(action) as SpecialAttackDeployedAction);
                break;

            case "HeroDeployed":
                result = (new HeroDeployedAction().FromObject(action) as HeroDeployedAction);
                break;

            case "HeroAbilityActivated":
                result = (new HeroAbilityAction().FromObject(action) as HeroAbilityAction);
                break;

            case "ChampionDeployed":
                result = (new ChampionDeployedAction().FromObject(action) as ChampionDeployedAction);
                break;

            case "SquadTroopPlaced":
                result = (new SquadTroopPlacedAction().FromObject(action) as SquadTroopPlacedAction);
                break;

            case "BattleCanceled":
                result = (new BattleCanceledAction().FromObject(action) as BattleCanceledAction);
                break;
            }
            return(result);
        }
示例#5
0
    /// <summary>
    /// Sets the phase. Reset all state variables
    /// </summary>
    /// <param name="phase">Phase.</param>
    public void SetPhase(Phase newPhase)
    {
        turnClock = 0;
        this.phase = newPhase;
        switch(newPhase) {
        case Phase.REQUIRES_INPUT:
            action = null;
            turnComplete = -1;
            break;
        case Phase.PREPARE:
            turnComplete = action.timePrepare;
            break;
        case Phase.EXECUTE:
            turnComplete = action.timeAction;
            break;
        case Phase.RECOVER:
            turnComplete = action.timeRecover;
            break;
        }

        CheckNextPhase(false);
    }
示例#6
0
 /// <summary>
 /// Sets the action. This will reset all variables to Prepare
 /// </summary>
 /// <param name="action">Action.</param>
 public void SetAction(IBattleAction action)
 {
     this.action = action;
     SetPhase(Phase.PREPARE);
 }
 protected void OnActionSelected(BattleEntity entity, IBattleAction action)
 {
     mBattleTimeQueue.SetAction(entity, action);
 }
示例#8
0
 public WarSkill(Skill skill, IBattleAction action)
 {
     _skill = skill;
     _action = action;
 }
示例#9
0
 public void SetSpecialAction(IBattleAction action)
 {
     _specialAction = action;
 }
示例#10
0
 public void SetBasicAction(IBattleAction action)
 {
     _basicAction = action;
 }
示例#11
0
 public void SetAction(BattleEntity entity, IBattleAction action)
 {
     entity.turnState.SetAction(action);
 }
示例#12
0
 public void Add(IBattleAction battleAction)
 {
     this.battleActions.Add(battleAction);
 }
示例#13
0
        private static IBattleAction CreateBattleAction(string actionId, object action)
        {
            IBattleAction result = null;
            uint          num    = < PrivateImplementationDetails >.ComputeStringHash(actionId);

            if (num <= 1033960932u)
            {
                if (num != 255476488u)
                {
                    if (num != 619276938u)
                    {
                        if (num == 1033960932u)
                        {
                            if (actionId == "HeroAbilityActivated")
                            {
                                result = (new HeroAbilityAction().FromObject(action) as HeroAbilityAction);
                            }
                        }
                    }
                    else if (actionId == "TroopPlaced")
                    {
                        result = (new TroopPlacedAction().FromObject(action) as TroopPlacedAction);
                    }
                }
                else if (actionId == "BattleCanceled")
                {
                    result = (new BattleCanceledAction().FromObject(action) as BattleCanceledAction);
                }
            }
            else if (num <= 2120365278u)
            {
                if (num != 1186883982u)
                {
                    if (num == 2120365278u)
                    {
                        if (actionId == "SpecialAttackDeployed")
                        {
                            result = (new SpecialAttackDeployedAction().FromObject(action) as SpecialAttackDeployedAction);
                        }
                    }
                }
                else if (actionId == "SquadTroopPlaced")
                {
                    result = (new SquadTroopPlacedAction().FromObject(action) as SquadTroopPlacedAction);
                }
            }
            else if (num != 3440613923u)
            {
                if (num == 3805918252u)
                {
                    if (actionId == "ChampionDeployed")
                    {
                        result = (new ChampionDeployedAction().FromObject(action) as ChampionDeployedAction);
                    }
                }
            }
            else if (actionId == "HeroDeployed")
            {
                result = (new HeroDeployedAction().FromObject(action) as HeroDeployedAction);
            }
            return(result);
        }