obj
Overhead
icon='Overhead.dmi'
icon_state=""//hmmif
density=0
layer=10
Click()
if(src.icon_state=="")
world<<"ITS ICON STATE IS BLANK"
switch(alert("What do you wish to turn this into?","","Machine Gun - 100","Grenader - 200"))
if("Machine Gun")
if(gold>=100)
gold-=100
src.icon_state="Machine Gun"
src.model=1
Check()
else
world<<"Not enough gold!"
if("Grenader")
if(gold>=200)
gold-=200
src.icon_state="Grenader"
src.model=1
Check()
else
world<<"Not enough gold!"
return
if(src.icon_state=="Machine Gun")
if(src.model==10)
world<<"This has no more upgrades!"
return
var/cost = model*100
switch(alert("Do you wish to upgrade this Machine Gun v[src.model] for [cost]?","","Yes","No"))
if("Yes")
if(gold>=cost)
src.model+=1
gold-=cost
else
world<<"Not enough gold!"
return
if(src.icon_state=="Grenader")
if(src.model==10)
world<<"This has no more upgrades!"
return
var/cost = model*100
switch(alert("Do you wish to upgrade this Grenader v[src.model] for [cost]?","","Yes","No"))
if("Yes")
if(gold>=cost)
src.model+=1
gold-=cost
else
world<<"Not enough gold!"
return
proc/Check()
for(var/mob/Enemies/M in view(7+src.model))
flick("[src.icon_state] Attack",src)
if(src.icon_state=="Machine Gun")
M.overlays+='Neon Blood.dmi'
M.health-=src.model+2
if(M.health<=0)
gold+=5
sleep(30-src.model*2)
Check()
return
if(src.icon_state=="Grenader")
M.overlays+='Neon Blood.dmi'
M.health-=src.model+3
if(M.health<=0)
gold+=5
sleep(40-src.model*2)
Check()
return
Problem description:
OK see where I put world<<"ITS ICON STATE IS BLANK"? Well that doesn't show, WHEN IT SHOULD =( is there something I'm not seeing or could this be a software bug?
if(!src.icon_state)