I want a missile that a person fires and it can do damage, and sometimes kill, I used this code:
obj
Kamehameha
verb
Kamehameha(mob/characters/M in oview(6))
set name = "Kame Hame Ha"
set category = "Fighting"
if(M.npp == 1||M.npc == 1||M.npp == null)
usr << "You cannot attack them. They are a newbie."
if(M.npp == 0)
if(usr.kame == 1)
usr << "You are currently using Kame Hame Ha."
if(usr.kame == 0)
if(usr.move == 0)
usr << "You cant now."
if(usr.move == 1)
amount = 2000
if(amount <= 0)
view(6) << "[usr] dies from putting too much energy in his Kame Hame Ha wave."
usr.powerlevel = 0
usr.Die()
if(amount >= 1)
if(amount > usr.powerlevel)
usr.kame = 1
view(6) << "[usr]: Kaaaa....."
sleep(30)
view(6) << "[usr]: Meeee....."
sleep(30)
usr.overlays += /obj/kame
view(6) << "[usr]: Haaaa....."
sleep(30)
view(6) << "[usr]: Meeee....."
sleep(30)
view(6) << "[usr]: HAAAA!!!!!"
view(6) << "From putting too much energy in the Kame Hame Ha wave, [usr] explodes!"
usr.overlays -= /obj/kame
usr.powerlevel = 0
usr.kame = 0
usr.overlays -= /obj/kame
usr.Die()
if(amount <= usr.powerlevel)
usr.kame = 1
view(6) << "[usr]: Kaaaa....."
sleep(30)
view(6) << "[usr]: Meeee....."
sleep(30)
usr.overlays += /obj/kame
view(6) << "[usr]: Haaaa....."
sleep(30)
view(6) << "[usr]: Meeee....."
sleep(30)
view(6) << "[usr]: HAAAA!!!!!"
usr.overlays -= /obj/kame
if(M.z == usr.z)
usr.overlays -= /obj/kame
s_missile('kame.dmi', usr, M)
usr.kame = 0
usr.powerlevel -= amount
amount = amount * usr.Str / M.Def
if(M.absorb == 1)
view(6) << "[M] absorbs [usr]'s Kame Hame ha!"
M.powerlevel += amount
if(M.absorb == 0)
M.powerlevel -= amount
view(6) << "[usr] shoots a Kame Hame Ha at [M]!!!"
M.Die()
usr.KO()
else
usr << "You launch your Kame Hame Ha, but [M] is out of sight."
usr.overlays -= /obj/kame
usr.kame = 0
This hurts, and can kill Players, but has NO effect on NPC's.
Can anyone help?
ID:175364
May 2 2003, 7:03 am
|
|
obj
Kamehameha verb Kamehameha(mob/characters/M in oview(6)) set name = "Kame Hame Ha" set category = "Fighting" if(M.npp == 1||M.npc == 1||M.npp == null) usr << "You cannot attack them. They are a newbie." if(M.npp == 0) if(usr.kame == 1) usr << "You are currently using Kame Hame Ha." if(usr.kame == 0) if(usr.move == 0) usr << "You cant now." if(usr.move == 1) amount = 2000 if(amount <= 0) view(6) << "[usr] dies from putting too much energy in his Kame Hame Ha wave." usr.powerlevel = 0 usr.Die() if(amount >= 1) if(amount > usr.powerlevel) usr.kame = 1 view(6) << "usr]:Kaaaa....." sleep(30) view(6) << "[usr]:Meeee....." sleep(30) usr.overlays += /obj/kame view(6) << "[usr]:Haaaa....." sleep(30) view(6) << "[usr]:Meeee....." sleep(30) view(6) << "[usr]:HAAAA!!!!!" view(6) << "From putting too much energy in the Kame Hame Ha wave, [usr] explodes!" usr.overlays -= /obj/kame usr.powerlevel = 0 usr.kame = 0 usr.overlays -= /obj/kame usr.Die() if(amount <= usr.powerlevel) usr.kame = 1 view(6) << "usr]:Kaaaa....." sleep(30) view(6) << "[usr]:Meeee....." sleep(30) usr.overlays += /obj/kame view(6) << "[usr]:Haaaa....." sleep(30) view(6) << "[usr]:Meeee....." sleep(30) view(6) << "[usr]:HAAAA!!!!!" usr.overlays -= /obj/kame if(M.z == usr.z) usr.overlays -= /obj/kame s_missile('kame.dmi', usr, M) usr.kame = 0 usr.powerlevel -= amount amount = amount * usr.Str / M.Def if(M.absorb == 1) view(6) << "[M] absorbs [usr]'s Kame Hame ha!" M.powerlevel += amount if(M.absorb == 0) M.powerlevel -= amount view(6) << "[usr] shoots a Kame Hame Ha at [M]!!!" M.Die() usr.KO() else usr << "You launch your Kame Hame Ha, but [M] is out of sight." usr.overlays -= /obj/kame usr.kame = 0 |
In response to Airjoe
|
|
PLeae help???
|
In response to Gokuss4neo
|
|
hmm....
if(usr.move == 1) amount = 2000 if(amount <= 0) //do stuff if(amount >= 1) //do other stuff that bit of code is a bit odd, why set amount to 2000 and then check to see if its less than zero then over zero? if(M.z == usr.z) this line is also confusing to me, why are you checking the z level of the player and target if you have already determined that M is in view of usr? You may just want to check if M is still in oview(usr) but, what part exactly isn't working as inteneded? -Salarn |
Some guy who dosn't always use a sig,
Ċirjoe