class CarnivorousApe(Animal): name = "Carnivorous Ape" hit_dice = dice.D8(4) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [AttackSet(Claw(dice.D4(1)), amount=2)] base_armor_class = 14 morale = 7 movement = movement.MovementSet(walk=units.FeetPerGameTurn(40)) no_appearing = AppearingSet(dice_dungeon=dice.D6(1), dice_wild=dice.D4(2), dice_lair=dice.D4(2)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set xp = 240
class SlingBullet(Bullet): name = "Sling Bullet" ammunition_type = Bullet ammunition_damage = dice.D4(1) price = coins.Silver(1) weight = units.Pound(0.1)
class Dagger(MeleeWeapon): name = "Dagger" melee_damage = dice.D4(1) price = coins.Gold(2) size = Size.Small weight = units.Pound(1)
class WalkingStaff(Staff): name = "Walking Staff" melee_damage = dice.D4(1) price = coins.Silver(2) size = Size.Medium weight = units.Pound(1)
class HandAxe(Axe): name = "Hand Axe" melee_damage = dice.D4(1) price = coins.Gold(4) size = Size.Small weight = units.Pound(5)
class Cudgel(Bludgeon): name = "Cudgel" melee_damage = dice.D4(1) price = coins.Silver(2) size = Size.Medium weight = units.Pound(1)
class CharmAnimal(Spell): name = "Charm Animal" class_level_map = { classes.Cleric: 2, } duration = SpellDuration(base_duration=dice.D4(1), duration_per_level=units.CombatRound(1)) range = SpellRange(base_range=units.Feet(60))
class Camel(Horse): name = "Camel" attack_bonus = AttackBonusTable.get_by_hit_dice(2) attack_sets = [ AttackChain(AttackSet(Bite(dice.D1(1))), AttackSet(Hoof(dice.D4(1)))) ] base_armor_class = 13 carry_capacity = CarryCapacity(units.Pound(400), units.Pound(800)) hit_dice = dice.D8(2) morale = 7 movement = movement.MovementSet(walk=units.FeetPerGameTurn(50), turning_distance=units.Feet(10)) no_appearing = AppearingSet(dice_wild=dice.D4(2)) save_as = Fighter.level_table.levels[2].saving_throws_set special_abilities = None treasure_type = None xp = 75
class Candle(LightItem): name = "Torch" bright_light_radius = units.Feet(5) dim_light_radius = units.Feet(5) fuel = None fuel_duration = units.GameTurn(4) last_life_dice = dice.D4(1) light_shape = Shape.Circle price = coins.Copper(10) weight = units.Pound(0.1)
class Torch(LightItem): name = "Torch" bright_light_radius = units.Feet(30) dim_light_radius = units.Feet(20) fuel = None fuel_duration = units.GameTurn(4) last_life_dice = dice.D4(1) light_shape = Shape.Circle price = coins.Silver(1) weight = units.Pound(0.2)
def _critical_failure_jump(self, character): new_pos = self._select_random_tile_with_offset(character, False) tile = character.location.level.get_tile(new_pos) context = contexts.Action(character, None) message = StringBuilder(Actor, Verb("trip", Actor), "and", Verb("faceplant", Actor), "into the %s!" % tile.name) self.game.echo.see(character, message, context) damage = dice.D4(1).roll_total() character.location.set_local_coords(new_pos) character.health.take_damage(damage, character)
class GrizzlyBear(Bear): name = "Grizzly Bear" hit_dice = dice.D8(5) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [ AttackChain( AttackSet(Claw(dice.D4(1)), amount=2, special_properties=specialproperties.BearHug), AttackSet(Bite(dice.D8(1))) ), AttackSet(Crush(dice.D8(2))) ] base_armor_class = 14 morale = 8 movement = movement.MovementSet(walk=units.FeetPerGameTurn(40)) no_appearing = AppearingSet(dice_dungeon=dice.D1(1), dice_wild=dice.D4(1), dice_lair=dice.D4(1)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set special_abilities = SpecialAbilitySet((LastBreath,)) size = Size.Large weight = units.Pound(595) xp = 360
class Deer(Animal): name = "Deer" hit_dice = dice.D8(1) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [AttackSet(Headbutt(dice.D4(1)))] base_armor_class = 13 morale = 5 movement = movement.MovementSet(walk=units.FeetPerGameTurn(80), turning_distance=units.Feet(10)) no_appearing = AppearingSet(dice_wild=dice.D10(3)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set xp = 25
class GiantBee(Bee): name = "Giant Bee" hit_dice = dice.D4(1) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [ AttackSet(Sting(dice.D4(1)), special_properties=specialproperties.DeathPoison) ] base_armor_class = 13 morale = 9 movement = movement.MovementSet(walk=units.FeetPerGameTurn(10), fly=units.Feet(50)) no_appearing = AppearingSet(dice_dungeon=dice.D6(1), dice_wild=dice.D6(1), dice_lair=dice.D6(5)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set size = Size.VerySmall special_abilities = specialabilities.CombatFrenzy, treasure_type = TreasureType.Special weight = units.Pound(10) xp = 13
class BlackBear(Animal): name = "Black Bear" hit_dice = dice.D8(4) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [ AttackChain( AttackSet(Claw(dice.D4(1)), amount=2, special_properties=specialproperties.BearHug), AttackSet(Bite(dice.D6(1)))), AttackSet(Crush(dice.D6(2))) ] base_armor_class = 14 morale = 7 movement = movement.MovementSet(walk=units.FeetPerGameTurn(40)) no_appearing = AppearingSet(dice_dungeon=dice.D4(1), dice_wild=dice.D4(1), dice_lair=dice.D4(1)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set special_abilities = SpecialAbilitySet((LastBreath, )) xp = 240
def __init__(self): head = bodyparts.Head() brain = bodyparts.Brain() left_eye = bodyparts.Eye("Left Eye") right_eye = bodyparts.Eye("Right Eye") left_ear = bodyparts.Ear("Left Ear") right_ear = bodyparts.Ear("Right Ear") neck = bodyparts.Neck() torso = bodyparts.Torso() heart = bodyparts.Heart() left_arm = bodyparts.Arm("Left Arm") left_hand = bodyparts.Hand("Left Hand") right_arm = bodyparts.Arm("Right Arm") right_hand = bodyparts.Hand("Right Hand") left_leg = bodyparts.Leg("Left Leg") left_foot = bodyparts.Foot("Left Foot") right_leg = bodyparts.Leg("Right Leg") right_foot = bodyparts.Foot("Right Foot") head.attach(left_eye, right_eye, left_ear, right_ear, neck) head.insert(brain) neck.attach(torso) torso.attach(left_arm, right_arm, left_leg, right_leg) torso.insert(heart) left_arm.attach(left_hand) right_arm.attach(right_hand) left_leg.attach(left_foot) right_leg.attach(right_foot) super().__init__(head.get_all_descendants()) punch_attack = attacks.AttackSet(attacks.Punch(dice.D4(1))) self.bind_attack(punch_attack, (left_arm, left_hand)) self.bind_attack(punch_attack, (right_arm, right_hand)) kick_attack = attacks.AttackSet(attacks.Kick(dice.D4(1))) self.bind_attack(kick_attack, (left_leg, left_foot)) self.bind_attack(kick_attack, (right_leg, right_foot))
class Pony(Horse): name = "Pony" attack_bonus = AttackBonusTable.get_by_hit_dice(1) attack_sets = [AttackSet(Bite(dice.D4(1)))] base_armor_class = 13 carry_capacity = CarryCapacity(units.Pound(275), units.Pound(550)) hit_dice = dice.D8(2) morale = 6 movement = movement.MovementSet(walk=units.FeetPerGameTurn(40), turning_distance=units.Feet(10)) no_appearing = None save_as = Fighter.level_table.levels[1].saving_throws_set special_abilities = None treasure_type = None xp = 25
class GiantBat(Animal): name = "Giant Bat" hit_dice = dice.D8(2) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [AttackSet(Bite(dice.D4(1)))] base_armor_class = 14 morale = 8 movement = movement.MovementSet(walk=units.FeetPerGameTurn(10), fly=units.FeetPerGameTurn(60)) no_appearing = AppearingSet(dice_dungeon=dice.D10(1), dice_wild=dice.D10(1), dice_lair=dice.D10(1)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set xp = 75
class DraftHorse(Horse): name = "Draft Horse" attack_bonus = AttackBonusTable.get_by_hit_dice(3) attack_sets = [AttackSet(Hoof(dice.D4(1)), amount=2)] base_armor_class = 13 carry_capacity = CarryCapacity(units.Pound(350), units.Pound(700)) hit_dice = dice.D8(3) morale = 7 movement = movement.MovementSet(walk=units.FeetPerGameTurn(60), turning_distance=units.Feet(10)) no_appearing = None save_as = Fighter.level_table.levels[3].saving_throws_set special_abilities = None treasure_type = None xp = 145
class Goblin(Humanoid): name = "Goblin" hit_dice = dice.D1(1) attack_bonus = AttackBonusTable.get_by_hit_dice(1) attack_sets = None base_armor_class = 11 morale = 7 movement = movement.MovementSet(walk=units.FeetPerGameTurn(30)) no_appearing = AppearingSet(dice_dungeon=dice.D4(2), dice_wild=dice.D10(6), dice_lair=dice.D10(6)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set special_abilities = SpecialAbilitySet((Darkvision, )) size = Size.Small weight = units.Pound(45) xp = 10
class AssassinVine(Plant): name = "Assassin Vine" hit_dice = dice.D8(6) attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount) attack_sets = [ AttackSet(Crush(dice.D8(1)), special_properties=(CrushingEntanglement, )) ] base_armor_class = 15 morale = 12 movement = movement.MovementSet(walk=units.FeetPerGameTurn(5)) no_appearing = AppearingSet(dice_dungeon=dice.D4(1, 1)) save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set size = Size.Small treasure_type = TreasureType.U weight = units.Pound(15) xp = 500
class GemsAndJewelryQualityTable(object): rows = [ GJQRow(0, 20, QualityType.Ornamental, 10, dice.D10(1)), GJQRow(21, 45, QualityType.Semiprecious, 50, dice.D8(1)), GJQRow(46, 75, QualityType.Fancy, 100, dice.D6(1)), GJQRow(76, 95, QualityType.Precious, 500, dice.D4(1)), GJQRow(96, 100, QualityType.Gem, 1000, dice.D2(1)), GJQRow(None, None, QualityType.Fancy, 5000, 1), ] _inner_table = {row.quality_type: row for row in rows} @classmethod def get_row_from_percent(cls, percent): return next((row for row in cls.rows if row.min_percent <= percent <= row.max_percent)) @classmethod def get_row_from_quality(cls, quality_type): return cls._inner_table.get(quality_type)
class Thief(CharacterClass): name = "Thief" restriction_set = restrictions.RestrictionSet( ability_score=restrictions.AbilityScoreRestrictionSet( minimum_set=abilityscores.AbilityScoreSet(dexterity=9)), armor=restrictions.ArmorRestrictionSet( included=(armor.types.Clothing, armor.types.LightArmor))) special_abilities = specialabilities.SpecialAbilitySet( (specialabilities.SneakAttack)) level_table = LevelTable( levels=(Level(value=1, attack_bonus=1, experience_required=0, hit_dice=dice.D4(1), saving_throws_set=SavingThrowSet(death_poison=13, dragon_breath=16, paralysis_stone=13, spells=15, wands=14), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(80), specialabilities.Hide(10), specialabilities.Listen(30), specialabilities.MoveSilently(25), specialabilities.OpenLock(25), specialabilities.RemoveTraps(20), specialabilities.PickPockets(30), ))), Level(value=2, attack_bonus=1, experience_required=1500, hit_dice=dice.D4(2), saving_throws_set=SavingThrowSet(death_poison=12, dragon_breath=15, paralysis_stone=12, spells=14, wands=14), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(81), specialabilities.Hide(15), specialabilities.Listen(34), specialabilities.MoveSilently(30), specialabilities.OpenLock(30), specialabilities.RemoveTraps(25), specialabilities.PickPockets(35), ))), Level(value=3, attack_bonus=2, experience_required=3000, hit_dice=dice.D4(3), saving_throws_set=SavingThrowSet(death_poison=12, dragon_breath=15, paralysis_stone=12, spells=14, wands=14), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(82), specialabilities.Hide(20), specialabilities.Listen(38), specialabilities.MoveSilently(35), specialabilities.OpenLock(35), specialabilities.RemoveTraps(30), specialabilities.PickPockets(40), ))), Level(value=4, attack_bonus=2, experience_required=6000, hit_dice=dice.D4(4), saving_throws_set=SavingThrowSet(death_poison=11, dragon_breath=14, paralysis_stone=12, spells=13, wands=13), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(83), specialabilities.Hide(25), specialabilities.Listen(42), specialabilities.MoveSilently(40), specialabilities.OpenLock(40), specialabilities.RemoveTraps(35), specialabilities.PickPockets(45), ))), Level(value=5, attack_bonus=3, experience_required=12000, hit_dice=dice.D4(5), saving_throws_set=SavingThrowSet(death_poison=11, dragon_breath=14, paralysis_stone=12, spells=13, wands=13), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(84), specialabilities.Hide(30), specialabilities.Listen(46), specialabilities.MoveSilently(45), specialabilities.OpenLock(45), specialabilities.RemoveTraps(40), specialabilities.PickPockets(50), ))), Level(value=6, attack_bonus=3, experience_required=24000, hit_dice=dice.D4(6), saving_throws_set=SavingThrowSet(death_poison=11, dragon_breath=13, paralysis_stone=11, spells=13, wands=13), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(85), specialabilities.Hide(35), specialabilities.Listen(50), specialabilities.MoveSilently(50), specialabilities.OpenLock(50), specialabilities.RemoveTraps(45), specialabilities.PickPockets(55), ))), Level(value=7, attack_bonus=4, experience_required=48000, hit_dice=dice.D4(7), saving_throws_set=SavingThrowSet(death_poison=11, dragon_breath=13, paralysis_stone=11, spells=13, wands=13), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(86), specialabilities.Hide(40), specialabilities.Listen(54), specialabilities.MoveSilently(55), specialabilities.OpenLock(55), specialabilities.RemoveTraps(50), specialabilities.PickPockets(60), ))), Level(value=8, attack_bonus=4, experience_required=90000, hit_dice=dice.D4(8), saving_throws_set=SavingThrowSet(death_poison=10, dragon_breath=12, paralysis_stone=11, spells=12, wands=12), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(87), specialabilities.Hide(45), specialabilities.Listen(58), specialabilities.MoveSilently(60), specialabilities.OpenLock(60), specialabilities.RemoveTraps(55), specialabilities.PickPockets(65), ))), Level(value=9, attack_bonus=5, experience_required=180000, hit_dice=dice.D4(9), saving_throws_set=SavingThrowSet(death_poison=10, dragon_breath=12, paralysis_stone=11, spells=12, wands=12), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(88), specialabilities.Hide(50), specialabilities.Listen(62), specialabilities.MoveSilently(65), specialabilities.OpenLock(65), specialabilities.RemoveTraps(60), specialabilities.PickPockets(70), ))), Level(value=10, attack_bonus=5, experience_required=270000, hit_dice=dice.D4(9), hit_dice_flat_bonus=2, saving_throws_set=SavingThrowSet(death_poison=9, dragon_breath=11, paralysis_stone=10, spells=11, wands=12), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(89), specialabilities.Hide(53), specialabilities.Listen(65), specialabilities.MoveSilently(68), specialabilities.OpenLock(68), specialabilities.RemoveTraps(63), specialabilities.PickPockets(74), ))), Level(value=11, attack_bonus=5, experience_required=360000, hit_dice=dice.D4(9), hit_dice_flat_bonus=4, saving_throws_set=SavingThrowSet(death_poison=9, dragon_breath=11, paralysis_stone=10, spells=11, wands=12), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(90), specialabilities.Hide(56), specialabilities.Listen(68), specialabilities.MoveSilently(71), specialabilities.OpenLock(71), specialabilities.RemoveTraps(66), specialabilities.PickPockets(78), ))), Level(value=12, attack_bonus=6, experience_required=450000, hit_dice=dice.D4(9), hit_dice_flat_bonus=6, saving_throws_set=SavingThrowSet(death_poison=9, dragon_breath=10, paralysis_stone=10, spells=11, wands=10), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(91), specialabilities.Hide(59), specialabilities.Listen(71), specialabilities.MoveSilently(74), specialabilities.OpenLock(74), specialabilities.RemoveTraps(69), specialabilities.PickPockets(82), ))), Level(value=13, attack_bonus=6, experience_required=540000, hit_dice=dice.D4(9), hit_dice_flat_bonus=8, saving_throws_set=SavingThrowSet(death_poison=9, dragon_breath=10, paralysis_stone=10, spells=11, wands=10), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(92), specialabilities.Hide(62), specialabilities.Listen(74), specialabilities.MoveSilently(77), specialabilities.OpenLock(77), specialabilities.RemoveTraps(72), specialabilities.PickPockets(86), ))), Level(value=14, attack_bonus=6, experience_required=630000, hit_dice=dice.D4(9), hit_dice_flat_bonus=10, saving_throws_set=SavingThrowSet(death_poison=8, dragon_breath=9, paralysis_stone=9, spells=10, wands=10), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(93), specialabilities.Hide(65), specialabilities.Listen(77), specialabilities.MoveSilently(80), specialabilities.OpenLock(80), specialabilities.RemoveTraps(75), specialabilities.PickPockets(90), ))), Level(value=15, attack_bonus=7, experience_required=720000, hit_dice=dice.D4(9), hit_dice_flat_bonus=12, saving_throws_set=SavingThrowSet(death_poison=8, dragon_breath=9, paralysis_stone=9, spells=10, wands=10), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(94), specialabilities.Hide(68), specialabilities.Listen(80), specialabilities.MoveSilently(83), specialabilities.OpenLock(83), specialabilities.RemoveTraps(78), specialabilities.PickPockets(94), ))), Level(value=16, attack_bonus=7, experience_required=810000, hit_dice=dice.D4(9), hit_dice_flat_bonus=14, saving_throws_set=SavingThrowSet(death_poison=7, dragon_breath=8, paralysis_stone=9, spells=9, wands=9), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(95), specialabilities.Hide(69), specialabilities.Listen(83), specialabilities.MoveSilently(85), specialabilities.OpenLock(84), specialabilities.RemoveTraps(79), specialabilities.PickPockets(95), ))), Level(value=17, attack_bonus=7, experience_required=900000, hit_dice=dice.D4(9), hit_dice_flat_bonus=16, saving_throws_set=SavingThrowSet(death_poison=7, dragon_breath=8, paralysis_stone=9, spells=9, wands=9), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(96), specialabilities.Hide(70), specialabilities.Listen(86), specialabilities.MoveSilently(87), specialabilities.OpenLock(85), specialabilities.RemoveTraps(80), specialabilities.PickPockets(96), ))), Level(value=18, attack_bonus=8, experience_required=990000, hit_dice=dice.D4(9), hit_dice_flat_bonus=18, saving_throws_set=SavingThrowSet(death_poison=7, dragon_breath=7, paralysis_stone=8, spells=9, wands=9), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(97), specialabilities.Hide(71), specialabilities.Listen(89), specialabilities.MoveSilently(89), specialabilities.OpenLock(86), specialabilities.RemoveTraps(81), specialabilities.PickPockets(97), ))), Level(value=19, attack_bonus=8, experience_required=1080000, hit_dice=dice.D4(9), hit_dice_flat_bonus=20, saving_throws_set=SavingThrowSet(death_poison=7, dragon_breath=7, paralysis_stone=8, spells=9, wands=9), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(98), specialabilities.Hide(72), specialabilities.Listen(92), specialabilities.MoveSilently(91), specialabilities.OpenLock(87), specialabilities.RemoveTraps(82), specialabilities.PickPockets(98), ))), Level(value=20, attack_bonus=8, experience_required=1170000, hit_dice=dice.D4(9), hit_dice_flat_bonus=22, saving_throws_set=SavingThrowSet(death_poison=6, dragon_breath=6, paralysis_stone=8, spells=8, wands=8), special_ability_set=specialabilities.SpecialAbilitySet(( specialabilities.ClimbWalls(99), specialabilities.Hide(73), specialabilities.Listen(95), specialabilities.MoveSilently(93), specialabilities.OpenLock(88), specialabilities.RemoveTraps(83), specialabilities.PickPockets(99), )))))
class PoisonDart(Trap): name = "Poison Dart Trap" attack = WeaponAttack(dice.D4(1), attack_bonus=1) effect = effects.FatalPoison saving_throw = savingthrows.DeathPoison target_type = targettypes.Touch
class TreasureTable(object): rows = [ TreasureRow(TreasureType.A, TreasureElement(50, coins.Copper, dice.D6(5)), TreasureElement(60, coins.Silver, dice.D6(5)), TreasureElement(40, coins.Electrum, dice.D4(5)), TreasureElement(70, coins.Gold, dice.D6(10)), TreasureElement(50, coins.Platinum, dice.D10(1)), TreasureElement(50, (Gem, ), dice.D6(6)), TreasureElement(50, (Jewelry, ), dice.D6(6)), TreasureElement(30, (RandomMagicItem, ), 3)), TreasureRow(TreasureType.B, TreasureElement(75, coins.Copper, dice.D10(5)), TreasureElement(50, coins.Silver, dice.D6(5)), TreasureElement(50, coins.Electrum, dice.D4(5)), TreasureElement(50, coins.Gold, dice.D6(3)), TreasureElement(25, Gem, dice.D6(1)), TreasureElement(25, Jewelry, dice.D6(1)), TreasureElement(10, ( Armor, Weapon, ), 1)), TreasureRow(TreasureType.C, TreasureElement(60, coins.Copper, dice.D6(6)), TreasureElement(60, coins.Silver, dice.D4(5)), TreasureElement(30, coins.Electrum, dice.D6(2)), TreasureElement(25, Gem, dice.D4(1)), TreasureElement(25, Jewelry, dice.D4(1)), TreasureElement(15, ( Armor, Weapon, ), dice.D2(1))), TreasureRow(TreasureType.D, TreasureElement(30, coins.Copper, dice.D6(4)), TreasureElement(45, coins.Silver, dice.D6(6)), TreasureElement(90, coins.Gold, dice.D8(5)), TreasureElement(30, Gem, dice.D8(1)), TreasureElement(30, Jewelry, dice.D8(1)), TreasureElement(20, RandomMagicItem, dice.D2(1), Potion)), TreasureRow( TreasureType.E, TreasureElement(30, coins.Copper, dice.D8(2)), TreasureElement(60, coins.Silver, dice.D6(10)), TreasureElement(50, coins.Electrum, dice.D8(3)), TreasureElement(50, coins.Gold, dice.D10(4)), TreasureElement(10, Gem, dice.D10(1)), TreasureElement(10, Jewelry, dice.D10(1)), TreasureElement(30, RandomMagicItem, dice.D4(1), MagicScroll)), TreasureRow( TreasureType.F, TreasureElement(40, coins.Silver, dice.D8(3)), TreasureElement(50, coins.Electrum, dice.D8(4)), TreasureElement(85, coins.Gold, dice.D10(6)), TreasureElement(70, coins.Platinum, dice.D8(2)), TreasureElement(20, Gem, dice.D12(2)), TreasureElement(10, Jewelry, dice.D12(1)), TreasureElement(35, RandomMagicItem, dice.D4(1), Potion, MagicScroll)), TreasureRow( TreasureType.G, TreasureElement(90, coins.Gold, dice.D6(4, multiplier=10)), TreasureElement(75, coins.Platinum, dice.D8(5)), TreasureElement(25, Gem, dice.D6(3)), TreasureElement(25, Jewelry, dice.D10(1)), TreasureElement(50, RandomMagicItem, dice.D4(1), MagicScroll)), TreasureRow( TreasureType.H, TreasureElement(75, coins.Copper, dice.D10(8)), TreasureElement(75, coins.Silver, dice.D10(6, multiplier=10)), TreasureElement(75, coins.Electrum, dice.D10(3, multiplier=10)), TreasureElement(75, coins.Gold, dice.D8(5, multiplier=10)), TreasureElement(75, coins.Platinum, dice.D8(9)), TreasureElement(50, Gem, dice.D100(1)), TreasureElement(50, Jewelry, dice.D4(10)), TreasureElement(20, RandomMagicItem, dice.D4(1), Potion, MagicScroll)), TreasureRow(TreasureType.I, TreasureElement(80, coins.Platinum, dice.D10(3)), TreasureElement(50, Gem, dice.D6(2)), TreasureElement(50, Jewelry, dice.D6(2)), TreasureElement(15, RandomMagicItem, 1)), TreasureRow( TreasureType.J, TreasureElement(45, coins.Copper, dice.D8(3)), TreasureElement(45, coins.Silver, dice.D8(1)), ), TreasureRow( TreasureType.K, TreasureElement(90, coins.Silver, dice.D10(2)), TreasureElement(35, coins.Electrum, dice.D8(1)), ), TreasureRow( TreasureType.L, TreasureElement(50, Gem, dice.D4(1)), ), TreasureRow( TreasureType.M, TreasureElement(90, coins.Gold, dice.D10(4)), TreasureElement(90, coins.Platinum, dice.D8(2, multiplier=10)), TreasureElement(55, Gem, dice.D4(5)), TreasureElement(45, Jewelry, dice.D6(2)), ), TreasureRow( TreasureType.N, TreasureElement(40, Potion, dice.D4(2)), ), TreasureRow( TreasureType.O, TreasureElement(50, MagicScroll, dice.D4(1)), ), TreasureRow( TreasureType.P, TreasureElement(100, coins.Copper, dice.D8(3)), ), TreasureRow( TreasureType.Q, TreasureElement(100, coins.Silver, dice.D6(3)), ), TreasureRow( TreasureType.R, TreasureElement(100, coins.Electrum, dice.D6(2)), ), TreasureRow( TreasureType.S, TreasureElement(100, coins.Gold, dice.D4(2)), ), TreasureRow( TreasureType.T, TreasureElement(100, coins.Platinum, dice.D6(1)), ), TreasureRow( TreasureType.U, TreasureElement(50, coins.Copper, dice.D20(1)), TreasureElement(50, coins.Silver, dice.D20(1)), TreasureElement(25, coins.Gold, dice.D20(1)), TreasureElement(5, Gem, dice.D4(1)), TreasureElement(5, Jewelry, dice.D4(1)), TreasureElement(2, RandomMagicItem, 1), ), TreasureRow( TreasureType.V, TreasureElement(25, coins.Silver, dice.D20(1)), TreasureElement(25, coins.Electrum, dice.D20(1)), TreasureElement(50, coins.Gold, dice.D20(1)), TreasureElement(25, coins.Platinum, dice.D20(1)), TreasureElement(10, Gem, dice.D4(1)), TreasureElement(10, Jewelry, dice.D4(1)), TreasureElement(5, RandomMagicItem, 1), ), ] inner_table = {row.treasure_type: row for row in rows} @classmethod def get_row(cls, treasure_type): """ :type treasure_type: TreasureType :rtype: TreasureRow """ return cls.inner_table.get(treasure_type)
class MagicUser(CharacterClass): name = "Magic-User" restriction_set = restrictions.RestrictionSet( ability_score=restrictions.AbilityScoreRestrictionSet( minimum_set=abilityscores.AbilityScoreSet(intelligence=9) ), armor=restrictions.ArmorRestrictionSet(included=(armor.types.Clothing, ), shields=False), weapons=restrictions.WeaponRestrictionSet( included=( weapons.types.Dagger, weapons.types.Cudgel, weapons.types.WalkingStaff, ) ) ) special_abilities = specialabilities.SpecialAbilitySet( special_abilities=( specialabilities.ArcaneCaster, specialabilities.ReadMagic ) ) level_table = LevelTable( levels=( Level( value=1, attack_bonus=1, experience_required=0, hit_dice=dice.D4(1), saving_throws_set=SavingThrowSet( death_poison=13, dragon_breath=16, paralysis_stone=13, spells=15, wands=14 ), spell_slots_set=SpellSlotSet(level_1=1) ), Level( value=2, attack_bonus=1, experience_required=2500, hit_dice=dice.D4(2), saving_throws_set=SavingThrowSet( death_poison=13, dragon_breath=15, paralysis_stone=13, spells=14, wands=14 ), spell_slots_set=SpellSlotSet(level_1=2) ), Level( value=3, attack_bonus=1, experience_required=5000, hit_dice=dice.D4(3), saving_throws_set=SavingThrowSet( death_poison=13, dragon_breath=15, paralysis_stone=13, spells=14, wands=14 ), spell_slots_set=SpellSlotSet(level_1=2, level_2=1) ), Level( value=4, attack_bonus=2, experience_required=10000, hit_dice=dice.D4(4), saving_throws_set=SavingThrowSet( death_poison=12, dragon_breath=15, paralysis_stone=12, spells=13, wands=13 ), spell_slots_set=SpellSlotSet(level_1=2, level_2=2) ), Level( value=5, attack_bonus=2, experience_required=20000, hit_dice=dice.D4(5), saving_throws_set=SavingThrowSet( death_poison=12, dragon_breath=15, paralysis_stone=12, spells=13, wands=13 ), spell_slots_set=SpellSlotSet(level_1=2, level_2=2, level_3=1) ), Level( value=6, attack_bonus=3, experience_required=40000, hit_dice=dice.D4(6), saving_throws_set=SavingThrowSet( death_poison=12, dragon_breath=14, paralysis_stone=11, spells=13, wands=12 ), spell_slots_set=SpellSlotSet(level_1=3, level_2=2, level_3=2) ), Level( value=7, attack_bonus=3, experience_required=80000, hit_dice=dice.D4(7), saving_throws_set=SavingThrowSet( death_poison=12, dragon_breath=14, paralysis_stone=11, spells=13, wands=12 ), spell_slots_set=SpellSlotSet(level_1=3, level_2=2, level_3=2, level_4=1) ), Level( value=8, attack_bonus=3, experience_required=150000, hit_dice=dice.D4(8), saving_throws_set=SavingThrowSet( death_poison=11, dragon_breath=14, paralysis_stone=10, spells=12, wands=11 ), spell_slots_set=SpellSlotSet(level_1=3, level_2=3, level_3=2, level_4=2) ), Level( value=9, attack_bonus=4, experience_required=300000, hit_dice=dice.D4(9), saving_throws_set=SavingThrowSet( death_poison=11, dragon_breath=14, paralysis_stone=10, spells=12, wands=11 ), spell_slots_set=SpellSlotSet(level_1=3, level_2=3, level_3=2, level_4=2, level_5=1) ), Level( value=10, attack_bonus=4, experience_required=450000, hit_dice=dice.D4(9), hit_dice_flat_bonus=1, saving_throws_set=SavingThrowSet( death_poison=11, dragon_breath=13, paralysis_stone=9, spells=11, wands=10 ), spell_slots_set=SpellSlotSet(level_1=4, level_2=3, level_3=3, level_4=2, level_5=2) ), Level( value=11, attack_bonus=4, experience_required=600000, hit_dice=dice.D4(9), hit_dice_flat_bonus=2, saving_throws_set=SavingThrowSet( death_poison=11, dragon_breath=13, paralysis_stone=9, spells=11, wands=10 ), spell_slots_set=SpellSlotSet(level_1=4, level_2=4, level_3=3, level_4=2, level_5=2, level_6=1) ), Level( value=12, attack_bonus=4, experience_required=750000, hit_dice=dice.D4(9), hit_dice_flat_bonus=3, saving_throws_set=SavingThrowSet( death_poison=10, dragon_breath=13, paralysis_stone=9, spells=11, wands=10 ), spell_slots_set=SpellSlotSet(level_1=4, level_2=4, level_3=3, level_4=3, level_5=2, level_6=2) ), Level( value=13, attack_bonus=5, experience_required=900000, hit_dice=dice.D4(9), hit_dice_flat_bonus=4, saving_throws_set=SavingThrowSet( death_poison=10, dragon_breath=13, paralysis_stone=9, spells=11, wands=10 ), spell_slots_set=SpellSlotSet(level_1=4, level_2=4, level_3=4, level_4=3, level_5=2, level_6=2) ), Level( value=14, attack_bonus=5, experience_required=1050000, hit_dice=dice.D4(9), hit_dice_flat_bonus=5, saving_throws_set=SavingThrowSet( death_poison=10, dragon_breath=12, paralysis_stone=8, spells=10, wands=9 ), spell_slots_set=SpellSlotSet(level_1=4, level_2=4, level_3=4, level_4=3, level_5=3, level_6=2) ), Level( value=15, attack_bonus=5, experience_required=1200000, hit_dice=dice.D4(9), hit_dice_flat_bonus=6, saving_throws_set=SavingThrowSet( death_poison=10, dragon_breath=12, paralysis_stone=8, spells=10, wands=9 ), spell_slots_set=SpellSlotSet(level_1=5, level_2=4, level_3=4, level_4=3, level_5=3, level_6=2) ), Level( value=16, attack_bonus=6, experience_required=1350000, hit_dice=dice.D4(9), hit_dice_flat_bonus=7, saving_throws_set=SavingThrowSet( death_poison=9, dragon_breath=12, paralysis_stone=7, spells=9, wands=8 ), spell_slots_set=SpellSlotSet(level_1=5, level_2=5, level_3=4, level_4=3, level_5=3, level_6=2) ), Level( value=17, attack_bonus=6, experience_required=1500000, hit_dice=dice.D4(9), hit_dice_flat_bonus=8, saving_throws_set=SavingThrowSet( death_poison=9, dragon_breath=12, paralysis_stone=7, spells=9, wands=8 ), spell_slots_set=SpellSlotSet(level_1=5, level_2=5, level_3=4, level_4=4, level_5=3, level_6=3) ), Level( value=18, attack_bonus=6, experience_required=1650000, hit_dice=dice.D4(9), hit_dice_flat_bonus=9, saving_throws_set=SavingThrowSet( death_poison=9, dragon_breath=11, paralysis_stone=6, spells=9, wands=7 ), spell_slots_set=SpellSlotSet(level_1=6, level_2=5, level_3=4, level_4=4, level_5=3, level_6=3) ), Level( value=19, attack_bonus=7, experience_required=1800000, hit_dice=dice.D4(9), hit_dice_flat_bonus=10, saving_throws_set=SavingThrowSet( death_poison=9, dragon_breath=11, paralysis_stone=6, spells=9, wands=7 ), spell_slots_set=SpellSlotSet(level_1=6, level_2=5, level_3=5, level_4=4, level_5=3, level_6=3) ), Level( value=20, attack_bonus=7, experience_required=1950000, hit_dice=dice.D4(9), hit_dice_flat_bonus=11, saving_throws_set=SavingThrowSet( death_poison=8, dragon_breath=11, paralysis_stone=5, spells=8, wands=6 ), spell_slots_set=SpellSlotSet(level_1=6, level_2=5, level_3=5, level_4=4, level_5=4, level_6=3) ) ) )