ID:264190
 
Code:
obj/projectile
var/damage=0
var/owner
var/odir
var/delay=3
proc/Effect(mob/A)
A.hp -= damage
A.mhp += damage/2
view(A) << "[A] has been hit by [src.owner]'s spell!"
A.Deathcheck()
Aqua_Undo
icon='Aqua Eructo.dmi'
icon_state = ""
density=1
damage=15
Bump(atom/A)
if(ismob(A))
var/mob/M=A
for(var/mob/H in oview(1,M))
if(H.hp + 7 >= H.mhp)
H.hp=H.mhp
H<<"You are cleansed by some of the water that hit [M], restoring some HP"
else
H.hp+=7
H<<"You are cleansed by some of the water that hit [M], restoring some HP"
Effect(M)
..()
del src
else
view(A)<<"[owner] missed their intended target and hit [A]!"
for(var/mob/H in oview(1,A))
if(H.hp + 7 >= H.mhp)
H.hp=H.mhp
H<<"You are cleansed by some of the water that hit [A], restoring some HP"
else
H.hp+=7
H<<"You are cleansed by some of the water that hit [A], restoring some HP"
del src


Problem description: The code works perfectly up to the point it hits a mob, at which point the mob's I want healed aren't healed. Can someone please tell me why it wont work, and perhaps some way to fix it please.
I'd use orange instead of oview for that.

Also, absolutely no point in doing this:
if(ismob(A))
var/mob/M=A
In response to Andre-g1
orange... the Fruit? :) xD
In response to Andre-g1
Andre-g1 wrote:
I'd use orange instead of oview for that.

Also, absolutely no point in doing this:
> if(ismob(A))
> var/mob/M=A
>


Yes there is; A is an atom-type variable, so you can only access the variables defined under atom/var. M defined there is a mob variable, so you can access mob variables like M.hp.
In response to Glarfugus
No there is not, because there is no point in defining A as an atom instead of defining it as a mob from the get-go, really, if you only need to access mob vars/procs. In actuality, even if you needed to access more, different types, generally.
In response to SubZeroChaos
No, orange is basically o-range, the overview of a certain range defined by the programmer.
In response to Andre-g1
Thanks, orange's done the trick.
In response to Demon_F0rce
i think he knows.. lol.. at first i read orange lmaooo but then i saw the joke he put about it, then i noticed what it was.. lol
In response to Demon_F0rce
I was kidding. People need to get some humour.