예제 #1
0
        public override void Hurt(Creature whoToHurt)
        {
            if (whoToHurt == null)
            {
                throw new ArgumentNullException(nameof(whoToHurt));
            }

            if (CurrentItem.GetType() == typeof(Weapon))
            {
                if (whoToHurt.GetDamage(((Weapon)CurrentItem).Damage) <= 0)
                {
                    Heal(20);

                    Inventory.Items.Concat(LootController.GetCreatureLoot(whoToHurt));

                    KilledTheCreatureEventArgs args = new KilledTheCreatureEventArgs(whoToHurt);
                    OnKilledTheCreature(args);
                }
            }
            else
            {
                if (whoToHurt.GetDamage(1) <= 0)
                {
                    Heal(25);

                    Inventory.Items.Concat(LootController.GetCreatureLoot(whoToHurt));

                    KilledTheCreatureEventArgs args = new KilledTheCreatureEventArgs(whoToHurt);
                    OnKilledTheCreature(args);
                }
            }
        }
예제 #2
0
 public TreasureChest(params Rarity[] possibleRarities)
 {
     Content = LootController.GetLoot(1, possibleRarities);
 }