mob/proc
enemyturn(mob/player/P,mob/enemy/E)
WeakAttack(E,P)
WeakAttack(mob/A,mob/D)
if(D in view(A.RANGE))
usr << "[A] uses Weak Attack on [D]!!!"
usr << "[A] deals 10 damage to [D]!!!"
D.HP = D.HP - 10
deathcheck(D)
Problem description:
Here's a portion of my code of my grid based game. So when was I was coding, I intended to let my WeakAttack() verb to be shared by both mob/player and mob/enemy, but i realized that there was a problem with this. The view() in the code would always be the mob/player's view() and not the mob/enemy's, even if the mob/enemy is the one using WeakAttack() as depicted. I tried using A.view() but that doesn't work. Any suggestions?
This should solve it.