//Combat Helper Functions void FindNextMonster(HunterParty hp, int monsterCount) { if (monsterCount == 0) { Debug.LogError("Hunter Count = 0, there are no living hunters on the field, something went wrong"); return; } for (int i = 0; i < monsterCount; i++) { if (hp.activeContract.MonstersGroup[i].IsAlive == true) { if (hp.activeContract.MonstersGroup[i].HasTakenTurn == false) { hp.activeMonster = hp.activeContract.MonstersGroup[i]; return; } } } if (hp.activeMonster == null) { Debug.Log("There are no more monsters available!"); return; } }
void FindNextHunter(HunterParty hunterParty, int hunterCount) { Debug.Log("Current hunter count parameter is " + hunterCount.ToString()); if (hunterCount == 0) { Debug.LogError("Hunter Count = 0, there are no living hunters on the field, something went wrong"); return; } for (int i = 0; i < hunterCount; i++) { Debug.Log(hp.HuntParty[i].Name); if (hp.HuntParty[i].IsAlive == true) { if (hp.HuntParty[i].HasTakenTurn == false) { Debug.Log("Current hunter count parameter is " + hunterCount.ToString()); hp.activeHunter = hp.HuntParty[i]; return; } } else { return; } } if (hp.activeMonster == null) { Debug.Log("There are no more hunters available!"); return; } }
void CreateHunterParty() { text.text = "Create a new party?\n" + "If yes press Space, else press Escape to discard"; { GameObject go = new GameObject(); go.AddComponent <HunterParty>(); hp = go.GetComponent <HunterParty>(); go.name = "Hunter Party" + p.ToString(); p++; } }
void FindARandomLivingMonster(HunterParty hp, int monsterCount) { bool isMonsterAlive = false; //Sanity Check if (monsterCount == 0) { Debug.LogError("Monster Count = 0, there are no living monsters on the field, something went wrong"); return; } while (isMonsterAlive == false) { int i = UnityEngine.Random.Range(0, monsterCount); if (hp.activeContract.MonstersGroup[i].IsAlive == true) { hp.activeMonster = hp.activeContract.MonstersGroup[i]; isMonsterAlive = true; return; } } }
void FindARandomLivingHunter(HunterParty hp, int hunterCount) { bool isHunterAlive = false; //Sanity Check if (hunterCount == 0) { Debug.LogError("Hunter Count = 0, there are no living hunters on the field, something went wrong"); return; } while (isHunterAlive == false) { int i = UnityEngine.Random.Range(0, hunterCount); if (hp.HuntParty[i].IsAlive == true) { hp.activeHunter = hp.HuntParty[i]; isHunterAlive = true; return; } } }