public void BuildPlayer() { int total_attack = 0; int total_speed = 0; int total_hp = 0; int total_def = 0; int total_mind = 0; int total_luck = 0; int total_move = 100; int total_heal = 100; int total_coin = 100; DataWeaponParam data_equip_weapon = DataManager.Instance.dataWeapon.list.Find(p => 0 < p.equip); MasterWeaponParam master_equip_weapon = DataManager.Instance.masterWeapon.list.Find(p => p.weapon_id == data_equip_weapon.weapon_id); // レベルの校正 MasterWeaponParam master_equip_weapon_level = master_equip_weapon.GetParam(data_equip_weapon.level); total_attack = master_equip_weapon_level.attack; total_speed = master_equip_weapon_level.speed; for (int i = 0; i < MasterArmor.ArmorPositionArr.Length; i++) { DataArmorParam data = DataManager.Instance.dataArmor.list.Find(p => p.position == MasterArmor.ArmorPositionArr[i]); MasterArmorParam master = DataManager.Instance.masterArmor.list.Find(p => p.armor_id == data.armor_id); total_hp += master.hp; total_def += master.def; total_mind += master.mind; total_luck += master.luck; } List <DataTreasureParam> data_treasure_list = DataManager.Instance.dataTreasure.list.FindAll(p => 0 < p.equip); TreasureAssist assist = TreasureAssist.GetTreasureAssist(data_treasure_list); total_hp = Mathf.CeilToInt((float)total_hp * (float)((float)assist.hp / 100.0f)); total_attack = Mathf.CeilToInt((float)total_attack * (float)((float)assist.attack / 100.0f)); total_def = Mathf.CeilToInt((float)total_def * (float)((float)assist.def / 100.0f)); total_mind = Mathf.CeilToInt((float)total_mind * (float)((float)assist.mind / 100.0f)); total_move = Mathf.CeilToInt((float)total_move * (float)((float)assist.move / 100.0f)); total_heal = Mathf.CeilToInt((float)total_heal * (float)((float)assist.heal / 100.0f)); total_luck = Mathf.CeilToInt((float)total_luck * (float)((float)assist.luck / 100.0f)); total_coin = Mathf.CeilToInt((float)total_coin * (float)((float)assist.coin / 100.0f)); hp = total_hp; hp_max = total_hp; attack = total_attack; speed = total_speed; def = total_def; mind = total_mind; luck = total_luck; move = total_move; heal = total_heal; coin = total_coin; //Debug.Log(string.Format("HP:{0} atk:{1} def:{2}", hp_max, attack, def)); }
public void Setup(DataWeaponParam _data, MasterWeaponParam _master) { m_icon.Initialize(_data, _master); if (_master != null) { m_txtName.text = _master.name; m_txtOutline.text = _master.name; } else { m_txtName.text = "なし"; m_txtOutline.text = "-----"; } if (10 <= _data.level) { m_txtGradeupPrice.text = "強化上限"; m_btnGradeup.interactable = false; } else { if (_master != null) { int price = MasterWeapon.GetGradeupPrice(_data, _master); m_txtGradeupPrice.text = price.ToString(); m_btnGradeup.interactable = price <= DataManager.Instance.GetCoin(); } else { m_txtGradeupPrice.text = "-----"; m_btnGradeup.interactable = false; } } m_btnBuyCheck.interactable = _data.weapon_id != 0 && _data.equip == 0; if (_master != null) { MasterWeaponParam equip_level = _master.GetParam(_data.level); m_txtAttack.text = equip_level.attack.ToString(); m_txtSpeed.text = equip_level.speed.ToString(); } else { m_txtAttack.text = "---"; m_txtSpeed.text = "---"; } }