//Set Health+time to full. public void ResetPlayer() { if (!list) { list = FindObjectOfType <equipmentList>(); } if (avatar != null) { Destroy(avatar); } if (list) { avatar = list.BuildCharacter(container); } currentHealth = healthBar.maxValue = baseHealth; resetTime = 40; Timer = timeLeft.maxValue = resetTime; greenZone = resetTime * .80f; redZone = resetTime * .25f; FindObjectOfType <TorsoPart>().Animate(Animations.Idle); }
// Use this for initialization void Start() { list = FindObjectOfType <equipmentList>(); if (list == null) { GameObject adding = Instantiate(prefabbedList, null, false); list = adding.GetComponent <equipmentList>(); adding.name = "List"; StateManager check = gameObject.GetComponent <StateManager>(); if (!check) { list.startGame("Guest", true); } } combinedShop.Begin(list); headButton.interactable = false; nextPart.interactable = false; prevPart.interactable = false; EnableEquip = false; foreach (Button item in otherSlots) { item.interactable = false; } SetStep(1); enableOutlines(-1); }
public override void Start() { list = FindObjectOfType <equipmentList>(); removedLimbs = new bool[6]; buttons = new EndlessModifierButton[3]; player = endlessState.player; monster = endlessState.enemy; player.enemy = monster; player.parent = this; monster.player = player; monster.manager = endlessState; monster.parent = this; highScores = GetComponent <HighSaveScore>(); highScores.setHighZero(); highScores.Load(); currentEnemy = monster; }
// Use this for initialization void Start() { Time.timeScale = 1; list = FindObjectOfType <equipmentList>(); if (list == null) { GameObject adding = Instantiate(prefabbedList, null, false); list = adding.GetComponent <equipmentList>(); adding.name = "List"; StateManager check = gameObject.GetComponent <StateManager>(); if (!check) { list.startGame("Guest", true); } } GameObject can = GameObject.Find("Canvas"); backs = Instantiate(backPrefab, can.transform, false); backgrounds = backs.GetComponent <backgroundManager>(); backgrounds.startBack(playStatus.subjectSelect); SetStep(1); }
internal void End(int earned) { winAnimation.GiveShards(earned); list = FindObjectOfType <equipmentList>(); QuizButton button = monsterM.quizRunning; int subject; int index = button.quizIndex; if ((int)button.Operator > (int)classType.Calculi) { subject = (int)classType.Calculi; } else { subject = (int)button.Operator; } int starsUnlocked = list.equip.StarsAcquired[((subject * 10) + index)]; if (button.boss) { foreach (Button item in stars) { item.gameObject.SetActive(false); } } else { foreach (Button item in stars) { item.gameObject.SetActive(true); } } stars[0].interactable = (starsUnlocked >= 1); stars[1].interactable = (starsUnlocked >= 2); stars[2].interactable = (starsUnlocked >= 3); bronzeParticle.SetActive(stars[0].interactable); silverParticle.SetActive(stars[1].interactable); goldParticle.SetActive(stars[2].interactable); if (shardsEarned) { shardsEarned.text = earned.ToString(); } }
//Counts down time while game is playing. Tale damage if hits 0. void Update() { music = FindObjectOfType <MusicManager>(); if (!list) { list = FindObjectOfType <equipmentList>(); } //healthBar.value = currentHealth; if (Frozen > 0) { timerManager.sliderColour(Color.cyan); return; } if (Timer > greenZone) { music.AdjustPitch(-1); timerManager.sliderColour(Color.green); } else if (Timer < redZone) { music.AdjustPitch(2); timerManager.sliderColour(Color.red); } else { music.AdjustPitch(1); timerManager.sliderColour(Color.yellow); } if (manager.isPlaying() && (!transition || transition.transitionState == TransitionState.None) && (!storyManager || storyManager.phase == phases.None)) { Timer -= Time.deltaTime; timerManager.SetTimeLeft(Timer); if (Timer < 0) { if (bossFighting) { Debug.Log("Boss is Attacking Player"); parent.boss.EnemyAttack(); } else { enemy.EnemyAttack(); } } } }
//Set Health+time to full. public void ResetPlayer(bool a_boss) { bossFighting = a_boss; if (!list) { list = FindObjectOfType <equipmentList>(); } if (avatar != null) { Destroy(avatar); } avatar = list.BuildCharacter(container); if (!abilities) { abilities = GetComponent <playerAbilities>(); abilities.Begin(); Debug.Log("abilities begun"); } abilities.SetupAbilities(a_boss); if (!a_boss) { EndTurn(false); } Frozen = 0; if (!calculator) { calculator = FindObjectOfType <Calculator>(); } calculator.AddInput("Cancel"); maxHealth = baseHealth * abilities.EquipmentHealth(); attackDamage = baseAttack * abilities.EquipmentAttack(); currentHealth = maxHealth; Healthbar.setMaxHealth(maxHealth, true); resetTime = parent.quizRunning.levelTime + abilities.EquipmentTime(); counterTimeModifier = abilities.CounterTimeModify(); counterDamage = baseAttack * abilities.EquipmentCounter(); FindObjectOfType <TorsoPart>().Animate(Animations.Idle); parent.currentEnemy.loadMonster(); }
//Use our current star levels to light up stars, buttons. public void CheckStars(QuizButton a_button) { if (!list) { list = FindObjectOfType <equipmentList>(); } if ((int)a_button.Operator > (int)classType.Calculi) { currentSubject = classType.Calculi; } else { currentSubject = (classType)a_button.Operator; } SetupGroups((int)currentSubject); starsUnlocked = list.equip.StarsAcquired[(((int)currentSubject * 10) + currentLevel)]; if (currentLevel == 4 || currentLevel == 9 || currentLevel == 14) { SetHardMode(false); medal.gameObject.SetActive(true); medal.SetChangingTalisman(list, talismanManager, currentSubject); BossButton.gameObject.SetActive(true); NormalMode.gameObject.SetActive(false); HardButton.gameObject.SetActive(false); starOne.gameObject.SetActive(false); starTwo.gameObject.SetActive(false); starThree.gameObject.SetActive(false); bronzestarParticle.gameObject.SetActive(false); silverstarParticle.gameObject.SetActive(false); goldstarParticle.gameObject.SetActive(false); return; } NormalMode.gameObject.SetActive(true); BossButton.gameObject.SetActive(false); medal.gameObject.SetActive(false); HardButton.gameObject.SetActive(true); starOne.gameObject.SetActive(true); starTwo.gameObject.SetActive(true); starThree.gameObject.SetActive(true); starOne.interactable = (starsUnlocked >= 1); starTwo.interactable = (starsUnlocked >= 2); HardButton.interactable = ((starsUnlocked >= 2) && currentContainer.buttons[currentLevel].hardMode != null); starThree.interactable = (starsUnlocked >= 3); bronzestarParticle.SetActive(starOne.interactable); silverstarParticle.SetActive(starTwo.interactable); goldstarParticle.SetActive(starThree.interactable); }
//If we bought the penalties, we're going to lose our limbs. void RemoveLimbs() { list = FindObjectOfType <equipmentList>(); for (int i = 0; i < 6; i++) { if (removedLimbs[i]) { list.ChangeEquip(null, (partType)i, -1); } } }
internal void SetStaticTalismans() { if (!list) { list = FindObjectOfType <equipmentList>(); } foreach (Talisman tal in talismans) { tal.SetStaticTalisman(list, this); } }
private void Update() { if (!list) { list = FindObjectOfType <equipmentList>(); UINeedsUpdate = true; } if (shardsUI && UINeedsUpdate) { if (list && list.equip != null) { UpdateUI(true); } } }
// Use this for initialization internal void Begin(StateManager a_state, equipmentList a_list) { states = a_state; list = a_list; nameOne = PlayerPrefs.GetString("NameOne", ""); nameTwo = PlayerPrefs.GetString("NameTwo", ""); nameThree = PlayerPrefs.GetString("NameThree", ""); nameTags[0].text = nameOne; nameTags[1].text = nameTwo; nameTags[2].text = nameThree; inputNames[0].text = ""; inputNames[1].text = ""; inputNames[2].text = ""; EnableProfiles(); }
//Set up abiltiies for display. //First empty the array, then check every equipped part for an ability. //Finally, display every single ability's description along with its charges. public void setAbilities(equipmentList a_list = null) { if (!list && a_list) { Start(); } Array.Clear(abilities, 0, abilities.Length); int[] parts = new int[6]; CheckPart(list.currentTorsoPrefab); CheckPart(list.currentHeadPrefab); CheckPart(list.currentLeftArmPrefab); CheckPart(list.currentRightArmPrefab); CheckPart(list.currentLeftLegPrefab); CheckPart(list.currentRightLegPrefab); }
// Use this for initialization internal void Begin(equipmentList a_list) { list = a_list; manager = list.equip; shop.list = list; parts.list = list; shop.Begin(this); parts.Begin(this); currentType = partType.Torso; stars = manager.GetTotalStars(); getPart(); Refresh = true; }
//Called from player if we won. //If we won, 1 star. //If we were at 100% health, 2 stars. //If it was hardmode, 3. public void SetStars(bool fullHealth, QuizButton a_button) { if (!list) { list = FindObjectOfType <equipmentList>(); } if (a_button.boss) { return; } currentLevel = a_button.quizIndex; if ((int)a_button.Operator > (int)classType.Calculi) { currentSubject = classType.Calculi; } else { currentSubject = (classType)a_button.Operator; } starsUnlocked = list.equip.StarsAcquired[(((int)currentSubject * 10) + currentLevel)]; if (starsUnlocked == 0) { starsUnlocked = 1; } if (fullHealth && starsUnlocked < 2) { starsUnlocked = 2; } if (a_button.Hard) { starsUnlocked = 3; } list.equip.StarsAcquired[(((int)currentSubject * 10) + currentLevel)] = starsUnlocked; CheckStars(a_button); SetButtons(); }
public void EquipmentReward() { equipment equip = new equipment(); equipmentList el = new equipmentList(); el.equipmentPicker(); int idInt = el.populateArray(); SqlCommand cmd = new SqlCommand("SELECT * FROM equipmentList WHERE id = @id;", conn); cmd.Parameters.AddWithValue("@id", idInt); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { equipment = dr["name"].ToString() + " " + dr["desciption"].ToString() + ". Please Click on the Picture to add to your equipment."; picture = dr["picture"].ToString(); } }
internal void SetStaticTalisman(equipmentList list, TalismanManager talismanManager) { if (!MainButton) { MainButton = GetComponent <Image>(); HalfButton = GetComponentsInChildren <Image>()[1]; } if (MainButton.sprite == null) { MainButton.sprite = talismanManager.ReturnSubject(myType, false); } if (MainButton.sprite == null) { MainButton.sprite = talismanManager.ReturnSubject(myType, true); } int index = list.equip.completedLevels[(int)myType]; SetActivity(index); }
public void Awaken() { if (!alreadyTurnedOn) { if (list == null) { list = FindObjectOfType <equipmentList>(); } int i = 0; foreach (QuizButton item in buttons) { item.quizIndex = i; item.parent = this; i++; } alreadyTurnedOn = true; } checkCompleted(); levelSelection.setContainer(this); gameObject.SetActive(false); }
//Counts down time while game is playing. Tale damage if hits 0. void Update() { if (!list) { list = FindObjectOfType <equipmentList>(); } healthBar.value = currentHealth; if (Frozen > 0) { bar.color = Color.cyan; return; } if (Timer > greenZone) { bar.color = Color.green; } else if (Timer < redZone) { bar.color = Color.red; } else { bar.color = Color.yellow; } Timer -= Time.deltaTime; timeLeft.value = Timer; if (Timer < 0) { enemy.EnemyAttack(); } }
internal void SetChangingTalisman(equipmentList list, TalismanManager talismanManager, classType a_type) { if (!MainButton) { MainButton = GetComponent <Image>(); HalfButton = GetComponentsInChildren <Image>()[1]; } myType = a_type; if (myType == classType.Calculi) { gameObject.SetActive(false); return; } MainButton.sprite = talismanManager.ReturnSubject(myType, false); HalfButton.sprite = talismanManager.ReturnSubject(myType, true); int index = list.equip.completedLevels[(int)myType]; SetActivity(index); }
public void Find() { list = FindObjectOfType <equipmentList>(); if (list == null) { GameObject adding = Instantiate(prefabbedList, null, false); list = adding.GetComponent <equipmentList>(); adding.name = "List"; StateManager check = gameObject.GetComponent <StateManager>(); if (!check) { list.startGame("Guest", true); } } GameObject can = GameObject.Find("Canvas"); backs = Instantiate(backPrefab, can.transform, false); backgrounds = backs.GetComponent <backgroundManager>(); }
// Use this for initialization void Start() { list = gameObject.GetComponent <equipmentList>(); abilities = new int[(int)abilityTypes.TimeLord]; }
public void save() { list = FindObjectOfType <equipmentList>(); highScores.Save(list.playerName); }