class Backstep(Skill): icon = res.unpack_sheet('common_skill_icon')[0] def __init__(self): Skill.__init__(self, "Backstep", "defend", startup=5, preview_area=[(-1, 0)]) def get_desc_body(self): return [ "Move back one tile to gain the Dodge effect. ", "You avoid damage from frontal attacks with 10 or more startup, " "but you still receive stagger. The amount of startup " "it takes to hit you increases by 2 for each hit dodged." ] def do(self): targets = self.target_area(self.preview_area) if len(targets ) == 0 and self.preview_area[0][0] + self.owner.x in range( self.owner.field.columns): self.affected_area = [] self.owner.change_pos(-self.owner.direction, 0) self.owner.gain_effect(E_Dodge, duration=1)
class GhostSlash(Skill): icon = res.unpack_sheet('slayer_skill_icon')[10] def __init__(self): Skill.__init__(self, "Ghost Slash", "attack", startup=8, damage=[100], stagger=[18], preview_area=[(1, 0), (2, 0), (3, 0)], finisher=True) def get_desc_body(self): return [ "Finisher (ends your turn on use, " "does full damage at the end of combos).", "Inflicts knockback against staggered enemies." ] def do(self): targets = self.target_area(self.preview_area) damaged = self.do_damage(targets, self.damage[0], stagger=self.stagger[0]) self.knockback_on_stagger(damaged)
class Unshackle(Special): icon = res.unpack_sheet('slayer_skill_icon')[80] def __init__(self): Special.__init__(self, "Unshackle", cooldown=10, preview_area=[(1, 0), (0, 1), (0, -1), (-1, 0)]) def get_desc_body(self): return [ "Unshackles adjacent friendly ghosts. Unshackled ghosts have their " "effects increased by 25%, their radii increased " "by 1, and re-apply their effects once immediately upon " "unshackling. Only unshackles one ghost per tile. If " "multiple ghosts occupy the same tile, only the first one " "will become unshackled." ] def do(self): tiles = self.tiles_in_radius(self.owner.x, self.owner.y, 1) for tile in tiles: tile = self.owner.field.tile[tile[0]][tile[1]] for effect in tile.effects: if effect.ghost and effect.player == self.owner.player: print "Buffed {}".format(effect.name) effect.strength *= 1.25 effect.damage *= 1.25 effect.radius += 1 effect.do() break
def __init__(self): super(ClayGolem, self).__init__(['claygolem']) self.idle = Animation(frames = [16]*25+range(16, 25), speed=0.12) self.attack1 = Animation(frames = range(8, 16), speed=0.2) self.hit1 = Animation(frames = [39]*3, speed=0.1) self.play_animation(self.idle) self.height = 150 self.center = 130, 205 self.portrait = res.unpack_sheet('monsterface')[22]
def __init__(self): super(Lugaru, self).__init__(['lugaru']) self.idle = Animation(frames = range(33, 37), speed=0.12) self.attack1 = Animation(frames = range(0, 6), speed=0.4) self.hit1 = Animation(frames = [15]*3, speed=0.1) self.play_animation(self.idle) self.height = 80 self.center = 65, 100 self.portrait = res.unpack_sheet('monsterface')[11]
class E_AcidBurn(Effect): icon = res.unpack_sheet('status_icon')[21] def __init__(self, duration, extras): Effect.__init__(self, "Acid Burn", duration, duration_stacking=True) def get_desc_body(self): return (["Take 10 damage each turn. "]) def tick(self): self.owner.take_damage(10)
class Guard(Skill): icon = res.unpack_sheet('slayer_skill_icon')[24] def __init__(self): Skill.__init__(self, "Guard", "defend", startup=1) def get_desc_body(self): return ["Reduces incoming frontal damage by 75%."] def do(self): self.owner.gain_effect(E_Guard, duration=1)
class E_Guard(Effect): icon = res.unpack_sheet('status_icon')[3] def __init__(self, duration, extras): Effect.__init__(self, "Guard", duration) def get_desc_body(self): return ["Reduces incoming frontal damage by 75%. "] def incoming_damage(self, damage, stagger, attack): if self.owner.direction * (attack.owner.x - self.owner.x) > 0: damage = damage * 0.25 return damage, stagger
def __init__(self): Skill.__init__(self, "Power Wave", "attack", startup=15, preview_area=[(1, 0), (2, 0), (2, -1), (2, 1)], stationary=False) self.desc = ([ "Damage: 25", "Startup: 15", "Stagger: 15", "A slow attack that covers a lot of area. " "Knocks back by 1 tile against staggered enemies. Can't be used after moving." ]) self.icon = res.unpack_sheet('slayer_skill_icon')[4]
def build_sprite(self, parts, pos_dict=None): built = [] with open(os.path.join(res.dir, parts[0]+'.txt'), 'r') as sheet_map: #Assumes that the first part has a line for every frame for line in sheet_map: size=(int(line.split()[4]), int(line.split()[5])) built.append(pygame.Surface(size)) built[-1].fill((124, 248, 0)) for part in parts: sprite_part = res.unpack_sheet(part) for i in range(len(sprite_part)): built[i].blit(sprite_part[i], (0,0)) built[i] = built[i].convert() built[i].set_colorkey((124, 248, 0)) return built
class Retreat(Special): icon = res.unpack_sheet('common_skill_icon')[2] def __init__(self): Special.__init__(self, "Retreat", cooldown=0) def get_desc_body(self): return [ "A test skill to go back to the party management page " "without having to win or lose.", "WARNING: THIS WILL MESS EVERYTHING UP" ] def do(self): return
class MoonlightSlash(Skill): icon = res.unpack_sheet('slayer_skill_icon')[160] def __init__(self): Skill.__init__(self, "Moonlight Slash", "attack", startup=13, damage=[70, 70, 120], stagger=[13, 16, 8], preview_area=[(1, -1), (1, 0), (2, 0), (1, 1)]) self.usable = 3 self.consecutive_hits = 0 def get_desc_header(self): text = [self.name, "Startup: {}".format(self.startup)] if self.used < 3: index = self.used else: index = 2 damage_line = "Damage: {}".format(self.damage[index]) stagger_line = "Stagger: {}".format(self.stagger[index] + self.surprise_stagger) if self.used < 2: damage_line += "->{}".format(self.damage[index + 1]) stagger_line += "->{}".format(self.stagger[index + 1] + self.surprise_stagger) text.append(damage_line) text.append(stagger_line) return text def get_desc_body(self): return [ "Can be used up to three times consecutively. " "Properties change on consecutive use." ] def do(self): targets = self.target_area(self.preview_area) damaged = self.do_damage(targets, self.damage[self.consecutive_hits], stagger=self.stagger[self.consecutive_hits]) self.consecutive_hits += 1 self.knockback_on_stagger(damaged) def tick(self): self.used = 0 self.consecutive_hits = 0
def __init__(self): Skill.__init__(self, "Power Geyser", "attack", startup=20, preview_area=[(1, 0), (2, 0), (2, -1), (2, 1), (3, -2), (3, -1), (3, 0), (3, 1), (3, 2), (4, -1), (4, 0), (4, 1)], stationary=False, finisher=True) self.desc = ([ "Damage: 50", "Startup: 20", "Stagger: 20", "A slow attack that covers a massive area. " "Knocks back by 2 tiles against staggered enemies. Can't be used after moving. " "Does full damage when used at the end of a combo." ]) self.icon = res.unpack_sheet('slayer_skill_icon')[6]
class E_BremenHaze(Effect): icon = res.unpack_sheet('status_icon')[7] def __init__(self, duration, extras): Effect.__init__(self, "Bremen's Haze", duration) self.amount = extras['amount'] def get_desc_body(self): return ([ "Resistance is decreased by {}%. ".format(int(self.amount * 100)) ]) def incoming_damage(self, damage, stagger, attack): damage = damage * (1 + self.amount) return damage, stagger def merge(self, new): if self.amount < new.amount: self.amount = new.amount if self.duration < new.duration: self.duration = new.duration
class E_KazanWrath(Effect): icon = res.unpack_sheet('status_icon')[1] def __init__(self, duration, extras): Effect.__init__(self, "Kazan's Wrath", duration) self.amount = extras['amount'] def get_desc_body(self): return ([ "Damage is increased by {}%. ".format(int(self.amount * 100)) ]) def outgoing_damage(self, damage, stagger, attack, target): damage = damage * (1 + self.amount) return damage, stagger def merge(self, new): if self.amount < new.amount: self.amount = new.amount if self.duration < new.duration: self.duration = new.duration
class E_Dodge(Effect): icon = res.unpack_sheet('status_icon')[54] def __init__(self, duration, extras): Effect.__init__(self, "Dodge", duration) self.dodge_count = 0 def get_desc_body(self): return [ "Avoids attacks with {} or more startup. ".format(10 + self.dodge_count) ] def incoming_damage(self, damage, stagger, attack): if (attack.startup / attack.owner.speed > (10 + self.dodge_count) / self.owner.speed and self.owner.direction * (attack.owner.x - self.owner.x) > 0): damage = 0 self.dodge_count += 2 return damage, stagger
class Kazan(Special): icon = res.unpack_sheet('slayer_skill_icon')[52] def __init__(self): Special.__init__(self, "Kazan", cooldown=6, preview_area=[(0, 0), (1, 0), (1, 1), (1, -1), (2, 0)]) def get_desc_body(self): return [ "Summons Kazan in front of you.", "Allies within 1 tile of Kazan deal +12% damage. " "Each turn, Kazan hits all enemies within 1 tile for 40 damage. " "Ghosts are intangible and do not take up space on the field." ] def do(self): effect = T_Kazan(self.owner.x + self.owner.direction, self.owner.y, self.owner)
class Thrust(Skill): icon = res.unpack_sheet('slayer_skill_icon')[42] def __init__(self): Skill.__init__(self, "Thrust", "attack", startup=12, damage=[60], stagger=[14], preview_area=[(1, 0), (2, 0), (3, 0)]) def get_desc_body(self): return ["Generate 5 Drive if you make contact with an enemy."] def do(self): targets = self.target_area(self.preview_area) damaged = self.do_damage(targets, self.damage[0], stagger=self.stagger[0]) if len(damaged) > 0: self.owner.drive += min(self.owner.drive + 5, 100)
class Bremen(Special): icon = res.unpack_sheet('slayer_skill_icon')[84] def __init__(self): Special.__init__(self, "Bremen", cooldown=6, drive_requirement=20, preview_area=[(0, 0), (1, 0), (1, 1), (1, -1), (2, 0)]) def get_desc_body(self): return [ "Summons Bremen in front of you.", "Enemies within 1 tile of Bremen take +12% damage. " "Each turn, Bremen hits all enemies within 1 tile for 40 damage. " "Ghosts are intangible and do not take up space on the field." ] def do(self): effect = T_Bremen(self.owner.x + self.owner.direction, self.owner.y, self.owner)