internal StateCombat(Monster monster) { MonsterList = new Monster[1]; MonsterList[0] = monster; initialize(); }
public override void action(Monster parent) { if (!charged) { MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.White; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "IMA CHARGIN MAH LASERS!"; charged = true; SubStateConfirmMessage temp = new SubStateConfirmMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; } else if (charged) { charged = false; MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.White; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "IMA FIRIN MAH LASERS!"; SubStateConfirmMessage temp = new SubStateConfirmMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; int choice = Globals.Random(0, 3); int bonus = 1000; if (PCBuilder.getPC(choice).IsDefending()) bonus = 0; parent.Attack(BehaviorRSTS.acquireTarget(), Globals.ELEMENT_FIRE, "LASERS", bonus); } }
public override void action(Monster parent) { MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.White; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "Water Attack!"; SubStateDisplayMessage temp = new SubStateDisplayMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; parent.Attack(BehaviorRSTS.acquireTarget(), Globals.ELEMENT_WATER, "water attack", 0); }
public override void action(Monster parent) { MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.White; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "Nature attack 2.0?"; SubStateConfirmMessage temp = new SubStateConfirmMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; parent.Attack(BehaviorRSTS.acquireTarget(), Globals.ELEMENT_NATURE, "nature", 20); }
public override void action(Monster parent) { MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.CornflowerBlue; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "HURRICANE!"; SubStateConfirmMessage temp = new SubStateConfirmMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; parent.Attack(BehaviorRSTS.acquireTarget(), Globals.ELEMENT_WATER, "hurricane", 40); }
public override void action(Monster parent) { MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.White; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "IMA FIRIN MAH LASER!"; SubStateConfirmMessage temp = new SubStateConfirmMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; parent.Attack(BehaviorRSTS.acquireTarget(), Globals.ELEMENT_PHYSICAL, "cowabunga", 0); }
public override void action(Monster parent) { MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[1]; colors[0] = Color.Crimson; int mX = 400; int mY = 100; int height = 100; int width = 345; string[] attackMessage = new string[1]; attackMessage[0] = "FLAME STORM!"; SubStateConfirmMessage temp = new SubStateConfirmMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; parent.Attack(BehaviorRSTS.acquireTarget(), Globals.ELEMENT_FIRE, "flame storm", 50); }
public override void action(Monster parent) { BehaviorAbstract att = null; switch (Globals.Random(1, 10)) { case 0: att = new BehaviorAttack(); break; case 1: att = new BehaviorDefend(); break; case 2: att = new BehaviorBasicFire(); break; case 3: att = new BehaviorEmbers(); break; case 4: att = new BehaviorFlameStorm(); break; case 5: att = new BehaviorBasicWater(); break; case 6: att = new BehaviorHurricane(); break; case 7: att = new BehaviorBasicNature(); break; case 8: att = new BehaviorNature(); break; case 9: att = new BehaviorSuperNature(); break; } att.action(parent); }
internal StateCombat(Monster[] monsters) { MonsterList = monsters; initialize(); }
public abstract void action(Monster parent);
internal static void checkCombat(float move) { if (move < 0) move *= -1; stepsTaken += move; if (stepsTaken > combatTarget*4) { stepsTaken = 0; generateCombatChance(); Monster[] monsterList = new Monster[Globals.Random(1, 4)]; for (int i = 0; i < monsterList.Length; i++) { monsterList[i] = MonsterFactory.randomMonster(StateHandler.Level, 0, Globals.MOB_WEAK, true); monsterList[i].ID = i; } // Enter combat here StateHandler.State = new StateCombat(monsterList); //.generateMonster("", StateHandler.Level, 0, Globals.MOB_WEAK, false)); } }
private static Monster generateMonster(string name, int level, int element, int specials, bool boss) { Monster monster = new Monster(); monster.Quality = specials; switch(name) { case "Eyeball": monster.model = ModelFactory.loadModel("Eyeball"); monster.Name = "Eyeball"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_FIRE; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_EYEBALL; monster.SetBehavior(new BehaviorBasicFire()); break; case "MutatedCroc": case "Mutated Croc": case "MutatedCrocodile": case "Mutated Crocodile": monster.model = ModelFactory.loadModel("MutatedCrocodile"); monster.Name = "Mutated Crocodile"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_WATER; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_MUTATED_CROCODILE; monster.SetBehavior(new BehaviorBasicWater()); break; case "MutatedRat": case "Mutated Rat": monster.Name = "Daisy"; monster.model = ModelFactory.loadModel("mutantRat34blend"); monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_NATURE; monster.setLevel( level ); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_MUTATED_RAT; monster.SetBehavior(new BehaviorBasicNature()); break; case "MutatedTurtle": case "Mutated Turtle": monster.model = ModelFactory.loadModel("MutatedTurtle"); monster.Name = "Mutated Turtle"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_WATER; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_MUTATED_TURTLE; monster.SetBehavior(new BehaviorBasicWater()); break; case "Drone": case "SecurityDrone": monster.model = ModelFactory.loadModel("securityDrone"); monster.Name = "Security Drone"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_PHYSICAL; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_SECURITY_DRONE; monster.SetBehavior(new BehaviorAttack()); break; case "SlimeMonster": case "MonsterSlime": default: monster.model = ModelFactory.loadModel("MonsterSlime"); monster.Name = "Slime Monster"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_WATER; monster.setLevel( level ); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_SLIMEMONSTER; monster.SetBehavior(new BehaviorBasicWater()); break; } monster.Quality = specials; switch (specials) { case Globals.MOB_WEAK: monster.Scale *= 0.75f; monster.MaxHealth = monster.MaxHealth / 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() / 2); monster.setDefense(monster.getDefense() / 2); monster.setMagic(monster.getMagic() / 2); monster.setMagicDefense(monster.getMagicDefense() / 2); break; case Globals.MOB_NORMAL: monster.Scale *= 1.25f; break; case Globals.MOB_HARD: monster.Scale *= 1.5f; monster.MaxHealth = monster.MaxHealth * 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 2); monster.setDefense(monster.getDefense() * 2); monster.setMagic(monster.getMagic() * 2); monster.setMagicDefense(monster.getMagicDefense() * 2); break; case Globals.MOB_INSANE: monster.Scale *= 2.5f; monster.MaxHealth = monster.MaxHealth * 3; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3); monster.setDefense(monster.getDefense() * 3); monster.setMagic(monster.getMagic() * 3); monster.setMagicDefense(monster.getMagicDefense() * 3); break; case Globals.MOB_BOSS: monster.Scale *= 4.0f; monster.MaxHealth = monster.MaxHealth * 10; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3); monster.setDefense(monster.getDefense() * 3); monster.setMagic(monster.getMagic() * 3); monster.setMagicDefense(monster.getMagicDefense() * 3); break; case Globals.MOB_SPECIAL: monster.Name = "The Stumonster"; monster.Scale *= 6.0f; monster.MaxHealth = monster.MaxHealth * 20; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 4); monster.setDefense(monster.getDefense() * 4); monster.setMagic(monster.getMagic() * 4); monster.setMagicDefense(monster.getMagicDefense() * 4); break; } switch (StateHandler.Difficulty) { case Globals.DIFFICULTY_VERY_EASY: monster.Scale *= 0.75f; monster.MaxHealth = monster.MaxHealth / 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() / 2); monster.setDefense(monster.getDefense() / 2); monster.setMagic(monster.getMagic() / 2); monster.setMagicDefense(monster.getMagicDefense() / 2); break; case Globals.DIFFICULTY_EASY: monster.Scale *= 0.85f; monster.MaxHealth = monster.MaxHealth * 3 / 4; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3 / 4); monster.setDefense(monster.getDefense() * 3 / 4); monster.setMagic(monster.getMagic() * 3 / 4); monster.setMagicDefense(monster.getMagicDefense() * 3 / 4); break; case Globals.DIFFICULTY_NORMAL: break; case Globals.DIFFICULTY_HARD: monster.Scale *= 1.15f; monster.MaxHealth = monster.MaxHealth * 5 / 4; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 5 / 4); monster.setDefense(monster.getDefense() * 5 / 4); monster.setMagic(monster.getMagic() * 5 / 4); monster.setMagicDefense(monster.getMagicDefense() * 5 / 4); break; case Globals.DIFFICULTY_VERY_HARD: monster.Scale *= 1.25f; monster.MaxHealth = monster.MaxHealth * 3 / 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3 / 2); monster.setDefense(monster.getDefense() * 3 / 2); monster.setMagic(monster.getMagic() * 3 / 2); monster.setMagicDefense(monster.getMagicDefense() * 3 / 2); break; case Globals.DIFFICULTY_INSANE: monster.Scale *= 1.5f; monster.MaxHealth = monster.MaxHealth * 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 2); monster.setDefense(monster.getDefense() * 2); monster.setMagic(monster.getMagic() * 2); monster.setMagicDefense(monster.getMagicDefense() * 2); break; } if (boss) { monster.Boss = true; monster.Scale *= 1.5f; monster.MaxHealth = monster.MaxHealth * 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 2); monster.setDefense(monster.getDefense() * 2); monster.setMagic(monster.getMagic() * 2); monster.setMagicDefense(monster.getMagicDefense() * 2); } return monster; }
private static Monster generateMonster(string name, int level, int element, int specials, bool boss) { Monster monster = new Monster(); monster.Quality = specials; switch (name) { case "Eyeball": monster.model = ModelFactory.loadModel("Eyeball"); monster.Name = "Eyeball"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_FIRE; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_EYEBALL; monster.SetBehavior(new BehaviorBasicFire()); break; case "MutatedCroc": case "Mutated Croc": case "MutatedCrocodile": case "Mutated Crocodile": monster.model = ModelFactory.loadModel("MutatedCrocodile"); monster.Name = "Mutated Crocodile"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_WATER; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_MUTATED_CROCODILE; monster.SetBehavior(new BehaviorBasicWater()); break; case "MutatedRat": case "Mutated Rat": monster.Name = "Daisy"; monster.model = ModelFactory.loadModel("mutantRat34blend"); monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_NATURE; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_MUTATED_RAT; monster.SetBehavior(new BehaviorBasicNature()); break; case "MutatedTurtle": case "Mutated Turtle": monster.model = ModelFactory.loadModel("MutatedTurtle"); monster.Name = "Mutated Turtle"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_WATER; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_MUTATED_TURTLE; monster.SetBehavior(new BehaviorBasicWater()); break; case "Drone": case "SecurityDrone": monster.model = ModelFactory.loadModel("securityDrone"); monster.Name = "Security Drone"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_PHYSICAL; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_SECURITY_DRONE; monster.SetBehavior(new BehaviorAttack()); break; case "SlimeMonster": case "MonsterSlime": default: monster.model = ModelFactory.loadModel("MonsterSlime"); monster.Name = "Slime Monster"; monster.MaxHealth = 100 * level; monster.Health = monster.MaxHealth; monster.Element = Globals.ELEMENT_WATER; monster.setLevel(level); monster.setAttack(level * 2); monster.setDefense(level * 2); monster.setMagic(level * 2); monster.setMagicDefense(level * 2); monster.Type = Globals.MONSTER_SLIMEMONSTER; monster.SetBehavior(new BehaviorBasicWater()); break; } monster.Quality = specials; switch (specials) { case Globals.MOB_WEAK: monster.Scale *= 0.75f; monster.MaxHealth = monster.MaxHealth / 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() / 2); monster.setDefense(monster.getDefense() / 2); monster.setMagic(monster.getMagic() / 2); monster.setMagicDefense(monster.getMagicDefense() / 2); break; case Globals.MOB_NORMAL: monster.Scale *= 1.25f; break; case Globals.MOB_HARD: monster.Scale *= 1.5f; monster.MaxHealth = monster.MaxHealth * 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 2); monster.setDefense(monster.getDefense() * 2); monster.setMagic(monster.getMagic() * 2); monster.setMagicDefense(monster.getMagicDefense() * 2); break; case Globals.MOB_INSANE: monster.Scale *= 2.5f; monster.MaxHealth = monster.MaxHealth * 3; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3); monster.setDefense(monster.getDefense() * 3); monster.setMagic(monster.getMagic() * 3); monster.setMagicDefense(monster.getMagicDefense() * 3); break; case Globals.MOB_BOSS: monster.Scale *= 4.0f; monster.MaxHealth = monster.MaxHealth * 10; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3); monster.setDefense(monster.getDefense() * 3); monster.setMagic(monster.getMagic() * 3); monster.setMagicDefense(monster.getMagicDefense() * 3); break; case Globals.MOB_SPECIAL: monster.Name = "The Stumonster"; monster.Scale *= 6.0f; monster.MaxHealth = monster.MaxHealth * 20; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 4); monster.setDefense(monster.getDefense() * 4); monster.setMagic(monster.getMagic() * 4); monster.setMagicDefense(monster.getMagicDefense() * 4); break; } switch (StateHandler.Difficulty) { case Globals.DIFFICULTY_VERY_EASY: monster.Scale *= 0.75f; monster.MaxHealth = monster.MaxHealth / 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() / 2); monster.setDefense(monster.getDefense() / 2); monster.setMagic(monster.getMagic() / 2); monster.setMagicDefense(monster.getMagicDefense() / 2); break; case Globals.DIFFICULTY_EASY: monster.Scale *= 0.85f; monster.MaxHealth = monster.MaxHealth * 3 / 4; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3 / 4); monster.setDefense(monster.getDefense() * 3 / 4); monster.setMagic(monster.getMagic() * 3 / 4); monster.setMagicDefense(monster.getMagicDefense() * 3 / 4); break; case Globals.DIFFICULTY_NORMAL: break; case Globals.DIFFICULTY_HARD: monster.Scale *= 1.15f; monster.MaxHealth = monster.MaxHealth * 5 / 4; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 5 / 4); monster.setDefense(monster.getDefense() * 5 / 4); monster.setMagic(monster.getMagic() * 5 / 4); monster.setMagicDefense(monster.getMagicDefense() * 5 / 4); break; case Globals.DIFFICULTY_VERY_HARD: monster.Scale *= 1.25f; monster.MaxHealth = monster.MaxHealth * 3 / 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 3 / 2); monster.setDefense(monster.getDefense() * 3 / 2); monster.setMagic(monster.getMagic() * 3 / 2); monster.setMagicDefense(monster.getMagicDefense() * 3 / 2); break; case Globals.DIFFICULTY_INSANE: monster.Scale *= 1.5f; monster.MaxHealth = monster.MaxHealth * 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 2); monster.setDefense(monster.getDefense() * 2); monster.setMagic(monster.getMagic() * 2); monster.setMagicDefense(monster.getMagicDefense() * 2); break; } if (boss) { monster.Boss = true; monster.Scale *= 1.5f; monster.MaxHealth = monster.MaxHealth * 2; monster.Health = monster.MaxHealth; monster.setAttack(monster.getAttack() * 2); monster.setDefense(monster.getDefense() * 2); monster.setMagic(monster.getMagic() * 2); monster.setMagicDefense(monster.getMagicDefense() * 2); } return(monster); }