//how to name for HeroPassiveAbility Method, Use all caps e.g. HELLOWORLD public bool SmallPosion(HeroStore hero) { Run(); if (hero.hp > 0) { hero.hp = hero.hp + 20; if (_core._gameMode == _GameStatus.BATTLE) { foreach (Hero h in _battleCon._heroData) { if (h.hero.id == hero.id) { h._icon.transform.Find("HPSlider").GetComponent <ControlSlider>().AddFill((float)hero.hp * 1 / hero.hpMax); break; } } } _core.CreateEffect(_core._healEffect, hero.obj.transform); return(true); } else { _core.OpenErrorNotify("ใช้กับฮีโร่ที่ตายไม่ได้!"); return(false); } }
public void Passive1(_Model type) { Run(); if (type == _Model.PLAYER) { if (_battleCon.GetHeroFocus().hp == 0) { if (_battleCon._currentEvent == _event.Wind) { //_battleCon.ShowPassive("[บุตรพระพาย]ทำงาน...", _Model.PLAYER); _battleCon.GetHeroFocus().hp += 50; _core.CreateEffect(_core._healEffect, _battleCon.GetHeroFocus()._avatar.transform); } } } else { if (_battleCon.GetMonFocus().hp == 0) { if (_battleCon._currentEvent == _event.Wind) { //_battleCon.ShowPassive("[บุตรพระพาย]ทำงาน...", _Model.MONSTER); _battleCon.GetMonFocus().hp += 50; _core.CreateEffect(_core._healEffect, _core._monPanel.GetComponent <MonPanel>()._monAvatarList[0].transform); } } } //Debug.Log("Passive1..."); }