Var error??? in Developer Help
|
|
I'm trying to make it so that when you walk into the arena through the stairs, an enemy appears but you cannot exit the same way until the enemy is dead, but when I test the game, every time a player kills the enemy the variable win stays at 0 instead of becoming 1
Player Code
world/mob=/mob/player/human
mob/player/human Login() alert("By Christian White") sleep(5) loc=locate(18,5,2) world<<"If it's your first time press the \"Instructions\" button above" icon = 'BaseT.dmi' verb info() set category = "Project" set name = "Info" verb instruct() set category = "Project" set name = "Instruction" usr<< "<H3><B>INSTRUCTIONS</B></H3><P>Welcome to the Collesseum</P><BR>Use the arrow keys to move. When you are ready, walk into the arena to start the fight. Once you enter you cannot leave until you have defeated the enemy. If you win you may return back to the barracks to rest. Enter the arena once more to start the next match. "
var hp = 50 vit = 10 stam = 20 str = 2 win = 0
|
Death Check 4 enemy
mob/enemy/proc Death_E(mob/player/human/L) if(hp<=0) world<<"You have Defeated your advarsary!" del(src) L.Win()
mob/player/human proc Win(mob/player/human/L) L.win = 1
|
Stairs
stairs2 icon = 'stairs.dmi' Exited() new/mob/enemy/guy1(src) Enter(mob) var/mob/player/human/H if(H.win==1) icon = 'floors.dmi' icon_state = "stoneground" H.loc=locate(2,5,2) else world<<"You must kill the enemy to earn your freedom!
|
Punch verb
mob/player/human verb punch() set name = "Punch" for(var/mob/enemy/M in get_step(src,dir)) var/D = str *1 M.hp = M.hp - D world<<"Your opponant takes [D] points of damage!" M.Death_E()
|
|
proc name: Enter (/turf/floors/stairs2/Enter)
usr: Guest-3723684239 (/mob/player/human)
src: the stairs2 (21,16,1) (/turf/floors/stairs2)
call stack:
the stairs2 (21,16,1) (/turf/floors/stairs2): Enter(Guest-3723684239 (/mob/player/human), the stonef (20,16,1) (/turf/floors/stonef))
runtime error: undefined proc or verb /mob/player/human/Death E().