ID:262999
 
Code:
    verb
Attack()
if(turn == usr.team && usr.move >= 2)
usr.move -= 2
var/list/att = list("cancel")
if(usr.typei == 1)
for(var/mob/m in oview(1))
att += m
var/bb = input(usr," Who will you attack?")in att
if(bb == "cancel")
return 0
else if(bb:killed != 1)
var/dmgd = rand(usr.str,usr.mstr)
bb:hp -= dmgd
world << "[usr] attacks [bb] for [dmgd] damage!"
death(bb,usr)
var/m = bb
bb:death(usr)
/*if(m:hp <= 0)
world << "[m] Was killed!"
usr.kills += 1
var/exptogive = 10
var/exptotake = usr.level
exptogive *=m:level
exptotake -= 1
usr.exp += exptogive
usr.exp -= exptotake
if(usr.exp >= usr.expneed)
world << "[usr] has leveled up!"
usr.level += 1
usr.str += 10
usr.mstr += 5
usr.hp += 10
usr.mhp += 10
usr.exp -= usr.expneed

m:killed = 1
var/list/rep
var/a = input(m, "What shall you be?")in list("same","Warrior team 1","Warrior team 2","Archer team 1","Archer team 2")
if(a == "Warrior team 1")
m:icon_state = "warrior"
m:hp = 100
m:mhp = 100
m:str = 30
m:mstr = 60
m:typei = 1
m:team = 1
m:level = 1
if(a == "Archer team 1")
m:icon_state = "archer"
m:hp = 90
m:mhp = 90
m:str = 10
m:mstr = 40
m:typei = 2
m:team = 1
m:level = 1


if(a == "Warrior team 2")
m:icon_state = "warrior2"
m:hp = 100
m:mhp = 100
m:str = 30
m:mstr = 60
m:typei = 1
m:team = 2
m:level = 1
if(a == "Archer team 2")
m:icon_state = "archer2"
m:hp = 90
m:mhp = 90
m:str = 10
m:mstr = 40
m:typei = 2
m:team = 2
m:level = 1
if(a == "same")
m:hp = m:mhp
if(m:team == 1)
for(var/mob/t1spawn/ar in world)
rep += ar
if(m:team == 2)
for(var/mob/t2spawn/ar in world)
rep += ar
var/wh = input(m,"where will you respawn?") in rep
m:loc = wh:loc
m:killed = 0
world << "[m] has respawned on team [m:team]"*/

if(usr.typei == 2)
for(var/mob/m in oview(4))
att += m
var/bb = input(usr," Who will you attack?")in att
if(bb == "cancel")
return 0
else if(bb:killed != 1)
var/dmgd = rand(usr.str,usr.mstr)
bb:hp -= dmgd
world << "[usr] attacks [bb] for [dmgd] damage!"
var/m = bb
bb:death(usr)
/*if(m:hp <= 0)
world << "[m] Was killed!"
usr.kills += 1
var/exptogive = 10
var/exptotake = usr.level
exptogive *=m:level
exptotake -= 1
usr.exp += exptogive
usr.exp -= exptotake
if(usr.exp >= usr.expneed)
world << "[usr] has leveled up!"
usr.level += 1
usr.str += 10
usr.mstr += 5
usr.hp += 10
usr.mhp += 10
usr.exp -= usr.expneed

m:killed = 1
var/list/rep
var/a = input(m, "What shall you be?")in list("same","Warrior team 1","Warrior team 2","Archer team 1","Archer team 2")
if(a == "Warrior team 1")
m:icon_state = "warrior"
m:hp = 100
m:mhp = 100
m:str = 30
m:mstr = 60
m:typei = 1
m:team = 1
m:level = 1
if(a == "Archer team 1")
m:icon_state = "archer"
m:hp = 90
m:mhp = 90
m:str = 10
m:mstr = 40
m:typei = 2
m:team = 1
m:level = 1


if(a == "Warrior team 2")
m:icon_state = "warrior2"
m:hp = 100
m:mhp = 100
m:str = 30
m:mstr = 60
m:typei = 1
m:team = 2
m:level = 1
if(a == "Archer team 2")
m:icon_state = "archer2"
m:hp = 90
m:mhp = 90
m:str = 10
m:mstr = 40
m:typei = 2
m:team = 2
m:level = 1
if(a == "same")
m:hp = m:mhp
if(m:team == 1)
for(var/mob/t1spawn/ar in world)
rep += ar
if(m:team == 2)
for(var/mob/t2spawn/ar in world)
rep += ar
var/wh = input(m,"where will you respawn?") in rep
m:loc = wh:loc
m:killed = 0
world << "[m] has respawned on team [m:team]"*/

Say(t as text)
world << "[usr]:||team:[usr.team]level:[usr.level]||:<b>[t]</b>"
//Save()
//usr << "You will be given a save code, it is used in the load verb to load your character. I am currently to busy(lazy) to make real saving and this also lets you go from server to server with your character"
//var/code = "[usr.type][usr.level][usr.kills][usr.team]"



proc
death()
var/mob/m = src
var/mob/ayt = usr
if(m.hp <= 0)
world << "[m] Was killed!"
ayt.kills += 1
var/exptogive = 10
var/exptotake = ayt.level
exptogive *=m.level
exptotake -= 1
ayt.exp += exptogive
ayt.exp -= exptotake
if(ayt.exp >= ayt.expneed)
world << "[ayt] has leveled up!"
ayt.level += 1
ayt.str += 10
ayt.mstr += 5
ayt.hp += 10
ayt.mhp += 10
ayt.exp -= ayt.expneed

m.killed = 1
var/list/rep
var/a = input(m, "What shall you be?")in list("same","Warrior team 1","Warrior team 2","Archer team 1","Archer team 2")
if(a == "Warrior team 1")
m.icon_state = "warrior"
m.hp = 100
m.mhp = 100
m.str = 30
m.mstr = 60
m.typei = 1
m.team = 1
m.level = 1
if(a == "Archer team 1")
m.icon_state = "archer"
m.hp = 90
m.mhp = 90
m.str = 10
m.mstr = 40
m.typei = 2
m.team = 1
m.level = 1


if(a == "Warrior team 2")
m.icon_state = "warrior2"
m.hp = 100
m.mhp = 100
m.str = 30
m.mstr = 60
m.typei = 1
m.team = 2
m.level = 1
if(a == "Archer team 2")
m.icon_state = "archer2"
m.hp = 90
m.mhp = 90
m.str = 10
m.mstr = 40
m.typei = 2
m.team = 2
m.level = 1
if(a == "same")
m.hp = m.mhp
if(m.team == 1)
for(var/mob/t1spawn/ar in world)
rep += ar
if(m.team == 2)
for(var/mob/t2spawn/ar in world)
rep += ar
var/wh = input(m,"where will you respawn?") in rep
m.loc = wh:loc
m.killed = 0
world << "[m] has respawned on team [m.team]"


Problem description:
runtime error: type mismatch
proc name: death (/mob/proc/death)
usr: Rky_nick (/mob/player)
src: Blakdragon77 (/mob/player)
call stack:
Blakdragon77 (/mob/player): death(Rky_nick (/mob/player))
Rky_nick (/mob/player): Attack()

problem is that before the dead get to choose where to respawn, the runtime happens. the proc ends. the dead cant be killed.

Your deathcheck proc is all wrong. Do not use usr in most procs, it's not appropriate to. In this case, you need to pass an argument through death() which will be a mob, and src will be the victim.

Aside from that- good god, the colon abuse! Use periods in places of colons, and another thing I noticed was that you added a text "cancel" option to an input menu list. This is bad design because the person may have to scroll down to cancel, as opposed to changing it to something such as as null|anything in att and having a cancel option right on the input menu.
In response to Artemio
i tried that, like 70 times. mob/ayt was the killer. before i did bb.death() it was death() and bb was mob/m.
In response to Rky_nick
Okay, you really need to redesign your attack verb, it's very ugly. Why would you have an input to select a mob inside of the verb in an oview of 4 when you could specify to do that in the verb parameters? Aside from that, it would be, in my opinion, better to select a target within the attack radius of the player automatically rather than prompting for it, because then the player loses time in attacking.
In response to Artemio
oh. im sorry sir, but your looking at the death proc in the attack verb that was commented out.(i cant test to see if theres a runtime error if the proc doesnt exist now can i?
In response to Artemio
thats becuase if typei is 2 your an archer and if it isnt your a warrior. oh and this is turnbased.
In response to Rky_nick
mob
var{hp=20;maxhp=20;target;radius=1}
verb/attack()
var/mob/M=locate() in oview(src,radius)
if(!M) return
if(target) if(locate(target)in oview(src,radius)) M=target
var/damage=rand(1,10)
view()<<"[M] was hit for [(damage<=0)?"no damage":"[damage] damage"]."
Attack(M,damage)
proc
death(mob/victim)
if(!victim) return
if(victim.hp<=0)
world<<"[victim] has died at the hands of [src]!"
victim.hp=victim.maxhp
Attack(mob/M,damage)
if(!M) return
M.hp-=damage
death(M)
Dummy
New()
..()
name=pick("L","O","A","B","Q","R")
Click() usr.target=src


There's an example of what I mean.
In response to Artemio
i know what you mean. but its a turn based game and i need help fixing the death proc