public void InstallAccessory(int index, Inventory inventory, int install) { //있던 보석의 능력치를 제거 switch (m_nAccessoryState) { case 1: inventory.m_Ability.SetAllHp(inventory.m_Ability.m_AllHp - m_nAccessoryIncrease); m_UIPlayerState.SetAllHp(); m_UIPlayerState.SetHp(); break; case 2: inventory.m_Ability.SetAllMp(inventory.m_Ability.m_AllMp - m_nAccessoryIncrease); m_UIPlayerState.SetAllMp(); m_UIPlayerState.SetMp(); break; case 3: inventory.m_Ability.SetDefense(inventory.m_Ability.m_Defense - m_nAccessoryIncrease); break; case 4: inventory.m_Ability.SetAttack(inventory.m_Ability.m_Attack - m_nAccessoryIncrease); break; } //장착하여 보석의 능력치를 생성 switch (index) { case 1: m_nAccessoryIncrease = (int)(inventory.m_Ability.m_AllHp * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f)); inventory.m_Ability.SetAllHp(inventory.m_Ability.m_AllHp + m_nAccessoryIncrease); m_UIPlayerState.SetAllHp(); m_UIPlayerState.SetHp(); break; case 2: m_nAccessoryIncrease = (int)(inventory.m_Ability.m_AllMp * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f)); inventory.m_Ability.SetAllMp(inventory.m_Ability.m_AllMp + m_nAccessoryIncrease); m_UIPlayerState.SetAllMp(); m_UIPlayerState.SetMp(); break; case 3: m_nAccessoryIncrease = (int)(inventory.m_Ability.m_Defense * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f)); inventory.m_Ability.SetDefense(inventory.m_Ability.m_Defense + m_nAccessoryIncrease); break; case 4: m_nAccessoryIncrease = (int)(inventory.m_Ability.m_Attack * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f)); inventory.m_Ability.SetAttack(inventory.m_Ability.m_Attack + m_nAccessoryIncrease); break; } m_nAccessoryState = index; }
public void Drink() { AudioManager.Instance.PlayEffect(10); switch (m_nType) { case (int)PortionType.Hp: m_PlayerAbility.SetHp(m_PlayerAbility.m_Hp + m_fEffect); if (m_PlayerAbility.m_AllHp < m_PlayerAbility.m_Hp) { m_PlayerAbility.SetHp(m_PlayerAbility.m_AllHp); } m_UIPlayerState.SetHp(); break; case (int)PortionType.Mp: m_PlayerAbility.SetMp(m_PlayerAbility.m_Mp + m_fEffect); if (m_PlayerAbility.m_AllMp < m_PlayerAbility.m_Mp) { m_PlayerAbility.SetMp(m_PlayerAbility.m_AllMp); } m_UIPlayerState.SetMp(); break; case (int)PortionType.Attack: m_PlayerAbility.buff(m_nType, m_fEffect); break; case (int)PortionType.Defense: m_PlayerAbility.buff(m_nType, m_fEffect); break; default: return; } --m_nCount; m_CountTxt.text = m_nCount.ToString(); m_InInvenCountTxt.text = m_nCount.ToString(); if (m_nCount < 1) { Destroy(gameObject); m_InInvenObj.GetComponent <PortionEquipment>().ZeroCount(); } }
//몬스터가 플레이어 공격 부분 public void plaseHit(int attack, AIController aIController) { int _sum; if (m_PlayerController.m_PlayerAbility.m_Hp >= 0) { m_PlayerController.m_PlayerAbility.DecreaseHp(attack, out _sum); m_PlayerState.SetHp(); } else { if (m_PlayerFlush != null) { StopCoroutine(m_PlayerFlush); m_PlayerFlush = null; } } }