battle
var/pname
parent_type = /area
battle_allow
Entered(mob/M)
if(!M.client)
return
else
if(M.monsters.len <= 0)
return
else
for(var/mob/monster/Q in M.monsters)
M.name = Q.name
M.mon = Q
M.icon = Q.icon
M.icon_state = Q.icon_state
M.mon2 += Q
del Q
M.monsters.len = 0
battle_unallow
Entered(mob/M)
if(!M.client)
return
else
M.icon = 'player.dmi'
M.icon_state = ""
for(var/mob/monster/Q in M.mon2)
Q = new(M.loc,M)
That's as far as I could get. =/
What I want to happen, is to transform the player into the mob(got that down), get rid of the mob(did and done), but how to add it back?
Well, thanks for taking time to read this!
Well, first, when the battle starts, create your battle mob, and set the user's client.mob variable to that. As for the old mob, put a reference of it in a variable, and set it's loc to null. After the battle, reconnect to the old mob, move it to a valid turf, and delete the battle mob. Be sure to work carefully with Login() and Logout()! Many times, people will put del(src) in Logout(), but you don't want this here, at least, not if you're going to reconnect with it. You can put del(mob) in client.Del() though. Also remember, the Login() procedure will be called whenever the client (re)connects to the mob.