Guest User

Untitled

a guest
Jun 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. public List<baseMonsters> allMonsters = new List<baseMonsters> ();
  2.  
  3. public void EnterBattle(Rarity rarity)
  4. {
  5. // this code swaps camera view to the battlefield from the overworld map
  6. playerCamera.SetActive(false);
  7. battleCamera.SetActive(true);
  8.  
  9. // call function to determine which monster appears
  10. baseMonsters battleMonster = GetRandomMonsterFromList(GetMonsterRarity(rarity));
  11.  
  12. // returns which monster was chosen
  13. Debug.Log (battleMonster.name);
  14.  
  15. // prevents the player from moving after combat begins
  16. player.GetComponent<PLayermove>().isAllowedtoMove = false;
  17.  
  18. //Creates the defending monster
  19. GameObject dMon = Instantiate (emptyMon, defencePodium.transform.position, Quaternion.identity);
  20. //Ensures scale from original is preserved
  21. dMon.transform.localScale = battleMonster.transform.localScale;
  22.  
  23.  
  24. Vector3 MonLocalPos = new Vector3 (0, 1, 0);
  25. dMon.transform.parent = defencePodium;
  26. dMon.transform.localPosition = MonLocalPos;
  27.  
  28. //Adds the stat components of the original prefab
  29. baseMonsters tempMon = dMon.AddComponent<baseMonsters> () as baseMonsters;
  30.  
  31. tempMon = battleMonster;
  32.  
  33. dMon.GetComponent<SpriteRenderer> ().sprite = battleMonster.image;
  34. bm.ChangeMenu (BattleMenu.Selection);
  35.  
  36. }
Add Comment
Please, Sign In to add comment