public void BonusAP(int apBonus) { currentApUsed -= 1; if (currentApUsed < 0) { GameObject apIcon = (GameObject)Instantiate(standardApIcon, this.gameObject.transform.position, this.gameObject.transform.rotation); Sc_ApIcon newscript = apIcon.GetComponent <Sc_ApIcon>(); newscript.isOneTime = true; } }
// Update is called once per frame void Update() { if (gameManager == null) { // create a monster } else { SpikedText.text = "" + currentSpiked; discardPile.text = "Discard: " + currentDiscard.Count; DeckPile.text = "Deck: " + currentDeck.Count; BanishPile.text = "Banish: " + currentBanished.Count; StageManager(); } if (Input.GetButtonDown("Jump")) { GameObject apIcon = (GameObject)Instantiate(standardApIcon, this.gameObject.transform.position, this.gameObject.transform.rotation); Sc_ApIcon newscript = apIcon.GetComponent <Sc_ApIcon>(); newscript.isOneTime = true; } }
// Use this for initialization void Start() { print("make monster"); gameManager = GameObject.FindObjectOfType <Sc_GameManager>(); GameObject newMonster = (GameObject)Instantiate(gameManager.currentMonster, transform.position, transform.rotation); Vector3 monsterPosition = new Vector3(-0.57f, 1.96f, 0); newMonster.transform.position = monsterPosition; monster = GameObject.FindObjectOfType <MonsterClass>(); saveDataManager.saveData.currentScene = "Battle"; currentDeck.Clear(); currentBanished.Clear(); currentDiscard.Clear(); currentHandObjects.Clear(); currentEquipmentArmor.Clear(); currentEquipmentMelee.Clear(); // set op some basic variables maxHandSize = 5; currentApUsed = 0; currentStage = 0; currentUtilityAP = gameManager.utilityAP; currentTotalDefence = gameManager.startingDefence; currentToughness = 0; currentNormalAttack = 0; currentBluntAttack = 0; currentPiercingAttack = 0; currentPoisonttack = 0; currentSpiked = 0; currentNumberOfAttacks = 1; currentPermenentSpiked = 0; currentRage = 0; if (gameManager.isLoading == true) { Load(); } else { for (int i = 0; i < gameManager.fullDeck.Count; i++) { currentDeck.Add(gameManager.fullDeck[i]); } currentApMax = 2; } // Create Ap Icons for (int i = 0; i < currentApMax; i++) { GameObject apIcon = (GameObject)Instantiate(standardApIcon, this.gameObject.transform.position, this.gameObject.transform.rotation); Sc_ApIcon newscript = apIcon.GetComponent <Sc_ApIcon>(); newscript.isStandard = true; } for (int i = 0; i < gameManager.utilityAP; i++) { GameObject apIcon = (GameObject)Instantiate(standardApIcon, this.gameObject.transform.position, this.gameObject.transform.rotation); Sc_ApIcon newscript = apIcon.GetComponent <Sc_ApIcon>(); newscript.isUtility = true; } // effect realted varibles mayPlayUtility = true; mayPlayMelee = true; mayPlayArmor = true; HasLostTurn = false; // Setting player related text defenceText.text = "" + currentTotalDefence; // Add some random cards to deck ShuffleDeck(); }