when they click on this in the loading screen, they become the character/mob, but none of the attributes or anything work, why is it doing this?
mob/Mage
icon = 'Mage.dmi'
Click()
usr.icon = 'Mage.dmi'
usr.race = "Magic-User"
usr.loc = locate(1,1,1)
HP = 60
Max_HP = 60
strength = 9
exp = 0
exp_give = 0
verb
Attack(mob/M in oview(1,src))
if(M != null)
var/damage = rand(1,strength)
src << "You attack [M]!"
src << "[damage] damage!"
M << "[src] attacks you!"
M << "[damage] damage!"
M.HP -= damage
characterDeath()
First, when no reference is made, it automatically defaults to src, which in this case is the character itself and not the player. This would work:
> usr.icon = 'Mage.dmi'Also, why make a different "Attack" verb for every character, as I've assume you've done by looking at this one snippet?
I also see another problem; It looks as if you're defining the playable character Mage as well as attempting to assign variables to usr at the same time.
<dm>
mob
Mage
icon = 'Mage.dmi'
race = "Magic-User"
HP = 60
Max_HP = 60
strength = 9
exp = 0
exp_give = 0
Click()
AssignStats(usr,src)
verb
Attack(mob/M in oview(1,src))
if(M != null)
var/damage = rand(1,strength)
src << "You attack [M]!"
src << "[damage] damage!"
M << "[src] attacks you!"
M << "[damage] damage!"
M.HP -= damage
characterDeath()
proc
AssignStats(var/mob/player,var/mob/character)
player.icon = character.icon
player.icon_state = character.icon_state
player.race = character.race
player.HP = character.HP
player.Max_HP = character.Max_HP
player.strength = character.strength
player.exp = character.exp
player.exp_give = character.exp_give
player.loc = locate(1,1,1)