Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #######################
- # IOOD trap (mumra)
- {{
- -- Generates an orb at the x,y aimed at targetx,targety (precise, not like spell)
- -- power is normally HD * 6 for monster spell version, or spell power for player spell
- -- So, 180 is equiv to a HD 30 pan lord
- function orb_generate(x, y, targetx, targety, power)
- local orb = dgn.create_monster(x, y, 'orb of destruction')
- -- Set x, y, velocity
- x = x - 0.5
- y = y - 0.5
- targetx = targetx - 0.5
- targety = targety - 0.5
- orb.set_prop("iood_x",x)
- orb.set_prop("iood_y",y)
- orb.set_prop("iood_vx",targetx - x)
- orb.set_prop("iood_vy",targety - y)
- orb.set_prop("iood_pow",power)
- -- Other misc properties (needs some review and testing)
- orb.set_prop("iood_kc",2) -- enum KC_OTHER
- orb.set_prop("iood_caster","an orb trap") -- relevant, I think, for cause of death text
- -- Normally holds the monster id; shouldn't cause an error, but could try setting to -1 if it does
- -- orb.set_prop("iood_mid",-1)
- end
- -- TODO: Avoid enemies triggering it (altho allow summons)
- function callback.orb_grate_trap_stepped(data, triggerable, triggerer, marker, ev)
- local x, y = marker:pos()
- local p = dgn.find_marker_positions_by_prop("orb_grate", 1)[1]
- if (p ~= nil) then
- if (dgn.mons_at(p.x, p.y) ~= nil or p == you.pos()) then
- if (you.see_cell(x, y)) then
- crawl.mpr("A part of the floor depresses, but nothing seems to happen.")
- return
- end
- end
- dgn.grid(p.x, p.y, "iron_grate")
- if (you.see_cell(p.x, p.y)) then
- crawl.mpr("An iron grate slams shut!")
- end
- end
- -- Remove the trap (remove following line for repeatable)
- dgn.grid(x, y, "floor")
- for slave in iter.slave_iterator("orb_spawn", 1) do
- local target = dgn.find_marker_positions_by_prop("orb_target",1)[1]
- -- Very high power; might want to change this (or read it from a property on the marker)
- orb_generate(slave.x, slave.y, target.x,target.y, 180)
- end
- end
- }}
- ######################################
- # Simple orb corridor
- # by mumra
- # Based on my simple boulder corridor
- #
- NAME: orb_corridor_run
- DEPTH: Vault,Crypt,D:15-27
- ORIENT: float
- KFEAT: ^ = pressure plate trap
- KITEM: ^ = *
- {{
- local tm = TriggerableFunction:new{func="callback.orb_grate_trap_stepped",
- repeated=true}
- tm:add_triggerer(DgnTriggerer:new{type="pressure_plate"})
- lua_marker('^', tm)
- lua_marker(',', props_marker { orb_grate=1 })
- lua_marker('A', props_marker { orb_spawn=1 })
- lua_marker('B', props_marker { orb_target=1 })
- }}
- KFEAT: AB=floor
- MAP
- xxxxxxxxxxxxxxxxxx
- xA..^............B@
- xxx,xxxxxxxxxxxxxx
- @
- ENDMAP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement