Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<baseMonsters> allMonsters = new List<baseMonsters> ();
- public void EnterBattle(Rarity rarity)
- {
- // this code swaps camera view to the battlefield from the overworld map
- playerCamera.SetActive(false);
- battleCamera.SetActive(true);
- // call function to determine which monster appears
- baseMonsters battleMonster = GetRandomMonsterFromList(GetMonsterRarity(rarity));
- // returns which monster was chosen
- Debug.Log (battleMonster.name);
- // prevents the player from moving after combat begins
- player.GetComponent<PLayermove>().isAllowedtoMove = false;
- //Creates the defending monster
- GameObject dMon = Instantiate (emptyMon, defencePodium.transform.position, Quaternion.identity);
- //Ensures scale from original is preserved
- dMon.transform.localScale = battleMonster.transform.localScale;
- Vector3 MonLocalPos = new Vector3 (0, 1, 0);
- dMon.transform.parent = defencePodium;
- dMon.transform.localPosition = MonLocalPos;
- //Adds the stat components of the original prefab
- baseMonsters tempMon = dMon.AddComponent<baseMonsters> () as baseMonsters;
- tempMon = battleMonster;
- dMon.GetComponent<SpriteRenderer> ().sprite = battleMonster.image;
- bm.ChangeMenu (BattleMenu.Selection);
- }
Add Comment
Please, Sign In to add comment