public void LevelUp() { Mokepon basemokepon = XmlManager.Instance.Load <Mokepon>("Data/Mokepons/BaseStats/" + DefaultName + ".xml"); //Level and experience to level LVL++; LVL_UP_XP = 5 * LVL * LVL * LVL / 4; //Calculate stats int prevMaxHP = MaxHP; MaxHP = (2 * (basemokepon.MaxHP + HP_IV) * LVL) / 100 + LVL + 10; ATK = (2 * (basemokepon.ATK + ATK_IV) * LVL) / 100 + 5; DEF = (2 * (basemokepon.DEF + DEF_IV) * LVL) / 100 + 5; SP_ATK = (2 * (basemokepon.SP_ATK + SP_ATK_IV) * LVL) / 100 + 5; SP_DEF = (2 * (basemokepon.SP_DEF + SP_DEF_IV) * LVL) / 100 + 5; SPD = (2 * (basemokepon.SPD + SPD_IV) * LVL) / 100 + 5; HP += MaxHP - prevMaxHP; //RESTORE BUFFS List <BattleBuff> temp = BattleBuffs; BattleBuffs = new List <BattleBuff>(); foreach (var buff in temp) { AddBuff(buff.ATK, buff.DEF, buff.SP_ATK, buff.SP_DEF, buff.SPD, buff.ACC); } //IF EVOLUTION LEVEL == LVL //EVOLVE //ADD NEW ABILITIES }
public static string ChooseMove(Mokepon attacker, Mokepon defender, int level) { if (level == 0) { return(attacker.AbilityNames[Managers.GameManager.Instance.random.Next(0, attacker.AbilityNames.Count)]); } return(attacker.AbilityNames[0]); }
public Mokepon(string mokeponName, int level) { Mokepon basemokepon = XmlManager.Instance.Load <Mokepon>("Data/Mokepons/BaseStats/" + mokeponName + ".xml"); Name = basemokepon.DefaultName; DefaultName = basemokepon.DefaultName; //Generate IVs HP_IV = GameManager.Instance.random.Next(0, 16); ATK_IV = GameManager.Instance.random.Next(0, 16); DEF_IV = GameManager.Instance.random.Next(0, 16); SP_ATK_IV = GameManager.Instance.random.Next(0, 16); SP_DEF_IV = GameManager.Instance.random.Next(0, 16); SPD_IV = GameManager.Instance.random.Next(0, 16); //Level and experience to level LVL = level; LVL_UP_XP = 5 * LVL * LVL * LVL / 4; XP = 0; //Calculate stats MaxHP = (2 * (basemokepon.MaxHP + HP_IV) * LVL) / 100 + LVL + 10; ATK = (2 * (basemokepon.ATK + ATK_IV) * LVL) / 100 + 5; DEF = (2 * (basemokepon.DEF + DEF_IV) * LVL) / 100 + 5; SP_ATK = (2 * (basemokepon.SP_ATK + SP_ATK_IV) * LVL) / 100 + 5; SP_DEF = (2 * (basemokepon.SP_DEF + SP_DEF_IV) * LVL) / 100 + 5; SPD = (2 * (basemokepon.SPD + SPD_IV) * LVL) / 100 + 5; ACC = 100; HP = MaxHP; Type1 = basemokepon.Type1; Type2 = basemokepon.Type2; EvolutionName = basemokepon.EvolutionName; EvolutionLevel = basemokepon.EvolutionLevel; AbilityNames = basemokepon.AbilityNames; BattleBuffs = new List <BattleBuff>(); }
public virtual void Effect(ref Mokepon caster, ref Mokepon target, BattleScreen screen) { }