Пример #1
0
 def __init__(self):
     super().__init__()
     from game_objects.LootTable import LootTable
     self.name = "Goblin"
     self.health = 25
     self.max_health = 25
     self.traits = self.traits + ["goblin", "humanoid"]
     self.possible_attacks: list[(int, AttackAction)] = [
         (1, AttackAction(name="punch", hit_bonus=0, dmg_type=DamageTypes.Bludgeon, dmg_roll=(1, 4), dmg_bonus=0)),
         (3, AttackAction(name="stab", hit_bonus=1, dmg_type=DamageTypes.Pierce, dmg_roll=(1, 10), dmg_bonus=0))
     ]
     from game_objects.Items.Weapon import Sword, Dagger, Spear, Mace, Axe, Torch
     from game_objects.Items.Item import Coins
     from game_objects.Items.Consumables.HealthPotion import HealthPotion
     from game_objects.Items.Consumables.StaminaPotion import StaminaPotion
     self.loot_table = LootTable([
         (Coins(count=random.randint(1, 10)), .30),
         (HealthPotion(),                     .20),
         (StaminaPotion(),                    .10),
         (Torch(),                            .10),
         (Dagger(),                           .10),
         (Axe(),                              .08),
         (Sword(),                            .05),
         (Mace(),                             .03),
         (Spear(),                            .03)
     ])
     self.drops = self.loot_table.roll_drops()
Пример #2
0
 def __init__(self):
     super().__init__()
     from game_objects.Room import Room
     from game_objects.LootTable import LootTable
     self.current_room: Optional[Room] = None
     self.name: str = None
     self.disambiguation_num: int = 0
     self.description: str = None
     self.max_health: int = 50
     self.health: int = 50
     self.traits = []
     self.natural_armor: dict = {
         "hit": {},
         "dmg": {}
     }
     self.armor_bonus: dict = {
         "hit": {},
         "dmg": {}
     }
     self.possible_attacks: list[(int, AttackAction)] = [
         (1, AttackAction(name="punch", hit_bonus=0, dmg_type=DamageTypes.Bludgeon, dmg_roll=(1, 4), dmg_bonus=0))
     ]
     from game_objects.Items.Weapon import Sword, Dagger, Spear, Mace, Axe, Torch
     from game_objects.Items.Item import Coins
     self.loot_table = LootTable([
         (Coins(count=random.randint(1, 10)), .30),
         (Torch(),                            .10),
         (Dagger(),                           .10),
         (Axe(),                              .08),
         (Sword(),                            .05),
         (Mace(),                             .03),
         (Spear(),                            .03)
     ])
     self.drops = self.loot_table.roll_drops()
Пример #3
0
 def __init__(self):
     super().__init__()
     from game_objects.AttackAction import AttackAction
     self.name: str = "Dagger"
     self.traits = self.traits + ["metallic", "simple_weapon"]
     self.weight = 2.2
     self.max_stack_size = 10
     self.attacks: list[AttackAction] = [
         AttackAction(name="slash",
                      hit_bonus=1,
                      dmg_type=DamageTypes.Slash,
                      dmg_roll=(2, 4),
                      dmg_bonus=0),
         AttackAction(name="stab",
                      hit_bonus=3,
                      dmg_type=DamageTypes.Pierce,
                      dmg_roll=(3, 4),
                      dmg_bonus=0)
     ]
     self.default_attack: str = "stab"
Пример #4
0
 def __init__(self):
     from game_objects.Items.Armor import PlateArmor
     from game_objects.Items.Weapon import Sword, Spear, Mace, Axe
     from game_objects.LootTable import LootTable
     super().__init__()
     self.name = "Orc"
     self.health = 75
     self.max_health = 75
     self.traits = self.traits + ["orc", "humanoid"]
     self.possible_attacks: list[(int, AttackAction)] = [
         (1, AttackAction(name="punch", hit_bonus=0, dmg_type=DamageTypes.Bludgeon, dmg_roll=(1, 4), dmg_bonus=1)),
         (3, AttackAction(name="slash", hit_bonus=1, dmg_type=DamageTypes.Slash, dmg_roll=(1, 16), dmg_bonus=0))
     ]
     self.armor_bonus: dict = {
         "hit": {
             DamageTypes.Slash: 2,
             DamageTypes.Pierce: 1,
             DamageTypes.Electricity: -1
         },
         "dmg": {
             DamageTypes.Pierce: 2,
             DamageTypes.Bludgeon: 1,
             DamageTypes.Electricity: -5
         }
     }
     from game_objects.Items.Consumables.HealthPotion import HealthPotion
     from game_objects.Items.Consumables.StaminaPotion import StaminaPotion
     from game_objects.Items.Item import Coins
     self.loot_table = LootTable([
         (Coins(count=random.randint(1, 100)), .50),
         (HealthPotion(),                      .50),
         (PlateArmor(),                        .30),
         (StaminaPotion(),                     .20),
         (Axe(),                               .20),
         (Sword(),                             .10),
         (Mace(),                              .10),
         (Spear(),                             .10)
     ])
     self.drops = self.loot_table.roll_drops()