Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Custom monitors
- local function MONITOR(doomednum, name, sprite, action, var1, var2)
- --[[ Arg Example Desc
- doomednum 5001 Map thing # of the object
- name "FIREFLOWERMONITOR" Internal name (don't declare freeslots for this!)
- sprite SPR_FLTV Sprite set to use (A=monitor, B=icon, C-E=flip - DO freeslot this beforehand!)
- action A_CustomPower Action for the monitor to run when popped
- var1 pw_shield Var1 for above action
- var2 SH_FIREFLOWER Var2 for above action
- ]]
- freeslot("MT_"..name, "MT_"..name.."ICO")
- local montype = EvalMath("MT_"..name)
- for i=1,7 do
- freeslot("S_"..name..i)
- end
- local monstate = EvalMath("S_"..name..1)
- -- Now create the monitor in question
- mobjinfo[montype] = {
- doomednum = doomednum,
- spawnstate = monstate,
- spawnhealth = 1,
- reactiontime = 8,
- painstate = monstate,
- deathstate = monstate+2,
- deathsound = sfx_pop,
- speed = MT_MONITOREXPLOSION,
- radius = 16*FRACUNIT,
- height = 32*FRACUNIT,
- mass = 100,
- damage = montype+1,
- flags = MF_SOLID|MF_SHOOTABLE|MF_MONITOR
- }
- mobjinfo[montype+1] = {
- spawnstate = monstate+2,
- seesound = sfx_shield,
- speed = 2*FRACUNIT,
- damage = 62*FRACUNIT,
- flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON
- }
- states[monstate+0] = {sprite,A,2,nil,0,0,monstate+1}
- states[monstate+1] = {SPR_MTEX,A,1,nil,0,0,monstate}
- states[monstate+2] = {sprite,B,4,A_MonitorPop,0,0,monstate+3}
- states[monstate+3] = {sprite,C,4,nil,0,0,monstate+4}
- states[monstate+4] = {sprite,D,4,nil,0,0,monstate+5}
- states[monstate+5] = {sprite,E,4,nil,0,0,monstate+6}
- states[monstate+6] = {sprite,B,4,action,var1,var2,S_NULL}
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement