ID:259219
 
I'm working on ladders at the moment. However, the following code doesn't remove the verbs as I desired. The debugging output *says* it does, but it don't! For example, a ladder that only goes up will still offer you options for "climb" and "descend."

I think this has something to do with the turf granting the verbs to the player; maybe I'd need to manipulate the player's verb list instead. Anyway, it's no big deal... but if anyone could suggest a way to customize the verbs offered by the ladder (without subclassing it into up_ladder, down_ladder, and two_way_ladder) it would make things a little tidier. Thanks!


New()
. = ..()
spawn(3)
var/turf/T
if(upX || upY || upZ)
T = locate(upX, upY, upZ)
if(!T) world << "ERROR: Ladder has bad target: [x], [y], [z]"
else
world << "Removing climb()"
verbs -= /turf/ladder/verb/climb()

if(downX || downY || downZ)
T = locate(downX, downY, downZ)
if(!T) world << "ERROR: Ladder has bad target: [x], [y], [z]"
else
world << "Removing descend()"
verbs -= /turf/ladder/verb/descend()


verb/climb()
set src = oview(0)
usr << "Climbing."
spawn(30)
if(In(usr, src))
if(!usr.Move(locate(upX, upY, upZ))) usr << "Passage is blocked."

Fortunately, this is an easy one:

verbs -= /turf/ladder/verb/climb()

should be

verbs -= /turf/ladder/verb/climb

But the other version should at least work or not compile. That's what I would call a notational problem.