Code: include, plotscr.hsd
include, scancode.hsi
#-------------------------------------------------------------------------
global variable, begin
2, herd
3, herx
4, hery
5, exh
6, hsx
7, hsy
8, hsd
9, weapon
10, animate
11, invinc
12, powerup
13, btime
14,pipe
15,npc
16,gun
17,shotgun
18,cocktail
19,firetime
20,spawntime
21,fueltime
22,flamer
end
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
plotscript, new game, begin
initialize
end
#-------------------------------------------------------------------------
plotscript, initialize, begin
suspend obstruction
weapon:=1
do game
end
#---------------------------------V LOOP V----------------------------------
#---------------------------------V LOOP V----------------------------------
#---------------------------------V LOOP V----------------------------------
#---------------------------------V LOOP V----------------------------------
#---------------------------------V LOOP V----------------------------------
#---------------------------------V LOOP V----------------------------------
plotscript, do game, begin
variable (playing)
playing := true
#---------- Let's do The Loop!------------------
while (playing) do (
#-----item get----
variable (la,hx,hy,xnpc)
hx:=hero pixel X(0)
hy:=hero pixel Y(0)
for(la, 0, 5, 1) do, begin
xNPC:=NPC at pixel(hx,hy,la)
if (get NPC ID (xnpc)==13) then (get item (2),destroy npc (xNPC),play sound (7,false,false))
if (get NPC ID (xnpc)==16) then (get item (15),destroy npc (xNPC),play sound (7,false,false))
if (get NPC ID (xnpc)==17) then (
set hero stat (0,0,Get hero stat (0,0)+1)
destroy npc (xNPC),play sound (7,false,false)
)
if (get NPC ID (xnpc)==18) then (get item (16),destroy npc (xNPC),play sound (7,false,false))
end
#-----------------
#---V weapon V----
if (key is pressed(key:z),and,check tag (5),and,pipe==0) then (pipe:=7)
if (key is pressed(key:z),and,check tag (6),and,gun==0) then (if (inventory(15)>>0) then(gun:=7)
else( play sound( 3,false,false ) ) )
if (key is pressed(key:z),and,check tag (7),and,shotgun==0) then (if (inventory(16)>>0) then(shotgun:=4)
else( play sound( 3,false,false ) ) )
if (key is pressed(key:x),and,check tag (8),and,cocktail==0) then (if (inventory(7)+1>>0) then(cocktail:=5) )
if (key is pressed(key:z),and,check tag (9)) then (if (inventory(17)>>0) then (flamer:=4)
else( play sound( 3,false,false ) ) )
if (pipe>>0) then (pipeattack)
if (gun>>0) then (gunattack)
if (shotgun>>0) then (shotgunattack)
if (Cocktail>>0) then (Cocktailattack)
if (flamer>>0) then (flameattack,decrement(flamer) )
#---^ weapon ^----
#---------------------HUD-------------
$0=""
$1=""
$2=""
$3=""
variable (f)
f:=50
while (f>>0) do, begin
if (f>>0) then (append ascii(0, 255),append ascii(1, 255),append ascii(2, 255),append ascii(3, 255),f:=(f--1))
end
show string at(0, 0, 170)
show string at(1, 0, 180)
show string at(2, 0, 190)
string color (0, 0)
string color (1, 0)
string color (2, 0)
$10="LIFE :"
variable(g)
g:=get hero stat (0,0)
while (g>>0) do, begin
if (g>>0) then (append ascii(10, 255),g:=(g--1))
end
show string at(10, 0, 170)
$12="AMMO :"
if (check tag (5)) then (append ascii(12, 254))
if (check tag (6)) then (
g:=inventory(15)
while (g>>0) do, begin
if (g>>0) then (append ascii(12, 253),g:=(g--1))
end
)
if (check tag (7)) then (
g:=inventory(16)
while (g>>0) do, begin
if (g>>0) then (append ascii(12, 252),g:=(g--1))
end
)
if (check tag (9)) then (
g:=inventory(17)
while (g>>0) do, begin
if (g>>0) then (append ascii(12, 249),g:=(g--1))
end
)
show string at(12, 0, 180)
$13="NADES:"
if (check tag (8)) then (
g:=inventory(7)
while (g>>0) do, begin
if (g>>0) then (append ascii(13, 250),g:=(g--1))
end
)
show string at(13, 0, 190)
#----------------end HUD--------------
#-------------------spawn----------------
variable (s,r,n)
increment(spawntime)
for (s,0,NPC copy count (4)--1,1) do,begin
n:=npc reference (4,s)
if (spawntime>>600) then (
r:=random(1,15)
if (r<<6) then ( create npc( 9,NPC X (n),NPC y (n)+1 ) )
if (r==6,or,r==7,or,r==8) then ( create npc( 8,NPC X (n),NPC y (n)+1 ) )
if (r==9,or,r==10,or, r==11) then ( create npc( 1,NPC X (n),NPC y (n)+1 ) )
if (r==12,or,r==13,or, r==14) then ( create npc( 2,NPC X (n),NPC y (n)+1 ) )
if (r==15) then ( create npc( 7,NPC X (n),NPC y (n)--1 ) )
r:=random(1,16)
if (r<<6) then ( create npc( 9,NPC X (n),NPC y (n)+1 ) )
if (r==6,or,r==7,or,r==8) then ( create npc( 8,NPC X (n),NPC y (n)+1 ) )
if (r==9,or,r==10,or, r==11) then ( create npc( 1,NPC X (n),NPC y (n)+1 ) )
if (r==12,or,r==13,or, r==14) then ( create npc( 2,NPC X (n),NPC y (n)+1 ) )
if (r==15) then ( create npc( 7,NPC X (n),NPC y (n)+1 ) )
r:=random(1,16)
if (r<<6) then ( create npc( 9,NPC X (n),NPC y (n)+1 ) )
if (r==6,or,r==7,or,r==8) then ( create npc( 8,NPC X (n),NPC y (n)+1 ) )
if (r==9,or,r==10,or, r==11) then ( create npc( 1,NPC X (n),NPC y (n)+1 ) )
if (r==12,or,r==13,or, r==14) then ( create npc( 2,NPC X (n),NPC y (n)+1 ) )
if (r==15) then ( create npc( 7,NPC X (n)--1,NPC y (n) ) )
r:=random(1,16)
if (r<<6>>600) then (spawntime:=0)
#----------------end spawn--------------
#------V hurt------
if (invinc>>0) then,begin
decrement (invinc)
set hero palette (me,0)
end
else (set hero palette (me,2))
if (Get hero stat (0,0)<<1>>100) then ( destroy npc(i),set NPC extra ( i,1,0 ) )
end
#^^fireburning^^
destroy npc (19),destroy npc (19),destroy npc (19)
destroy npc (6),destroy npc (6),destroy npc (6)
destroy npc (10)
if (shotgun==0) then ,begin
destroy npc (11),destroy npc (11),destroy npc (11)
destroy npc (11),destroy npc (11),destroy npc (11)
end
if (gun==0) then (set hero picture (0,0))
#fire kill
variable(fire,bx,by,t,h,nade)
for(h, 0, 200, 1) do, begin
set variable(fire,NPC reference(14,h))
bx:=NPC pixel X(fire)
by:=NPC pixel Y(fire)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
end
#fire kill end
#----endCleanup
)
end
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
#----------------^loop^------------------------------------------------
script, pipeattack, begin
decrement (pipe)
if (pipe<<6>>3) then (
set hero picture (0,8)
set hero frame (0,0)
play sound (0,false,false)
)
if (pipe<<4>>1) then (
set hero picture (0,8)
set hero frame (0,1)
play sound (0,false,false)
)
if (pipe==1) then , begin
variable (t)
hsx:=hero pixel x (me)
hsy:=hero pixel y (me)
hsd:=hero direction(me)
if (hsd==south) then (hsx:=hsx+10,hsy:=hsy+30)
if (hsd==north) then (hsx:=hsx+10,hsy:=hsy--10)
if (hsd==east) then (hsx:=hsx+30,hsy:=hsy+10)
if (hsd==west) then (hsx:=hsx--10,hsy:=hsy+10)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(hsx,hsy,t)
killndrop
end
set hero picture (0,0)
end
end
#-----------------------------------------------------------------
plotscript,hurt,begin
if (invinc==0) then,begin
play sound (2,false,false)
invinc := 10
set hero stat (0,0,get hero stat (0,0)--1)
end
end
#-----------------------------------------------------------------
script, shotgunattack, begin
variable(shot1,shot2,shot3,shot4,shot5,shot6)
decrement (shotgun)
if (shotgun==3) then (
delete item (16)
set hero picture (0,6)
set hero frame (0,0)
)
if (shotgun==2) then (
set hero picture (0,6)
set hero frame (0,1)
play sound (4,false,false)
create NPC(11,herox (me),heroy (me)), create NPC(11,herox (me),heroy (me)), create NPC(11,herox (me),heroy (me))
create NPC(11,herox (me),heroy (me)), create NPC(11,herox (me),heroy (me)), create NPC(11,herox (me),heroy (me))
shot1:=npc reference (11,0)
shot2:=npc reference (11,1)
shot3:=npc reference (11,2)
shot4:=npc reference (11,3)
shot5:=npc reference (11,4)
shot6:=npc reference (11,5)
hsx:=hero pixel x (me)
hsy:=hero pixel y (me)
hsd:=hero direction(me)
if (hsd==north) then(
put NPC(shot1,hsx--10,hsy--25),put NPC(shot2,hsx,hsy--30),put NPC(shot3,hsx+10,hsy--25)
put NPC(shot4,hsx--10,hsy--20),put NPC(shot5,hsx,hsy--15),put NPC(shot6,hsx+10,hsy--20)
)
if (hsd==east) then(
put NPC(shot1,hsx+25,hsy--10),put NPC(shot2,hsx+30,hsy),put NPC(shot3,hsx+25,hsy+10)
put NPC(shot4,hsx+20,hsy--10),put NPC(shot5,hsx+15,hsy),put NPC(shot6,hsx+20,hsy+10)
)
if (hsd==south) then(
put NPC(shot1,hsx--10,hsy+25),put NPC(shot2,hsx,hsy+30),put NPC(shot3,hsx+10,hsy+25)
put NPC(shot4,hsx--10,hsy+20),put NPC(shot5,hsx,hsy+15),put NPC(shot6,hsx+10,hsy+20)
)
if (hsd==west) then(
put NPC(shot1,hsx--25,hsy--10),put NPC(shot2,hsx--30,hsy),put NPC(shot3,hsx--25,hsy+10)
put NPC(shot4,hsx--20,hsy--10),put NPC(shot5,hsx--15,hsy),put NPC(shot6,hsx--20,hsy+10)
)
)
if (shotgun==1) then (
set hero picture (0,0)
play sound (4,false,false)
shot1:=npc reference (11,0)
shot2:=npc reference (11,1)
shot3:=npc reference (11,2)
shot4:=npc reference (11,3)
shot5:=npc reference (11,4)
shot6:=npc reference (11,5)
if (hsd==north) then(
put NPC(shot1,hsx--20,hsy--40),put NPC(shot2,hsx,hsy--50),put NPC(shot3,hsx+20,hsy--40)
put NPC(shot4,hsx--20,hsy--25),put NPC(shot5,hsx,hsy--25),put NPC(shot6,hsx+20,hsy--25)
)
if (hsd==east) then(
put NPC(shot1,hsx+40,hsy--20),put NPC(shot2,hsx+50,hsy),put NPC(shot3,hsx+40,hsy+20)
put NPC(shot4,hsx+25,hsy--20),put NPC(shot5,hsx+25,hsy),put NPC(shot6,hsx+25,hsy+20)
)
if (hsd==south) then(
put NPC(shot1,hsx--20,hsy+40),put NPC(shot2,hsx,hsy+50),put NPC(shot3,hsx+20,hsy+40)
put NPC(shot4,hsx--20,hsy+25),put NPC(shot5,hsx,hsy+25),put NPC(shot6,hsx+20,hsy+25)
)
if (hsd==west) then(
put NPC(shot1,hsx--40,hsy--20),put NPC(shot2,hsx--50,hsy),put NPC(shot3,hsx--40,hsy+20)
put NPC(shot4,hsx--25,hsy--20),put NPC(shot5,hsx--25,hsy),put NPC(shot6,hsx--25,hsy+20)
)
)
variable(bullet,bx,by,t,f)
for(f, 0, 6, 1) do, begin
set variable(bullet,NPC reference(11,f))
bx:=NPC pixel X(bullet)
by:=NPC pixel Y(bullet)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
end
end
#-----------------------------------------------------------------
script, gunattack, begin
decrement (gun)
if (gun==5) then (
delete item (15)
set hero picture (0,6)
set hero frame (0,0)
)
if (gun==4) then (
set hero picture (0,6)
set hero frame (0,1)
play sound (4,false,false)
create NPC(10,herox (me),heroy (me))
hsx:=hero pixel x (me)
hsy:=hero pixel y (me)
hsd:=hero direction(me)
if (hsd==north) then(
put NPC(10,hsx,hsy--20))
if (hsd==east) then(
put NPC(10,hsx+20,hsy))
if (hsd==south) then(
put NPC(10,hsx,hsy+20))
if (hsd==west) then(
put NPC(10,hsx--20,hsy))
set NPC direction (10,hsd)
)
if (gun==3) then (
set hero picture (0,6)
set hero frame (0,0)
create NPC(10,herox (me),heroy (me))
if (hsd==north) then(
put NPC(10,hsx,hsy--40))
if (hsd==east) then(
put NPC(10,hsx+40,hsy))
if (hsd==south) then(
put NPC(10,hsx,hsy+40))
if (hsd==west) then(
put NPC(10,hsx--40,hsy))
set NPC direction (10,hsd)
)
if (gun==2) then (
set hero picture (0,0)
create NPC(10,herox (me),heroy (me))
if (hsd==north) then(
put NPC(10,hsx,hsy--60))
if (hsd==east) then(
put NPC(10,hsx+60,hsy))
if (hsd==south) then(
put NPC(10,hsx,hsy+60))
if (hsd==west) then(
put NPC(10,hsx--60,hsy))
set NPC direction (10,hsd)
)
if (gun==1) then (
create NPC(10,herox (me),heroy (me))
if (hsd==north) then(
put NPC(10,hsx,hsy--80))
if (hsd==east) then(
put NPC(10,hsx+80,hsy))
if (hsd==south) then(
put NPC(10,hsx,hsy+80))
if (hsd==west) then(
put NPC(10,hsx--80,hsy))
set NPC direction (10,hsd)
)
if (gun==0) then (
create NPC(10,herox (me),heroy (me))
if (hsd==north) then(
put NPC(10,hsx,hsy--100))
if (hsd==east) then(
put NPC(10,hsx+100,hsy))
if (hsd==south) then(
put NPC(10,hsx,hsy+100))
if (hsd==west) then(
put NPC(10,hsx--100,hsy))
set NPC direction (10,hsd)
)
variable(bullet,bx,by,t)
set variable(bullet,NPC reference(10,0))
bx:=NPC pixel X(bullet)
by:=NPC pixel Y(bullet)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
end
#-----------------------------------------------------------------
script, cocktailattack, begin
variable(fire,bx,by,t,h,nade)
variable(fire1,fire2,fire3,fire4,fire5,fire6,fire7,fire8,fire9)
decrement (cocktail)
if (cocktail==4) then (
if (inventory(7)==0) then (unequip (me,2))
delete item (7)
play sound (5,false,false)
create NPC(15,herox (me),heroy (me))
hsx:=hero pixel x (me)
hsy:=hero pixel y (me)
hsd:=hero direction(me)
if (hsd==north) then(
put NPC(15,hsx,hsy--20))
if (hsd==east) then(
put NPC(15,hsx+20,hsy))
if (hsd==south) then(
put NPC(15,hsx,hsy+20))
if (hsd==west) then(
put NPC(15,hsx--20,hsy))
set NPC direction (15,hsd)
)
if (cocktail==3) then (
if (hsd==north) then(
put NPC(15,hsx,hsy--40))
if (hsd==east) then(
put NPC(15,hsx+40,hsy))
if (hsd==south) then(
put NPC(15,hsx,hsy+40))
if (hsd==west) then(
put NPC(15,hsx--40,hsy))
set NPC direction (15,hsd)
)
if (cocktail==2) then (
if (hsd==north) then(
put NPC(15,hsx,hsy--60))
if (hsd==east) then(
put NPC(15,hsx+60,hsy))
if (hsd==south) then(
put NPC(15,hsx,hsy+60))
if (hsd==west) then(
put NPC(15,hsx--60,hsy))
set NPC direction (15,hsd)
)
if (cocktail==1) then (
if (hsd==north) then(
put NPC(15,hsx,hsy--80))
if (hsd==east) then(
put NPC(15,hsx+80,hsy))
if (hsd==south) then(
put NPC(15,hsx,hsy+80))
if (hsd==west) then(
put NPC(15,hsx--80,hsy))
set NPC direction (15,hsd)
)
set variable(nade,NPC reference(15,0))
if (check NPC wall (nade, hsd)) then (cocktail:=0)
if (cocktail==0) then (
play sound (6,false,false)
set variable(nade,NPC reference(15,0))
create NPC(14,npcx(nade),npcy(nade)), create NPC(14,npcx(nade),npcy(nade)), create NPC(14,npcx(nade),npcy(nade))
create NPC(14,npcx(nade),npcy(nade)), create NPC(14,npcx(nade),npcy(nade)), create NPC(14,npcx(nade),npcy(nade))
create NPC(14,npcx(nade),npcy(nade)), create NPC(14,npcx(nade),npcy(nade)), create NPC(14,npcx(nade),npcy(nade))
set variable(fire1,NPC reference(14,0)), set variable(fire2,NPC reference(14,1)), set variable(fire3,NPC reference(14,2))
set variable(fire4,NPC reference(14,3)), set variable(fire5,NPC reference(14,4)), set variable(fire6,NPC reference(14,5))
set variable(fire7,NPC reference(14,6)), set variable(fire8,NPC reference(14,7)), set variable(fire9,NPC reference(14,8))
put NPC(fire1,NPCpixelX(nade),NPCpixely(nade)),put NPC(fire2,NPCpixelX(nade)--20,NPCpixely(nade)--20)
put NPC(fire3,NPCpixelX(nade),NPCpixely(nade)--20),put NPC(fire4,NPCpixelX(nade)+20,NPCpixely(nade)--20)
put NPC(fire5,NPCpixelX(nade)+20,NPCpixely(nade)),put NPC(fire6,NPCpixelX(nade)+20,NPCpixely(nade)+20)
put NPC(fire7,NPCpixelX(nade),NPCpixely(nade)+20),put NPC(fire8,NPCpixelX(nade)--20,NPCpixely(nade)+20)
put NPC(fire9,NPCpixelX(nade)--20,NPCpixely(nade))
destroy npc (15)
)
for(h, 0, 9, 1) do, begin
set variable(fire,NPC reference(14,h))
bx:=NPC pixel X(fire)
by:=NPC pixel Y(fire)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
end
end
#---------------------------------------------------------------------
#---------------------------------------------------------------------
#---------------------------------------------------------------------
#---------------------------------------------------------------------
#-------------------------------------------------------------
script,killndrop,begin
variable (Q)
if (get NPC ID (npc)==1) then ,begin
change npc id(npc,17)
play sound (1,false,false),gun:=0
end
if (get NPC ID (npc)==2) then ,begin
Q:=random(1,10)
if (q<<5>>5) then (change npc id(npc,18))
play sound (1,false,false),gun:=0
end
if (get NPC ID (npc)==7) then ,begin
Q:=random(1,5)
if (q>>3) then (change npc id(npc,6))
if (q==1) then (change npc id(npc,16))
if (q==2) then (change npc id(npc,17))
if (q==3) then (change npc id(npc,18))
play sound (1,false,false),gun:=0
end
if (get NPC ID (npc)==8) then ,begin
Q:=random(1,15)
if (q>>3) then (change npc id(npc,6))
if (q==1) then (change npc id(npc,16))
if (q==2) then (change npc id(npc,17))
if (q==3) then (change npc id(npc,18))
play sound (1,false,false),gun:=0
end
if (get NPC ID (npc)==9) then ,begin
Q:=random(1,10)
if (q>>3) then (change npc id(npc,6))
if (q==1) then (change npc id(npc,16))
if (q==2) then (change npc id(npc,17))
if (q==3) then (change npc id(npc,18))
play sound (1,false,false),gun:=0
end
#if (get NPC ID (npc)==1) then (change NPC ID (NPC,6),play sound (1,false,false))
#if (get NPC ID (npc)==2) then (change NPC ID (NPC,6),play sound (1,false,false))
#if (get NPC ID (npc)==7) then (change NPC ID (NPC,6),play sound (1,false,false))
#if (get NPC ID (npc)==8) then (change NPC ID (NPC,6),play sound (1,false,false))
#if (get NPC ID (npc)==9) then (change NPC ID (NPC,6),play sound (1,false,false))
end
#---------------------------------------------------------------------
#---------------------------------------------------------------------
#---------------------------------------------------------------------
script, flameattack, begin
variable(flame1,flame2,flame3,r)
increment (fueltime)
if (fueltime>>15) then ( delete item(17), FUELTIME:=0 )
if (flamer>>2) then ,begin
set hero picture (0,6)
set hero frame (0,1)
play sound (8,false,false)
create NPC(19,herox (me),heroy (me)),create NPC(19,herox (me),heroy (me)),create NPC(19,herox (me),heroy (me))
hsx:=hero pixel x (me)
hsy:=hero pixel y (me)
hsd:=hero direction(me)
FLAME1:=npc reference (19,0)
flame2:=npc reference (19,1)
flame3:=npc reference (19,2)
if (hsd==north) then(
put NPC(flame1,hsx,hsy--20),put NPC(flame2,hsx,hsy--40),put NPC(flame3,hsx,hsy--60)
)
if (hsd==east) then(
put NPC(flame1,hsx+20,hsy),put NPC(flame2,hsx+40,hsy),put NPC(flame3,hsx+60,hsy)
)
if (hsd==south) then(
put NPC(flame1,hsx,hsy+20),put NPC(flame2,hsx,hsy+40),put NPC(flame3,hsx,hsy+60)
)
if (hsd==west) then(
put NPC(flame1,hsx--20,hsy),put NPC(flame2,hsx--40,hsy),put NPC(flame3,hsx--60,hsy)
)
set NPC direction (flame1,hsd),set NPC direction (flame2,hsd),set NPC direction (flame3,hsd)
r:=random(0,1)
set NPC frame (flame1,r)
r:=random(0,1)
set NPC frame (flame2,r)
r:=random(0,1)
set NPC frame (flame3,r)
end
if (flamer<<2) then (
set hero picture (0,0)
)
variable(bx,by,t)
bx:=NPC pixel X(flame1)
by:=NPC pixel Y(flame1)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
bx:=NPC pixel X(flame2)
by:=NPC pixel Y(flame2)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
bx:=NPC pixel X(flame3)
by:=NPC pixel Y(flame3)
for(t, 0, 5, 1) do, begin
NPC:=NPC at pixel(bx,by,t)
killndrop
end
end