Ejemplo n.º 1
0
        public override void Attack(IAdventurePlayer player, IAdventureItem troll, IAdventureItem weapon)
        {
            if (weapon != null)
            {
                player.ChatClient.PostDirectMessage(player, $"You try to to attack the dragon, but it breathes acid at your {weapon.Name}!");
                player.ChatClient.PostDirectMessage(player, $"You drop the ruined {weapon.Name} and it quickly dissolves into a puddle of slag!");
                var loseWeapon = new RemoveFromInventory();
                loseWeapon.Do(player, weapon);
            }

            return;
        }
Ejemplo n.º 2
0
        public override void Give(IAdventurePlayer player, IAdventureItem item, IAdventureItem snake)
        {
            var removeItem = new RemoveFromInventory();

            removeItem.Do(player, item);

            // Place item in the Hall of the Mountain King
            Game.Dungeon.TryGetLocation(Location.HallOfMountainKing, out var location);
            var addToLocation = new AddToLocation(item, location);

            addToLocation.Do(player, item);

            player.ChatClient.PostDirectMessage(player, $"The snake hisses and snaps at you! It ignores the {item.Name}");
        }
Ejemplo n.º 3
0
 public override void Attack(IAdventurePlayer player, IAdventureItem troll, IAdventureItem weapon = null)
 {
     if (weapon != null)
     {
         player.ChatClient.PostDirectMessage(player, $"You try to to attack the troll, but it snatches the {weapon.Name} from your puny grasp and casts it into the chasm!");
         var loseWeapon = new RemoveFromInventory();
         loseWeapon.Do(player, weapon);
     }
     else
     {
         player.ChatClient.PostDirectMessage(player, $"As you approach the hideous troll, it points at its sign and yells 'Pay troll!'");
         player.ChatClient.PostDirectMessage(player, $"The creature's foul breath drives you back, gasping for air.");
     }
 }
Ejemplo n.º 4
0
        public override void Attack(IAdventurePlayer player, IAdventureItem troll, IAdventureItem weapon)
        {
            player.ChatClient.PostDirectMessage(player, "The snake hisses horribly and strikes it you!");

            if (weapon != null)
            {
                player.ChatClient.PostDirectMessage(player, $"You are so startled that you drop your {weapon.Name}!");

                var removeItem = new RemoveFromInventory();
                removeItem.Do(player, weapon);

                // Place item in the Hall of the Mountain King
                Game.Dungeon.TryGetLocation(Location.HallOfMountainKing, out var location);
                var addToLocation = new AddToLocation(weapon, location);
                addToLocation.Do(player, weapon);
            }

            return;
        }
Ejemplo n.º 5
0
        public override void Give(IAdventurePlayer player, IAdventureItem item, IAdventureItem troll)
        {
            // Destroy item
            var removeItem = new RemoveFromInventory();

            removeItem.Do(player, item);

            if (item.IsTreasure)
            {
                // Place item in the Troll's Cave
                Game.Dungeon.TryGetLocation(Location.TrollCave, out var location);

                var addToLocation = new AddToLocation(item, location);
                addToLocation.Do(player, item);

                // Troll will move away from the bridge
                player.ChatClient.PostDirectMessage(player,
                                                    $"The troll accepts your {item.Name}, appraises it with a critical eye, and retreats under its bridge!");
            }
            else
            {
                // The troll throws the item into the chasm
                player.ChatClient.PostDirectMessage(player,
                                                    $"The troll scowls at you and throws the {item.Name} into the chasm. 'Pay Troll!', it roars.");

                return;
            }

            Game.Dungeon.TryGetLocation(Location.SouthWestOfChasm, out var swOfChasm);
            Game.Dungeon.TryGetLocation(Location.NorthEastOfChasm, out var neOfChasm);
            RemoveTroll(player, troll, swOfChasm, neOfChasm);

            var clock = new StartClock("troll");

            clock.Do(player, troll);
        }