public ShipInWar GetAttackerShip(AttackParam ap)
 {
     if (ap.attackSide == AttackSide.Self)
     {
         return this.selfShips[ap.fromIndex];
     }
     return this.enemyShips[ap.fromIndex];
 }
 public ShipInWar GetAttackerShip(AttackParam ap)
 {
     if (ap.attackSide == AttackSide.Self)
     {
         return(this.selfShips[ap.fromIndex]);
     }
     return(this.enemyShips[ap.fromIndex]);
 }
 public void startAttack(AttackParam[] attacks)
 {
     this.attackParams = attacks;
     if ((this.attackParams == null) || (this.attackParams.Length == 0))
     {
         this.OnAnimationFinished(EventArgs.Empty);
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
 public AttackParam GetNextAttack()
 {
     if (this.currentNormalAttackIndex < this.normalAttacks.Length)
     {
         AttackParam param = this.normalAttacks[this.currentNormalAttackIndex];
         this.currentNormalAttackIndex++;
         return(param);
     }
     return(null);
 }
 public List<RecoveryParam> GetRecoveryShipOfAttacks(AttackParam[] attacks)
 {
     List<RecoveryParam> list = new List<RecoveryParam>();
     foreach (AttackParam param in attacks)
     {
         if ((param.recovery != null) && (param.recovery.Length > 0))
         {
             list.AddRange(param.recovery);
         }
     }
     return list;
 }
Exemple #6
0
        internal static string getDetailWarBattleParam(AttackParam[] ap, UserFleet uf, ShipInWar[] enemy)
        {
            string r = "";
            foreach (var opa in ap)
            {
                if(opa.attackSide == AttackSide.Self)
                {
                    UserShip ata = GameData.instance.GetShipById(uf.ships[opa.fromIndex]);
                    r += "\t " + getshiptype(ata.ship.type) + " " + getFormatedtitle(ata.ship.title) + " Lv." + ata.level + (opa.attackSide == AttackSide.Self ? " => " : " <= ");
                    for (int i = 0; i < opa.targetIndex.Length && i < opa.damage.Length; i++)
                    {
                        ShipInWar siw = enemy[opa.targetIndex[i]];
                        siw.hp -= opa.damage[i];
                        if(siw.hp <0 )
                        {
                            siw.hp = 0;
                        }
                        var damp = opa.damages[i];
                        var eqatk = GameConfigs.instance.GetEquipmentByCid(opa.equipmentCid);
                        var skilldesc = GameConfigs.instance.GetSkillConfig(opa.skillId);

                        r += (opa.damage[i] == 0 ? "MISS" : (" -" + opa.damage[i]))
                            + "\t " + (damp.isCritical == 1 ? " 暴击! " : "       ")
                            + "\t"+ (skilldesc != null ? skilldesc.title : (eqatk != null? eqatk.title:"\t") )
                            + "\t " + getShipAttackTypeString(opa.attackType)
                            +"\t" + siw.title + " Lv." + siw.level + " "
                            + siw.hp + "/" + siw.hpMax;
                    }
                    r += "\r\n";
                }else{
                    ShipInWar ata =enemy[opa.fromIndex];

                    for (int i = 0; i < opa.targetIndex.Length && i < opa.damage.Length; i++)
                    {
                        UserShip siw = GameData.instance.GetShipById(uf.ships[opa.targetIndex[i]]);
                        var damp = opa.damages[i];
                        var eqatk = GameConfigs.instance.GetEquipmentByCid(opa.equipmentCid);

                        r += "\t " + getshiptype(siw.ship.type) + " "+ getFormatedtitle(siw.ship.title) + " Lv." + siw.level + " <= ";
                        r += (opa.damage[i] == 0 ? "MISS" : (" -" + opa.damage[i]))
                            + "\t " + (damp.isCritical == 1 ? " 暴击! " : "       ")
                            + "\t " + (eqatk == null ? "\t " : eqatk.title)
                            + "\t " + getShipAttackTypeString(opa.attackType)
                            + "\t"  + ata.title + " Lv." + ata.level + " "
                            + ata.hp + "/" + ata.hp;
                    }
                    r += "\r\n";
                }

            }
            return r;
        }
Exemple #7
0
 public virtual AttackParam Attack(AttackParam attack) => attack;