/// <summary> /// 서브 콘테이너에게 인덱스를 받아 세팅 /// </summary> /// <param name="_index"></param> public override void GetTargetIndex(int _index) { if (_index >= 0) { selectTarget = true; } else { Strengthen(); return; } DataArea db = Management.MenuGameManager.Instance.DataArea; slot.IndexOfViewType = _index; slot.lvText.text = db.OwnedData.MinionData[_index].Lv.ToString(); slot.nameText.text = db.DefaultMinionData[db.OwnedData.MinionData[_index].IndexOfMinion].MinionName; slot.SlotImage.sprite = Resources.Load <Sprite>(db.DefaultMinionData[db.OwnedData.MinionData[_index].IndexOfMinion].MainImagePath); BasicStatus bs = db.DefaultMinionData[db.OwnedData.MinionData[_index].IndexOfMinion].BasicStatus; BasicStatus abs = db.OwnedData.MinionData[_index].AddStatus; lvText.text = (db.OwnedData.MinionData[_index].Lv).ToString(); expText.text = (db.OwnedData.MinionData[_index].CurExp).ToString(); hpText.text = (bs.Hp + abs.Hp).ToString(); mpText.text = (bs.Mp + abs.Mp).ToString(); attackSpeedText.text = (bs.AttackSpeed + abs.AttackSpeed).ToString(); attackRangeText.text = (bs.AttackRange + abs.AttackRange).ToString(); attackPowerText.text = (bs.AttackPower + abs.AttackPower).ToString(); criticalChanceText.text = (bs.CriticalChance + abs.CriticalChance).ToString(); deffenceText.text = (bs.Deffence + abs.Deffence).ToString(); deffencePentractionText.text = (bs.DeffencePentraction + abs.DeffencePentraction).ToString(); evasiveText.text = (bs.Evasive + abs.Evasive).ToString(); moveSpeedText.text = (bs.MoveSpeed + abs.MoveSpeed).ToString(); }
private void SetTextBySelectedMat(DataArea _db) { int needExp = _db.OwnedData.ItemData[slot.IndexOfViewType].NeedExp; int curExp = _db.OwnedData.ItemData[slot.IndexOfViewType].CurExp + addExp; int lv = _db.OwnedData.ItemData[slot.IndexOfViewType].Lv; int prevLv = lv; bool changeLv = false; while (needExp <= curExp) { ++lv; curExp -= needExp; needExp = _db.DefaultExpManager.UnitExpChart.NeedExp[lv]; changeLv = true; } addLv = lv - prevLv; addExp = curExp; BasicStatus bs = _db.DefaultItemData[_db.OwnedData.ItemData[slot.IndexOfViewType].IndexOfType].BasicStatus; BasicStatus abs = _db.OwnedData.ItemData[slot.IndexOfViewType].AddStatus; BasicStatus nextAbs = _db.OwnedData.ItemData[slot.IndexOfViewType].AddStatus + _db.DefaultItemData[_db.OwnedData.ItemData[slot.IndexOfViewType].IndexOfType].AddStatusByLv * (lv - prevLv); if (addLv > 0) { lvText.text = (_db.OwnedData.ItemData[slot.IndexOfViewType].Lv) + " >> " + lv; } else { lvText.text = prevLv.ToString(); } expText.text = (_db.OwnedData.ItemData[slot.IndexOfViewType].CurExp) + " >> " + curExp; }
/// <summary> /// 서브 콘테이너에게 인덱스를 받아 세팅 /// </summary> /// <param name="_index"></param> public override void GetTargetIndex(int _index) { if (_index >= 0) { selectTarget = true; } else { Strengthen(); return; } DataArea db = Management.MenuGameManager.Instance.DataArea; slot.IndexOfViewType = _index; slot.lvText.text = db.OwnedData.SkillData[_index].Lv.ToString(); slot.nameText.text = db.DefaultSkillData[db.OwnedData.SkillData[_index].IndexOfType].SkillName; slot.SlotImage.sprite = Resources.Load <Sprite>(db.DefaultSkillData[db.OwnedData.SkillData[_index].IndexOfType].MainImagePath); BasicStatus bs = db.DefaultSkillData[db.OwnedData.SkillData[_index].IndexOfType].BasicStatus; BasicStatus abs = db.OwnedData.SkillData[_index].AddStatus; lvText.text = (db.OwnedData.SkillData[_index].Lv).ToString(); expText.text = (db.OwnedData.SkillData[_index].CurExp).ToString(); }
public Default_ItemData(string itemName, ItemType itemType, BasicStatus basicStatus, BasicStatus addStatusByLv, string iconPath, string explanation) { ItemName = itemName ?? throw new ArgumentNullException(nameof(itemName)); ItemType = itemType; BasicStatus = basicStatus ?? throw new ArgumentNullException(nameof(basicStatus)); AddStatusByLv = addStatusByLv ?? throw new ArgumentNullException(nameof(addStatusByLv)); IconPath = iconPath ?? throw new ArgumentNullException(nameof(iconPath)); Explanation = explanation ?? throw new ArgumentNullException(nameof(explanation)); }
public BasicStatus GetBasicStatus() { BasicStatus oBasicStatus = new BasicStatus(); XElement xBasicStatus = GetReceiverList(FunctionType.SubunitInput, "G1"); if (xBasicStatus != null) { oBasicStatus = (new BasicStatus(xBasicStatus)).Parse(); } return(oBasicStatus); }
public SettingMinionSkillData(SkillType skillType, int indexOfType, int lv, int curExp, int needExp) { SkillType = skillType; IndexOfType = indexOfType; Lv = lv; AddStatus = new BasicStatus(); if (lv > 1) { addStatus.AddStatus(Management.MenuGameManager.Instance.DataArea.DefaultMinionSkillData[IndexOfType].AddStatusByLv * Lv); } }
public Default_MinionSkillData(SkillType skillType, string skillName, BasicStatus basicStatus, BasicStatus addStatusByLv, BasicStatus bufStatus, BasicStatus addBufStatusByLv, int moduleIndex, string mainImagePath, string effectImagePath, string explanation) { SkillType = skillType; SkillName = skillName ?? throw new ArgumentNullException(nameof(skillName)); BasicStatus = basicStatus ?? throw new ArgumentNullException(nameof(basicStatus)); AddStatusByLv = addStatusByLv ?? throw new ArgumentNullException(nameof(addStatusByLv)); BufStatus = bufStatus ?? throw new ArgumentNullException(nameof(bufStatus)); AddBufStatusByLv = addBufStatusByLv ?? throw new ArgumentNullException(nameof(addBufStatusByLv)); ModuleIndex = moduleIndex; MainImagePath = mainImagePath ?? throw new ArgumentNullException(nameof(mainImagePath)); EffectImagePath = effectImagePath ?? throw new ArgumentNullException(nameof(effectImagePath)); Explanation = explanation ?? throw new ArgumentNullException(nameof(explanation)); }
SettingMinionSkillData[] ownedSkillList; // setting skill data public SettingMinionData(int indexOfMinion, int indexOfSerializeCode, int lv, int rate, int curExp, int needExp, int maxItemSlotCount, int[] indexOfOwnedItem, int maxSkillSlotCount, SettingMinionSkillData[] ownedSkillList) { DataArea db = Management.MenuGameManager.Instance.DataArea; IndexOfMinion = indexOfMinion; IndexOfSerializeCode = indexOfSerializeCode; Lv = lv; Rate = rate; CurExp = curExp; NeedExp = needExp; AddStatus = new BasicStatus(); MaxItemSlotCount = maxItemSlotCount; IndexOfSerializeCodeOwnedItem = new int[MaxItemSlotCount]; AddStatus.AddStatus(Management.MenuGameManager.Instance.DataArea.DefaultMinionData[IndexOfMinion].AddStatusByLv * (Lv - 1)); for (int i = 0; i < MaxItemSlotCount; ++i) { if (indexOfOwnedItem.Length > i) { IndexOfSerializeCodeOwnedItem[i] = indexOfOwnedItem[i]; // 아이템에 따른 addStatus 추가 //AddStatus.AddStatus(Management.MenuGameManager.Instance.DataArea.DefaultItemData[IndexOfOwnedItem[i]].AddStatusByLv * (LvOfOwnedItem[i]-1)); var ownedItemData = db.OwnedData.ItemData.Find(x => x.IndexOfSerializeCode == IndexOfSerializeCodeOwnedItem[i]); if (ownedItemData != null) { int defaultIndex = ownedItemData.IndexOfType; AddStatus.AddStatus(db.DefaultItemData[defaultIndex].BasicStatus + ownedItemData.AddStatus); } } else { IndexOfSerializeCodeOwnedItem[i] = -1; } } MaxSkillSlotCount = maxSkillSlotCount; OwnedSkillList = ownedSkillList; }
private void ChangeStatus(DataArea _db, int _curExp, int _lv, int _prevLv) { addLv = _lv - _prevLv; addExp = _curExp; BasicStatus bs = _db.DefaultMinionData[_db.OwnedData.MinionData[slot.IndexOfViewType].IndexOfMinion].BasicStatus; BasicStatus abs = _db.OwnedData.MinionData[slot.IndexOfViewType].AddStatus; BasicStatus nextAbs = _db.OwnedData.MinionData[slot.IndexOfViewType].AddStatus + _db.DefaultMinionData[_db.OwnedData.MinionData[slot.IndexOfViewType].IndexOfMinion].AddStatusByLv * (_lv - _prevLv); expText.text = (_db.OwnedData.MinionData[slot.IndexOfViewType].CurExp) + " >> " + _curExp; if (addLv == 0) { lvText.text = (_db.OwnedData.MinionData[slot.IndexOfViewType].Lv).ToString(); hpText.text = (bs.Hp + abs.Hp).ToString(); mpText.text = (bs.Mp + abs.Mp).ToString(); attackSpeedText.text = (bs.AttackSpeed + abs.AttackSpeed).ToString(); attackRangeText.text = (bs.AttackRange + abs.AttackRange).ToString(); attackPowerText.text = (bs.AttackPower + abs.AttackPower).ToString(); criticalChanceText.text = (bs.CriticalChance + abs.CriticalChance).ToString(); deffenceText.text = (bs.Deffence + abs.Deffence).ToString(); deffencePentractionText.text = (bs.DeffencePentraction + abs.DeffencePentraction).ToString(); evasiveText.text = (bs.Evasive + abs.Evasive).ToString(); moveSpeedText.text = (bs.MoveSpeed + abs.MoveSpeed).ToString(); } else { lvText.text = (_db.OwnedData.MinionData[slot.IndexOfViewType].Lv) + " >> " + _lv; hpText.text = (bs.Hp + abs.Hp) + " >> " + (bs.Hp + nextAbs.Hp); mpText.text = (bs.Mp + abs.Mp) + " >> " + (bs.Mp + nextAbs.Mp); attackSpeedText.text = (bs.AttackSpeed + abs.AttackSpeed) + " >> " + (bs.AttackSpeed + nextAbs.AttackSpeed); attackRangeText.text = (bs.AttackRange + abs.AttackRange) + " >> " + (bs.AttackRange + nextAbs.AttackRange); attackPowerText.text = (bs.AttackPower + abs.AttackPower) + " >> " + (bs.AttackPower + nextAbs.AttackPower); criticalChanceText.text = (bs.CriticalChance + abs.CriticalChance) + " >> " + (bs.CriticalChance + nextAbs.CriticalChance); deffenceText.text = (bs.Deffence + abs.Deffence) + " >> " + (bs.Deffence + nextAbs.Deffence); deffencePentractionText.text = (bs.DeffencePentraction + abs.DeffencePentraction) + " >> " + (bs.DeffencePentraction + nextAbs.DeffencePentraction); evasiveText.text = (bs.Evasive + abs.Evasive) + " >> " + (bs.Evasive + nextAbs.Evasive); moveSpeedText.text = (bs.MoveSpeed + abs.MoveSpeed) + " >> " + (bs.MoveSpeed + nextAbs.MoveSpeed); } }
public override void SetModule(object _data = null) { Debug.LogError("버프 리스트 추가 요망"); UnitSetData data = (UnitSetData)_data; unitCode = data.indexOfSerialize; battleType = data.battleType; nodePos = data.indexOfNode; ownedIndex = data.indexOfOwnedUnit; decType = data.decType; DataArea db = Management.MenuGameManager.Instance.DataArea; if (data.decType == DecType.Minion) { unitName = db.DefaultMinionData[db.OwnedData.MinionData[data.indexOfOwnedUnit].IndexOfMinion].MinionName; mainStatus = db.DefaultMinionData[db.OwnedData.MinionData[data.indexOfOwnedUnit].IndexOfMinion].BasicStatus + db.OwnedData.MinionData[data.indexOfOwnedUnit].AddStatus; curSprite = Resources.Load <Sprite>(db.DefaultMinionData[db.OwnedData.MinionData[data.indexOfOwnedUnit].IndexOfMinion].MainImagePath); } else { unitName = db.DefaultSkillData[db.OwnedData.SkillData[data.indexOfOwnedUnit].IndexOfType].SkillName; mainStatus = db.DefaultSkillData[db.OwnedData.SkillData[data.indexOfOwnedUnit].IndexOfType].BasicStatus + db.OwnedData.SkillData[data.indexOfOwnedUnit].AddStatus; curSprite = Resources.Load <Sprite>(db.DefaultSkillData[db.OwnedData.SkillData[data.indexOfOwnedUnit].IndexOfType].MainImagePath); } bufStatus = new BasicStatus(); curHP = mainStatus.Hp + bufStatus.Hp; curMP = mainStatus.Mp + bufStatus.Mp; moveRoot.Clear(); bAlive = true; bDetectEnemy = false; bEndTurn = true; }
public override void ToAction(UI_Container _curContainer, UI_Container _targetContainer, object _data = null) { StrengthenData data = (StrengthenData)_data; ((UI_StrengthenSubSettingModule)_curContainer.SettingModule).Strengthen(); DataArea db = Management.MenuGameManager.Instance.DataArea; switch (data.type) { case ViewType.Minion: SettingMinionData target = db.OwnedData.MinionData[data.ownedTargetIndex]; target.Lv += data.addLv; target.CurExp += data.addExp; BasicStatus addStatus = target.AddStatus + db.DefaultMinionData[db.OwnedData.MinionData[data.ownedTargetIndex].IndexOfMinion].AddStatusByLv * (data.addLv); target.AddStatus = addStatus; target.NeedExp = db.DefaultExpManager.UnitExpChart.NeedExp[target.Lv]; List <SettingMinionData> newList = new List <SettingMinionData>(db.OwnedData.MinionData); int listCount = 0; for (int i = 0; i < db.OwnedData.MinionData.Count; ++i) { if (data.ownedMaterialIndex.Contains(i)) { for (int j = 0; j < db.OwnedData.MinionData[i].IndexOfSerializeCodeOwnedItem.Length; ++j) { var ownedItem = db.OwnedData.ItemData.Find(x => x.IndexOfSerializeCode == db.OwnedData.MinionData[i].IndexOfSerializeCodeOwnedItem[j]); if (ownedItem != null) { ownedItem.UseItem = false; ownedItem.OwnerMinionIndexOfSerializeCode = -1; } } // dec에서 삭제 DeleteInDecByIndex(db, DecType.Minion, i); // 리스트에서 삭제 newList.RemoveAt(listCount); } else { // dec에서 현재 타입이 같고 index가 i와 같은 녀석을 찾아서, listCount로 고쳐준다 SearchDecByIndex(db, DecType.Minion, i, listCount); ++listCount; } } db.OwnedData.MinionData = newList; for (int i = 0; i < db.OwnedData.MinionData.Count; ++i) { for (int j = 0; j < db.OwnedData.MinionData[i].IndexOfSerializeCodeOwnedItem.Length; ++j) { var curItem = db.OwnedData.ItemData.Find(x => x.IndexOfSerializeCode == db.OwnedData.MinionData[i].IndexOfSerializeCodeOwnedItem[j]); if (curItem != null) { curItem.OwnerMinionIndexOfSerializeCode = db.OwnedData.MinionData[i].IndexOfSerializeCode; } } } break; case ViewType.Item: SettingItemData targetItem = db.OwnedData.ItemData[data.ownedTargetIndex]; targetItem.Lv += data.addLv; targetItem.CurExp += data.addExp; BasicStatus addStatusItem = targetItem.AddStatus + db.DefaultItemData[db.OwnedData.ItemData[data.ownedTargetIndex].IndexOfType].AddStatusByLv * (data.addLv); // 소유 미니언의 추가스텟 보정 if (targetItem.OwnerMinionIndexOfSerializeCode >= 0) { var owner = db.OwnedData.MinionData.Find(x => x.IndexOfSerializeCode == targetItem.OwnerMinionIndexOfSerializeCode); if (owner != null) { owner.AddStatus -= targetItem.AddStatus; targetItem.AddStatus = addStatusItem; owner.AddStatus += targetItem.AddStatus; } } targetItem.NeedExp = db.DefaultExpManager.UnitExpChart.NeedExp[targetItem.Lv]; List <SettingItemData> newListItem = new List <SettingItemData>(db.OwnedData.ItemData); for (int i = 0; i < data.ownedMaterialIndex.Count; ++i) { newListItem.Remove(db.OwnedData.ItemData[data.ownedMaterialIndex[i]]); } db.OwnedData.ItemData = newListItem; break; case ViewType.Skill: SettingSkillData targetSkill = db.OwnedData.SkillData[data.ownedTargetIndex]; targetSkill.Lv += data.addLv; targetSkill.CurExp += data.addExp; BasicStatus addStatusSkill = targetSkill.AddStatus + db.DefaultSkillData[db.OwnedData.SkillData[data.ownedTargetIndex].IndexOfType].AddStatusByLv * (data.addLv); targetSkill.NeedExp = db.DefaultExpManager.UnitExpChart.NeedExp[targetSkill.Lv]; List <SettingSkillData> newListSkill = new List <SettingSkillData>(db.OwnedData.SkillData); //for (int i = 0; i < data.ownedMaterialIndex.Count; ++i) //{ // DeleteInDecByIndex(db,DecType.Skill, data.ownedMaterialIndex[i]); // newListSkill.Remove(db.OwnedData.SkillData[data.ownedMaterialIndex[i]]); //} int listCountSkill = 0; for (int i = 0; i < db.OwnedData.SkillData.Count; ++i) { if (data.ownedMaterialIndex.Contains(i)) { // dec에서 삭제 DeleteInDecByIndex(db, DecType.Skill, i); // 리스트에서 삭제 newListSkill.Remove(db.OwnedData.SkillData[i]); } else { // dec에서 현재 타입이 같고 index가 i와 같은 녀석을 찾아서, listCount로 고쳐준다 SearchDecByIndex(db, DecType.Skill, i, listCountSkill); ++listCountSkill; } } db.OwnedData.SkillData = newListSkill; break; } //Management.MenuGameManager.Instance.SaveData(); }