# Duane's Dungeon - a rogue-like game # Copyright (C) 2022 Duane Robertson # spell_eater.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 _ready(): super() null_magic() func set_species_attributes(): species = 'spell_eater' defense = { magic = 0 } description = 'Spell eaters are strange entities that devour magic.' energy_max = 15 icon_name = 'eater' icon_fg = 'cc4ccc' strength_max = 24 super() func null_magic(): var r := Rect2(grid_position, Vector2.ONE) r = r.grow(5) @warning_ignore("unused_variable") var stat := { area = r, duration = 1, name = 'null_magic', entity_id = uid, on_cast = 'on_cast', } # map.status.add(stat) func on_cast(_statee:Node2D, _stat:Dictionary, _spell, caster, _targets): caster.show_message('Your spell is nullified') return false func turn(): super() null_magic()