mob
DblClick()
..()
if(src == usr)
return
if(src.owner == usr)
return
if(src == client)
return
if(istype(src,/mob))
usr << "You have targeted [src]"
usr << "The enemies health is [src.HP]"
for(var/mob/Koromon/K in world)
if(K.owner == usr)
K.Target = src
else
usr << "You cant target a Tamer!"
Attack_Panel
name = "Attack"
icon = 'Digipanel.dmi'
screen_loc = "4,1"
icon_state = "Attack"
Click()
for(var/mob/Koromon/K in world)
if(K.owner == usr)
walk(K,0)
repeat
for(var/mob/E in world)
if(K.Target == E)
if(E.HP > 0 )
if(K.Target != oview(1))
step_towards(K,K.Target)
sleep(1)
E.Attack()
E.Death(K)
else
walk(K,0)
goto end
goto repeat
end
walk_towards(K,usr)
Attack()
for(var/mob/Koromon/K in world)
if(K.owner == usr)
if(src == K.Target)
if(src in oview(1))
var/damage = rand(src.Str,src.Str*2)
src.HP -= damage
Problem description:
Im currently working on a Digimon game and I want to code it so that your a Tamer and you have a digimon. I've coded all the vars for the digimon so they save and everything Im just having trouble with the code.
The problem is the usr which is the tamer must be standing next to the enemy for any damage to take place.
That means if the src(Person your attacking) is in 1 tile of the usr(tamer). What you want I think is replace usr with K(The digimon) so it would look like the following. Which means that the src has to be within 1 tile of K.