ID:179965
 
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>
mob/verb/smash_ground(turf/grass/T as turf in view(0))
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)
T.icon='cracked.dmi'


Might that be better?
In response to Lord of Water
Lord of Water wrote:
> mob/verb/smash_ground(turf/grass/T as turf in view(0))
> 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)
> T.icon='cracked.dmi'
>

Might that be better?

then it pops up a list
In response to Air _King
Air _King wrote:
Lord of Water wrote:
> > mob/verb/smash_ground(turf/grass/T as turf in view(0))
> > 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)
> > T.icon='cracked.dmi'
> >

Might that be better?

then it pops up a list
is that what you want valderalgx?
In response to Air _King
Maybe try,

turf/grass/T in src.loc
In response to Lord of Water
Thanks guys!
In response to Lord of Water
Lord of Water wrote:
Maybe try,

turf/grass/T in src.loc

WRONG! it would be usr not src since it is in the attack verb.
In response to Nadrew
Err, I was suggesting a change to the code that I gave him. It's just a mod.
In response to Nadrew
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
In response to Lord of Water
Lord of Water wrote:
> mob/verb/smash_ground(turf/grass/T as turf in view(0))
> 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)
> T.icon='cracked.dmi'
>

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'
In response to Valderalgx
try this:

mob/verb/Grnd_Smash(turf/grass/T in src.loc)
T.overlays += /obj/smashed
src << "You smashed the ground!!!"


This should work!
In response to Lord of Water
Lord of Water wrote:
try this:

> mob/verb/Grnd_Smash(turf/grass/T in src.loc)
> T.overlays += /obj/smashed
> src << "You smashed the ground!!!"
>

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.