ID:1275739
 
(See the best response by Albro1.)
Code:
mob/var
learn_Saiyan_Kamehameha = 0

mob/learn/
verb
Saiyan_Kamehameha()
set category = "Techniques"

if(usr.doing)
src << "You are already doing something!"
return

if(src.monkey)
usr << "You cannot use this skill at the moment."
return

if(src.wrapped)
src << "Your ki has been contained in the goo!"
return

if(usr.buku)
return

if(src.safe)
src << "You are currently safe and cannot attack."
return

if(usr.dead)
return

if(usr.ki_lock)
src << "Cannot use this Technique at his time"
return

if(!usr.pk)
usr << "You are not a Combatant!"
return

for(var/turf/Floors/Safe_Zone/S in view(6))
if(S in view(8))
usr << "They are in a Safe Zone!"
return
for(var/turf/Planet_Gravitys/Supreme_Kai/A in view(6))
if(A in view(8))
usr << "They are in a Safe Zone!"
return

for(var/turf/Planet_Gravitys/King_Kai/D in view(6))
if(D in view(8))
usr << "They are in a Safe Zone!"
return


Saiyan_Kamehameha_Shoot()
src.afk_time = 0





mob
proc
Saiyan_Kamehameha_Shoot()
var/ki_cost = round(src.ki_max * 17.59)
if(src.ki >= ki_cost)
if(!src.doing)
src.ki_lock = 1
spawn(20) src.ki_lock = 0
src.doing = 1
src.ki -= ki_cost
src.overlays += new /obj/Overlays/SaiyanKame/Trunks
src.overlays += new /obj/Overlays/SaiyanKame/Gohan
src.overlays += new /obj/Overlays/SaiyanKame/Goten
view(6) << "<font color = yellow>[src]:</font> Trunks! Gohan! Goten! Lets do this!"
sleep(10)
view(6) << "<font color = yellow>[src]:</font> Gohan: I'll Lend You My Power! <br> Trunks: Take some of mine too! <br> Goten: I'll give you a LITTLE bit!"
sleep(1)
view(6) << "<font color = yellow>[src]:</font> TAKE THIS!!!!"
sleep(1)
view(6) << "<font color = yellow>[src]:</font> <font size=4><font color=yellow>SAIYAN!!!!</font>"
sleep(3)
view(6) << "<font color = yellow>[src]:</font> KAMEHAMEHA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
usr.icon_state = "attack"
sleep(6)
usr.icon_state = ""
spawn(5) src.doing = 0
spawn(5) src.frozen = 0
src.overlays -= new /obj/Overlays/SaiyanKame/Trunks
src.overlays -= new /obj/Overlays/SaiyanKame/Gohan
src.overlays -= new /obj/Overlays/SaiyanKame/Goten
spawn()usr.SNorth()
spawn()usr.SSouth()
spawn()usr.SEast()
spawn()usr.SWest()

mob
proc
SNorth
set background=1
var/ki_damage = round(usr.powerlevel * 70.75)
var/ki_cost = round(src.ki_max * 17.59)
var/obj/H = new/obj/Saiyan_Kamehameha
var/obj/O = new/obj/SK_trail
H.dir = NORTH
H.loc = usr.loc
while(H)
O.loc=H.loc
O.dir=H.dir
spawn(40)
del O
step(H,H.dir)
if(!H)break
var/turf/T = H.loc
if(T.density)
del(H)
break
for(var/mob/M as mob in T)
var/absorb_max = round(M.powerlevel_max)
var/ki_absorbed = round(M.ki_shield_strength - ki_damage)
if(!M.dead && !M.safe && M.pk)
if(M.ki_shield)
if(ki_absorbed >= 1)
src << "<font color = #00C3ED>[M]'s Ki Shield Absorbs the attacks damage!"
M << "<font color = #00C3ED>Your Ki Shield Absorbs [src]'s Attack!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
M << "\red [src]'s SK slams into you!"
src <<"\red Your SK slams into [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
if(M.absorbing)
if(absorb_max > ki_damage)
M << "\red [src]'s attacks hits you, but you Absorb the energy!"
src <<"\red Your SK is Absorbed by [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.ki += ki_damage
src.doing = 0
src.frozen = 0
return
else
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_damage)
M << "\red You try to absorb [src]'s SK, but it is too strong!"
src <<"\red Your SK slams into [M]!"
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return

M << "\red [src.name]'s SK slams into you"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= ki_damage
M.BigKiDeathCheck(src)
del(H)
sleep(1)
mob
proc
SSouth
set background=1
var/ki_damage = round(usr.powerlevel * 70.75)
var/ki_cost = round(src.ki_max * 17.59)
var/obj/H = new/obj/Saiyan_Kamehameha
var/obj/O = new/obj/SK_trail
H.dir = SOUTH
H.loc = usr.loc
while(H)
O.loc=H.loc
O.dir=H.dir
spawn(40)
del O
step(H,H.dir)
if(!H)break
var/turf/T = H.loc
if(T.density)
del(H)
break
for(var/mob/M as mob in T)
var/absorb_max = round(M.powerlevel_max)
var/ki_absorbed = round(M.ki_shield_strength - ki_damage)
if(!M.dead && !M.safe && M.pk)
if(M.ki_shield)
if(ki_absorbed >= 1)
src << "<font color = #00C3ED>[M]'s Ki Shield Absorbs the attacks damage!"
M << "<font color = #00C3ED>Your Ki Shield Absorbs [src]'s Attack!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
M << "\red [src]'s SK slams into you!"
src <<"\red Your SK slams into [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
if(M.absorbing)
if(absorb_max > ki_damage)
M << "\red [src]'s attacks hits you, but you Absorb the energy!"
src <<"\red Your SK is Absorbed by [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.ki += ki_damage
src.doing = 0
src.frozen = 0
return
else
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_damage)
M << "\red You try to absorb [src]'s SK, but it is too strong!"
src <<"\red Your SK slams into [M]!"
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return

M << "\red [src.name]'s SK slams into you"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= ki_damage
M.BigKiDeathCheck(src)
del(H)
sleep(1)
mob
proc
SEast
set background=1
var/ki_damage = round(usr.powerlevel * 70.75)
var/ki_cost = round(src.ki_max * 17.59)
var/obj/H = new/obj/Saiyan_Kamehameha
var/obj/O = new/obj/SK_trail
H.dir = EAST
H.loc = usr.loc
while(H)
O.loc=H.loc
O.dir=H.dir
spawn(40)
del O
step(H,H.dir)
if(!H)break
var/turf/T = H.loc
if(T.density)
del(H)
break
for(var/mob/M as mob in T)
var/absorb_max = round(M.powerlevel_max)
var/ki_absorbed = round(M.ki_shield_strength - ki_damage)
if(!M.dead && !M.safe && M.pk)
if(M.ki_shield)
if(ki_absorbed >= 1)
src << "<font color = #00C3ED>[M]'s Ki Shield Absorbs the attacks damage!"
M << "<font color = #00C3ED>Your Ki Shield Absorbs [src]'s Attack!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
M << "\red [src]'s SK slams into you!"
src <<"\red Your SK slams into [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
if(M.absorbing)
if(absorb_max > ki_damage)
M << "\red [src]'s attacks hits you, but you Absorb the energy!"
src <<"\red Your SK is Absorbed by [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.ki += ki_damage
src.doing = 0
src.frozen = 0
return
else
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_damage)
M << "\red You try to absorb [src]'s SK, but it is too strong!"
src <<"\red Your SK slams into [M]!"
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return

M << "\red [src.name]'s SK slams into you"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= ki_damage
M.BigKiDeathCheck(src)
del(H)
sleep(1)
mob
proc
SWest
set background=1
var/ki_damage = round(usr.powerlevel * 70.75)
var/ki_cost = round(src.ki_max * 17.59)
var/obj/H = new/obj/Saiyan_Kamehameha
var/obj/O = new/obj/SK_trail
H.dir = WEST
H.loc = usr.loc
while(H)
O.loc=H.loc
O.dir=H.dir
spawn(40)
del O
step(H,H.dir)
if(!H)break
var/turf/T = H.loc
if(T.density)
del(H)
break
for(var/mob/M as mob in T)
var/absorb_max = round(M.powerlevel_max)
var/ki_absorbed = round(M.ki_shield_strength - ki_damage)
if(!M.dead && !M.safe && M.pk)
if(M.ki_shield)
if(ki_absorbed >= 1)
src << "<font color = #00C3ED>[M]'s Ki Shield Absorbs the attacks damage!"
M << "<font color = #00C3ED>Your Ki Shield Absorbs [src]'s Attack!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
M << "\red [src]'s SK slams into you!"
src <<"\red Your SK slams into [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_absorbed)
M.ki_shield_strength -= round(ki_damage)
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return
else
if(M.absorbing)
if(absorb_max > ki_damage)
M << "\red [src]'s attacks hits you, but you Absorb the energy!"
src <<"\red Your SK is Absorbed by [M]!"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.ki += ki_damage
src.doing = 0
src.frozen = 0
return
else
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= round(ki_damage)
M << "\red You try to absorb [src]'s SK, but it is too strong!"
src <<"\red Your SK slams into [M]!"
M.BigKiDeathCheck(src)
src.doing = 0
src.frozen = 0
return

M << "\red [src.name]'s SK slams into you"
Explode(new /Effect/BasicBoom(M.loc,1,3))
M.powerlevel -= ki_damage
M.BigKiDeathCheck(src)
del(H)
sleep(1)

obj/Saiyan_Kamehameha
icon = 'Super Big Bang kamehameha.dmi' //'Saiyan Kame.dmi'
icon_state = "Main"

obj/Saiyan_Kamehameha
icon = 'Super Big Bang kamehameha.dmi' //'Saiyan Kame.dmi'
icon_state = ""//"Head"
layer = 100
New()
spawn(100)
del src
Move()
var/O = new/obj/SK_trail(src.loc)
O:dir = src.dir
..()

obj/SK_trail
icon = 'Super Big Bang kamehameha.dmi' //'Saiyan Kame.dmi'
icon_state = "Trail"
layer=MOB_LAYER-1
New()
spawn(30)
del src

obj/Overlays/SaiyanKame/Goten
icon='Goten No Helmet.dmi'
pixel_x = 32
pixel_y = 0

obj/Overlays/SaiyanKame/Gohan
icon='Mystic Gohan.dmi'
pixel_x = -32
pixel_y = 0

obj/Overlays/SaiyanKame/Trunks
icon='Trunks.dmi'
pixel_x = 0
pixel_y = 32


Problem description:
A friend of mine coded this for me and couldn't figure out how to solve the error, neither can I. I get bad argument definition error on lines: 126, 136, 148, 154, 164, 198, 208, 220, 226, 236, 270, 280, 292, 298, 308, 342, 352, 364, 370, and 380. All these lines contain code like "M.ki += ki_damage" "M.powerlevel -= ki_damage" "M.powerlevel -= round(ki_damage)" etc. Please help, cause I'm stuck. :/
You did a good job trying to find what these errors found in common, but you didn't do it quite right. You did help narrow down where I should look though.

Your error is whenever you call Explode() with a new in the arguments. Could you post your Explode() procedure, please?
In response to Albro1
proc

Explode(Effect/theeffect)

if(theeffect.orig)
new /ExplodeNode/CenterAll(theeffect,theeffect.orig.x,theeffect.orig.y,theeffect.basepower)


ExplodeBM(Effect/theeffect)

if(theeffect.orig)
new /ExplodeNode/CenterBM(theeffect,theeffect.orig.x,theeffect.orig.y,theeffect.basepower)



ExplodeNode


CenterBM

New(Effect/theeffect,x as num,y as num, power as num)

if(round(power) > 0)

power = theeffect.Apply(x,y,power,NORTH)

new /ExplodeNode/Straight(theeffect,x,y - 1,power,NORTH)
new /ExplodeNode/Straight(theeffect,x,y + 1,power,SOUTH)
new /ExplodeNode/Straight(theeffect,x - 1,y,power,WEST)
new /ExplodeNode/Straight(theeffect,x + 1,y,power,EAST)

del(src)





CenterAll

New(Effect/theeffect,x as num,y as num, power as num)

if(round(power) > 0)

power = theeffect.Apply(x,y,power,NORTH)

new /ExplodeNode/Straight(theeffect,x,y - 1,power,NORTH)
new /ExplodeNode/Straight(theeffect,x,y + 1,power,SOUTH)
new /ExplodeNode/Straight(theeffect,x - 1,y,power,WEST)
new /ExplodeNode/Straight(theeffect,x + 1,y,power,EAST)
new /ExplodeNode/Corner(theeffect,x - 1,y - 1,power,NORTHWEST)
new /ExplodeNode/Corner(theeffect,x + 1,y - 1,power,NORTHEAST)
new /ExplodeNode/Corner(theeffect,x - 1,y + 1,power,SOUTHWEST)
new /ExplodeNode/Corner(theeffect,x + 1,y + 1,power,SOUTHEAST)



del(src)





Straight

New(Effect/theeffect,x as num,y as num, power as num, dir as num)

var

tx
ty


if(round(power) > 0)

if(x >= 1 && x <= world.maxx && y >= 1 && y <= world.maxy)
power = theeffect.Apply(x,y,power,dir)

switch(dir)

if(NORTH)
ty = -1
if(SOUTH)
ty = 1
if(WEST)
tx = -1
if(EAST)
tx = 1

if(theeffect.speed)
spawn(theeffect.speed)
src.New(theeffect,x+tx,y+ty,power,dir)
else
src.New(theeffect,x+tx,y+ty,power,dir)

else
del(src)



Corner

New(Effect/theeffect,x as num,y as num, power as num, dir as num)

var

ty
tx


if(round(power) > 0)

if(x >= 1 && x <= world.maxx && y >= 1 && y <= world.maxy)
power = theeffect.Apply(x,y,power,dir)

switch(dir)

if(NORTHEAST)
ty = -1
tx = 1
if(theeffect.speed)
spawn(theeffect.speed)
new /ExplodeNode/Straight(theeffect,x,y - 1,power,NORTH)
new /ExplodeNode/Straight(theeffect,x+1,y,power,EAST)
else
new /ExplodeNode/Straight(theeffect,x,y - 1,power,NORTH)
new /ExplodeNode/Straight(theeffect,x+1,y,power,EAST)
if(SOUTHEAST)
ty = 1
tx = 1
if(theeffect.speed)
spawn(theeffect.speed)
new /ExplodeNode/Straight(theeffect,x,y + 1,power,SOUTH)
new /ExplodeNode/Straight(theeffect,x +1,y,power,EAST)
else
new /ExplodeNode/Straight(theeffect,x,y + 1,power,SOUTH)
new /ExplodeNode/Straight(theeffect,x +1,y,power,EAST)
if(NORTHWEST)
ty = -1
tx = -1
if(theeffect.speed)
spawn(theeffect.speed)
new /ExplodeNode/Straight(theeffect,x,y - 1,power,NORTH)
new /ExplodeNode/Straight(theeffect,x - 1,y,power,WEST)
else
new /ExplodeNode/Straight(theeffect,x,y - 1,power,NORTH)
new /ExplodeNode/Straight(theeffect,x - 1,y,power,WEST)
if(SOUTHWEST)
ty = 1
tx = -1
if(theeffect.speed)
spawn(theeffect.speed)
new /ExplodeNode/Straight(theeffect,x,y + 1,power,SOUTH)
new /ExplodeNode/Straight(theeffect,x - 1,y,power,WEST)
else
new /ExplodeNode/Straight(theeffect,x,y + 1,power,SOUTH)
new /ExplodeNode/Straight(theeffect,x - 1,y,power,WEST)


if(theeffect.speed)
spawn(theeffect.speed)
src.New(theeffect,x + tx,y + ty,power,dir)
else
src.New(theeffect,x + tx,y + ty,power,dir)

else
del(src)

In response to Albro1
Are you sure the problem deals with the Explode()?
In response to Nourn
Explode() is what appears to be sending the error - that it is a bad argument definition. What you are sending is a new /Effect, can you also post the New() for /Effect?
In response to Albro1
Effect
{

var
{
atom/orig // The point of origin for the explosion
speed = 1 // The rate at which the explosion expands in ticks
basepower = 10 // The strength of the explosion at ground zero
}

proc
{
Apply(x,y,power,dir)
{
return power
}
}

New(atom/p_orig, p_speed, p_basepower)
{
orig = p_orig
speed = p_speed
basepower = p_basepower
}
//------------------------
//Example Effects
//------------------------

//------------------------
//Standard Explosion
//------------------------

BasicBoom
{
Apply(x,y,power,dir)
{
var/i
var/obj/dirt/i2 = new
var/i3
var/turf/T
T = locate(x,y,orig.z)
//Doesn't go through walls so kill the trail if there is a wall
if(T.density)
return 0

//Show the fire
i = image('fire.dmi',locate(x,y,orig.z))
world << i
spawn(1)
del(i)

//Damage the terrain
i3 = image(i2,locate(x,y,orig.z))
world << i3
spawn(50)
del(i3)

//Use the base expansion algorithm except reduce the
//power by one so it doesn't go forever
return ..(x,y,power-1,dir)
}
}


}

obj
{
dirt
{
icon = 'Dirt.dmi'
density = 0
}
}

There you go.
Best response
Perhaps the location you are sending it is not behaving correctly. Try doing some debugging, like sending T (It shouldn't change anything, but either way there's no sense in sending M.loc when you have it stored in T already) instead of M.loc. Narrow down the possible causes of the error. Is the problem because the /Effect isn't initializing correctly, or is it in Explode()? I would imagine the problem is in the initialization of /Effect/BasicBoom.

Also, you don't need to do for(var/mob/m as mob in T). Since you are specifying m as /mob, it will only search for mobs. Simply doing for(var/mob/m in T) will do.