public void setDupeMessage(DogStatsConfig dogToShow) { int refund; Rarity dogRarity = dogToShow.dogRarity; switch (dogRarity) { case Rarity.rare: refund = 10; break; case Rarity.superRare: refund = 25; break; case Rarity.superDuperRare: refund = 50; break; case Rarity ultraRare: refund = 75; break; } myPlayer.changeBones(refund); dupeMessage.text = "Duplicate Dog Summoned\n (+ " + refund.ToString() + " bones)"; }
public void onTeamPanel(DogStatsConfig dogToShow) { removeGameObject.SetActive(true); addGameObject.SetActive(false); dupeGameObject.SetActive(false); showPanel(dogToShow); }
public void dupePanel(DogStatsConfig dogToShow) { Debug.Log("dupliate panel being built"); setDupeMessage(dogToShow); removeGameObject.SetActive(false); addGameObject.SetActive(false); dupeGameObject.SetActive(true); showPanel(dogToShow); }
public void summonTime() { myPlayer.changeBones(-100); int i = dogs.generateRandom(); int j = dogs.generateRandom(); DogStatsConfig toSummon = returnDog(i, j); summon.Raise(toSummon); Debug.Log("summon event sent: " + toSummon); }
public void setStatBars(DogStatsConfig dogToShow) { float[] myNewArray = { dogToShow.MaxHealth, dogToShow.BaseAttack, dogToShow.BaseDefense, dogToShow.BaseSpeed }; sliders[0].value = myNewArray[0] / 200; for (int i = 1; i < sliders.Length - 1; i++) { sliders[i].value = myNewArray[i] / 50; } sliders[3].value = myNewArray[3] / 35; }
public void removeFromTeam(DogStatsConfig toRemove) { for (int i = 0; i < yourTeam.Length; i++) { if (yourTeam[i] == toRemove) { yourTeam[i] = null; } } }
//TODO: null values when unit dies public void initializeDog(DogStatsConfig newDog) { dogName.text = newDog.dogName; dogPortrait.sprite = newDog.head; dogPortrait.color = new Color(1, 1, 1, 1); dogChargeCount = 0; for (int i = 0; i < 3; i++) { dogSpecialCharge[i].color = new Color(0, 0, 0, 0); } }
//dog functions /* public void dogsInit() * { * yourDogs = new List<DogStatsConfig>(ownedDogs); * } */ public bool hasDog(DogStatsConfig toCheck) { if (yourDogs.Contains(toCheck)) { return(true); } else { return(false); } }
public void addToTeam(DogStatsConfig toAdd) { for (int i = 0; i < yourTeam.Length; i++) { if (yourTeam[i] == null) { yourTeam[i] = toAdd; i = 4; } } }
public void showPanel(DogStatsConfig dogToShow) { if (myPlayer.hasDog(dogToShow)) { displayDog = dogToShow; stringGen(dogToShow); setName(dogToShow); setStatBars(dogToShow); setPortrait(dogToShow); thisPanel.SetActive(true); } }
public bool isOnTeam(DogStatsConfig check) { bool toReturn = false; for (int i = 0; i < yourTeam.Length; i++) { if (yourTeam[i] == check) { toReturn = true; } } return(toReturn); }
public void addDog(DogStatsConfig newDog) { //DogStatsConfig newDog = dogsInTheGame.dogsInTheGame[i]; if (myPlayer.isOnTeam(newDog)) { Debug.Log("is on team"); onTeamPanel(newDog); } else { addPanel(newDog); } }
public DogStatsConfig returnDog(int i, int j) { int pool; if (i < 4) { pool = 0; } else if (i < 7) { pool = 1; } else if (i < 9) { pool = 2; } else if (i == 9) { pool = 3; } else { pool = 0; } Debug.Log("pool is " + pool); switch (pool) { case 0: j = j % dogs.RareDogs.Count; Debug.Log("rare count is " + dogs.RareDogs.Count); Debug.Log("j is " + j); break; case 1: j = j % dogs.SuperRareDogs.Count; Debug.Log("sr count is " + dogs.SuperRareDogs.Count); Debug.Log("j is " + j); break; case 2: j = j % dogs.SuperDuperRareDogs.Count; Debug.Log("sdr count is " + dogs.SuperDuperRareDogs.Count); Debug.Log("j is " + j); break; case 3: j = j % dogs.UltraRareDogs.Count; Debug.Log("ur count is " + dogs.UltraRareDogs.Count); Debug.Log("j is " + j); break; } DogStatsConfig toReturn = dogs.summoningPools[pool][j]; return toReturn; }
public void summonedDog(DogStatsConfig newDog) { Debug.Log("summoned dog recieved"); if (myPlayer.hasDog(newDog)) { Debug.Log("recognized as duplicate"); duplicateDog(newDog); } else { myPlayer.yourDogs.Add(newDog); addDog(newDog); } }
public void addPanel(DogStatsConfig dogToShow) { removeGameObject.SetActive(false); dupeGameObject.SetActive(false); int numDogsInTeam = 0; for (int i = 0; i < myPlayer.yourTeam.Length; i++) { if (myPlayer.yourTeam[i] != null) { numDogsInTeam++; } } if (numDogsInTeam < 3) { addGameObject.SetActive(true); } else { addGameObject.SetActive(false); } showPanel(dogToShow); }
public void setName(DogStatsConfig dogToShow) { dogName.text = dogToShow.dogName; }
public void setPortrait(DogStatsConfig dogToShow) { portrait.sprite = dogToShow.head; }
//this function sets your current dog as active and calls the previous spawndog function public void loadDog(DogStatsConfig newdoggo) { activeDog = newdoggo; spawnDog(); }
public string generateSpecialDescription(DogStatsConfig dogToShow) { StringBuilder sb = new StringBuilder("", 100); foreach (special effect in dogToShow.specialEffects) { types typeToCheck = effect.type; switch (typeToCheck) { case types.changeHealth: if (effect.value > 0) { sb.Append("Heals "); } else if (effect.value < 0) { sb.Append("Damages "); } break; case types.changeAttack: if (effect.value > 0) { sb.Append("Raises "); } else if (effect.value < 0) { sb.Append("Lowers "); } sb.Append("attack of "); break; case types.changeDefense: if (effect.value > 0) { sb.Append("Raises "); } else if (effect.value < 0) { sb.Append("Lowers "); } sb.Append("defense of "); break; case types.changeSpeed: if (effect.value > 0) { sb.Append("Raises "); } else if (effect.value < 0) { sb.Append("Lowers "); } sb.Append("speed of "); break; } float absValueEffect = Math.Abs(effect.value); if (effect.targets == target.self) { sb.Append("self "); } if (effect.targets == target.enemy) { sb.Append("enemy "); } if (absValueEffect < 15) { sb.Append("a little bit\n"); } else if (absValueEffect < 35) { sb.Append("moderately\n"); } else if (absValueEffect <= 50) { sb.Append("massively\n"); } } return(sb.ToString()); }
public void removeDogFromFrame(int i) { DogStatsConfig myCoolDog = myPlayer.yourTeam[i]; addDog(myCoolDog); }
public void addDogFromDoghouse(int i) { DogStatsConfig myCoolDog = doggies.dogsInTheGame[i]; addDog(myCoolDog); }
public void stringGen(DogStatsConfig dogToShow) { specialTextMeshPro.text = generateSpecialDescription(dogToShow); }
public void duplicateDog(DogStatsConfig dupeDog) { dupePanel(dupeDog); }
public void setActive(DogStatsConfig currentDog) { //TODO: sets to active //TODO: checks dogs for active ones //TODO: loads in current team }