ID:149580
 
Well, basically, the person that wins the battle goes to their old loc but the person that loses gets stuck.

Challenge stuff


mob/verb/Challenge(mob/kid/M in oview(2))
switch(alert("Are you sure about challenging [M]?",,"Yes","No"))
if("Yes")
switch(alert(M,"[usr] has challenged you! shall you beat him down?",,"Yes","No way!"))
if("Yes")
usr.ox = usr.x
usr.oy = usr.y
usr.oz = usr.z
M.ox = M.x
M.oy = M.y
M.oz = M.z
var/turf/battlestart/X
for(X in world)
if(X.occupied == 0)
M << "The battle begins!"
usr << "The battle begins!"
usr.loc = X
M.loc = X
X.occupied = 1
M.battlearena = X
usr.battlearena = X
break

if("No way!")
usr << "[M] has chickened out of a battle!"
..()
if("No")
usr << "You back down from a fight!"
..()



Punch verb


mob/verb/punch()
//this stuff works and I call the proc like this
var/mob/M
for(M in get_step(src,src.dir)) break
if(M)
PhysicalDamage(M)


Physical Damage proc()

proc/PhysicalDamage(var/mob/M)
//equation stuff here
//damage stuff here
goto BattleDeath

BattleDeath
if(M.health <= 0)
world << "[usr] beats [M] in a battle!"
M.health = M.max_health
usr.health = usr.max_health
goto BattleEnd
else
return 0 //I tried return..() but it spammed me with errors, return also doesnt spam me

BattleEnd
var/turf/battlestart/X = M.battlearena
X.occupied = 0
usr<< "The battle is over!"
M<<"The battle is over!"
usr.loc = locate(usr.ox,usr.oy,usr.oz)
M.loc = locate(M.ox,M.oy,M.ox)
M.battlearena = null
usr.battlearena = null



mob vars


mob
var
ox = null
oy = null
oz = null
battlearena = null

Thanks for reading. I appreciate you reading this far.

-Sariat
Were you replying to me?
Hey, I think you should just like send the winner to a location like usr.loc=locate(1,1,1) ,but I don't know how