diff --git a/ModularTegustation/tegu_mobs/lc13_humanoids.dm b/ModularTegustation/tegu_mobs/lc13_humanoids.dm index 4fe836fbfec3..7352cf821ca4 100644 --- a/ModularTegustation/tegu_mobs/lc13_humanoids.dm +++ b/ModularTegustation/tegu_mobs/lc13_humanoids.dm @@ -113,12 +113,12 @@ Skittish, they prefer to move in groups and will run away if the enemies are in return FALSE return ..() -/mob/living/simple_animal/hostile/humanoid/rat/knife/AttackingTarget() +/mob/living/simple_animal/hostile/humanoid/rat/knife/AttackingTarget(atom/attacked_target) if(!can_act) return ..() if(dash_cooldown < world.time) - BackstreetsDash(target) + BackstreetsDash(attacked_target) return /mob/living/simple_animal/hostile/humanoid/rat/knife/OpenFire() @@ -620,8 +620,8 @@ Skittish, they prefer to move in groups and will run away if the enemies are in return . = ..() - if (istype(target, /mob/living)) - var/mob/living/L = target + if (istype(attacked_target, /mob/living)) + var/mob/living/L = attacked_target L.apply_lc_burn(burn_stacks) /mob/living/simple_animal/hostile/humanoid/fixer/flame/bullet_act(obj/projectile/Proj, def_zone, piercing_hit = FALSE) diff --git a/ModularTegustation/tegu_mobs/lc13_outskirtdwellers.dm b/ModularTegustation/tegu_mobs/lc13_outskirtdwellers.dm index f9e7bdf78a19..0aaebfed64df 100644 --- a/ModularTegustation/tegu_mobs/lc13_outskirtdwellers.dm +++ b/ModularTegustation/tegu_mobs/lc13_outskirtdwellers.dm @@ -55,10 +55,10 @@ if(maxHealth >= 250) . += span_notice("Drag yourself onto [src] in order to ride them.") -/mob/living/simple_animal/hostile/morsel/AttackingTarget() +/mob/living/simple_animal/hostile/morsel/AttackingTarget(atom/attacked_target) retreat_distance = 0 - if(is_type_in_typecache(target,wanted_objects)) //we eats - qdel(target) + if(is_type_in_typecache(attacked_target, wanted_objects)) //we eats + qdel(attacked_target) buffed = (buffed + 1) if(buffed >= 10) PustuleChurn() @@ -84,10 +84,10 @@ if(!target) retreat_distance = 0 -/mob/living/simple_animal/hostile/morsel/AttackingTarget() +/mob/living/simple_animal/hostile/morsel/AttackingTarget(atom/attacked_target) . = ..() if(.) - var/dir_to_target = get_dir(get_turf(src), get_turf(target)) + var/dir_to_target = get_dir(get_turf(src), get_turf(attacked_target)) animate(src, pixel_y = (base_pixel_y + 18), time = 2) addtimer(CALLBACK(src, PROC_REF(AnimateBack)), 2) for(var/i = 1 to 2) @@ -724,11 +724,11 @@ Mobs that mostly focus on dealing RED damage, they are all a bit more frail than return FALSE return ..() -/mob/living/simple_animal/hostile/lovetown/slumberer/AttackingTarget() +/mob/living/simple_animal/hostile/lovetown/slumberer/AttackingTarget(atom/attacked_target) if(countering) return if(grab_ready) - return OpenFire(target) + return OpenFire(attacked_target) return ..() /mob/living/simple_animal/hostile/lovetown/slumberer/OpenFire(target) @@ -1023,8 +1023,8 @@ Mobs that mostly focus on dealing RED damage, they are all a bit more frail than if(current_stage == 2) adjustBruteLoss(-40) //self damages at stage 2 - if(ishuman(target)) - if(Finisher(target)) + if(ishuman(attacked_target)) + if(Finisher(attacked_target)) return if(countering) @@ -1037,7 +1037,7 @@ Mobs that mostly focus on dealing RED damage, they are all a bit more frail than DisableCounter() return if(counter_ready) - return OpenFire(target) + return OpenFire(attacked_target) return AoeAttack() /mob/living/simple_animal/hostile/lovetown/abomination/OpenFire(target) diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/censored.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/censored.dm index 43d885a588bb..7ea1b33f91ee 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/censored.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/censored.dm @@ -92,15 +92,15 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/censored/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/censored/AttackingTarget(atom/attacked_target) . = ..() if(!can_act) return - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.stat >= SOFT_CRIT || H.health < 0) return Convert(H) diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/crying_children.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/crying_children.dm index 01b9734613c0..d8e48db2a43b 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/crying_children.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/crying_children.dm @@ -260,24 +260,24 @@ Combusting_Courage() return -/mob/living/simple_animal/hostile/abnormality/crying_children/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/crying_children/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE if(!client) if(desperate && (courage_cooldown <= world.time) && prob(30)) return Combusting_Courage() if(sorrow_cooldown <= world.time && prob(25)) - return Wounds_Of_Sorrow(target) + return Wounds_Of_Sorrow(attacked_target) if(prob(35)) - return Bygone_Illusion(target) + return Bygone_Illusion(attacked_target) // Distorted Illusion can_act = FALSE icon_state = "[icon_phase]_salvador" . = ..() - if(isliving(target)) - var/mob/living/L = target + if(isliving(attacked_target)) + var/mob/living/L = attacked_target L.apply_lc_burn(5*burn_mod) SLEEP_CHECK_DEATH(10) icon_state = "[icon_phase]_idle" @@ -506,7 +506,7 @@ if(!target) target = H if(target in view(1, src)) - AttackingTarget() + AttackingTarget(target) tagged = TRUE // Unseeing diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/melting_love.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/melting_love.dm index 2254daf3402e..5f7e7bfc400a 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/melting_love.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/melting_love.dm @@ -80,16 +80,16 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/melting_love/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/melting_love/AttackingTarget(atom/attacked_target) // Convert - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target if(H.stat == DEAD || H.health <= HEALTH_THRESHOLD_DEAD) return SlimeConvert(H) // Consume a slime. Cannot work on the big one, so the check is not istype() - if(target.type == /mob/living/simple_animal/hostile/slime) - var/mob/living/simple_animal/hostile/slime/S = target + if(attacked_target.type == /mob/living/simple_animal/hostile/slime) + var/mob/living/simple_animal/hostile/slime/S = attacked_target visible_message(span_warning("[src] consumes \the [S], restoring its own health.")) . = ..() // We do a normal attack without AOE and then consume the slime to restore HP adjustBruteLoss(-maxHealth * 0.2) @@ -97,9 +97,9 @@ return . // AOE attack - if(isliving(target) || ismecha(target)) - new /obj/effect/gibspawner/generic/silent/melty_slime(get_turf(target)) - for(var/turf/open/T in view(1, target)) + if(isliving(attacked_target) || ismecha(attacked_target)) + new /obj/effect/gibspawner/generic/silent/melty_slime(get_turf(attacked_target)) + for(var/turf/open/T in view(1, attacked_target)) var/obj/effect/temp_visual/small_smoke/halfsecond/S = new(T) S.color = "#FF0081" var/list/got_hit = list() @@ -288,10 +288,10 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/slime/AttackingTarget() +/mob/living/simple_animal/hostile/slime/AttackingTarget(atom/attacked_target) // Convert - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target if(H.stat == DEAD || H.health <= HEALTH_THRESHOLD_DEAD) return SlimeConvert(H) if(prob(statuschance)) diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/mountain.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/mountain.dm index 013e9ef9b8b5..df85ac26e0df 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/mountain.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/mountain.dm @@ -110,16 +110,16 @@ return TRUE return FALSE -/mob/living/simple_animal/hostile/abnormality/mountain/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/mountain/AttackingTarget(atom/attacked_target) if(finishing) return FALSE if(phase >= 2) if(prob(35) && OpenFire()) return . = ..() - if(. && isliving(target)) - var/mob/living/L = target - if(isliving(target) && (L.health < 0 || L.stat == DEAD)) + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target + if(isliving(attacked_target) && (L.health < 0 || L.stat == DEAD)) finishing = TRUE if(phase == 3) icon_state = "mosb_bite2" diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/nobody_is.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/nobody_is.dm index 42a3fc83f160..69298d68c94c 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/nobody_is.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/nobody_is.dm @@ -604,8 +604,8 @@ for(var/i = 1 to 3) target_turf = get_step(target_turf, get_dir(get_turf(src), target_turf)) return WhipAttack(target_turf) - if(isliving(target)) - var/mob/living/L = target + if(isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.health <= 0) if(ishuman(L)) var/mob/living/carbon/human/H = L diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/seasons.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/seasons.dm index 315a75090c88..4115fa7ee9bf 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/seasons.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/seasons.dm @@ -335,8 +335,8 @@ return ConeAttack(target) if((slam_cooldown <= world.time) && prob(35)) return Slam() - if(ishuman(target)) - if(Finisher(target)) + if(ishuman(attacked_target)) + if(Finisher(attacked_target)) return return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/titania.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/titania.dm index 3b906ad075e2..0492723bd28f 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/titania.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/titania.dm @@ -71,16 +71,16 @@ return ..() //Attacking code -/mob/living/simple_animal/hostile/abnormality/titania/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/titania/AttackingTarget(atom/attacked_target) if(fused) return FALSE - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target //Kills the weak immediately. if(get_user_level(H) < 4 && (ishuman(H))) say("I rid you of your pain, mere human.") H.gib() for(var/i=fairy_spawn_number*2, i>=1, i--) //This counts down. - var/mob/living/simple_animal/hostile/fairyswarm/V = new(get_turf(target)) + var/mob/living/simple_animal/hostile/fairyswarm/V = new(get_turf(attacked_target)) V.faction = faction spawned_mobs+=V return diff --git a/code/modules/mob/living/simple_animal/abnormality/aleph/white_night.dm b/code/modules/mob/living/simple_animal/abnormality/aleph/white_night.dm index 674046cbca37..d86efa3cc58a 100644 --- a/code/modules/mob/living/simple_animal/abnormality/aleph/white_night.dm +++ b/code/modules/mob/living/simple_animal/abnormality/aleph/white_night.dm @@ -285,16 +285,16 @@ GLOBAL_LIST_EMPTY(apostles) return FALSE return ..() -/mob/living/simple_animal/hostile/apostle/AttackingTarget() +/mob/living/simple_animal/hostile/apostle/AttackingTarget(atom/attacked_target) if(!can_act) return - if(isliving(target)) - var/mob/living/L = target + if(isliving(attacked_target)) + var/mob/living/L = attacked_target if(faction_check_mob(L)) return . = ..() - if(. && isliving(target)) + if(. && isliving(attacked_target)) if(!client && ranged && ranged_cooldown <= world.time) OpenFire() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/KQE.dm b/code/modules/mob/living/simple_animal/abnormality/he/KQE.dm index ad4d8534c669..4652575e6c02 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/KQE.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/KQE.dm @@ -184,7 +184,7 @@ if(!can_act) return FALSE if ((grab_cooldown <= world.time) && prob(35) && (!client))//checks for client since you can still use the claw if you click nearby - var/turf/target_turf = get_turf(target) + var/turf/target_turf = get_turf(attacked_target) return ClawGrab(target_turf) return Whip_Attack() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/better_memories.dm b/code/modules/mob/living/simple_animal/abnormality/he/better_memories.dm index 4ae2f374ba81..afcf67e597b4 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/better_memories.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/better_memories.dm @@ -192,12 +192,12 @@ if(target_memory[the_target] <= 100) return FALSE -/mob/living/simple_animal/hostile/better_memories_minion/AttackingTarget() +/mob/living/simple_animal/hostile/better_memories_minion/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE if(!client) - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target /* Dont jab those standing still for their picture. Death is not our goal */ diff --git a/code/modules/mob/living/simple_animal/abnormality/he/blue_shepherd.dm b/code/modules/mob/living/simple_animal/abnormality/he/blue_shepherd.dm index a3a6564c1a52..96288336a9dc 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/blue_shepherd.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/blue_shepherd.dm @@ -196,12 +196,12 @@ hired = FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/blue_shepherd/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/blue_shepherd/AttackingTarget(atom/attacked_target) . = ..() if(client) switch(chosen_attack) if(1) - if(isliving(target)) + if(isliving(attacked_target)) slash_current-=1 return OpenFire() if(2) @@ -215,7 +215,7 @@ slashing = TRUE slash() if(awakened_buddy) - awakened_buddy.GiveTarget(target) + awakened_buddy.GiveTarget(attacked_target) /mob/living/simple_animal/hostile/abnormality/blue_shepherd/OpenFire() if(slash_current == 0) diff --git a/code/modules/mob/living/simple_animal/abnormality/he/drifting_fox.dm b/code/modules/mob/living/simple_animal/abnormality/he/drifting_fox.dm index cb4387d3c792..b72f1fdff62f 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/drifting_fox.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/drifting_fox.dm @@ -84,8 +84,8 @@ ..() /mob/living/simple_animal/hostile/abnormality/drifting_fox/AttackingTarget(atom/attacked_target) - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target H.apply_status_effect(STATUS_EFFECT_FALSEKIND) return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/eris.dm b/code/modules/mob/living/simple_animal/abnormality/he/eris.dm index 03b59a3c1849..21468b217174 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/eris.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/eris.dm @@ -98,10 +98,10 @@ return FALSE /mob/living/simple_animal/hostile/abnormality/eris/AttackingTarget(atom/attacked_target) - if(ishuman(target)) - var/mob/living/H = target + if(ishuman(attacked_target)) + var/mob/living/H = attacked_target if(H.stat >= SOFT_CRIT) - Dine(target) + Dine(attacked_target) return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/golden_false_apple.dm b/code/modules/mob/living/simple_animal/abnormality/he/golden_false_apple.dm index 3e8693ad2a81..606324bc156a 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/golden_false_apple.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/golden_false_apple.dm @@ -283,13 +283,13 @@ is_maggot = TRUE SpeedChange(-1) -/mob/living/simple_animal/hostile/abnormality/golden_apple/AttackingTarget()//regular attacks or AOE. Determines the outcome for both players and the AI behavior +/mob/living/simple_animal/hostile/abnormality/golden_apple/AttackingTarget(atom/attacked_target)//regular attacks or AOE. Determines the outcome for both players and the AI behavior if(!can_act) return FALSE if(!is_maggot)//Is it still in the first form? Start building sheen pulses if(pulse_count < pulse_maximum) - if(isliving(target)) - var/mob/living/hit = target + if(isliving(attacked_target)) + var/mob/living/hit = attacked_target if((hit.stat == DEAD) ||!ishuman(hit))//if the target is dead or not human return ..() pulse_count += 1 @@ -297,12 +297,12 @@ if(client && smash_cooldown < world.time)//playable behavior is nested under here switch(chosen_attack) if(1) - Smash(target) + Smash(attacked_target) if(2) - Smash(target, wide = FALSE) + Smash(attacked_target, wide = FALSE) return if(prob(50) && (smash_cooldown < world.time))//AI behavior goes here - Smash(target, wide = pick(TRUE, FALSE)) + Smash(attacked_target, wide = pick(TRUE, FALSE)) return return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/headless_ichthys.dm b/code/modules/mob/living/simple_animal/abnormality/he/headless_ichthys.dm index ee839fa2812e..1d791ad1dee6 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/headless_ichthys.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/headless_ichthys.dm @@ -178,14 +178,14 @@ can_act = TRUE // Breach Stuff -/mob/living/simple_animal/hostile/abnormality/headless_ichthys/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/headless_ichthys/AttackingTarget(atom/attacked_target) if(!can_act) return if(jump_cooldown <= world.time && prob(10) && !client) - IchthysJump(target) + IchthysJump(attacked_target) return if(cannon_cooldown <= world.time && prob(5) && !client) - BloodCannon(target) + BloodCannon(attacked_target) return return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/jangsan.dm b/code/modules/mob/living/simple_animal/abnormality/he/jangsan.dm index 40bfe79ff8c6..492f11c2e743 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/jangsan.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/jangsan.dm @@ -236,9 +236,9 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/jangsan/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/jangsan/AttackingTarget(atom/attacked_target) if(bite_cooldown < world.time) - KillCheck(target) + KillCheck(attacked_target) icon_state = icon_aggro return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/he/porccubus.dm b/code/modules/mob/living/simple_animal/abnormality/he/porccubus.dm index df41da37cc5e..e4de9b4c04c7 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/porccubus.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/porccubus.dm @@ -187,10 +187,10 @@ playsound(src, 'sound/abnormalities/porccubus/porccu_giggle.ogg', 10, FALSE, 4) // This thing is absurdly loud ranged_cooldown = world.time + ranged_cooldown_time -/mob/living/simple_animal/hostile/abnormality/porccubus/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/porccubus/AttackingTarget(atom/attacked_target) var/mob/living/carbon/human/H - if(ishuman(target)) - H = target + if(ishuman(attacked_target)) + H = attacked_target . = ..() if(.) if(!H) diff --git a/code/modules/mob/living/simple_animal/abnormality/he/red_shoes.dm b/code/modules/mob/living/simple_animal/abnormality/he/red_shoes.dm index 5336153f51b3..435dc9c79151 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/red_shoes.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/red_shoes.dm @@ -206,11 +206,11 @@ if(S.stat != DEAD && !S.target && !S.client && faction_check_mob(S))//cannibalized from steel ordeals S.Goto(src,S.move_to_delay,1) -/mob/living/simple_animal/hostile/abnormality/red_shoes/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/red_shoes/AttackingTarget(atom/attacked_target) . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.stat >= SOFT_CRIT || H.health < 0) ChopFeet(H) @@ -375,11 +375,11 @@ move_to_delay = 3 var/steppy = 0 -/mob/living/simple_animal/hostile/red_shoe/AttackingTarget() +/mob/living/simple_animal/hostile/red_shoe/AttackingTarget(atom/attacked_target) . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.stat >= SOFT_CRIT || H.health < 0) ChopFeet(H) diff --git a/code/modules/mob/living/simple_animal/abnormality/he/scarecrow.dm b/code/modules/mob/living/simple_animal/abnormality/he/scarecrow.dm index 351347ffa737..ca8df4ee7549 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/scarecrow.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/scarecrow.dm @@ -69,12 +69,12 @@ QDEL_IN(src, 10 SECONDS) ..() -/mob/living/simple_animal/hostile/abnormality/scarecrow/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/scarecrow/AttackingTarget(atom/attacked_target) . = ..() if(.) - if(!istype(target, /mob/living/carbon/human)) + if(!istype(attacked_target, /mob/living/carbon/human)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.health < 0 && stat != DEAD && !finishing && H.getorgan(/obj/item/organ/brain)) finishing = TRUE H.Stun(10 SECONDS) diff --git a/code/modules/mob/living/simple_animal/abnormality/he/woodsman.dm b/code/modules/mob/living/simple_animal/abnormality/he/woodsman.dm index c12cf3095f32..3ba472ba67ac 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/woodsman.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/woodsman.dm @@ -123,8 +123,8 @@ /mob/living/simple_animal/hostile/abnormality/woodsman/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target if(H.stat == DEAD || (H.health <= HEALTH_THRESHOLD_DEAD && HAS_TRAIT(H, TRAIT_NODEATH)) || H.health <= -30) Heal(H) return ..() @@ -134,12 +134,12 @@ if(client) switch(chosen_attack) if(1) - Woodsman_Flurry(target) + Woodsman_Flurry(attacked_target) if(2) return ..() return ..() - if(isliving(target) && flurry_cooldown <= world.time && get_dist(src, target) <= 2 && prob(30)) - Woodsman_Flurry(target) + if(isliving(attacked_target) && flurry_cooldown <= world.time && get_dist(src, attacked_target) <= 2 && prob(30)) + Woodsman_Flurry(attacked_target) return ..() /mob/living/simple_animal/hostile/abnormality/woodsman/PickTarget(list/Targets) // We attack corpses first if there are any diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/fairy_gentleman.dm b/code/modules/mob/living/simple_animal/abnormality/teth/fairy_gentleman.dm index b7135d6c24e5..57e15427f6c9 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/fairy_gentleman.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/fairy_gentleman.dm @@ -123,16 +123,16 @@ is_flying_animal = TRUE ADD_TRAIT(src, TRAIT_MOVE_FLYING, INNATE_TRAIT) -/mob/living/simple_animal/hostile/abnormality/fairy_gentleman/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/fairy_gentleman/AttackingTarget(atom/attacked_target) if(!can_act) return melee_damage_type = WHITE_DAMAGE if(jump_cooldown <= world.time && prob(10) && !client) - FairyJump(target) + FairyJump(attacked_target) return - if(!ishuman(target)) + if(!ishuman(attacked_target)) return ..() - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target H.drunkenness += 5 to_chat(H, span_warning("Yuck, some of it got in your mouth!")) if(H.sanity_lost) diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/fairy_long_legs.dm b/code/modules/mob/living/simple_animal/abnormality/teth/fairy_long_legs.dm index 285b4e05bf5d..2528619637aa 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/fairy_long_legs.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/fairy_long_legs.dm @@ -136,10 +136,10 @@ rain.End(FALSE) //Breach Stuff -/mob/living/simple_animal/hostile/abnormality/fairy_longlegs/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/fairy_longlegs/AttackingTarget(atom/attacked_target) if(finishing) return FALSE - if(!istype(target, /mob/living/carbon/human)) + if(!istype(attacked_target, /mob/living/carbon/human)) return ..() finishing = TRUE icon_state = "fairy_longlegs_healing" diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/pale_horse.dm b/code/modules/mob/living/simple_animal/abnormality/teth/pale_horse.dm index c9d566191f4c..1d3197701f58 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/pale_horse.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/pale_horse.dm @@ -123,11 +123,11 @@ for(var/turf/T in view(1, target_turf)) new /obj/effect/temp_visual/palefog(T) -/mob/living/simple_animal/hostile/abnormality/pale_horse/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/pale_horse/AttackingTarget(atom/attacked_target) . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return FALSE - var/mob/living/carbon/human/T = target + var/mob/living/carbon/human/T = attacked_target if(T.health > 0) var/datum/status_effect/mortis/M = T.has_status_effect(/datum/status_effect/mortis) if(!M) diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/ppodae.dm b/code/modules/mob/living/simple_animal/abnormality/teth/ppodae.dm index 747dc4152c00..056dd72909a0 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/ppodae.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/ppodae.dm @@ -46,11 +46,11 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/ppodae/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/ppodae/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE - var/mob/living/carbon/L = target - if(iscarbon(target) && (L.health < 0 || L.stat == DEAD)) + var/mob/living/carbon/L = attacked_target + if(iscarbon(attacked_target) && (L.health < 0 || L.stat == DEAD)) if(HAS_TRAIT(L, TRAIT_NODISMEMBER)) return var/list/parts = list() @@ -65,7 +65,7 @@ bp.forceMove(get_turf(datum_reference.landmark)) // Teleports limb to containment QDEL_NULL(src) // Taken from eldritch_demons.dm - return Smash(target) + return Smash(attacked_target) //AoE attack taken from woodsman /mob/living/simple_animal/hostile/abnormality/ppodae/proc/Smash(target) diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/punishing_bird.dm b/code/modules/mob/living/simple_animal/abnormality/teth/punishing_bird.dm index 5aaddb9ec3c9..778d56e7561a 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/punishing_bird.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/punishing_bird.dm @@ -156,8 +156,8 @@ var/mob/living/carbon/le_target = pick(potential_mobs) pecking_targets |= le_target -/mob/living/simple_animal/hostile/abnormality/punishing_bird/AttackingTarget() - if(ishuman(target) && bird_angry) +/mob/living/simple_animal/hostile/abnormality/punishing_bird/AttackingTarget(atom/attacked_target) + if(ishuman(attacked_target) && bird_angry) melee_damage_lower = angry_damage_human melee_damage_upper = angry_damage_human @@ -169,8 +169,8 @@ melee_damage_lower = 1 melee_damage_upper = 2 - if(isliving(target)) - var/mob/living/L = target + if(isliving(attacked_target)) + var/mob/living/L = attacked_target if(!(L in enemies) && obj_damage > 0) // The target didn't attack us and we've transformed to_chat(src, span_warning("You can't punish innocent people!")) return diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/simple_smile.dm b/code/modules/mob/living/simple_animal/abnormality/teth/simple_smile.dm index 111114038f35..860534842d32 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/simple_smile.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/simple_smile.dm @@ -53,10 +53,10 @@ -/mob/living/simple_animal/hostile/abnormality/smile/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/smile/AttackingTarget(atom/attacked_target) . = ..() - if(ishuman(target)) - var/mob/living/carbon/human/L = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/L = attacked_target L.Knockdown(20) var/obj/item/held = L.get_active_held_item() L.dropItemToGround(held) //Drop weapon diff --git a/code/modules/mob/living/simple_animal/abnormality/teth/so_that_no_cry.dm b/code/modules/mob/living/simple_animal/abnormality/teth/so_that_no_cry.dm index 0626e3892451..e09930122afc 100644 --- a/code/modules/mob/living/simple_animal/abnormality/teth/so_that_no_cry.dm +++ b/code/modules/mob/living/simple_animal/abnormality/teth/so_that_no_cry.dm @@ -179,12 +179,12 @@ can_act = TRUE //Talisman Stuff -/mob/living/simple_animal/hostile/abnormality/so_that_no_cry/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/so_that_no_cry/AttackingTarget(atom/attacked_target) if(!can_act) return - if(!ishuman(target)) + if(!ishuman(attacked_target)) return ..() - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target Apply_Talisman(H) return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/apex_predator.dm b/code/modules/mob/living/simple_animal/abnormality/waw/apex_predator.dm index f2f2c068e581..a6986013cef3 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/apex_predator.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/apex_predator.dm @@ -95,7 +95,7 @@ Cloak() GiveTarget(user) -/mob/living/simple_animal/hostile/abnormality/apex_predator/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/apex_predator/AttackingTarget(atom/attacked_target) if(!can_act) return if(!revealed) @@ -106,23 +106,23 @@ Decloak() SLEEP_CHECK_DEATH(3) //Backstab - if(target in range(1, src)) - if(isliving(target)) - var/mob/living/V = target - visible_message(span_danger("The [src] rips out [target]'s guts!")) + if(attacked_target in range(1, src)) + if(isliving(attacked_target)) + var/mob/living/V = attacked_target + visible_message(span_danger("The [src] rips out [attacked_target]'s guts!")) new /obj/effect/gibspawner/generic(get_turf(V)) V.apply_damage(backstab_damage, RED_DAMAGE, null, V.run_armor_check(null, RED_DAMAGE), spread_damage = TRUE) //Backstab succeeds from any one of 3 tiles behind a mecha, backstab from directly behind gets boosted by mecha directional armor weakness - else if(ismecha(target)) - var/relative_angle = abs(dir2angle(target.dir) - dir2angle(get_dir(target, src))) + else if(ismecha(attacked_target)) + var/relative_angle = abs(dir2angle(attacked_target.dir) - dir2angle(get_dir(attacked_target, src))) relative_angle = relative_angle > 180 ? 360 - relative_angle : relative_angle if(relative_angle >= 135) - visible_message(span_danger("The [src] shreds [target]'s armor!")) - var/obj/vehicle/sealed/mecha/M = target + visible_message(span_danger("The [src] shreds [attacked_target]'s armor!")) + var/obj/vehicle/sealed/mecha/M = attacked_target M.take_damage(backstab_damage, RED_DAMAGE, attack_dir = get_dir(M, src)) new /obj/effect/temp_visual/kinetic_blast(get_turf(M)) else - visible_message(span_danger("The [src]'s attack misses [target]'s weakspots!")) + visible_message(span_danger("The [src]'s attack misses [attacked_target]'s weakspots!")) ..() else ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/big_bird.dm b/code/modules/mob/living/simple_animal/abnormality/waw/big_bird.dm index 76d423babf07..e47ef25cb620 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/big_bird.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/big_bird.dm @@ -114,11 +114,11 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/big_bird/AttackingTarget() - if(ishuman(target)) +/mob/living/simple_animal/hostile/abnormality/big_bird/AttackingTarget(atom/attacked_target) + if(ishuman(attacked_target)) if(bite_cooldown > world.time) return FALSE - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target var/obj/item/bodypart/head/head = H.get_bodypart("head") if(QDELETED(head)) return diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/clown_smiling.dm b/code/modules/mob/living/simple_animal/abnormality/waw/clown_smiling.dm index 7aabcf79c827..51bef3e4330e 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/clown_smiling.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/clown_smiling.dm @@ -94,12 +94,12 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/clown/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/clown/AttackingTarget(atom/attacked_target) . = ..() if(.) - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/TH = target + var/mob/living/carbon/human/TH = attacked_target if(TH.health < 0) finishing = TRUE TH.Stun(4 SECONDS) diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/ebony_queen.dm b/code/modules/mob/living/simple_animal/abnormality/waw/ebony_queen.dm index 0c405c78b757..41e856fda51f 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/ebony_queen.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/ebony_queen.dm @@ -185,15 +185,15 @@ OpenFire() return - if(target) // You'd think this should be "attacked_target" but no this shit still uses target I hate it. - if(ismecha(target)) + if(attacked_target) // You'd think this should be "attacked_target" but no this shit still uses target I hate it. + if(ismecha(attacked_target)) if(burst_cooldown <= world.time && prob(50)) thornBurst() else OpenFire() return - else if(isliving(target)) - var/mob/living/L = target + else if(isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD) if(burst_cooldown <= world.time && prob(50)) thornBurst() diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/hatred_queen.dm b/code/modules/mob/living/simple_animal/abnormality/waw/hatred_queen.dm index 1b1fb8404fe4..5b139376319f 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/hatred_queen.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/hatred_queen.dm @@ -152,8 +152,8 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/abnormality/hatred_queen/AttackingTarget() - return OpenFire(target) +/mob/living/simple_animal/hostile/abnormality/hatred_queen/AttackingTarget(atom/attacked_target) + return OpenFire(attacked_target) /mob/living/simple_animal/hostile/abnormality/hatred_queen/OpenFire() if(!can_act || IsContained()) diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/judgement_bird.dm b/code/modules/mob/living/simple_animal/abnormality/waw/judgement_bird.dm index 08572681433d..1c1f71a694e5 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/judgement_bird.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/judgement_bird.dm @@ -175,10 +175,10 @@ retreat_distance = 3 minimum_distance = 1 -/mob/living/simple_animal/hostile/runawaybird/AttackingTarget() +/mob/living/simple_animal/hostile/runawaybird/AttackingTarget(atom/attacked_target) . = ..() - if(ishuman(target)) - var/mob/living/carbon/human/L = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/L = attacked_target L.Knockdown(20) var/obj/item/held = L.get_active_held_item() L.dropItemToGround(held) //Drop weapon diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/naked_nest.dm b/code/modules/mob/living/simple_animal/abnormality/waw/naked_nest.dm index 0d1a328bcc24..f8d213cfde71 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/naked_nest.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/naked_nest.dm @@ -177,14 +177,14 @@ origin_nest = home_naked_nest AddComponent(/datum/component/swarming) -/mob/living/simple_animal/hostile/naked_nest_serpent/AttackingTarget() - if(iscarbon(target)) - var/mob/living/carbon/human/C = target +/mob/living/simple_animal/hostile/naked_nest_serpent/AttackingTarget(atom/attacked_target) + if(iscarbon(attacked_target)) + var/mob/living/carbon/human/C = attacked_target if(C.stat != DEAD && !C.NAKED_NESTED && a_intent == "harm") EnterHost(C) return - if(istype(target, /mob/living/simple_animal/hostile/abnormality/naked_nest)) - var/mob/living/simple_animal/hostile/abnormality/naked_nest/nest = target + if(istype(attacked_target, /mob/living/simple_animal/hostile/abnormality/naked_nest)) + var/mob/living/simple_animal/hostile/abnormality/naked_nest/nest = attacked_target nest.RecoverSerpent(src) return ..() diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/nosferatu.dm b/code/modules/mob/living/simple_animal/abnormality/waw/nosferatu.dm index 6500dae6562e..2a400d14655d 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/nosferatu.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/nosferatu.dm @@ -178,15 +178,15 @@ Banquet() return -/mob/living/simple_animal/hostile/abnormality/nosferatu/AttackingTarget() //Combo for double attacks - if(!ishuman(target)) +/mob/living/simple_animal/hostile/abnormality/nosferatu/AttackingTarget(atom/attacked_target) //Combo for double attacks + if(!ishuman(attacked_target)) return ..() - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(bloodlust <= 0) bloodlust = bloodlust_cooldown H.apply_damage(45, BLACK_DAMAGE, null, H.run_armor_check(null, BLACK_DAMAGE)) playsound(get_turf(src), 'sound/abnormalities/nosferatu/bat_attack.ogg', 50, 1) - to_chat(target, span_danger("The [src] attacks you savagely!")) + to_chat(attacked_target, span_danger("The [src] attacks you savagely!")) AdjustThirst(40) else bloodlust -= 1 @@ -256,8 +256,8 @@ retreat_distance = 3 minimum_distance = 1 -/mob/living/simple_animal/hostile/nosferatu_mob/AttackingTarget() //they spawn blood on hit - if(ishuman(target)) +/mob/living/simple_animal/hostile/nosferatu_mob/AttackingTarget(atom/attacked_target) //they spawn blood on hit + if(ishuman(attacked_target)) var/obj/effect/decal/cleanable/blood/B = locate() in get_turf(src) if(!B) B = new /obj/effect/decal/cleanable/blood(get_turf(src)) diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/queen_bee.dm b/code/modules/mob/living/simple_animal/abnormality/waw/queen_bee.dm index f22207d11298..f4b6f349e0de 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/queen_bee.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/queen_bee.dm @@ -113,11 +113,11 @@ alpha = 25 animate(src, alpha = 255, transform = init_transform, time = 5) -/mob/living/simple_animal/hostile/worker_bee/AttackingTarget() +/mob/living/simple_animal/hostile/worker_bee/AttackingTarget(atom/attacked_target) . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.health <= 0) var/turf/T = get_turf(H) visible_message(span_danger("[src] bites hard on \the [H] as another bee appears!")) diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/screenwriter.dm b/code/modules/mob/living/simple_animal/abnormality/waw/screenwriter.dm index 2984e4b8da65..aae4d7f08134 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/screenwriter.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/screenwriter.dm @@ -305,12 +305,12 @@ Defeating the murderer also surpresses the abnormality. if(LAZYLEN(priority)) return pick(priority) -/mob/living/simple_animal/hostile/actor/AttackingTarget() +/mob/living/simple_animal/hostile/actor/AttackingTarget(atom/attacked_target) . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(!H.sanity_lost) return diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/sphinx.dm b/code/modules/mob/living/simple_animal/abnormality/waw/sphinx.dm index 2a2152564f4c..f42331aed719 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/sphinx.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/sphinx.dm @@ -256,12 +256,12 @@ if(LAZYLEN(priority)) return pick(priority) -/mob/living/simple_animal/hostile/abnormality/sphinx/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/sphinx/AttackingTarget(atom/attacked_target) ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(!H.sanity_lost) return diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/thunder_bird.dm b/code/modules/mob/living/simple_animal/abnormality/waw/thunder_bird.dm index c33c27d14496..f9a109de9b1b 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/thunder_bird.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/thunder_bird.dm @@ -360,13 +360,13 @@ var/mob/living/simple_animal/hostile/abnormality/thunder_bird/master //Zombie conversion from zombie kills -/mob/living/simple_animal/hostile/thunder_zombie/AttackingTarget() +/mob/living/simple_animal/hostile/thunder_zombie/AttackingTarget(atom/attacked_target) . = ..() if(!can_act) return - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.stat >= SOFT_CRIT || H.health < 0) Convert(H) diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/warden.dm b/code/modules/mob/living/simple_animal/abnormality/waw/warden.dm index b15a3555e3ae..a191f1953634 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/warden.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/warden.dm @@ -41,14 +41,14 @@ abnormality_origin = ABNORMALITY_ORIGIN_ARTBOOK var/finishing = FALSE -/mob/living/simple_animal/hostile/abnormality/warden/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/warden/AttackingTarget(atom/attacked_target) . = ..() if(.) if(finishing) return FALSE - if(!istype(target, /mob/living/carbon/human)) + if(!istype(attacked_target, /mob/living/carbon/human)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.health < 0) diff --git a/code/modules/mob/living/simple_animal/abnormality/waw/wrath_servant.dm b/code/modules/mob/living/simple_animal/abnormality/waw/wrath_servant.dm index 1ee80a712d80..ff1319716732 100644 --- a/code/modules/mob/living/simple_animal/abnormality/waw/wrath_servant.dm +++ b/code/modules/mob/living/simple_animal/abnormality/waw/wrath_servant.dm @@ -244,18 +244,18 @@ return if(prob(5)) if(friendly) - new /obj/effect/gibspawner/generic/silent/wrath_acid(get_turf(target)) + new /obj/effect/gibspawner/generic/silent/wrath_acid(get_turf(attacked_target)) else - new /obj/effect/gibspawner/generic/silent/wrath_acid/bad(get_turf(target)) + new /obj/effect/gibspawner/generic/silent/wrath_acid/bad(get_turf(attacked_target)) . = ..() attack_sound = pick('sound/abnormalities/wrath_servant/small_smash1.ogg','sound/abnormalities/wrath_servant/small_smash2.ogg') - if(!isliving(target) || (get_dist(target, src) > 1)) + if(!isliving(attacked_target) || (get_dist(attacked_target, src) > 1)) return - var/mob/living/L = target + var/mob/living/L = attacked_target L.apply_damage(rand(10, 15), BLACK_DAMAGE, null, L.run_armor_check(null, BLACK_DAMAGE), spread_damage = TRUE) - if(!istype(target, /mob/living/simple_animal/hostile/azure_hermit)) + if(!istype(attacked_target, /mob/living/simple_animal/hostile/azure_hermit)) return - var/mob/living/simple_animal/hostile/azure_hermit/AZ = target + var/mob/living/simple_animal/hostile/azure_hermit/AZ = attacked_target if(AZ.health > 120) return PerformEnding(AZ) @@ -627,8 +627,8 @@ /mob/living/simple_animal/hostile/azure_hermit/AttackingTarget(atom/attacked_target) if(!can_act || (status_flags & GODMODE)) return - if(istype(target, /mob/living/simple_animal/hostile/abnormality/wrath_servant)) - var/mob/living/simple_animal/hostile/abnormality/wrath_servant/SW = target + if(istype(attacked_target, /mob/living/simple_animal/hostile/abnormality/wrath_servant)) + var/mob/living/simple_animal/hostile/abnormality/wrath_servant/SW = attacked_target if(SW.stunned) return if(SW.health > 400) @@ -657,8 +657,8 @@ SW.icon_state = "wrath_staff_stun" SW.desc = "A large red monster with white bandages hanging from it. Its flesh oozes a bubble acid. A wooden staff is impaled in its chest, it can't seem to move!" return - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target if(get_user_level(H) < 3) say("Pardon me.") var/turf/TT = get_turf(H) diff --git a/code/modules/mob/living/simple_animal/abnormality/zayin/bald.dm b/code/modules/mob/living/simple_animal/abnormality/zayin/bald.dm index d4d1288795c5..42a98ca9a583 100644 --- a/code/modules/mob/living/simple_animal/abnormality/zayin/bald.dm +++ b/code/modules/mob/living/simple_animal/abnormality/zayin/bald.dm @@ -102,10 +102,10 @@ if(HAS_TRAIT(not_bald, TRAIT_BALD)) . -= not_bald -/mob/living/simple_animal/hostile/abnormality/bald/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/bald/AttackingTarget(atom/attacked_target) . = ..() - if(ishuman(target)) - var/mob/living/carbon/human/H = target + if(ishuman(attacked_target)) + var/mob/living/carbon/human/H = attacked_target do_bald(H) /mob/living/simple_animal/hostile/abnormality/bald/Login() diff --git a/code/modules/mob/living/simple_animal/abnormality/zayin/blubbering_toad.dm b/code/modules/mob/living/simple_animal/abnormality/zayin/blubbering_toad.dm index 0835a97b0ae2..d69a59e0dbcb 100644 --- a/code/modules/mob/living/simple_animal/abnormality/zayin/blubbering_toad.dm +++ b/code/modules/mob/living/simple_animal/abnormality/zayin/blubbering_toad.dm @@ -208,14 +208,14 @@ update_icon_state() //prevents icons from getting stuck ..() -/mob/living/simple_animal/hostile/abnormality/blubbering_toad/AttackingTarget() - if(!ishuman(target)) +/mob/living/simple_animal/hostile/abnormality/blubbering_toad/AttackingTarget(atom/attacked_target) + if(!ishuman(attacked_target)) return - if(target != idiot) - LoseTarget(target) + if(attacked_target != idiot) + LoseTarget(attacked_target) return ..() - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.sanity_lost) //prevents hitting the same guy in an infinite loop melee_damage_type = BLACK_DAMAGE if(H.health < 0) diff --git a/code/modules/mob/living/simple_animal/abnormality/zayin/bottle.dm b/code/modules/mob/living/simple_animal/abnormality/zayin/bottle.dm index caea70806996..488be3848858 100644 --- a/code/modules/mob/living/simple_animal/abnormality/zayin/bottle.dm +++ b/code/modules/mob/living/simple_animal/abnormality/zayin/bottle.dm @@ -77,8 +77,8 @@ /mob/living/simple_animal/hostile/abnormality/bottle/AttackingTarget(atom/attacked_target) if(eating) return - if(isliving(target)) - var/mob/living/L = target + if(isliving(attacked_target)) + var/mob/living/L = attacked_target if(faction_check_mob(L)) L.visible_message(span_danger("[src] feeds [L]... [L] seems heartier!"), span_nicegreen("[src] feeds you, you feel heartier!")) L.adjustBruteLoss(-speak_damage/2) diff --git a/code/modules/mob/living/simple_animal/abnormality/zayin/fairy_festival.dm b/code/modules/mob/living/simple_animal/abnormality/zayin/fairy_festival.dm index 49a0af263bd1..023188f23380 100644 --- a/code/modules/mob/living/simple_animal/abnormality/zayin/fairy_festival.dm +++ b/code/modules/mob/living/simple_animal/abnormality/zayin/fairy_festival.dm @@ -156,15 +156,15 @@ AddComponent(/datum/component/swarming) summon_backup() -/mob/living/simple_animal/hostile/mini_fairy/AttackingTarget() +/mob/living/simple_animal/hostile/mini_fairy/AttackingTarget(atom/attacked_target) . = ..() var/friends = 0 for(var/mob/living/simple_animal/hostile/mini_fairy/fren in view(6, src)) friends++ if(friends < 3) summon_backup() - if(ishuman(target)) - var/mob/living/L = target + if(ishuman(attacked_target)) + var/mob/living/L = attacked_target if(L.health < 0 || L.stat == DEAD) var/mob/living/simple_animal/hostile/mini_fairy/MF = new(get_turf(L)) MF.faction = src.faction diff --git a/code/modules/mob/living/simple_animal/abnormality/zayin/sleeping_beauty.dm b/code/modules/mob/living/simple_animal/abnormality/zayin/sleeping_beauty.dm index 2980b1a91be2..55fbb973131e 100644 --- a/code/modules/mob/living/simple_animal/abnormality/zayin/sleeping_beauty.dm +++ b/code/modules/mob/living/simple_animal/abnormality/zayin/sleeping_beauty.dm @@ -146,9 +146,9 @@ //pink midnight code -/mob/living/simple_animal/hostile/abnormality/sleeping/AttackingTarget() +/mob/living/simple_animal/hostile/abnormality/sleeping/AttackingTarget(atom/attacked_target) if(grab_cooldown < world.time) - buckle_mob(target) + buckle_mob(attacked_target) grab_cooldown = world.time + grab_cooldown_time return ..() diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 84ab90aafd29..4ca0cd39bf15 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -27,6 +27,10 @@ var/rapid_melee = 1 //Number of melee attacks between each npc pool tick. Spread evenly. var/melee_queue_distance = 4 //If target is close enough start preparing to hit them if we have rapid_melee enabled var/melee_reach = 1 // The range at which a mob can make melee attacks + var/attack_cooldown = 0 + var/attack_is_on_cooldown = FALSE + var/attack_timer_id = null + var/old_rapid_melee = 0 var/ranged_message = "fires" //Fluff text for ranged mobs var/ranged_cooldown = 0 //What the current cooldown on ranged attacks is, generally world.time + ranged_cooldown_time @@ -80,6 +84,9 @@ /mob/living/simple_animal/hostile/Initialize() . = ..() + if(attack_cooldown == 0) + attack_cooldown = SSnpcpool.wait / rapid_melee + old_rapid_melee = rapid_melee if(!targets_from) targets_from = src /*Update Speed overrides set speed and sets it @@ -90,6 +97,9 @@ /mob/living/simple_animal/hostile/Destroy() targets_from = null + if(attack_timer_id) + deltimer(attack_timer_id) + attack_timer_id = null return ..() /mob/living/simple_animal/hostile/Life() @@ -122,8 +132,9 @@ var/list/possible_targets = ListTargets() if(environment_smash) EscapeConfinement() - if(AICanContinue(possible_targets)) + if(!attack_is_on_cooldown) + TryAttack() if(!QDELETED(target) && !targets_from.Adjacent(target)) DestroyPathToTarget() if(!MoveToTarget(possible_targets)) //if we lose our target @@ -297,17 +308,17 @@ //////////////HOSTILE MOB TARGETTING AND AGGRESSION//////////// -/mob/living/simple_animal/hostile/proc/ListTargets() //Step 1, find out what we can see +/mob/living/simple_animal/hostile/proc/ListTargets(max_range = vision_range) //Step 1, find out what we can see if(!search_objects) - . = hearers(vision_range, targets_from) - src //Remove self, so we don't suicide + . = hearers(max_range, targets_from) - src //Remove self, so we don't suicide var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/vehicle/sealed/mecha)) - for(var/HM in typecache_filter_list(range(vision_range, targets_from), hostile_machines)) - if(can_see(targets_from, HM, vision_range)) + for(var/HM in typecache_filter_list(range(max_range, targets_from), hostile_machines)) + if(can_see(targets_from, HM, max_range)) . += HM else - . = oview(vision_range, targets_from) + . = oview(max_range, targets_from) /mob/living/simple_animal/hostile/proc/ListTargetsLazy(_Z) var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/vehicle/sealed/mecha)) @@ -344,9 +355,9 @@ /* Essentially is the middle part of FindTarget but returns only a list without giving a target.*/ -/mob/living/simple_animal/hostile/proc/PossibleThreats() +/mob/living/simple_animal/hostile/proc/PossibleThreats(max_range = vision_range) . = list() - for(var/pos_targ in ListTargets()) + for(var/pos_targ in ListTargets(max_range)) var/atom/A = pos_targ if(Found(A)) . = list(A) @@ -543,12 +554,52 @@ /mob/living/simple_animal/hostile/proc/CheckAndAttack() if(!target) return FALSE - var/in_range = melee_reach > 1 ? target.Adjacent(targets_from) || (get_dist(src, target) <= melee_reach && (target in view(src, melee_reach))) : target.Adjacent(targets_from) + var/in_range = melee_reach > 1 ? target.Adjacent(targets_from) || (get_dist(src, target) <= melee_reach && (target in view(melee_reach, src))) : target.Adjacent(targets_from) if(targets_from && isturf(targets_from.loc) && in_range && !incapacitated()) AttackingTarget() return TRUE return FALSE +/mob/living/simple_animal/hostile/Bumped(atom/movable/AM) + . = ..() + if(!client && AIStatus == AI_ON && !attack_is_on_cooldown && CanAttack(AM)) + TryAttack() + +/mob/living/simple_animal/hostile/Moved() + . = ..() + if(!client && AIStatus == AI_ON && target && !attack_is_on_cooldown) + TryAttack() + +/mob/living/simple_animal/hostile/proc/TryAttack() + if(client || stat != CONSCIOUS || AIStatus != AI_ON || incapacitated() || !targets_from || !isturf(targets_from.loc)) + attack_is_on_cooldown = FALSE + if(attack_timer_id) + deltimer(attack_timer_id) + attack_timer_id = null + return + if(target && (target.Adjacent(targets_from) || melee_reach > 1 && (target in view(melee_reach, targets_from)))) + //attack target + attack_is_on_cooldown = TRUE + if(attack_timer_id) + deltimer(attack_timer_id) + attack_timer_id = null + AttackingTarget(target) + GainPatience() + else + in_melee = FALSE + var/list/targets_in_range = PossibleThreats(melee_reach) + if(targets_in_range.len > 0) + //attack random thing in the list + attack_is_on_cooldown = TRUE + if(attack_timer_id) + deltimer(attack_timer_id) + attack_timer_id = null + AttackingTarget(pick(targets_in_range)) + else + attack_is_on_cooldown = FALSE + if(!attack_timer_id) + attack_timer_id = addtimer(CALLBACK(src, PROC_REF(TryAttack)), attack_cooldown, TIMER_STOPPABLE) + // Called by automated_action and causes the AI to go idle if it returns false. This proc is pretty big. /mob/living/simple_animal/hostile/proc/MoveToTarget(list/possible_targets) stop_automated_movement = 1 @@ -603,13 +654,6 @@ //This is for attacking. if(target) - if(targets_from && isturf(targets_from.loc) && in_range) - //If they're next to us, attack - MeleeAction() - else - if(rapid_melee > 1 && target_distance <= melee_queue_distance) - MeleeAction(FALSE) - in_melee = FALSE //If we're just preparing to strike do not enter sidestep mode return TRUE return FALSE @@ -637,13 +681,17 @@ walk_to(src, target, minimum_distance, delay) /mob/living/simple_animal/hostile/proc/AttackingTarget(atom/attacked_target) - SEND_SIGNAL(src, COMSIG_HOSTILE_ATTACKINGTARGET, target) - in_melee = TRUE - if(ismob(target)) - changeNext_move(SSnpcpool.wait / rapid_melee) - // Wow! that's a really weird variable to base attack speed on! Yes. - // It's because mobs typically attack once per this duration, because the subsystem calls handle_automated_movement() which then calls the attacking procs. - return target.attack_animal(src) + if(!attacked_target) + attacked_target = target + if(old_rapid_melee != rapid_melee) + attack_cooldown = SSnpcpool.wait / rapid_melee + old_rapid_melee = rapid_melee + SEND_SIGNAL(src, COMSIG_HOSTILE_ATTACKINGTARGET, attacked_target) + if(attacked_target == target) + in_melee = TRUE + if(ismob(attacked_target) || isobj(attacked_target)) + changeNext_move(attack_cooldown) + return attacked_target.attack_animal(src) //////////////END HOSTILE MOB TARGETTING AND AGGRESSION//////////// diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index ea7f320a71c2..fa6c4ce79523 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -117,12 +117,12 @@ else ..() -/mob/living/simple_animal/hostile/megafauna/AttackingTarget() +/mob/living/simple_animal/hostile/megafauna/AttackingTarget(atom/attacked_target) if(recovery_time >= world.time) return . = ..() - if(. && isliving(target)) - var/mob/living/L = target + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD) if(!client && ranged && ranged_cooldown <= world.time) OpenFire() diff --git a/code/modules/mob/living/simple_animal/hostile/ordeal/amber.dm b/code/modules/mob/living/simple_animal/hostile/ordeal/amber.dm index 9e908e4c0d82..46957021ffcb 100644 --- a/code/modules/mob/living/simple_animal/hostile/ordeal/amber.dm +++ b/code/modules/mob/living/simple_animal/hostile/ordeal/amber.dm @@ -79,10 +79,10 @@ if(. && target) //reset burrow cooldown whenever in combat burrow_cooldown = world.time + burrow_cooldown_time -/mob/living/simple_animal/hostile/ordeal/amber_bug/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/amber_bug/AttackingTarget(atom/attacked_target) . = ..() if(.) - var/dir_to_target = get_dir(get_turf(src), get_turf(target)) + var/dir_to_target = get_dir(get_turf(src), get_turf(attacked_target)) animate(src, pixel_y = (base_pixel_y + 18), time = 2) addtimer(CALLBACK(src, PROC_REF(AnimateBack)), 2) for(var/i = 1 to 2) diff --git a/code/modules/mob/living/simple_animal/hostile/ordeal/crimson.dm b/code/modules/mob/living/simple_animal/hostile/ordeal/crimson.dm index d9f370c1c725..d565e71a984f 100644 --- a/code/modules/mob/living/simple_animal/hostile/ordeal/crimson.dm +++ b/code/modules/mob/living/simple_animal/hostile/ordeal/crimson.dm @@ -36,9 +36,9 @@ return TRUE return FALSE -/mob/living/simple_animal/hostile/ordeal/crimson_clown/AttackingTarget() - if(istype(target, /obj/machinery/computer/abnormality)) - var/obj/machinery/computer/abnormality/CA = target +/mob/living/simple_animal/hostile/ordeal/crimson_clown/AttackingTarget(atom/attacked_target) + if(istype(attacked_target, /obj/machinery/computer/abnormality)) + var/obj/machinery/computer/abnormality/CA = attacked_target if(console_attack_counter < 12) console_attack_counter += 1 visible_message(span_warning("[src] hits [CA]'s buttons at random!")) @@ -367,10 +367,10 @@ L.apply_damage(700, RED_DAMAGE, null, L.run_armor_check(null, RED_DAMAGE)) gib() -/mob/living/simple_animal/hostile/ordeal/crimson_tent/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/crimson_tent/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE - return Bite(target) + return Bite(attacked_target) /mob/living/simple_animal/hostile/ordeal/crimson_tent/proc/Bite(target) if (get_dist(src, target) > 3) diff --git a/code/modules/mob/living/simple_animal/hostile/ordeal/gold.dm b/code/modules/mob/living/simple_animal/hostile/ordeal/gold.dm index edad37cb4a01..dd066c9dda38 100644 --- a/code/modules/mob/living/simple_animal/hostile/ordeal/gold.dm +++ b/code/modules/mob/living/simple_animal/hostile/ordeal/gold.dm @@ -214,10 +214,10 @@ guaranteed_butcher_results = list(/obj/item/food/meat/slab/human/mutant/plant = 1) stat_attack = DEAD -/mob/living/simple_animal/hostile/ordeal/sin_gluttony/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/sin_gluttony/AttackingTarget(atom/attacked_target) . = ..() - if(. && isliving(target)) - var/mob/living/L = target + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD && SSmaptype.maptype != "limbus_labs") if(L.health <= HEALTH_THRESHOLD_DEAD && HAS_TRAIT(L, TRAIT_NODEATH)) devour(L) @@ -293,10 +293,10 @@ AreaAttack() return -/mob/living/simple_animal/hostile/ordeal/white_lake_corrosion/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/white_lake_corrosion/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE - return Slash(target) + return Slash(attacked_target) /mob/living/simple_animal/hostile/ordeal/white_lake_corrosion/proc/Slash(target) if (get_dist(src, target) > 3) @@ -518,16 +518,16 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/ordeal/sin_pride/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/sin_pride/AttackingTarget(atom/attacked_target) if(charging) return if(dash_cooldown <= world.time && prob(10) && !client) - PrepCharge(target) + PrepCharge(attacked_target) return . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.health < 0) if(SSmaptype.maptype != "limbus_labs") H.gib() @@ -632,19 +632,19 @@ var/charged = FALSE var/list/spawned_mobs = list() -/mob/living/simple_animal/hostile/ordeal/thunderbird_corrosion/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/thunderbird_corrosion/AttackingTarget(atom/attacked_target) . = ..() - if(!isliving(target)) + if(!isliving(attacked_target)) return - var/mob/living/L = target + var/mob/living/L = attacked_target if(charged) L.apply_damage(15, BLACK_DAMAGE, null, L.run_armor_check(null, BLACK_DAMAGE)) playsound(get_turf(src), 'sound/weapons/fixer/generic/energyfinisher1.ogg', 75, 1) to_chat(L,span_danger("The [src] unleashes its charge!")) charged = FALSE - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.stat >= SOFT_CRIT || H.health < 0) Convert(H) @@ -890,7 +890,7 @@ if(!can_act) return FALSE if((hello_cooldown <= world.time) && prob(35)) - var/turf/target_turf = get_turf(target) + var/turf/target_turf = get_turf(attacked_target) for(var/i = 1 to 3) target_turf = get_step(target_turf, get_dir(get_turf(src), target_turf)) return Hello(target_turf) @@ -976,12 +976,12 @@ return FALSE ..() -/mob/living/simple_animal/hostile/ordeal/snake_corrosion/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/snake_corrosion/AttackingTarget(atom/attacked_target) if(!can_act) return FALSE ..() - if(isliving(target)) - var/mob/living/H = target + if(isliving(attacked_target)) + var/mob/living/H = attacked_target H.apply_venom(applied_venom) /mob/living/simple_animal/hostile/ordeal/snake_corrosion/OpenFire() @@ -1138,16 +1138,16 @@ return ..() -/mob/living/simple_animal/hostile/ordeal/dog_corrosion/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/dog_corrosion/AttackingTarget(atom/attacked_target) if(charging) return if(dash_cooldown <= world.time && !client && charge_ready) - PrepCharge(target) + PrepCharge(attacked_target) return . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target if(H.health < 0) H.gib() playsound(src, "sound/abnormalities/clouded_monk/eat.ogg", 75, 1) @@ -1276,9 +1276,9 @@ /mob/living/simple_animal/hostile/ordeal/sin_wrath/AttackingTarget(atom/attacked_target) . = ..() - if(!ishuman(target)) + if(!ishuman(attacked_target)) return - var/mob/living/carbon/human/H = target + var/mob/living/carbon/human/H = attacked_target var/datum/status_effect/stacking/fuming/F = H.has_status_effect(/datum/status_effect/stacking/fuming) if(!F) to_chat(H, span_userdanger("You start to feel overcome with rage!")) @@ -1386,11 +1386,11 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/ordeal/sin_lust/AttackingTarget()// AOE attacks only +/mob/living/simple_animal/hostile/ordeal/sin_lust/AttackingTarget(atom/attacked_target)// AOE attacks only if(!can_act) return FALSE if(prob(50)) - return Smash(target, wide = pick(TRUE, FALSE)) + return Smash(attacked_target, wide = pick(TRUE, FALSE)) return ..() //AoE attack taken from golden apple diff --git a/code/modules/mob/living/simple_animal/hostile/ordeal/green.dm b/code/modules/mob/living/simple_animal/hostile/ordeal/green.dm index f1b5def52349..d6422cd4769b 100644 --- a/code/modules/mob/living/simple_animal/hostile/ordeal/green.dm +++ b/code/modules/mob/living/simple_animal/hostile/ordeal/green.dm @@ -47,14 +47,14 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/ordeal/green_bot/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/green_bot/AttackingTarget(atom/attacked_target) . = ..() if(.) - if(!istype(target, /mob/living/carbon/human)) + if(!istype(attacked_target, /mob/living/carbon/human)) return if(SSmaptype.maptype == "city") return - var/mob/living/carbon/human/TH = target + var/mob/living/carbon/human/TH = attacked_target if(TH.health < 0) finishing = TRUE TH.Stun(4 SECONDS) @@ -162,12 +162,12 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/ordeal/green_bot_big/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/green_bot_big/AttackingTarget(atom/attacked_target) . = ..() if(.) - if(!istype(target, /mob/living)) + if(!istype(attacked_target, /mob/living)) return - var/turf/T = get_turf(target) + var/turf/T = get_turf(attacked_target) if(!T) return for(var/i = 1 to 4) diff --git a/code/modules/mob/living/simple_animal/hostile/ordeal/indigo.dm b/code/modules/mob/living/simple_animal/hostile/ordeal/indigo.dm index 2f024700ab2b..4a030ffb3915 100644 --- a/code/modules/mob/living/simple_animal/hostile/ordeal/indigo.dm +++ b/code/modules/mob/living/simple_animal/hostile/ordeal/indigo.dm @@ -24,10 +24,10 @@ blood_volume = BLOOD_VOLUME_NORMAL silk_results = list(/obj/item/stack/sheet/silk/indigo_simple = 1) -/mob/living/simple_animal/hostile/ordeal/indigo_dawn/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/indigo_dawn/AttackingTarget(atom/attacked_target) . = ..() - if(. && isliving(target)) - var/mob/living/L = target + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD) if(L.health <= HEALTH_THRESHOLD_DEAD && HAS_TRAIT(L, TRAIT_NODEATH)) devour(L) @@ -89,10 +89,10 @@ . = ..() a_intent_change(INTENT_HELP) -/mob/living/simple_animal/hostile/ordeal/indigo_noon/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/indigo_noon/AttackingTarget(atom/attacked_target) . = ..() - if(. && isliving(target)) - var/mob/living/L = target + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD) if(L.health <= HEALTH_THRESHOLD_DEAD && HAS_TRAIT(L, TRAIT_NODEATH)) devour(L) @@ -222,10 +222,10 @@ . = ..() a_intent_change(INTENT_HELP) //so that they dont get body blocked by their kin outside of combat -/mob/living/simple_animal/hostile/ordeal/indigo_dusk/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/indigo_dusk/AttackingTarget(atom/attacked_target) . = ..() - if(. && isliving(target)) - var/mob/living/L = target + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD) if(L.health <= HEALTH_THRESHOLD_DEAD && HAS_TRAIT(L, TRAIT_NODEATH)) devour(L) @@ -385,10 +385,10 @@ patrol_reset() return FALSE -/mob/living/simple_animal/hostile/ordeal/indigo_midnight/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/indigo_midnight/AttackingTarget(atom/attacked_target) . = ..() - if(. && isliving(target)) - var/mob/living/L = target + if(. && isliving(attacked_target)) + var/mob/living/L = attacked_target if(L.stat != DEAD) if(L.health <= HEALTH_THRESHOLD_DEAD && HAS_TRAIT(L, TRAIT_NODEATH)) devour(L) diff --git a/code/modules/mob/living/simple_animal/hostile/ordeal/white.dm b/code/modules/mob/living/simple_animal/hostile/ordeal/white.dm index 10296b8fe447..bd15154022af 100644 --- a/code/modules/mob/living/simple_animal/hostile/ordeal/white.dm +++ b/code/modules/mob/living/simple_animal/hostile/ordeal/white.dm @@ -59,12 +59,12 @@ current_pulse_range = max(6, current_pulse_range - min(round(amount * 0.1), 4)) // Being attacked will reduce the range temporarily return ..() -/mob/living/simple_animal/hostile/ordeal/black_fixer/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/black_fixer/AttackingTarget(atom/attacked_target) if(busy) return ..() if(hammer_cooldown < world.time) - HammerAttack(target) + HammerAttack(attacked_target) /mob/living/simple_animal/hostile/ordeal/black_fixer/OpenFire() if(busy) @@ -390,15 +390,15 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/ordeal/red_fixer/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/red_fixer/AttackingTarget(atom/attacked_target) if(busy) return ..() if(multislash_cooldown < world.time) - MultiSlash(target) + MultiSlash(attacked_target) return if(prob(50) && beam_cooldown < world.time) - LaserBeam(target) + LaserBeam(attacked_target) return /mob/living/simple_animal/hostile/ordeal/red_fixer/OpenFire() @@ -542,14 +542,14 @@ return FALSE return ..() -/mob/living/simple_animal/hostile/ordeal/pale_fixer/AttackingTarget() +/mob/living/simple_animal/hostile/ordeal/pale_fixer/AttackingTarget(atom/attacked_target) if(!can_act) return if(prob(60) && multislash_cooldown < world.time) - MultiSlash(target) + MultiSlash(attacked_target) return if(prob(40) && tentacle_cooldown < world.time) - TentacleAttack(target) + TentacleAttack(attacked_target) return return ..() diff --git a/code/modules/spells/ability_types/realized.dm b/code/modules/spells/ability_types/realized.dm index 4aab5a3f9fb1..8c03c7dd3d8e 100644 --- a/code/modules/spells/ability_types/realized.dm +++ b/code/modules/spells/ability_types/realized.dm @@ -1046,10 +1046,10 @@ AddComponent(/datum/component/knockback, 1, FALSE, TRUE) QDEL_IN(src, (90 SECONDS)) -/mob/living/simple_animal/hostile/shrimp/friendly/AttackingTarget() +/mob/living/simple_animal/hostile/shrimp/friendly/AttackingTarget(atom/attacked_target) . = ..() if(.) - var/mob/living/L = target + var/mob/living/L = attacked_target if(L.health < 0 || L.stat == DEAD) L.gib() //Punch them so hard they explode /* Flesh Idol - Repentance */ @@ -1224,8 +1224,8 @@ AddComponent(/datum/component/swarming) QDEL_IN(src, (20 SECONDS)) -/mob/living/simple_animal/hostile/naked_nest_serpent_friend/AttackingTarget() - var/mob/living/L = target +/mob/living/simple_animal/hostile/naked_nest_serpent_friend/AttackingTarget(atom/attacked_target) + var/mob/living/L = attacked_target var/datum/status_effect/stacking/infestation/INF = L.has_status_effect(/datum/status_effect/stacking/infestation) if(!INF) INF = L.apply_status_effect(/datum/status_effect/stacking/infestation) diff --git a/code/modules/suppressions/extraction.dm b/code/modules/suppressions/extraction.dm index fae16e15516a..fbe1415f385a 100644 --- a/code/modules/suppressions/extraction.dm +++ b/code/modules/suppressions/extraction.dm @@ -174,8 +174,8 @@ /* Combat */ -/mob/living/simple_animal/hostile/megafauna/arbiter/AttackingTarget() - return OpenFire(target) +/mob/living/simple_animal/hostile/megafauna/arbiter/AttackingTarget(atom/attacked_target) + return OpenFire(attacked_target) /mob/living/simple_animal/hostile/megafauna/arbiter/OpenFire(target) if(charging)