public ArrayList generateModList() { ArrayList allMods = new ArrayList(); //Making all mod types //Bulky MonsterMod hearty = new MonsterMod(); hearty.hpMod = HEARTY_MOD; MonsterMod bulky = new MonsterMod(); bulky.hpMod = HEARTY_MOD; bulky.dmgMod = VICIOUS_MOD; MonsterMod clever = new MonsterMod(); clever.initMod = CLEVER_MOD; MonsterMod fast = new MonsterMod(); fast.moveMod = (int)FAST_MOD; MonsterMod vicious = new MonsterMod(); vicious.dmgMod = VICIOUS_MOD; MonsterMod caucious = new MonsterMod(); caucious.fortifyMod = CAUCIOUS_MOD; MonsterMod raging = new MonsterMod(); raging.moveMod = (int)RAGING_MOD.x; raging.dmgMod = RAGING_MOD.y; raging.hpMod = RAGING_MOD.z; MonsterMod terrifying = new MonsterMod(); terrifying.initMod = TERRIFYING_MOD.x; terrifying.moveMod = (int)TERRIFYING_MOD.y; terrifying.dmgMod = TERRIFYING_MOD.z; MonsterMod vampiric = new MonsterMod(); vampiric.vampiric = true; MonsterMod brave = new MonsterMod(); brave.moraleMod = BRAVE_MOD; //allMods.in //Finally insert all of the created Modifiers and return the list allMods.Add(bulky); allMods.Add(raging); allMods.Add(terrifying); allMods.Add(brave); allMods.Add(clever); allMods.Add(caucious); allMods.Add(hearty); allMods.Add(fast); allMods.Add(vicious); allMods.Add(vampiric); return(allMods); }
void applyModifier(EnemyUnit luckyUnit) { bool notValidMod = true; while (notValidMod) { MonsterMod chosen = (MonsterMod)mod.generateModList()[UnityEngine.Random.Range(0, MonsterMod.NUM_MODS)]; if (!luckyUnit.hasModifier(chosen)) { luckyUnit.AddMobModifier(chosen); curCredits = curCredits - BASE_MODIFIER_COST; } } //} //Creates A list of potential enemies sorted by credit cost }
public bool hasModifier(MonsterMod modInQuestion) { return(mods.Contains(modInQuestion)); }
public void AddMobModifier(MonsterMod newMod) { mods.Add(newMod); }