ID:1537405
 
(See the best response by Pirion.)
Code:
obj
Nbeam
icon = 'wind.dmi'
icon_state = "windslash"
layer = 100
density = 1
Bump(A)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/turf/water/))
del(src)
if(istype(A,/turf/sands/))
del(src)
if(istype(A,/obj/))
del(src)
if(ismob(A))
var/mob/M = A
var/damage = usr.Strength * 7 + usr.Willpower * 5
M.Health -= damage
M << output("[usr]'s wind slices you for [damage] damage!","output1")
usr << output("Your wind hits [M] for [damage] damage!","output1")
del (src)




obj/skills
windslash
name = "Wind Slash"
Click()
usr.windslash()



mob
verb
windslash()
set hidden = 0
if(usr.windslashcd == 1)return
if(usr.Stamina < 20)return
if(usr.haswind == 0)return
usr.windslashcd = 1
spawn(50)usr.windslashcd = 0
var/obj/Nbeam/K = new /obj/Nbeam
if(src.dir == NORTH)
K.loc = locate(usr.x,usr.y+1,usr.z)
if(src.dir == SOUTH)
K.loc = locate(usr.x,usr.y-1,usr.z)
if(src.dir == EAST)
K.loc = locate(usr.x+1,usr.y,usr.z)
if(src.dir == WEST)
K.loc = locate(usr.x-1,usr.y,usr.z)
K.dir = usr.dir
K.name=usr.name

walk(K,usr.dir,0.5)
spawn(16)
del(K)


Problem description:The problem has something to do with the obj im using to call the verb. The reason I know this is because when I use the verb, it works fine. But if I try to use it through the object, it will not do anything.

obj
Nbeam
icon = 'wind.dmi'
icon_state = "windslash"
layer = 100
density = 1
Bump(A)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/turf/water/)||istype(A,/turf/sands/)||istype(A,/obj/))
del(src)
if(ismob(A))
var/mob/M = A
var/damage = usr.Strength * 7 + usr.Willpower * 5
M.Health -= damage
M << output("[usr]'s wind slices you for [damage] damage!","output1")
usr << output("Your wind hits [M] for [damage] damage!","output1")
del (src)


obj/skills
windslash
name = "Wind Slash"
Click()
usr.windslasheject()

mob/proc/windslasheject()
src.windslashcd = 1
spawn(50)src.windslashcd = 0
var/obj/Nbeam/K = new /obj/Nbeam
if(src.dir == NORTH)
K.loc = locate(usr.x,usr.y+1,usr.z)
if(src.dir == SOUTH)
K.loc = locate(usr.x,usr.y-1,usr.z)
if(src.dir == EAST)
K.loc = locate(usr.x+1,usr.y,usr.z)
if(src.dir == WEST)
K.loc = locate(usr.x-1,usr.y,usr.z)
K.dir = src.dir
K.name=src.name
walk(K,src.dir,0.5)
spawn(16)
del(K)

mob/verb/windslash()
set hidden = 0
if(usr.windslashcd == 1||usr.Stamina < 20||!usr.haswind)return
usr.windslasheject()


use one proc() to execute the action of the obj and of the verb
In response to JEY_SENSEY
Best response
JEY_SENSEY wrote:
use one proc() to execute the action of the obj and of the verb


A verb is a special type of proc. Should be able to call it just fine how it is.

The code snipit smells of usr abuse - I just haven't had time to look through it yet to confirm.