|
303 | 303 | if(melee_type == MELEE_WEAPON_DSWORD && prob(50)) |
304 | 304 | jedi_spin() |
305 | 305 |
|
306 | | -/mob/living/simple_animal/hostile/syndicate/Shoot(atom/targeted_atom) |
307 | | - if(QDELETED(targeted_atom) || targeted_atom == targets_from.loc || targeted_atom == targets_from) |
308 | | - return |
309 | | - var/turf/startloc = get_turf(targets_from) |
310 | | - var/turf/target_turf = get_turf(targeted_atom) |
311 | | - if(!target_turf) |
312 | | - return |
313 | | - if(casingtype) |
314 | | - // I know that is ABSOLUTELY terrible way to do that, but.. i don't know how to make it properly. I wasted a lot of time trying to, but only this is working somewhat good enough. |
315 | | - var/dx = abs(target_turf.x - startloc.x) |
316 | | - var/dy = abs(target_turf.y - startloc.y) |
317 | | - if(target_turf.x < startloc.x && target_turf.y > startloc.y) |
318 | | - if(dy > dx) |
319 | | - target_turf.pixel_x = 14 |
320 | | - target_turf.pixel_y = 14 |
321 | | - else if(dy < dx) |
322 | | - target_turf.pixel_x = -14 |
323 | | - target_turf.pixel_y = -14 |
324 | | - else if(target_turf.x < startloc.x && target_turf.y < startloc.y) |
325 | | - if(dy > dx) |
326 | | - target_turf.pixel_x = 14 |
327 | | - target_turf.pixel_y = -14 |
328 | | - else if(dy < dx) |
329 | | - target_turf.pixel_x = -14 |
330 | | - target_turf.pixel_y = 14 |
331 | | - else if(target_turf.x > startloc.x && target_turf.y > startloc.y) |
332 | | - if(dy > dx) |
333 | | - target_turf.pixel_x = -14 |
334 | | - target_turf.pixel_y = 14 |
335 | | - else if(dy < dx) |
336 | | - target_turf.pixel_x = 14 |
337 | | - target_turf.pixel_y = -14 |
338 | | - else if(target_turf.x > startloc.x && target_turf.y < startloc.y) |
339 | | - if(dy > dx) |
340 | | - target_turf.pixel_x = -14 |
341 | | - target_turf.pixel_y = -14 |
342 | | - else if(dy < dx) |
343 | | - target_turf.pixel_x = 14 |
344 | | - target_turf.pixel_y = 14 |
345 | | - var/obj/item/ammo_casing/casing = new casingtype(startloc) |
346 | | - playsound(src, projectilesound, 100, 1) |
347 | | - casing.fire(targeted_atom, src, zone_override = ran_zone(), firer_source_atom = src) |
348 | | - target_turf.pixel_x = initial(target_turf.pixel_x) |
349 | | - target_turf.pixel_y = initial(target_turf.pixel_y) |
350 | | - |
351 | 306 | /mob/living/simple_animal/hostile/syndicate/LoseTarget() |
352 | 307 | . = ..() |
353 | 308 | if(syndie_flags & SWORD && melee_type != MELEE_WEAPON_NONE) |
|
0 commit comments