public BasePiMon GetRandomPiMonFromList(List <BasePiMon> PiMonList) { BasePiMon PiMon = new BasePiMon(); int PiMonIndex = Random.Range(0, PiMonList.Count - 1); PiMon = PiMonList[PiMonIndex]; return(PiMon); }
public void AddMember(BasePiMon bp) { this.Name = bp.Name; this.image = bp.image; this.biomeFound = bp.biomeFound; this.type = bp.type; this.rarity = bp.rarity; this.HP = bp.HP; this.maxHP = bp.maxHP; this.AttackStat = bp.AttackStat; this.DefenceStat = bp.DefenceStat; this.piMonStats = bp.piMonStats; this.canEvolve = bp.canEvolve; this.evolveTo = bp.evolveTo; this.level = bp.level; }
public void EnterBattle(Rarity rarity) { playerCamera.SetActive(false); battleCamera.SetActive(true); BasePiMon battlePiMon = GetRandomPiMonFromList(GetPiMonByRarity(rarity)); Debug.Log(battlePiMon.Name); player.GetComponent <PlayerMovement>().isAllowedToMove = false; GameObject dPiMon = Instantiate(emptyPiMon, defencePodium.transform.position, Quaternion.identity) as GameObject; dPiMon.transform.parent = defencePodium; BasePiMon tempPiMon = dPiMon.AddComponent <BasePiMon>() as BasePiMon; tempPiMon.AddMember(battlePiMon); dPiMon.GetComponent <SpriteRenderer>().sprite = battlePiMon.image; }