ZZT-style explosions
#1
Posted 09 January 2014 - 12:28 AM

#2
Posted 09 January 2014 - 12:47 AM

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#3
Posted 09 January 2014 - 02:33 AM
become pushable set "commands" to "(-1>>1)" cycle 3 set "EXPLOSION_DAMAGE" to 10 set "A_BLOW_UP_(0x06)" to 1 set "A_BLOW_UP_(0x07)" to 1 set "A_BLOW_UP_(0x08)" to 1 set "A_BLOW_UP_(0x09)" to 1 set "A_BLOW_UP_(0x0A)" to 1 set "A_BLOW_UP_(0x12)" to 1 set "A_BLOW_UP_(0x13)" to 1 set "A_BLOW_UP_(0x1B)" to 1 set "A_BLOW_UP_(0x1C)" to 1 set "A_BLOW_UP_(0x1D)" to 1 set "A_BLOW_UP_(0x37)" to 1 set "A_BLOW_UP_(0x3D)" to 1 set "A_BLOW_UP_(0x4E)" to 1 set "A_BLOW_UP_(0x4F)" to 1 set "A_BLOW_UP_(0x50)" to 1 set "A_BLOW_UP_(0x52)" to 1 set "A_BLOW_UP_(0x54)" to 1 set "A_BLOW_UP_(0x57)" to 1 set "A_BLOW_UP_(0x58)" to 1 set "A_BLOW_UP_(0x59)" to 1 set "A_BLOW_UP_(0x5A)" to 1 set "A_BLOW_UP_(0x5B)" to 1 set "A_BLOW_UP_(0x5E)" to 1 set "A_BLOW_UP_(0x5F)" to 1 set "A_UNDER_(0x00)" to 1 set "A_UNDER_(0x0D)" to 1 set "A_UNDER_(0x0E)" to 1 set "A_UNDER_(0x0F)" to 1 set "A_UNDER_(0x10)" to 1 set "A_UNDER_(0x11)" to 1 set "A_UNDER_(0x12)" to 1 set "A_UNDER_(0x13)" to 1 set "A_UNDER_(0x14)" to 1 set "A_UNDER_(0x15)" to 1 set "A_UNDER_(0x16)" to 1 set "A_UNDER_(0x17)" to 1 set "A_UNDER_(0x18)" to 1 set "A_UNDER_(0x19)" to 1 set "A_UNDER_(0x1A)" to 1 set "A_UNDER_(0x22)" to 1 set "A_UNDER_(0x2B)" to 1 set "A_UNDER_(0x2C)" to 1 set "A_UNDER_(0x30)" to 1 set "A_UNDER_(0x3F)" to 1 set "A_UNDER_(0x43)" to 1 set "A_UNDER_(0x44)" to 1 set "A_UNDER_(0x45)" to 1 set "A_UNDER_(0x46)" to 1 set "A_EXPLODE_(0x24)" to 1 set "A_EXPLODE_(0x25)" to 1 set "A_EXPLODE_(0x3E)" to 1 set "A_EXPLODE_(0x51)" to 1 end : "touch" lockself end play play "tcf+cf+c" char '9' wait for 5 char '8' play "z3c" wait for 5 char '7' play "z2g" wait for 5 char '6' play "z3c" wait for 5 char '5' play "z2g" wait for 5 char '4' play "z3c" wait for 5 char '3' play "z2g" wait for 5 char '2' play "z3c" wait for 5 char '1' play "z2g" wait for 5 end play play "s+++c-c-c-c-c-c" char "(11)" set "local5" to 0 goto "#pass" wait for 1 set "local5" to 1 goto "#pass" die : "#pass" loop start set "local2" to "('loopcount'%15-7)" set "local3" to "('loopcount'/15-4)" if "('local3'*'local3'*2+('local2'*'local2'))" < 50 then "#bomb&local5&" loop for "(15 * 9 - 1)" goto "#return" : "#bomb0" inc "local2" by "thisx" inc "local3" by "thisy" if "(('local2'<0)o('local3'<0)o('local2'>='board_w')o('local3'>='board_h'))" = 1 then "#return" goto "#hit('A_BLOW_UP_('bid&local2&,&local3&')')" if "A_UNDER_('bid&local2&,&local3&')" = 1 then "#draw" goto "#return" : "#bomb1" inc "local2" by "thisx" inc "local3" by "thisy" if "(('local2'<0)o('local3'<0)o('local2'>='board_w')o('local3'>='board_h'))" = 1 then "#return" if c?? Breakaway p00 at "('local2')" "('local3')" then "#cleanup" goto "#return" : "#cleanup" set "local11" to "uco('local2'),('local3')" set "local12" to "upr('local2'),('local3')" set "local13" to "uid('local2'),('local3')" put "local11" Ricochet "local12" at "('local2')" "('local3')" set "bid('local2'),('local3')" to "local13" goto "#return" : "#draw" set "local4" to random 9 to 15 put "local4" Breakaway p00 at "local2" "local3" goto "#return" : "#hit1" : "hit1" goto "#cleanup" goto "#return" : "#hit0" if "(('bid&local2&,&local3&'=0x53)a('bpr&local2&,&local3&'a0x80=0))" = 1 then "hit1" if "(('bid&local2&,&local3&'=0x55)a('bpr&local2&,&local3&'a0x08=0))" = 1 then "hit1" if "(('bid&local2&,&local3&'=0x56)a('bpr&local2&,&local3&'a0xE0=0))" = 1 then "hit1" if "bid&local2&,&local3&" = "(0x56)" then "dragon_hurt" if "A_EXPLODE_('bid&local2&,&local3&')" = 1 then "boom" if c?? Mine p?? at "local2" "local3" then "boom_mine" if c?? Robot p?? at "local2" "local3" then "hurtrobot" if c?? PushableRobot p?? at "local2" "local3" then "hurtrobot" if player at "local2" "local3" "hurtpl" goto "#return" : "dragon_hurt" dec "bpr&local2&,&local3&" by "(0x20)" goto "#return" : "boom" goto "#cleanup" put c?? Explosion p40 at "local2" "local3" goto "#return" : "boom_mine" set "local16" to "bpr('local2'),('local3')" goto "#cleanup" put c?? Explosion "('local16'a0xF0)" at "local2" "local3" goto "#return" : "hurtpl" dec "health" by "EXPLOSION_DAMAGE" sfx 21 goto "#return" : "hurtrobot" send at "local2" "local3" to "bombed" goto "#return"
It's not perfect. It's a weird mishmash of ZZT and MZX explosion behaviour, but it looks generally right. It doesn't sound quite right- I just lifted the SFX used from Gemini's Town of ZZT, but the tick tock isn't quite percussive enough.

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#4
Posted 09 January 2014 - 04:13 AM
edit: WARNING:this code is a bull s***
As far as the features in Lancer's implementation go, I think the board access counters are the only stuff that has been added since the port. With minor reworking his thing would probably work in at least the Exo DOS versions. You'd be cutting a lot of corners to get it into 2.51 though...
This post has been edited by Lachesis: 09 January 2014 - 04:23 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#5
Posted 09 January 2014 - 06:06 AM
Also, uses 4 + (2 * number of exploding bombs currently in queue) counters. (I accidentally used LOCAL instead of LOOPCOUNT in one of the robots or it would use one less. oh well)
EDIT: uploaded a new one that's a little more comprehensive in the things it does and doesn't blow up, has some test stuff on the board, and uses a bit less robot memory (there's now ~25% available instead of ~11%). Same link... edit the green 'W' robot at the bottom to change the rules on what explodes and what doesn't :3
This post has been edited by Lachesis: 09 January 2014 - 07:13 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#6
Posted 13 January 2014 - 09:39 AM

#7
Posted 14 January 2014 - 02:03 AM
It will send the label bombed to the area of explosion. It will also destroy breakaways/custom breakaways and kill gems/magic gems (I believe bombs used to kill gems in ZZT). Also if you remember in ZZT the appearing explosions were shoot-able because they were themselves randomly colored breakaways. This is also the case in this example.
- Might want to change the sound effects for Tick and Tock.
- Keep in mind too that these won't work against built-in enemies.
set "commands" to "(-1>>1)" end : "touch" * "Bomb activated!" play "tcf+cf+c" zap "touch" 1 loop start char "(57-'loopcount')" play "z2c" wait for 10 loop for 8 char '' set "exp_rad0" to 7 set "exp_rad1" to 6 set "exp_rad2" to 6 set "exp_rad3" to 5 set "exp_rad4" to 4 set "local" to -4 : "exp_loop" loop start set "local2" to "('exp_rad('abs&local&')'-'loopcount')" send at "('thisx'+'local2')" "('thisy'+'local')" to "bombed" if player at "('thisx'+'local2')" "('thisy'+'local')" "#hurt_player" if c?? Breakaway p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? Gem p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? MagicGem p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? CustomBreak p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? Space p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? Floor p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? Carpet p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? Fake p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" if c?? CustomFloor p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion" : "continue" loop for "('exp_rad('abs&local&')'*2)" inc "local" by 1 if "local" <= 4 then "exp_loop" wait for 3 set "local" to -4 : "clear_loop" loop start set "local2" to "('exp_rad('abs&local&')'-'loopcount')" if c?? Breakaway p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#clear_explosion" loop for "('exp_rad('abs&local&')'*2)" inc "local" by 1 if "local" <= 4 then "clear_loop" play "t+++c-c-c-c-c-c" die : "#place_explosion" set "local3" to random 4 to 15 put "local3" Breakaway p00 at "('thisx'+'local2')" "('thisy'+'local')" goto "#return" : "#clear_explosion" put c07 Space p00 at "('thisx'+'local2')" "('thisy'+'local')" goto "#return" : "#hurt_player" take 10 HEALTHS goto "#return"
Attached File(s)
-
ZZT_Bomb.mzx (10.71K)
Number of downloads: 1
This post has been edited by T-Bone: 14 January 2014 - 02:23 AM
#8
Posted 14 January 2014 - 04:03 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository