How would i make a verb that if the usr is on a the turf grass the grass icon changes when they use the verb? I have
mob/verb/smash_ground()
set category="actions"
if(usr.strength<50)usr<<"You cant smash the ground!"
if(usr.isstronger==0)
if(usr.Strength>=50)
usr.strength+=2
usr.isstronger=1
src.icon='strongman.dmi'
if(usr.loc==(/turf/grass)
turf/grass.icon='cracked.dmi'
It doesn't work though i know i am doing something wrong with the /turf/grass.icon</50>
ID:179965
![]() Sep 29 2001, 12:18 pm
|
|
Lord of Water wrote:
> mob/verb/smash_ground(turf/grass/T as turf in view(0)) Might that be better? then it pops up a list |
Air _King wrote:
Lord of Water wrote: > > mob/verb/smash_ground(turf/grass/T as turf in view(0)) is that what you want valderalgx?Might that be better? |
Lord of Water wrote:
Maybe try, WRONG! it would be usr not src since it is in the attack verb. |
In verbs like this one, the src and the usr are equivalent, since the user of the verb is the source of the verb (think about it.)
Let's try to calm down a bit on the forums... no need to yell. -AbyssDragon |
Lord of Water wrote:
> mob/verb/smash_ground(turf/grass/T as turf in view(0)) Might that be better? No.........This part won seem to work...if(usr.loc==(/turf/grass) i keep trying it and it wont work nomatter what i use it for. I tried using it in a simple verb like mob/verb/c() if(us.loc==/turf/grass) usr.loc.overlays+='cracked.dmi' |
try this:
mob/verb/Grnd_Smash(turf/grass/T in src.loc) This should work! |
Lord of Water wrote:
try this: > mob/verb/Grnd_Smash(turf/grass/T in src.loc) This should work! nope doesn't. I think this is the problem: (turf/grass/T in src.loc) |
<font color=#ffffa0>turf/grass/verb/smash_ground()</font>
set category="actions" if(usr.strength<50) usr<<"You can't smash the ground!" else usr.strength+=2 usr.isstronger=1 <font color=#ffffa0>usr</font>.icon='strongman.dmi' <font color=#ffffa0>src</font>.icon='cracked.dmi' I'm not certain what you were trying to do with the if(usr.isstronger==0) line, since you set isstronger within that block of code... I just took that chunk out. By making it a verb of turf/grass, it only comes up when you can use it. The default for turfs is set src in view(0), meaning players may only use this verb if they are standing on the turf. |
Might that be better?