Attached Files |
xom_exploding_sheep.des [^] (1,415 bytes) 2012-02-06 15:40 [Show Content] [Hide Content]# Xom sends flaming sheep into four corners of the world.
{{
function callback.xom_exploding_sheep(data, triggerable,
triggerer, marker, ev)
local x, y = marker:pos()
local permarock = dgn.feature_number("permarock_wall")
local door = dgn.feature_number("open_door")
crawl.mpr("Walls come down!")
for p in iter.rect_iterator(dgn.point(x-2, y-2), dgn.point(x+2, y+2)) do
local feat = dgn.grid(p.x, p.y)
if feat == permarock or feat == door then
dgn.terrain_changed(p.x, p.y, "floor", false, false, false)
end
end
local sheep = dgn.mons_at(x, y)
if sheep ~= nil and sheep.name == "sheep" then
sheep.set_hp(1)
sheep.add_ench("inner_flame", 1, 30000)
sheep.add_ench("sticky_flame", 1, 30000)
crawl.mpr("A sheep catches on fire! You hear mad divine giggling.")
end
end
}}
NAME: xom_sheep
TAGS: temple_overflow_xom
DEPTH: D:3-15, Lair
KFEAT: _ = altar_xom
{{
local tm = TriggerableFunction:new{func="callback.xom_exploding_sheep"}
tm:add_triggerer(DgnTriggerer:new{type="player_los"})
lua_marker('_', tm)
lua_marker('+', restrict_door())
lua_marker('+', props_marker {veto_fragmentation="veto", veto_disintegrate="veto", veto_shatter="veto"})
}}
MONS: sheep
KMONS: _ = sheep
KPROP: 1'_ = no_rtele_into
SUBST: ' = .
MAP
@.......@
.........
..XXXXX..
..X1'1X..
..X'_'X..
..X1'1X..
..XX+XX..
.........
@.......@
ENDMAP
kilobyte_xom_exploding_sheep.des [^] (2,696 bytes) 2012-07-07 22:00 [Show Content] [Hide Content]# Xom sends flaming sheep into four corners of the world.
{{
function callback.kilobyte_xom_exploding_sheep(data, triggerable,
triggerer, marker, ev)
local x, y = marker:pos()
crawl.mpr("Walls come down!")
for p in iter.slave_iterator("feat_remove", 1) do
dgn.terrain_changed(p.x, p.y, "floor", false, false, false)
end
-- The logic here is a bit obtuse; the idea is to get the
-- "A sheep comes into view" messages to all display before
-- anything else.
local nsheep = 0
local sheeparray = {}
local visarray = {}
local flee = mons.behaviour("flee")
for p in iter.slave_iterator("sheep_place", 1) do
local sheep = dgn.create_monster(p.x, p.y, 'generate_awake sheep')
if sheep then
nsheep = nsheep + 1
sheeparray[nsheep] = sheep
visarray[nsheep] = you.see_cell(p.x, p.y)
end
end
for i = 1, nsheep do
local sheep = sheeparray[i]
sheep.add_ench("inner_flame", 1, 30000)
sheep.add_ench("sticky_flame", 1, 30000)
sheep.add_ench("fear", 1, 30000)
sheep.beh = flee
if visarray[i] then
crawl.mpr("A sheep catches fire!", "warning")
-- No way at present to get a speech string through Lua, so...
local which = crawl.random2(8)
if (which < 3) then
crawl.mpr("The sheep bleats in terror.", "talk")
elseif which == 3 then
crawl.mpr("The sheep is struck with panic!", "visual")
elseif which == 4 then
crawl.mpr("The sheep panics and turns to flee.", "visual")
elseif which == 5 then
crawl.mpr("A frightened sheep leaps away.", "visual")
elseif which == 6 then
crawl.mpr("The sheep turns to a blind rush.", "visual")
else
crawl.mpr("The sheep stampedes away.", "visual")
end
end
end
crawl.god_speaks("Xom", "You hear mad divine giggling.")
end
}}
NAME: kilobyte_xom_exploding_sheep
TAGS: transparent no_monster_gen no_item_gen temple_overflow_xom \
uniq_altar_xom
DEPTH: D:3-15, Lair
KFEAT: _ = altar_xom
{{
local tm = TriggerableFunction:new{func="callback.kilobyte_xom_exploding_sheep"}
tm:add_triggerer(DgnTriggerer:new{type="player_los"})
lua_marker('_', tm)
lua_marker('_', props_marker {sheep_place = 1})
lua_marker('H', props_marker {sheep_place = 1})
lua_marker('c', props_marker {feat_remove = 1})
lua_marker('+', props_marker {feat_remove = 1})
lua_marker('+', restrict_door())
lua_marker('+', props_marker {veto_fragmentation="veto", veto_disintegrate="veto", veto_shatter="veto"})
}}
KPROP: H'_ = no_rtele_into
SUBST: ' = .
MAP
@.......@
.........
..ccccc..
..cH'Hc..
..c'_'c..
..cH'Hc..
..cc+cc..
.........
@.......@
ENDMAP
|