Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##############################################################################
- # Trap: shadow creatures
- # Summons level-appropriate shadow creatures
- ##############################################################################
- {{
- function callback.shadow_creatures_trap_stepped(data, triggerable, triggerer, marker, ev)
- if data.triggered == true then
- return
- end
- local x, y = marker:pos()
- if not you.see_cell(x, y) then
- -- pretend the monster avoided it
- return
- end
- local shadows = 0
- for p in iter.rect_iterator(dgn.point(x-4, y-4), dgn.point(x+4, y+4)) do
- -- 80 squares iterated and a one-in-ten chance means on average 6 shadows
- if (dgn.mons_at(p.x, p.y) == nil and p ~= you.pos() and dgn.is_passable(p.x, p.y) and you.see_cell(p.x, p.y) and crawl.one_chance_in(10)) then
- if (dgn.create_monster(p.x, p.y, "generate_awake " .. data.monster .. " dur:5 sum:shadow_creatures")) then
- shadows = shadows + 1
- end
- end
- end
- if (shadows > 0) then
- crawl.mpr("Wisps of shadow whirl around you...")
- data.triggered = true
- -- remove the trap
- dgn.grid(x, y, "floor")
- else
- crawl.mpr("Nothing happens...")
- end
- end
- }}
- #############################################
- # Shadow creatures: dungeon
- #
- NAME: shadow_creatures_trap_dungeon
- DEPTH: D:3-27
- TAGS: allow_dup extra luniq_shadow_creatures_trap
- WEIGHT: 100
- KFEAT: ^ = pressure plate trap
- {{
- local tm = TriggerableFunction:new{func="callback.shadow_creatures_trap_stepped",
- repeated=true,
- data={triggered=false,monster="kobold"} }
- tm:add_triggerer(DgnTriggerer:new{type="pressure_plate"})
- lua_marker('^', tm)
- }}
- MAP
- A..
- .^.
- ...
- ENDMAP
- #############################################
- # Shadow creatures: Zot
- #
- NAME: shadow_creatures_trap_zot
- DEPTH: Zot:1-4
- TAGS: allow_dup extra luniq_shadow_creatures_trap
- WEIGHT: 100
- KFEAT: ^ = pressure plate trap
- {{
- local tm = TriggerableFunction:new{func="callback.shadow_creatures_trap_stepped",
- repeated=true,
- data={triggered=false,monster="draconian"} }
- tm:add_triggerer(DgnTriggerer:new{type="pressure_plate"})
- lua_marker('^', tm)
- }}
- MAP
- A..
- .^.
- ...
- ENDMAP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement