public ShienModel_Hou(DeckModel shien_deck, List <ShipModel_BattleAll> ships_f, List <ShipModel_BattleAll> ships_e, SupportAtack data) { _shien_deck_id = shien_deck.Id; _ships_shien = new List <ShipModel_Attacker>(); ShipModel[] ships = shien_deck.GetShips(); for (int i = 0; i < ships.Length; i++) { _ships_shien.Add(new __ShipModel_Attacker__(ships[i], i)); } _ships_f = ships_f; _ships_e = ships_e; _data = data; _dmg_data = new List <DamageModel>(); for (int j = 0; j < ships_e.Count; j++) { ShipModel_BattleAll shipModel_BattleAll = ships_e[j]; if (shipModel_BattleAll == null) { _dmg_data.Add(null); continue; } DamageModel damageModel = new DamageModel(shipModel_BattleAll); int damage = data.Hourai.Damage[j]; BattleHitStatus hitstate = data.Hourai.Clitical[j]; BattleDamageKinds dmgkind = data.Hourai.DamageType[j]; damageModel.__AddData__(damage, hitstate, dmgkind); damageModel.__CalcDamage__(); _dmg_data.Add(damageModel); } }
public void __createCacheDataAfterCommand__() { if (this._phase != CombatPhase.DAY) { return; } if (!this.IsTakeCommand()) { return; } this._cache_opening_effect = null; if (this._battleData.DayBattle.OpeningProduction != null) { this._cache_opening_effect = new __EffectModel__(this._battleData.DayBattle.OpeningProduction); } this._cache_kouku = null; if (this._battleData.DayBattle.AirBattle != null) { int count = this._battleData.DayBattle.AirBattle.F_PlaneFrom.get_Count(); int count2 = this._battleData.DayBattle.AirBattle.E_PlaneFrom.get_Count(); if (count > 0 || count2 > 0) { this._cache_kouku = new KoukuuModel(this._ships_f, this._ships_e, this._battleData.DayBattle.AirBattle); } } this._cache_shien = null; if (this._battleData.DayBattle.SupportAtack != null) { SupportAtack supportAtack = this._battleData.DayBattle.SupportAtack; int deck_Id = supportAtack.Deck_Id; DeckModel deck = base.UserInfo.GetDeck(deck_Id); BattleSupportKinds supportType = supportAtack.SupportType; if (supportType == BattleSupportKinds.AirAtack) { this._cache_shien = new ShienModel_Air(deck, this._ships_f, this._ships_e, supportAtack); } else if (supportType == BattleSupportKinds.Hougeki) { this._cache_shien = new ShienModel_Hou(deck, this._ships_f, this._ships_e, supportAtack); } else if (supportType == BattleSupportKinds.Raigeki) { this._cache_shien = new ShienModel_Rai(deck, this._ships_f, this._ships_e, supportAtack); } } this._cache_kaimaku = null; if (this._battleData.DayBattle.OpeningAtack != null) { this._cache_kaimaku = new RaigekiModel(this._ships_f, this._ships_e, this._battleData.DayBattle.OpeningAtack); if (this._cache_kaimaku.Count_f == 0 && this._cache_kaimaku.Count_e == 0) { this._cache_kaimaku = null; } } this._cache_cmd_actions = null; if (this._battleData.DayBattle.FromMiddleDayBattle != null) { this._cache_cmd_actions = new List <CmdActionPhaseModel>(); Dictionary <int, ShipModel_BattleAll> ships = this._GetShipsDic(); for (int i = 0; i < this._battleData.DayBattle.FromMiddleDayBattle.get_Count(); i++) { FromMiddleBattleDayData data = this._battleData.DayBattle.FromMiddleDayBattle.get_Item(i); CmdActionPhaseModel cmdActionPhaseModel = new CmdActionPhaseModel(data, ships); this._cache_cmd_actions.Add(cmdActionPhaseModel); } if (this._cache_cmd_actions.TrueForAll((CmdActionPhaseModel model) => model == null || !model.HasAction())) { this._cache_cmd_actions = null; } else if (this._cache_cmd_actions.get_Count() == 0) { this._cache_cmd_actions = null; } } this._cache_raigeki = null; if (this._battleData.DayBattle.Raigeki != null) { this._cache_raigeki = new RaigekiModel(this._ships_f, this._ships_e, this._battleData.DayBattle.Raigeki); if (this._cache_raigeki.Count_f == 0 && this._cache_raigeki.Count_e == 0) { this._cache_raigeki = null; } } this._cache_kouku2 = null; if (this._battleData.DayBattle.AirBattle2 != null) { int count3 = this._battleData.DayBattle.AirBattle2.F_PlaneFrom.get_Count(); int count4 = this._battleData.DayBattle.AirBattle2.E_PlaneFrom.get_Count(); if (count3 > 0 || count4 > 0) { this._cache_kouku2 = new KoukuuModel(this._ships_f, this._ships_e, this._battleData.DayBattle.AirBattle2); } } if (this._cache_opening_effect != null) { ShipModel_Battle nextActionShip = this._GetFirstActionShip(0); ((__EffectModel__)this._cache_opening_effect).SetNextActionShip(nextActionShip); } if (this._cache_cmd_actions != null) { for (int j = 0; j < this._cache_cmd_actions.get_Count(); j++) { CmdActionPhaseModel cmdActionPhaseModel2 = this._cache_cmd_actions.get_Item(j); if (cmdActionPhaseModel2 != null && cmdActionPhaseModel2.Effect != null) { ShipModel_Battle nextActionShip = this._GetFirstActionShip(j + 1); ((__EffectModel__)cmdActionPhaseModel2.Effect).SetNextActionShip(nextActionShip); } } } }
public ShienModel_Air(DeckModel shien_deck, List <ShipModel_BattleAll> ships_f, List <ShipModel_BattleAll> ships_e, SupportAtack data) : base(ships_f, ships_e, data.AirBattle) { this._shien_deck_id = shien_deck.Id; this._ships_shien = new List <ShipModel_Attacker>(); ShipModel[] ships = shien_deck.GetShips(); for (int i = 0; i < ships.Length; i++) { this._ships_shien.Add(new __ShipModel_Attacker__(ships[i], i)); } base._Initialize(); }
public void __createCacheDataAfterCommand__() { if (_phase != 0 || !IsTakeCommand()) { return; } _cache_opening_effect = null; if (_battleData.DayBattle.OpeningProduction != null) { _cache_opening_effect = new __EffectModel__(_battleData.DayBattle.OpeningProduction); } _cache_kouku = null; if (_battleData.DayBattle.AirBattle != null) { int count = _battleData.DayBattle.AirBattle.F_PlaneFrom.Count; int count2 = _battleData.DayBattle.AirBattle.E_PlaneFrom.Count; if (count > 0 || count2 > 0) { _cache_kouku = new KoukuuModel(_ships_f, _ships_e, _battleData.DayBattle.AirBattle); } } _cache_shien = null; if (_battleData.DayBattle.SupportAtack != null) { SupportAtack supportAtack = _battleData.DayBattle.SupportAtack; int deck_Id = supportAtack.Deck_Id; DeckModel deck = base.UserInfo.GetDeck(deck_Id); switch (supportAtack.SupportType) { case BattleSupportKinds.AirAtack: _cache_shien = new ShienModel_Air(deck, _ships_f, _ships_e, supportAtack); break; case BattleSupportKinds.Hougeki: _cache_shien = new ShienModel_Hou(deck, _ships_f, _ships_e, supportAtack); break; case BattleSupportKinds.Raigeki: _cache_shien = new ShienModel_Rai(deck, _ships_f, _ships_e, supportAtack); break; } } _cache_kaimaku = null; if (_battleData.DayBattle.OpeningAtack != null) { _cache_kaimaku = new RaigekiModel(_ships_f, _ships_e, _battleData.DayBattle.OpeningAtack); if (_cache_kaimaku.Count_f == 0 && _cache_kaimaku.Count_e == 0) { _cache_kaimaku = null; } } _cache_cmd_actions = null; if (_battleData.DayBattle.FromMiddleDayBattle != null) { _cache_cmd_actions = new List <CmdActionPhaseModel>(); Dictionary <int, ShipModel_BattleAll> ships = _GetShipsDic(); for (int i = 0; i < _battleData.DayBattle.FromMiddleDayBattle.Count; i++) { FromMiddleBattleDayData data = _battleData.DayBattle.FromMiddleDayBattle[i]; CmdActionPhaseModel item = new CmdActionPhaseModel(data, ships); _cache_cmd_actions.Add(item); } if (_cache_cmd_actions.TrueForAll((CmdActionPhaseModel model) => model == null || !model.HasAction())) { _cache_cmd_actions = null; } else if (_cache_cmd_actions.Count == 0) { _cache_cmd_actions = null; } } _cache_raigeki = null; if (_battleData.DayBattle.Raigeki != null) { _cache_raigeki = new RaigekiModel(_ships_f, _ships_e, _battleData.DayBattle.Raigeki); if (_cache_raigeki.Count_f == 0 && _cache_raigeki.Count_e == 0) { _cache_raigeki = null; } } _cache_kouku2 = null; if (_battleData.DayBattle.AirBattle2 != null) { int count3 = _battleData.DayBattle.AirBattle2.F_PlaneFrom.Count; int count4 = _battleData.DayBattle.AirBattle2.E_PlaneFrom.Count; if (count3 > 0 || count4 > 0) { _cache_kouku2 = new KoukuuModel(_ships_f, _ships_e, _battleData.DayBattle.AirBattle2); } } if (_cache_opening_effect != null) { ShipModel_Battle nextActionShip = _GetFirstActionShip(0); ((__EffectModel__)_cache_opening_effect).SetNextActionShip(nextActionShip); } if (_cache_cmd_actions == null) { return; } for (int j = 0; j < _cache_cmd_actions.Count; j++) { CmdActionPhaseModel cmdActionPhaseModel = _cache_cmd_actions[j]; if (cmdActionPhaseModel != null && cmdActionPhaseModel.Effect != null) { ShipModel_Battle nextActionShip = _GetFirstActionShip(j + 1); ((__EffectModel__)cmdActionPhaseModel.Effect).SetNextActionShip(nextActionShip); } } }
public ShienModel_Rai(DeckModel shien_deck, List <ShipModel_BattleAll> ships_f, List <ShipModel_BattleAll> ships_e, SupportAtack data) : base(shien_deck, ships_f, ships_e, data) { }