// protected override bool PerformAbility() { DungeonMap map = Game.DungeonMap; Player player = Game.Player; Game.MessageLog.Add($"{player.Name} performs a whirlwind attack against all adjacent enemies"); List <Point> monsterLocations = new List <Point>(); foreach (Cell cell in map.GetCellsInSquare(player.X, player.Y, 1)) { foreach (Point monsterLocation in map.GetMonsterLocations()) { if (cell.X == monsterLocation.X && cell.Y == monsterLocation.Y) { monsterLocations.Add(monsterLocation); } } } foreach (Point monsterLocation in monsterLocations) { Monster monster = map.GetMonsterAt(monsterLocation.X, monsterLocation.Y); if (monster != null) { Game.CommandSystem.Attack(player, monster); } } return(true); }
// protected override bool PerformAbility() { DungeonMap map = Game.DungeonMap; Player player = Game.Player; foreach (Cell cell in map.GetCellsInSquare(player.X, player.Y, _revealDistance)) { if (cell.IsWalkable) { map.SetCellProperties(cell.X, cell.Y, cell.IsTransparent, cell.IsWalkable, true); } } return(true); }
private void PlaceSaloon(DungeonMap map, Rectangle Room) { //10x10 box of wall tiles with a door, east of the player int centerX = Room.Center.X; int centerY = Room.Center.Y; int buildingCenter = centerX + 25; int doorCoord = buildingCenter - 5; foreach (Cell cell in map.GetCellsInSquare(buildingCenter, centerY, 5)) { map.SetCellProperties(cell.X, cell.Y, false, false, true); } MakeTownDoor(map, doorCoord, centerY, '2'); }
private void PlaceSheriffsOffice(DungeonMap map, Rectangle Room) { //10x10 box of wall tiles with a door, north of the player int centerX = Room.Center.X; int centerY = Room.Center.Y; int buildingCenter = centerY - 25; int doorCoord = buildingCenter + 5; foreach (Cell cell in map.GetCellsInSquare(centerX, buildingCenter, 5)) { map.SetCellProperties(cell.X, cell.Y, false, false, true); } MakeTownDoor(map, centerX, doorCoord, '1'); }
protected override bool PerformAbility() { DungeonMap map = Game.DungeonMap; Player player = Game.Player; if (player.Mana < _manaCost) { Game.MessageLog.Add($"You don't have enough mana to use this skill", Swatch.DbBlood); return(false); } else { player.Mana -= _manaCost; Game.MessageLog.Add($"You perform a whirlwind attack against all enemies {_range} tile(s) away"); List <Point> monsterLocations = new List <Point>(); foreach (ICell cell in map.GetCellsInSquare(player.X, player.Y, _range)) { foreach (Point monsterLocation in map.GetMonsterLocations()) { if (cell.X == monsterLocation.X && cell.Y == monsterLocation.Y) { monsterLocations.Add(monsterLocation); } } } foreach (Point monsterLocation in monsterLocations) { Monster monster = map.GetMonsterAt(monsterLocation.X, monsterLocation.Y); if (monster != null) { Game.CommandSystem.Attack(player, monster); if (Dice.Roll("1D100") < _poisonChance) { if (monster.IsPoisonedImmune == false && _poisonDamage != 0) { monster.State = new MonsterAbnormalState(monster, _poisonLength, "Poisoned", -2, -2, _poisonDamage); } } } } return(true); } }
public bool Act(Monster monster, CommandSystem commandSystem) { bool didReveal = false; DungeonMap dungeonMap = Game.DungeonMap; Player player = Game.Player; MessageLog messageLog = Game.MessageLog; foreach (ICell cell in dungeonMap.GetCellsInSquare(monster.X, monster.Y, 1)) { if (dungeonMap.CheckForPlayer(cell.X, cell.Y) && didReveal == false) { monster.Name = "Mimic"; monster.Symbol = 'M'; monster.IsMimicInHiding = false; messageLog.Add("That's no armor, that a Mimic", Swatch.DbBlood); messageLog.Add("The mimic spat poison at you", Swatch.DbBlood); // hp debug if (Dice.Roll("1D10") < 7) { if (player.IsPoisonedImmune == false) { messageLog.Add("You were hit! The poison starts to enter your system", Swatch.DbBlood); player.State = new AbnormalState(4, "Poisoned", "The Poison has stated to take its full effect", -2, -2, -3, 2, 3); } else if (player.Status == "Hardened") { messageLog.Add("You were hit! However, the poison has no effect on you in your hardened state"); } else { messageLog.Add("You were hit! However, you are completely immune to the poison", Swatch.DbBlood); } } else { messageLog.Add("You swifty dodge the poison"); } didReveal = true; } } return(didReveal); }
// public void SelectTarget(Point target) { DungeonMap map = Game.DungeonMap; Player player = Game.Player; Game.MessageLog.Add($"{player.Name} casts a {Name}"); Actor fireballActor = new Actor { Attack = _attack, AttackChance = _attackChance, Name = Name }; foreach (Cell cell in map.GetCellsInSquare(target.X, target.Y, _area)) { Monster monster = map.GetMonsterAt(cell.X, cell.Y); if (monster != null) { Game.CommandSystem.Attack(fireballActor, monster); } } }
public void Draw(RLConsole mapConsole) { if (IsPlayerTargeting) { DungeonMap map = Game.DungeonMap; Player player = Game.Player; if (_selectionType == SelectionType.Area) { foreach (Cell cell in map.GetCellsInSquare(_cursorPosition.X, _cursorPosition.Y, _area)) { mapConsole.SetBackColor(cell.X, cell.Y, Palette.DbSun); } } else if (_selectionType == SelectionType.Line) { foreach (Cell cell in map.GetCellsAlongLine(player.X, player.Y, _cursorPosition.X, _cursorPosition.Y)) { mapConsole.SetBackColor(cell.X, cell.Y, Palette.DbSun); } } mapConsole.SetBackColor(_cursorPosition.X, _cursorPosition.Y, Palette.DbLight); } }