コード例 #1
0
ファイル: Enemy.py プロジェクト: JohnKossa/MUDDLE
 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
ファイル: Enemy.py プロジェクト: JohnKossa/MUDDLE
 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
ファイル: BossEnemy.py プロジェクト: JohnKossa/MUDDLE
 def __init__(self):
     from game_objects.AttackAction import AttackAction
     from game_objects.Items.Weapon import Sword, Dagger, Spear, Mace, Axe, Torch, DuelistDagger, WerebatFang, \
         PerunsPike, CrudgelOfChione, RavensBeak
     from game_objects.Items.Item import Coins, Item
     super().__init__()
     self.name: str = "StoneGolem"
     self.max_health = 150
     self.health = 150
     self.traits = self.traits + ["construct", "stone"]
     self.natural_armor = {
         "hit": {
             DamageTypes.Slash: 3,
             DamageTypes.Fire: 5,
             DamageTypes.Pierce: 2,
             DamageTypes.Bludgeon: 0
         },
         "dmg": {
             DamageTypes.Slash: 1,
             DamageTypes.Fire: 5,
             DamageTypes.Pierce: 1,
             DamageTypes.Bludgeon: -3,
             DamageTypes.Ice: 1
         }
     }
     self.possible_attacks: list[(int, AttackAction)] = [
         (2,
          AttackAction(name="punch",
                       hit_bonus=1,
                       dmg_type=DamageTypes.Bludgeon,
                       dmg_roll=(2, 10),
                       dmg_bonus=0,
                       action_cost=1)),
         (1,
          AttackAction(name="smash",
                       hit_bonus=2,
                       dmg_type=DamageTypes.Bludgeon,
                       dmg_roll=(3, 20),
                       dmg_bonus=0,
                       action_cost=2))
     ]
     self.drops: list[Item] = [Coins(
         count=random.randint(100, 300))] + random.choices(
             [Sword(), Dagger(),
              Spear(), Mace(),
              Axe(), Torch()], k=4) + random.choices([
                  DuelistDagger(),
                  WerebatFang(),
                  PerunsPike(),
                  CrudgelOfChione(),
                  RavensBeak()
              ],
                                                     k=1)
コード例 #4
0
 def __init__(self):
     from game_objects.Items.Armor import Gambeson
     from game_objects.Items.Weapon import Sword, Dagger, Mace, Spear, Axe, Torch
     from game_objects.Items.Consumables.HealthPotion import HealthPotion
     from game_objects.Items.Item import Item
     from utils.Constanats import EquipmentSlots
     self.equipment = {
         EquipmentSlots.Head: None,
         EquipmentSlots.Body: Gambeson(),
         EquipmentSlots.Mainhand: random.choice([Sword(), Dagger(), Mace(), Spear(), Axe(), Torch()]),
         EquipmentSlots.Offhand: None,
         EquipmentSlots.Belt: [HealthPotion()]
     }
     self.bag: list[Item] = [HealthPotion()]
コード例 #5
0
ファイル: Enemy.py プロジェクト: JohnKossa/MUDDLE
 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()
コード例 #6
0
 def __init__(self, lootable_items=None):
     import random
     from game_objects.Items.Weapon import Sword, Dagger, Spear, Mace, Axe, Torch, DuelistDagger, WerebatFang
     from game_objects.Items.Shield import Shield
     from game_objects.Items.Armor import PlateArmor, ChainArmor, Gambeson
     from game_objects.Items.Item import Coins, DungeonMap
     from game_objects.Items.Consumables.HealthPotion import HealthPotion
     from game_objects.Items.Consumables.StaminaPotion import StaminaPotion
     from game_objects.Items.Consumables.RagePotion import RagePotion
     from game_objects.Items.Consumables.FocusPotion import FocusPotion
     from game_objects.LootTable import LootTable
     super().__init__()
     self.name = "Chest"
     self.items = LootTable(lootable_items
                            or [(Coins(count=random.randint(0, 50)), .85),
                                (HealthPotion(), .60), (FocusPotion(), .30),
                                (StaminaPotion(), .30), (RagePotion(), .30),
                                (Shield(), .15), (DungeonMap(), .05),
                                (Torch(), .05), (Dagger(), .05),
                                (Axe(), .05), (Sword(), .05), (Mace(), .05),
                                (Spear(), .05), (PlateArmor(), .05),
                                (ChainArmor(), .05), (Gambeson(), .05),
                                (DuelistDagger(), .01),
                                (WerebatFang(), .01)]).roll_drops()