public void DropTreasureFromMonster(Monster monster) { // Non-intelligent monsters don't drop anything if (!monster.Intelligent) return; int chance = s_random.getInt(0, 99); if (chance < 5) { DropItem(ItemFactory.Instance.CreateRandomArmor(CoreGameEngine.Instance.CurrentLevel + 1), monster.Position); return; } else if (chance < 10) { DropItem(ItemFactory.Instance.CreateRandomWeapon(CoreGameEngine.Instance.CurrentLevel + 1), monster.Position); return; } else if (chance < 15) { DropItem(ItemFactory.Instance.CreateRandomItem(CoreGameEngine.Instance.CurrentLevel + 1), monster.Position); return; } }
public bool RemoveMonster(Monster m) { return m_monsterList.Remove(m); }
public void AddMonster(Monster m) { m_monsterList.Add(m); }
private Monster CreateMonsterCore(string baseType, string AIType, string name, int level, Point p, int maxHP, bool intelligent, int vision, DiceRoll damage, double evade, double ctIncreaseModifer, double ctMoveCost, double ctActCost, double ctAttackCost) { List<IMonsterTactic> tactics = new List<IMonsterTactic>(); switch (AIType) { case "Bruiser": tactics.Add(new DoubleSwingTactic()); tactics.Add(new DefaultTactic()); break; case "Healer": tactics.Add(new UseFirstAidTactic()); tactics.Add(new MoveToWoundedAllyTactic()); tactics.Add(new DefaultTactic()); break; case "Ranged": tactics.Add(new KeepAwayFromMeleeRangeIfAbleTactic()); tactics.Add(new UseSlingStoneTactic()); tactics.Add(new KeepAwayFromPlayerWithOtherMonstersNearbyTactic()); tactics.Add(new PossiblyRunFromPlayerTactic()); tactics.Add(new DefaultTactic()); break; case "Sprinter": tactics.Add(new RushTactic()); tactics.Add(new DefaultTactic()); break; default: tactics.Add(new DefaultTactic()); break; } Monster monster = new Monster(baseType, name, level, p, maxHP, intelligent, vision, damage, evade, ctIncreaseModifer, ctMoveCost, ctActCost, ctAttackCost, tactics); return monster; }