Ah! Yes, that was the problem: I had an errant comma on the previous line. Fixed now, thank you.
I changed the shielding code to CLASS_WIZARD, SKILL_AIR, method_light (which is convenient because it stops you having to cast all those light spells before venturing underwater), and it seems to work.
However, I'm afraid I've discovered two whole new problems.
First, after we wrote the petrifaction code, I'd failed to test what happens when someone dies for reasons
not related to petrifaction. What happens is a FATAL LUA ERROR: Lua Function sys_character_die: mfi_dungeon/attacks.lua:14: attempt to call global 'dsb_set_topimages' (a nil value)
This is the code at the start of attacks.lua with the problem line indicated:
Code: Select all
--Miscellaneous functions and conditions. These are called by individual monster special attacks
function sys_character_die(ppos, who, mouse_drop)
drop_all_items_and_magicshields(ppos, who, mouse_drop)
local death_object
use_ch_exvar(who)
if (ch_exvar[who].petrified) then
death_object = "petrified"
dsb_replace_topimages(who, nil, nil, "top_dead_petrified")
ch_exvar[who].petrified = nil
else
death_object = "bones"
dsb_set_topimages(who, nil, nil, 0) <---- This line is the one with the problem
end
local lev, xc, yc = dsb_party_coords()
local tile_pos = dsb_ppos_tile(ppos)
local dead_id = dsb_spawn(death_object, lev, xc, yc, tile_pos)
exvar[dead_id] = { owner = who }
end
I've also discovered that shortly after entering the water with water breathing up, the character dies with no warning.
The code that I've written for this currently reads:-
Code: Select all
method_info.WATERBREATHE = {
xp_class = CLASS_WIZARD,
xp_sub = SKILL_AIR,
xp_get = 35,
idleness = 10,
stamina_used = 2
}
and
Code: Select all
obj.trident = {
name="TRIDENT",
type="THING",
class="WEAPON",
mass=39,
icon=gfx.thing_icon_trident,
dungeon=gfx.thing_dungeon_trident,
methods = {
{ "JAB", 0, CLASS_FIGHTER, method_physattack },
{ "THRUST", 5, { CLASS_FIGHTER, SKILL_STABBING }, method_physattack },
{ "WATERBREATHE", 3, { CLASS_WIZARD, SKILL_AIR }, method_light }
},
spell_power=140,
light_power=60,
light_fade=2,
light_fade_time=2500,
base_range=10,
base_tpower=50,
impact=28,
fit_sheath=true
}
(I changed it from WATERBREATHING to WATERBREATHE so it would fit in the "methods" box when displayed in DSB--otherwise we had a method called WATERBREATHI which wasn't ideal...)
Is the light_fade parameter the one that's causing a problem?