# Duane's Dungeon - a rogue-like game # Copyright (C) 2023 Duane Robertson # hydra.gd - a monster # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . extends Creature func set_species_attributes(): species = 'hydra' defense = { weapon = 0.9, } description = 'Hydras are snake-like creatures that grow two heads every time one is destroyed, making them more dangerous the longer they fight. This one has %d heads.' energy_max = 14 extra_level = 1.0 # for extra heads icon_name = 'hydra1' icon_fg = '6d879b' strength_max = 20 size = 4 super() func change_strength(amt: int, source=null) -> bool: if amt < -4 and damage_mult < 6: if source and source.is_in_group('creatures'): source.show_message('%s grows another head' % [species]) # print('%s (%s) damage increases to %0.1f' % [species, name, damage_mult]) damage_mult += 0.5 amt = int(amt * 0.75) if damage_mult < 3.5: icon_name = 'hydra1' icon_fg = '6d879b' elif damage_mult < 4.5: icon_name = 'hydra2' icon_fg = '8d879b' else: icon_name = 'hydra3' icon_fg = 'ad879b' var tex:ImageTexture = G.sprite_sheet.texture(icon_name, icon_fg) sprite.texture = tex return super(amt, source) func get_description() -> String: return description % [int((damage_mult - 1) / 0.5)]