AirSlash
//icon = 'AirSlashHtBx.dmi'
player = 0
scaffold = 0
density = 0
offset_x = 0
offset_y = 0
x_push = 0.5
y_push = 1
hitstun = 3
pwidth = 25
pheight = 25
var //makin the list for down there
list/HitByLinkAirSlash
New(mob/m, sx, sy, vx, vy, dmg)
x_pos = sx
y_pos = sy
dir = m.dir
src.loc = m.loc
set_pos(x_pos, y_pos)
spawn(1.5)
del(src)
movement() // this runs every tick!
for(var/mob/M in oview(1,src))
if(M.inside4(px,py,pwidth,pheight)) //if M is within AirSlashes width and height
if(M.enemy == 1 && !(M in src.HitByLinkAirSlash))//only enemies and NOT in the list
M.damage(M, src.damage, hitstun, dir, x_push, y_push) //OUCH
src.HitByLinkAirSlash += M //add M to AirSlashes HitByLinkAirSlash list
Problem description:
So the AirSlash has a list so that it hits an enemy, adds it to the list, and doesnt attack it again. I thought that was ok, but when I do it in the game, the enemy gets hit multiple times because its not being added to the list somehow!
I get this error
runtime error: type mismatch: the red octorok (/mob/ai/red_octorok) += the red octorok (/mob/ai/red_octorok)
proc name: movement (/mob/pc/Link/AirSlash/movement)
usr: null
src: AirSlash (/mob/pc/Link/AirSlash)
call stack:
AirSlash (/mob/pc/Link/AirSlash): movement(89)
: movement()
I'm not sure whats happening, but it looks like its adding itself to itself or something, but thats not how I have it in the code!
I've gone crazy the past hour
i assume this is the problem
try putting = list() in there