public void SetObservedShelling(HougekiModel model) { _clsAttacker = model.Attacker; Texture2D shipTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(model.Attacker); Vector3 offs = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(model.Attacker, model.Attacker.DamagedFlg, MstShipGraphColumn.CutIn); _listShipTextures.ForEach(delegate(UITexture x) { x.mainTexture = shipTexture; x.MakePixelPerfect(); x.transform.localPosition = offs; }); List <SlotitemModel_Battle> list = new List <SlotitemModel_Battle>(model.GetSlotitems()); _listSlotLabels[0].text = list[1].Name; _listSlotLabels[1].text = list[2].Name; _uiAircraft.mainTexture = KCV.Battle.Utils.SlotItemUtils.LoadUniDirTexture(list[0]); _uiAircraft.localSize = ResourceManager.SLOTITEM_TEXTURE_SIZE[6]; _listHexBtns[0].SetSlotItem(list[1]); _listHexBtns[1].SetSlotItem(list[2]); Color col = (!_clsAttacker.IsFriend()) ? new Color(1f, 0f, 0f, 0.50196f) : new Color(0f, 51f / 160f, 1f, 0.50196f); _uiTelopOverlay.color = col; _listOverlays.ForEach(delegate(UITexture x) { x.color = col; }); }
public void SetObservedShelling(HougekiModel model) { this._clsAttacker = model.Attacker; Texture2D shipTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(model.Attacker); Vector3 offs = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(model.Attacker, model.Attacker.DamagedFlg, MstShipGraphColumn.CutIn); this._listShipTextures.ForEach(delegate(UITexture x) { x.mainTexture = shipTexture; x.MakePixelPerfect(); x.get_transform().set_localPosition(offs); }); List <SlotitemModel_Battle> list = new List <SlotitemModel_Battle>(model.GetSlotitems()); this._listSlotLabels.get_Item(0).text = list.get_Item(1).Name; this._listSlotLabels.get_Item(1).text = list.get_Item(2).Name; this._uiAircraft.mainTexture = KCV.Battle.Utils.SlotItemUtils.LoadUniDirTexture(list.get_Item(0)); this._uiAircraft.localSize = ResourceManager.SLOTITEM_TEXTURE_SIZE.get_Item(6); this._listHexBtns.get_Item(0).SetSlotItem(list.get_Item(1)); this._listHexBtns.get_Item(1).SetSlotItem(list.get_Item(2)); Color col = (!this._clsAttacker.IsFriend()) ? new Color(1f, 0f, 0f, 0.50196f) : new Color(0f, 0.31875f, 1f, 0.50196f); this._uiTelopOverlay.color = col; this._listOverlays.ForEach(delegate(UITexture x) { x.color = col; }); }
public List <ShipModel_Attacker> GetAttackers(bool is_friend) { List <ShipModel_Attacker> list = new List <ShipModel_Attacker>(); HashSet <int> hashSet = new HashSet <int>(); List <DamageModelBase> list2 = (!is_friend) ? _data_f : _data_e; for (int i = 0; i < list2.Count; i++) { RaigekiDamageModel raigekiDamageModel = (RaigekiDamageModel)list2[i]; if (raigekiDamageModel == null) { continue; } for (int j = 0; j < raigekiDamageModel.Attackers.Count; j++) { ShipModel_Attacker shipModel_Attacker = raigekiDamageModel.Attackers[j]; if (!hashSet.Contains(shipModel_Attacker.TmpId)) { hashSet.Add(shipModel_Attacker.TmpId); list.Add(shipModel_Attacker); } } } return(list); }
public void SetShellingData(HougekiModel model) { _iList = getAnimation(model.AttackType); _clsAttacker = model.Attacker; setShipsTexture(model.Attacker); setSlotItems(model.GetSlotitems()); }
protected List <PlaneModelBase> __CreatePlanes(List <ShipModel_Attacker> ships, List <int> plane_from) { List <PlaneModelBase> list = new List <PlaneModelBase>(); for (int i = 0; i < plane_from.Count; i++) { int tmp_id = plane_from[i]; ShipModel_Attacker shipModel_Attacker = ships.Find((ShipModel_Attacker item) => item.TmpId == tmp_id); if (shipModel_Attacker == null) { continue; } List <SlotitemModel_Battle> slotitemList = shipModel_Attacker.SlotitemList; slotitemList = slotitemList.FindAll((SlotitemModel_Battle slot) => slot?.IsPlaneAtKouku() ?? false); if (slotitemList.Count > 0) { for (int j = 0; j < slotitemList.Count; j++) { PlaneModel item2 = new PlaneModel(shipModel_Attacker, slotitemList[j].MstId); list.Add(item2); } } } return(list); }
public static AudioSource PlayTorpedoSE(ShipModel_Attacker model) { if (model.ShipType == 4) { return(KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.BattleAdmission)); } return(KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.BattleAdmission)); }
public static Vector3 GetShipOffsPos(ShipModel_Attacker model, MstShipGraphColumn iColumn) { if (model == null) { return(Vector3.zero); } return(GetShipOffsPos(model.GetGraphicsMstId(), model.IsFriend(), model.DamagedFlg, iColumn)); }
private void _setShipInfo() { this._flagShip = this._clsSupport.ShienShips[0]; this._shipTex.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(this._flagShip); this._shipTex.MakePixelPerfect(); this._shipTex.get_transform().set_localPosition(Util.Poi2Vec(new ShipOffset(this._flagShip.GetGraphicsMstId()).GetFace(this._flagShip.DamagedFlg))); this._shipShadow.mainTexture = this._shipTex.mainTexture; this._shipShadow.MakePixelPerfect(); this._shipShadow.get_transform().set_localPosition(this._shipTex.get_transform().get_localPosition()); }
private void _setShipInfo() { _flagShip = _clsSupport.ShienShips[0]; _shipTex.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(_flagShip); _shipTex.MakePixelPerfect(); _shipTex.transform.localPosition = Util.Poi2Vec(new ShipOffset(_flagShip.GetGraphicsMstId()).GetFace(_flagShip.DamagedFlg)); _shipShadow.mainTexture = _shipTex.mainTexture; _shipShadow.MakePixelPerfect(); _shipShadow.transform.localPosition = _shipTex.transform.localPosition; }
protected void _CalcStage2() { if (_data.Air2 == null) { return; } Random random = new Random(); if (_planes_f.Count > 0) { int lost = Stage2_LostCount_f; while (lost > 0) { List <PlaneModelBase> list = _planes_f.FindAll((PlaneModelBase plane) => plane.Power_Stage2End > 0); if (list.Count > 0) { PlaneModelBase planeModelBase = list[random.Next(list.Count)]; planeModelBase.SetStage2Lost(ref lost); } } } if (_planes_e.Count > 0) { int lost2 = Stage2_LostCount_e; while (lost2 > 0) { List <PlaneModelBase> list2 = _planes_e.FindAll((PlaneModelBase plane) => plane.Power_Stage2End > 0); if (list2.Count > 0) { PlaneModelBase planeModelBase2 = list2[random.Next(list2.Count)]; planeModelBase2.SetStage2Lost(ref lost2); } } } if (_data.Air2.F_AntiFire != null) { AirFireInfo info = _data.Air2.F_AntiFire; _taiku_ship_f = _ships_f.Find((ShipModel_BattleAll ship) => ship.TmpId == info.AttackerId).__CreateAttacker__(); _taiku_slotitems_f = new List <SlotitemModel_Battle>(); for (int i = 0; i < info.UseItems.Count; i++) { _taiku_slotitems_f.Add(new SlotitemModel_Battle(info.UseItems[i])); } } if (_data.Air2.E_AntiFire != null) { AirFireInfo info2 = _data.Air2.E_AntiFire; _taiku_ship_e = _ships_e.Find((ShipModel_BattleAll ship) => ship.TmpId == info2.AttackerId).__CreateAttacker__(); _taiku_slotitems_e = new List <SlotitemModel_Battle>(); for (int j = 0; j < info2.UseItems.Count; j++) { _taiku_slotitems_e.Add(new SlotitemModel_Battle(info2.UseItems[j])); } } }
protected void _CalcStage2() { if (this._data.Air2 == null) { return; } Random random = new Random(); if (this._planes_f.get_Count() > 0) { int i = this.Stage2_LostCount_f; while (i > 0) { List <PlaneModelBase> list = this._planes_f.FindAll((PlaneModelBase plane) => plane.Power_Stage2End > 0); if (list.get_Count() > 0) { PlaneModelBase planeModelBase = list.get_Item(random.Next(list.get_Count())); planeModelBase.SetStage2Lost(ref i); } } } if (this._planes_e.get_Count() > 0) { int j = this.Stage2_LostCount_e; while (j > 0) { List <PlaneModelBase> list2 = this._planes_e.FindAll((PlaneModelBase plane) => plane.Power_Stage2End > 0); if (list2.get_Count() > 0) { PlaneModelBase planeModelBase2 = list2.get_Item(random.Next(list2.get_Count())); planeModelBase2.SetStage2Lost(ref j); } } } if (this._data.Air2.F_AntiFire != null) { AirFireInfo info = this._data.Air2.F_AntiFire; this._taiku_ship_f = this._ships_f.Find((ShipModel_BattleAll ship) => ship.TmpId == info.AttackerId).__CreateAttacker__(); this._taiku_slotitems_f = new List <SlotitemModel_Battle>(); for (int k = 0; k < info.UseItems.get_Count(); k++) { this._taiku_slotitems_f.Add(new SlotitemModel_Battle(info.UseItems.get_Item(k))); } } if (this._data.Air2.E_AntiFire != null) { AirFireInfo info = this._data.Air2.E_AntiFire; this._taiku_ship_e = this._ships_e.Find((ShipModel_BattleAll ship) => ship.TmpId == info.AttackerId).__CreateAttacker__(); this._taiku_slotitems_e = new List <SlotitemModel_Battle>(); for (int l = 0; l < info.UseItems.get_Count(); l++) { this._taiku_slotitems_e.Add(new SlotitemModel_Battle(info.UseItems.get_Item(l))); } } }
private void setShipsTexture(ShipModel_Attacker model) { Texture2D mainTexture = ShipUtils.LoadTexture(model.GetGraphicsMstId(), model.IsFriend() && model.DamagedFlg); Vector2 v = ShipUtils.GetShipOffsPos(model, model.DamagedFlg, GetGraphColumn(_iList)); foreach (UITexture item in _listShipTexture) { item.mainTexture = mainTexture; item.MakePixelPerfect(); item.transform.localPosition = v; } }
private void _setShipInfo(bool isFriend) { _ship = _clsAerial.GetTaikuShip(isFriend); _uiShip.mainTexture = ShipUtils.LoadTexture(_ship); _uiShip.MakePixelPerfect(); _uiShip.transform.localPosition = Util.Poi2Vec(new ShipOffset(_ship.GetGraphicsMstId()).GetShipDisplayCenter(_ship.DamagedFlg)); _uiShip.flip = ((!isFriend) ? UIBasicSprite.Flip.Horizontally : UIBasicSprite.Flip.Nothing); _uiShipShadow.mainTexture = _uiShip.mainTexture; _uiShipShadow.MakePixelPerfect(); _uiShipShadow.flip = ((!isFriend) ? UIBasicSprite.Flip.Horizontally : UIBasicSprite.Flip.Nothing); _uiShipObj.transform.localRotation = ((!isFriend) ? Quaternion.EulerAngles(new Vector3(0f, 180f, 0f)) : Quaternion.EulerAngles(Vector3.zero)); }
protected string ToString_Stage2() { string text = string.Empty; if (this._data.Air2 != null) { text += string.Format("--Stage2 ", new object[0]); text += string.Format("[味方側] Count:{0}-{1} Lost:{2} ", this.Stage2_StartCount_f, this.Stage2_EndCount_f, this.Stage2_LostCount_f); text += string.Format("[相手側] Count:{0}-{1} Lost:{2}\n", this.Stage2_StartCount_e, this.Stage2_EndCount_e, this.Stage2_LostCount_e); ShipModel_Attacker taikuShip = this.GetTaikuShip(true); List <SlotitemModel_Battle> taikuSlotitems = this.GetTaikuSlotitems(true); if (taikuShip != null) { text += string.Format("[味方側 対空カットイン] {0}\n", taikuShip); text += "\t使用した装備: "; for (int i = 0; i < taikuSlotitems.get_Count(); i++) { if (taikuSlotitems.get_Item(i) == null) { text += " [-]"; } else { text += string.Format(" [{0}]", taikuSlotitems.get_Item(i)); } } text += "\n"; } taikuShip = this.GetTaikuShip(false); taikuSlotitems = this.GetTaikuSlotitems(false); if (taikuShip != null) { text += string.Format("[相手側 対空カットイン] {0}\n", taikuShip); text += "\t使用した装備: "; for (int j = 0; j < taikuSlotitems.get_Count(); j++) { if (taikuSlotitems.get_Item(j) == null) { text += " [-]"; } else { text += string.Format(" [{0}]", taikuSlotitems.get_Item(j)); } } text += "\n"; } } return(text); }
private void setShipsTexture(ShipModel_Attacker model) { Texture2D mainTexture = ShipUtils.LoadTexture(model.GetGraphicsMstId(), model.IsFriend() && model.DamagedFlg); Vector2 vector = ShipUtils.GetShipOffsPos(model, model.DamagedFlg, this.GetGraphColumn(this._iList)); using (List <UITexture> .Enumerator enumerator = this._listShipTexture.GetEnumerator()) { while (enumerator.MoveNext()) { UITexture current = enumerator.get_Current(); current.mainTexture = mainTexture; current.MakePixelPerfect(); current.get_transform().set_localPosition(vector); } } }
private void _setShipTexture(bool isFriend) { ShipModel_Attacker shipModel_Attacker = (_koukuuModel.GetCaptainShip(isFriend) == null) ? null : _koukuuModel.GetCaptainShip(isFriend); if (shipModel_Attacker != null) { _uiShip.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(shipModel_Attacker); _uiShip.MakePixelPerfect(); _uiShip.flip = ((!isFriend) ? UIBasicSprite.Flip.Horizontally : UIBasicSprite.Flip.Nothing); Vector3 shipOffsPos = KCV.Battle.Utils.ShipUtils.GetShipOffsPos(shipModel_Attacker, shipModel_Attacker.DamagedFlg, MstShipGraphColumn.CutInSp1); _uiShip.transform.localPosition = ((!isFriend) ? new Vector3(shipOffsPos.x * -1f, shipOffsPos.y, shipOffsPos.z) : shipOffsPos); } else { _uiShip.mainTexture = null; } }
private void setShipInfo() { ShipModel_Attacker torpedoCutInShip = getTorpedoCutInShip(_clsRaigeki, isFriend: true); if (torpedoCutInShip != null) { _listShipTex[0].mainTexture = ShipUtils.LoadTexture(torpedoCutInShip); _listShipTex[0].MakePixelPerfect(); _listShipTex[0].transform.localPosition = Util.Poi2Vec(new ShipOffset(torpedoCutInShip.GetGraphicsMstId()).GetShipDisplayCenter(torpedoCutInShip.DamagedFlg)); } ShipModel_Attacker torpedoCutInShip2 = getTorpedoCutInShip(_clsRaigeki, isFriend: false); if (torpedoCutInShip2 != null) { _listShipTex[1].mainTexture = ShipUtils.LoadTexture(torpedoCutInShip2); _listShipTex[1].MakePixelPerfect(); _listShipTex[1].transform.localPosition = ShipUtils.GetShipOffsPos(torpedoCutInShip2, MstShipGraphColumn.CutIn); } _iList = getAnimationList(torpedoCutInShip, torpedoCutInShip2); }
private void setShipInfo() { ShipModel_Attacker torpedoCutInShip = this.getTorpedoCutInShip(this._clsRaigeki, true); if (torpedoCutInShip != null) { this._listShipTex.get_Item(0).mainTexture = ShipUtils.LoadTexture(torpedoCutInShip); this._listShipTex.get_Item(0).MakePixelPerfect(); this._listShipTex.get_Item(0).get_transform().set_localPosition(Util.Poi2Vec(new ShipOffset(torpedoCutInShip.GetGraphicsMstId()).GetShipDisplayCenter(torpedoCutInShip.DamagedFlg))); } ShipModel_Attacker torpedoCutInShip2 = this.getTorpedoCutInShip(this._clsRaigeki, false); if (torpedoCutInShip2 != null) { this._listShipTex.get_Item(1).mainTexture = ShipUtils.LoadTexture(torpedoCutInShip2); this._listShipTex.get_Item(1).MakePixelPerfect(); this._listShipTex.get_Item(1).get_transform().set_localPosition(ShipUtils.GetShipOffsPos(torpedoCutInShip2, MstShipGraphColumn.CutIn)); } this._iList = this.getAnimationList(torpedoCutInShip, torpedoCutInShip2); }
public List <ShipModel_Attacker> GetAttackers(bool is_friend) { List <ShipModel_Attacker> list = new List <ShipModel_Attacker>(); HashSet <int> hashSet = new HashSet <int>(); List <DamageModelBase> list2 = (!is_friend) ? this._data_f : this._data_e; for (int i = 0; i < list2.get_Count(); i++) { RaigekiDamageModel raigekiDamageModel = (RaigekiDamageModel)list2.get_Item(i); if (raigekiDamageModel != null) { for (int j = 0; j < raigekiDamageModel.Attackers.get_Count(); j++) { ShipModel_Attacker shipModel_Attacker = raigekiDamageModel.Attackers.get_Item(j); if (!hashSet.Contains(shipModel_Attacker.TmpId)) { hashSet.Add(shipModel_Attacker.TmpId); list.Add(shipModel_Attacker); } } } } return(list); }
protected List <PlaneModelBase> __CreatePlanes(List <ShipModel_Attacker> ships, List <int> plane_from) { List <PlaneModelBase> list = new List <PlaneModelBase>(); for (int i = 0; i < plane_from.get_Count(); i++) { int tmp_id = plane_from.get_Item(i); ShipModel_Attacker shipModel_Attacker = ships.Find((ShipModel_Attacker item) => item.TmpId == tmp_id); if (shipModel_Attacker != null) { List <SlotitemModel_Battle> list2 = shipModel_Attacker.SlotitemList; list2 = list2.FindAll((SlotitemModel_Battle slot) => slot != null && slot.IsPlaneAtKouku()); if (list2.get_Count() > 0) { for (int j = 0; j < list2.get_Count(); j++) { PlaneModel planeModel = new PlaneModel(shipModel_Attacker, list2.get_Item(j).MstId); list.Add(planeModel); } } } } return(list); }
protected string ToString_Stage2() { string text = string.Empty; if (_data.Air2 != null) { text += $"--Stage2 "; text += $"[味方側] Count:{Stage2_StartCount_f}-{Stage2_EndCount_f} Lost:{Stage2_LostCount_f} "; text += $"[相手側] Count:{Stage2_StartCount_e}-{Stage2_EndCount_e} Lost:{Stage2_LostCount_e}\n"; ShipModel_Attacker taikuShip = GetTaikuShip(is_friend: true); List <SlotitemModel_Battle> taikuSlotitems = GetTaikuSlotitems(is_friend: true); if (taikuShip != null) { text += $"[味方側 対空カットイン] {taikuShip}\n"; text += "\t使用した装備: "; for (int i = 0; i < taikuSlotitems.Count; i++) { text = ((taikuSlotitems[i] != null) ? (text + $" [{taikuSlotitems[i]}]") : (text + " [-]")); } text += "\n"; } taikuShip = GetTaikuShip(is_friend: false); taikuSlotitems = GetTaikuSlotitems(is_friend: false); if (taikuShip != null) { text += $"[相手側 対空カットイン] {taikuShip}\n"; text += "\t使用した装備: "; for (int j = 0; j < taikuSlotitems.Count; j++) { text = ((taikuSlotitems[j] != null) ? (text + $" [{taikuSlotitems[j]}]") : (text + " [-]")); } text += "\n"; } } return(text); }
public static Texture2D LoadTexture(ShipModel_Attacker model) { return(LoadTexture(model.GetGraphicsMstId(), model.IsFriend() && model.DamagedFlg)); }
private void _initialize <T>(Hougeki <T> data, Dictionary <int, ShipModel_BattleAll> ships) where T : IConvertible { _attacker = ships[data.Attacker].__CreateAttacker__(); for (int i = 0; i < data.Target.Count; i++) { _AddData(data.Damage[i], data.Clitical[i], data.DamageKind[i]); } _slots = new List <SlotitemModel_Battle>(); if (data.Slot_List != null) { for (int j = 0; j < data.Slot_List.Count; j++) { int num = data.Slot_List[j]; if (num == 0) { _slots.Add(null); } else { _slots.Add(new SlotitemModel_Battle(num)); } } } while (_slots.Count < 3) { _slots.Add(null); } if (IsNight() && Attacker.IsAircraftCarrier() && Attacker.Yomi != "グラ\u30fcフ・ツェッペリン") { _attack_type = BattleAttackKind.AirAttack; } if (AttackType == BattleAttackKind.Normal) { _setAttackSubType(); } else if (AttackType == BattleAttackKind.AirAttack) { List <SlotitemModel_Battle> slotitemList = Attacker.SlotitemList; List <int> enable_type3; if (base.Defender.IsSubMarine()) { enable_type3 = new List <int> { 7, 8, 11, 25, 26, 41 }; _slots[0] = slotitemList.Find((SlotitemModel_Battle slot) => enable_type3.IndexOf(slot.Type3) >= 0 && slot.Taisen > 0); } else { enable_type3 = new List <int> { 7, 8 }; _slots[0] = slotitemList.Find((SlotitemModel_Battle slot) => enable_type3.IndexOf(slot.Type3) >= 0 && (slot.Bakugeki > 0 || slot.Raigeki > 0)); } } }
public PlaneModel(ShipModel_Attacker parent, int slotitem_mst_id) : base(slotitem_mst_id) { this._parent = parent; }
private void _initialize <T>(Hougeki <T> data, Dictionary <int, ShipModel_BattleAll> ships) where T : IConvertible { this._attacker = ships.get_Item(data.Attacker).__CreateAttacker__(); for (int i = 0; i < data.Target.get_Count(); i++) { base._AddData(data.Damage.get_Item(i), data.Clitical.get_Item(i), data.DamageKind.get_Item(i)); } this._slots = new List <SlotitemModel_Battle>(); if (data.Slot_List != null) { for (int j = 0; j < data.Slot_List.get_Count(); j++) { int num = data.Slot_List.get_Item(j); if (num == 0) { this._slots.Add(null); } else { this._slots.Add(new SlotitemModel_Battle(num)); } } } while (this._slots.get_Count() < 3) { this._slots.Add(null); } if (this.IsNight() && this.Attacker.IsAircraftCarrier() && this.Attacker.Yomi != "グラーフ・ツェッペリン") { this._attack_type = BattleAttackKind.AirAttack; } if (this.AttackType == BattleAttackKind.Normal) { this._setAttackSubType(); } else if (this.AttackType == BattleAttackKind.AirAttack) { HougekiModel.< _initialize > c__AnonStorey537 <T> < _initialize > c__AnonStorey = new HougekiModel.< _initialize > c__AnonStorey537 <T>(); List <SlotitemModel_Battle> slotitemList = this.Attacker.SlotitemList; if (base.Defender.IsSubMarine()) { HougekiModel.< _initialize > c__AnonStorey537 <T> arg_1A7_0 = < _initialize > c__AnonStorey; List <int> list = new List <int>(); list.Add(7); list.Add(8); list.Add(11); list.Add(25); list.Add(26); list.Add(41); arg_1A7_0.enable_type3 = list; this._slots.set_Item(0, slotitemList.Find((SlotitemModel_Battle slot) => < _initialize > c__AnonStorey.enable_type3.IndexOf(slot.Type3) >= 0 && slot.Taisen > 0)); } else { HougekiModel.< _initialize > c__AnonStorey537 <T> arg_1EB_0 = < _initialize > c__AnonStorey; List <int> list = new List <int>(); list.Add(7); list.Add(8); arg_1EB_0.enable_type3 = list; this._slots.set_Item(0, slotitemList.Find((SlotitemModel_Battle slot) => < _initialize > c__AnonStorey.enable_type3.IndexOf(slot.Type3) >= 0 && (slot.Bakugeki > 0 || slot.Raigeki > 0))); } } }