mob
verb
Attack(mob/M in get_step(src,src.dir))
set category="Fighting"
if(!usr.knife)
usr<<"<b>You must first equipe a knife!"
return
if(M.race == src.race)
return
if(M.owner1 == src.key||M.owner4 == src.key)
return
if(M.NPC1 == 1)
return
if(src.underwater == 1||src.flying == 1||src.driving == 1||src.shootinggun == 1||src.shootinggun2 == 1)
return
else
var/damage=round(src.str-M.def/2)
if(damage <= 0).
damage = 1
flick("slash",src)
M.health-=damage
view()<<"[src] slashed [M] with his [usr.knife] inflicting [damage] damage!"
M.death()
Problem description:
It asks who in my oview() I want to ask with a switch(input statement, however I set it to only attack the person 1 space in front of me... Any ideas?
In your Attack()verb you use a verb argument making the player choose a mob in the tile that's in front of him. If there is one then it will be chosen automatically as with all inputting cases, but if there's more than one the player will be prompted to choose between them, so that's a possible cause. If you don't want that to happen, you mustn't use a verb argument - you can use locate() in the verb's body to find a single mob in front of the player instead. Another possible cause could potentially be that you have another attacking verb defined somewhere you've forgotten about which also uses the attack command, and it is getting fired up instead, and it looks in oview().
Also, there are various things that should be done or designed differently that can be seen in that code, however IIRC you wouldn't be interested in any of the details, so I'm only pointing that out.