示例#1
0
 public BattleAction(AttackSide side, Type type, TacticsMove atk, TacticsMove def)
 {
     this.side = side;
     this.type = type;
     attacker  = atk;
     defender  = def;
     weaponAtk = attacker.inventory.GetFirstUsableItemTuple(ItemCategory.WEAPON);
     weaponDef = defender.inventory.GetFirstUsableItemTuple(ItemCategory.WEAPON);
     staffAtk  = attacker.inventory.GetFirstUsableItemTuple(ItemCategory.SUPPORT);
     if (defender.currentTile)
     {
         terrainDef = defender.currentTile.terrain;
     }
 }
示例#2
0
 public void KnockbackStraight(Vector2 direction, float knockbackDistance, AttackSide attackSide)
 {
     knockBack           = true;
     totalTravelDistance = knockbackDistance;
     knockBackDirection  = direction;
     if (attackSide == AttackSide.horizontal)
     {
         recoilState.SetState(new bool[] { true, false });
     }
     else if (attackSide == AttackSide.down)
     {
         recoilState.SetState(new bool[] { false, true });
     }
 }
示例#3
0
    public void SetupTile(BehaviorAction action, UnitBasicProperties properties, AttackSide side)
    {
        action.Side = side;
        if (action is AttackAction)
        {
            attack = (AttackAction)action;
        }
        else if (action is MovementAction)
        {
            movement = (MovementAction)action;
        }

        UnitProperties = properties;

        IsSelected = false;
        IsDisabled = false;

        SetupAttack();
    }