void Awake() { GameManager GM = GameObject.Find("GameManager").GetComponent <GameManager>(); CombatManager CM = CombatManager.instance; MonsterController monster = null; HeroController hero = GameObject.Find(GM.GetHeroByPID(CM.battleHeroID)).GetComponent <HeroController>(); if (hero.GetHeroID() != HeroSelection.HS.mySelectedCharacter) { foreach (GameObject m in GM.getMonsterList()) { if (m.GetComponent <MonsterController>().getCurrentPosition().GetComponent <Node>().getRank() == CM.MonsterFighterID) { monster = m.GetComponent <MonsterController>(); break; } } monster.GetMonster().Recover(); } CM.battleHeroID = 0; CM.MonsterFighterID = 0; CM.heroRetreaterID = 0; Destroy(this); }
protected int HeroRollMethod(List <DieValue> values) { CombatManager combatManager = CombatManager.instance; List <int> rolls = new List <int>(); foreach (DieValue v in values) { rolls.Add(v.value); } combatManager.DoneRolling = true; return(strengthPoints + rolls.Max()); }
//The one where you take the highest value rolled protected int HeroRollMethod() { CombatManager combatManager = CombatManager.instance; List <int> rolls; if (GetMonsterKind() == MonsterKind.NotMonster) { rolls = combatManager.HeroRoll(numRegularDice, numBlackDice); } else { rolls = combatManager.MonsterRoll(numRegularDice, numBlackDice); } combatManager.DoneRolling = true; return(strengthPoints + rolls.Max()); }
protected int HelmRollMethod(List <DieValue> values) { CombatManager combatManager = CombatManager.instance; List <int> rolls = new List <int>(); foreach (DieValue v in values) { rolls.Add(v.value); } int sumIdentical = rolls.GroupBy(i => i) .Select(grp => grp.Sum()) .Max(); combatManager.DoneRolling = true; return(strengthPoints + Math.Max(rolls.Max(), sumIdentical)); }
//The one where you use the sum of identical rolls protected int HelmRollMethod() { CombatManager combatManager = CombatManager.instance; List <int> rolls; if (GetMonsterKind() == MonsterKind.NotMonster) { rolls = combatManager.HeroRoll(numRegularDice, numBlackDice); } else { rolls = combatManager.MonsterRoll(numRegularDice, numBlackDice); } int sumIdentical = rolls.GroupBy(i => i) .Select(grp => grp.Sum()) .Max(); combatManager.DoneRolling = true; return(strengthPoints + Math.Max(rolls.Max(), sumIdentical)); }
void Awake() { GameManager GM = GameObject.Find("GameManager").GetComponent <GameManager>(); CombatManager CM = CombatManager.instance; MonsterController monster = null; HeroController hero = GameObject.Find(GM.GetHeroByPID(CM.battleHeroID)).GetComponent <HeroController>(); if (hero.GetHeroID() != HeroSelection.HS.mySelectedCharacter) { foreach (GameObject m in GM.getMonsterList()) { if (m.GetComponent <MonsterController>().getCurrentPosition().GetComponent <Node>().getRank() == CM.MonsterFighterID) { monster = m.GetComponent <MonsterController>(); break; } } int result = CM.heroSyncBV - CM.monsterSyncBV; if (result > 0) { monster.GetMonster().TakeDamage(result); } else { hero.getHero().TakeDamage(result); } hero.TimeTrackTick(); } CM.monsterSyncBV = 0; CM.heroSyncBV = 0; Destroy(this); }
//The one where you keep rolling until you decide to stop protected int ArcherRollMethod() { CombatManager combatManager = CombatManager.instance; combatManager.DisplayDoneRollingButton(true); List <int> rolls; //Prioritize rolling black dice int black; int regular; if (blackDiceRemaining > 0) { black = 1; regular = 0; blackDiceRemaining--; } else { black = 0; regular = 1; diceRemaining--; } if (GetMonsterKind() == MonsterKind.NotMonster) { rolls = combatManager.HeroRoll(regular, black); } else { rolls = combatManager.MonsterRoll(regular, black); } //Finished if you are out of dice if (blackDiceRemaining == 0 && diceRemaining == 0) { combatManager.DoneRolling = true; combatManager.DisplayDoneRollingButton(false); } return(strengthPoints + rolls[0]); }
void Start() { PV = GetComponent <PhotonView>(); God = GameObject.Find("God").GetComponent <Instantiator>(); instance = this; }