ID:178059
 
i saw it once on a game where the character after drinking too much became hard to control, and would occasionaly go off in its on direction, can someone point me in the right direction on how to make something like this work? please
Move()
if(rand(1,100) >= src.Dunkenness)
..()
else
step_rand(src)

Or something like that.
In response to Garthor
Old Mortes system worked on a tmp var

so something like:

mob
tmp/var/Drunk = 0

and make a proc thats called when the person drinks like:

mob/proc/Drunk()
while(usr.Drunk > 0)
step_rand(usr)
usr.Drunk --

That was a basic way but it worked and was fun =p
mazarot wrote:
i saw it once on a game where the character after drinking too much became hard to control, and would occasionaly go off in its on direction, can someone point me in the right direction on how to make something like this work? please

I liked WildBlood's idea. Here's another one that's good, that you can use on top of that:
client
proc/UserMove(_dir)
mob.dir=_dir // face in the intended direction
if(mob.drunk && prob(100-100*(0.95**mob.drunk)))
// "stumble" to one side
_dir=turn(_dir,prob(50)?45:(-45))
var/turf/T=get_step(mob,_dir)
if(T) mob.Move(T,mob.dir)

North() UserMove(NORTH)
South() UserMove(SOUTH)
West() UserMove(WEST)
East() UserMove(EAST)
Northwest() UserMove(NORTHWEST)
Northeast() UserMove(NORTHEAST)
Southwest() UserMove(SOUTHWEST)
Southeast() UserMove(SOUTHEAST)

Lummox JR
In response to WildBlood
Mine is shorter!
In response to Garthor
Too bad it doesn't work efficently.
In response to Nadrew
And what does that have to do with shortness?