示例#1
0
class EnemySoldier(EnemyMale):
    def __init__(self, game, name, (x, y)):
        BasicUnit.__init__(self, game, name, 'player', (x, y))
        self.name = name
        self.anim_name = "player"
        self.hostile = True
        self.playable = False
        self.ally = False
        self.has_special = False
        self.palette_swaps.update({
            (128, 128, 64): (128, 128, 128),
            (128, 64, 0): (128, 128, 128)
        })
        self.equipment = [
            equipment.make(game, 'iron_chain_mail'),
            equipment.make(game, 'iron_sword'),
            equipment.make(game, 'iron_shield'),
            equipment.Hairpiece(game, 'Hair', 'hairpiece'),
            equipment.make(game, 'helm_of_suck')
        ]
        self.inventory = []
        self.activities = [
            'standing', 'walking', 'attacking', 'falling', 'dead', 'stunned'
        ]
        self.current_activity = 'standing'
        self.animations = []
        self.current_hp = self.max_hp = 90
        self.min_damage = 6
        self.max_damage = 8
        self.mitigation = 0.1
        self.avoidance = 0.2
        self.load_animations(game, self.palette_swaps)
        self.reset(game)
示例#2
0
class EnemyBandit(EnemySoldier):
    def __init__(self, game, name, (x, y)):
        BasicUnit.__init__(self, game, name, 'player', (x, y))
        self.vision_radius = 12
        self.hostile = True
        self.playable = False
        self.ally = False
        self.has_special = False
        self.palette_swaps.update({(0, 0, 128): (90, 60, 0)})
        equip_palette_swaps = {
            (128, 64, 0): (128, 0, 128),
            (128, 128, 128): (192, 128, 0),
            (192, 192, 192): (255, 255, 0)
        }
        self.equipment = [
            equipment.make(game, 'sword_of_suck'),
            equipment.make(game, 'brown_bandit_tunic'),
            equipment.Hairpiece(game, 'Hair of Suck', 'hairpiece'),
            equipment.make(game, 'brown_bandit_crown'),
            equipment.make(game, 'green_bandit_shield')
        ]
        self.current_hp = self.max_hp = 90
        self.avoidance = 0.3
        self.mitigation = 0
        self.min_damage = 6
        self.max_damage = 8
        self.activities = [
            'standing', 'walking', 'attacking', 'falling', 'dead',
            'decapitated', 'dead_decapitated'
        ]
        self.current_activity = 'standing'
        self.animations = []
        self.load_animations(game, self.palette_swaps)
        self.reset(game)
示例#3
0
class EnemyOfficer(EnemyMale):
    def __init__(self, game, name, (x, y)):
        BasicUnit.__init__(self, game, name, 'player', (x, y))
        self.name = name
        self.anim_name = "player"
        self.hostile = True
        self.playable = False
        self.ally = False
        self.has_special = False
        self.palette_swaps.update({
            (128, 128, 64): (192, 192, 192),
            (128, 64, 0): (192, 192, 192),
            (0, 0, 0): (64, 64, 64)
        })
        #hair
        self.equipment = [
            equipment.make(game, 'iron_chain_mail'),
            equipment.make(game, 'iron_sword'),
            equipment.make(game, 'iron_shield'),
            equipment.Hairpiece(game, 'Hair', 'hairpiece'),
            equipment.make(game, 'officer_helm')
        ]
        self.inventory = []
        self.activities = [
            'standing', 'walking', 'attacking', 'falling', 'dead',
            'decapitated', 'dead_decapitated'
        ]
        self.current_activity = 'standing'
        self.animations = []
        self.max_hp = 100
        self.current_hp = self.max_hp
        self.load_animations(game, self.palette_swaps)
        self.reset(game)
示例#4
0
class SoldierNPC(EnemyMale):
    # contains the core code for JickerNPC
    # ally = false by default, just switch it to true to make them follow you
    def __init__(self, game, name, (x, y)):
        BasicUnit.__init__(self, game, name, 'player', (x, y))
        self.name = name
        self.anim_name = "player"
        self.hostile = False
        self.playable = False
        self.ally = False
        self.has_special = False
        self.palette_swaps.update({(128, 64, 0): (0, 0, 255)})
        (self.x, self.y) = (x, y)
        #hair
        r = random.randint(0, 192)
        g = random.randint(int(r * 0.5), int(r * 0.9))
        b = random.randint(int(r * 0.1), int(r * 0.2))
        self.equipment = [
            equipment.make(game, 'blue_chain_mail'),
            equipment.make(game, 'sword_of_suck'),
            equipment.make(game, 'iron_shield'),
            equipment.Hairpiece(game, 'Hair', 'hairpiece'),
            equipment.make(game, 'helm_of_suck')
        ]
        self.inventory = []
        self.activities = [
            'standing', 'walking', 'attacking', 'falling', 'dead',
            'decapitated', 'dead_decapitated', 'stunned'
        ]
        self.current_activity = 'standing'
        self.animations = []
        self.max_hp = 100
        self.current_hp = self.max_hp
        self.load_animations(game, self.palette_swaps)
        self.reset(game)
示例#5
0
class MayorNPC(BasicFriendlyNPC):
    def __init__(self, game, name, (x, y)):
        BasicUnit.__init__(self, game, name, 'player', (x, y))
        self.name = name
        self.anim_name = 'player'
        self.hostile = False
        self.playable = False
        self.ally = False
        self.has_special = False
        self.palette_swaps = {}
        self.equipment = [
            equipment.Hairpiece(game, "Gray Hair", "hairpiece",
                                {(0, 0, 0): (128, 128, 128)}),
            equipment.Hairpiece(game, "Gray Beard", "beard",
                                {(0, 0, 0): (128, 128, 128)}),
            equipment.make(game, "helm_of_suck"),
            equipment.make(game, "blue_tunic")
        ]
        self.inventory = []
        self.activities = [
            'standing', 'walking', 'attacking', 'falling', 'dead',
            'decapitated', 'dead_decapitated', 'stunned'
        ]
        self.current_activity = 'standing'
        self.animations = []
        self.max_hp = 100
        self.current_hp = self.max_hp
        self.load_animations(game, self.palette_swaps)
        self.reset(game)
        self.quest_given = False
示例#6
0
class JickerNPC(SoldierNPC):
    def __init__(self, game, name, (x, y)):
        BasicUnit.__init__(self, game, name, 'player', (x, y))
        self.hostile = False
        self.playable = False
        self.ally = True
        self.has_special = False
        self.palette_swaps.update({
            (128, 128, 64): (50, 100, 150),
            (128, 64, 0): (64, 48, 32),
            (128, 128, 0): (64, 48, 32),
            (0, 64, 64): (64, 48, 32)
        })
        self.equipment = [
            equipment.make(game, 'jick'),
            equipment.Hairpiece(game, 'Hair', 'hairpiece')
        ]
        self.inventory = []
        self.activities = [
            'standing', 'walking', 'attacking', 'falling', 'dead',
            'decapitated', 'dead_decapitated', 'stunned'
        ]
        self.current_activity = 'standing'
        self.animations = []
        self.max_hp = 100
        self.current_hp = self.max_hp
        self.load_animations(game, self.palette_swaps)
        self.reset(game)