From 57e6bfa458c0850b6df3529aa4aad541b3aaebcb Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Mon, 13 Nov 2023 20:34:01 +0000 Subject: [PATCH] remove single letter vars --- .../abilities/warrior/warrior_powers.dm | 171 ++++++++---------- .../living/carbon/xenomorph/castes/Warrior.dm | 46 ++--- 2 files changed, 101 insertions(+), 116 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm index 1ba675f5e6d6..4160c43ae494 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/warrior/warrior_powers.dm @@ -1,28 +1,28 @@ -/datum/action/xeno_action/activable/lunge/use_ability(atom/A) - var/mob/living/carbon/xenomorph/X = owner +/datum/action/xeno_action/activable/lunge/use_ability(atom/affected_atom) + var/mob/living/carbon/xenomorph/xeno = owner if (!action_cooldown_check()) if(twitch_message_cooldown < world.time ) - X.visible_message(SPAN_XENOWARNING("\The [X]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you try to lunge but lack the strength. Wait a moment to try again.")) + xeno.visible_message(SPAN_XENOWARNING("[xeno]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you try to lunge but lack the strength. Wait a moment to try again.")) twitch_message_cooldown = world.time + 5 SECONDS return //this gives a little feedback on why your lunge didn't hit other than the lunge button going grey. Plus, it might spook marines that almost got lunged if they know why the message appeared, and extra spookiness is always good. - if (!A) + if (!affected_atom) return - if (!isturf(X.loc)) - to_chat(X, SPAN_XENOWARNING("You can't lunge from here!")) + if (!isturf(xeno.loc)) + to_chat(xeno, SPAN_XENOWARNING("You can't lunge from here!")) return - if (!X.check_state() || X.agility) + if (!xeno.check_state() || xeno.agility) return - if(X.can_not_harm(A) || !ismob(A)) + if(xeno.can_not_harm(affected_atom) || !ismob(affected_atom)) apply_cooldown_override(click_miss_cooldown) return - var/mob/living/carbon/H = A - if(H.stat == DEAD) + var/mob/living/carbon/carbon = affected_atom + if(carbon.stat == DEAD) return if (!check_and_use_plasma_owner()) @@ -31,81 +31,64 @@ apply_cooldown() ..() - X.visible_message(SPAN_XENOWARNING("\The [X] lunges towards [H]!"), SPAN_XENOWARNING("You lunge at [H]!")) + xeno.visible_message(SPAN_XENOWARNING("[xeno] lunges towards [carbon]!"), SPAN_XENOWARNING("You lunge at [carbon]!")) - X.throw_atom(get_step_towards(A, X), grab_range, SPEED_FAST, X) + xeno.throw_atom(get_step_towards(affected_atom, xeno), grab_range, SPEED_FAST, xeno) - if (X.Adjacent(H)) - X.start_pulling(H,1) + if (xeno.Adjacent(carbon)) + xeno.start_pulling(carbon,1) else - X.visible_message(SPAN_XENOWARNING("\The [X]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you lunge but are unable to grab onto your target. Wait a moment to try again.")) + xeno.visible_message(SPAN_XENOWARNING("[xeno]'s claws twitch."), SPAN_XENOWARNING("Your claws twitch as you lunge but are unable to grab onto your target. Wait a moment to try again.")) return TRUE -/datum/action/xeno_action/onclick/toggle_agility/use_ability(atom/A) - var/mob/living/carbon/xenomorph/X = owner +/datum/action/xeno_action/activable/fling/use_ability(atom/affected_atom) + var/mob/living/carbon/xenomorph/xeno = owner if (!action_cooldown_check()) return - if (!X.check_state(1)) + if (!isxeno_human(affected_atom) || xeno.can_not_harm(affected_atom)) return - X.agility = !X.agility - if (X.agility) - to_chat(X, SPAN_XENOWARNING("You lower yourself to all fours.")) - else - to_chat(X, SPAN_XENOWARNING("You raise yourself to stand on two feet.")) - X.update_icons() - - apply_cooldown() - return ..() - -/datum/action/xeno_action/activable/fling/use_ability(atom/target_atom) - var/mob/living/carbon/xenomorph/woyer = owner - - if (!action_cooldown_check()) + if (!xeno.check_state() || xeno.agility) return - if (!isxeno_human(target_atom) || woyer.can_not_harm(target_atom)) + if (!xeno.Adjacent(affected_atom)) return - if (!woyer.check_state() || woyer.agility) + var/mob/living/carbon/carbon = affected_atom + if(carbon.stat == DEAD) return - if (!woyer.Adjacent(target_atom)) + if(HAS_TRAIT(carbon, TRAIT_NESTED)) return - var/mob/living/carbon/carbone = target_atom - if(carbone.stat == DEAD) return - if(HAS_TRAIT(carbone, TRAIT_NESTED)) - return - - if(carbone == woyer.pulling) - woyer.stop_pulling() + if(carbon == xeno.pulling) + xeno.stop_pulling() - if(carbone.mob_size >= MOB_SIZE_BIG) - to_chat(woyer, SPAN_XENOWARNING("[carbone] is too big for you to fling!")) + if(carbon.mob_size >= MOB_SIZE_BIG) + to_chat(xeno, SPAN_XENOWARNING("[carbon] is too big for you to fling!")) return if (!check_and_use_plasma_owner()) return - woyer.visible_message(SPAN_XENOWARNING("\The [woyer] effortlessly flings [carbone] to the side!"), SPAN_XENOWARNING("You effortlessly fling [carbone] to the side!")) - playsound(carbone,'sound/weapons/alien_claw_block.ogg', 75, 1) + xeno.visible_message(SPAN_XENOWARNING("[xeno] effortlessly flings [carbon] to the side!"), SPAN_XENOWARNING("You effortlessly fling [carbon] to the side!")) + playsound(carbon,'sound/weapons/alien_claw_block.ogg', 75, 1) if(stun_power) - carbone.apply_effect(get_xeno_stun_duration(carbone, stun_power), STUN) + carbon.apply_effect(get_xeno_stun_duration(carbon, stun_power), STUN) if(weaken_power) - carbone.apply_effect(weaken_power, WEAKEN) + carbon.apply_effect(weaken_power, WEAKEN) if(slowdown) - if(carbone.slowed < slowdown) - carbone.apply_effect(slowdown, SLOW) - carbone.last_damage_data = create_cause_data(initial(woyer.caste_type), woyer) - shake_camera(carbone, 2, 1) + if(carbon.slowed < slowdown) + carbon.apply_effect(slowdown, SLOW) + carbon.last_damage_data = create_cause_data(initial(xeno.caste_type), xeno) + shake_camera(carbon, 2, 1) - var/facing = get_dir(woyer, carbone) - var/turf/throw_turf = woyer.loc - var/turf/temp = woyer.loc + var/facing = get_dir(xeno, carbon) + var/turf/throw_turf = xeno.loc + var/turf/temp = xeno.loc for (var/x in 0 to fling_distance-1) temp = get_step(throw_turf, facing) @@ -114,82 +97,84 @@ throw_turf = temp // Hmm today I will kill a marine while looking away from them - woyer.face_atom(carbone) - woyer.animation_attack_on(carbone) - woyer.flick_attack_overlay(carbone, "disarm") - carbone.throw_atom(throw_turf, fling_distance, SPEED_VERY_FAST, woyer, TRUE) + xeno.face_atom(carbon) + xeno.animation_attack_on(carbon) + xeno.flick_attack_overlay(carbon, "disarm") + carbon.throw_atom(throw_turf, fling_distance, SPEED_VERY_FAST, xeno, TRUE) apply_cooldown() return ..() -/datum/action/xeno_action/activable/warrior_punch/use_ability(atom/target_atom) - var/mob/living/carbon/xenomorph/woyer = owner +/datum/action/xeno_action/activable/warrior_punch/use_ability(atom/affected_atom) + var/mob/living/carbon/xenomorph/xeno = owner if (!action_cooldown_check()) return - if (!isxeno_human(target_atom) || woyer.can_not_harm(target_atom)) + if (!isxeno_human(affected_atom) || xeno.can_not_harm(affected_atom)) return - if (!woyer.check_state() || woyer.agility) + if (!xeno.check_state() || xeno.agility) return - var/distance = get_dist(woyer, target_atom) + var/distance = get_dist(xeno, affected_atom) if (distance > 2) return - var/mob/living/carbon/carbone = target_atom + var/mob/living/carbon/carbon = affected_atom - if (!woyer.Adjacent(carbone)) + if (!xeno.Adjacent(carbon)) return - if(carbone.stat == DEAD) return - if(HAS_TRAIT(carbone, TRAIT_NESTED)) return - - var/obj/limb/target_limb = carbone.get_limb(check_zone(woyer.zone_selected)) + if(carbon.stat == DEAD) + return + if(HAS_TRAIT(carbon, TRAIT_NESTED)) + return - if (ishuman(carbone) && (!target_limb || (target_limb.status & LIMB_DESTROYED))) - target_limb = carbone.get_limb("chest") + var/obj/limb/target_limb = carbon.get_limb(check_zone(xeno.zone_selected)) + if (ishuman(carbon) && (!target_limb || (target_limb.status & LIMB_DESTROYED))) + target_limb = carbon.get_limb("chest") if (!check_and_use_plasma_owner()) return - carbone.last_damage_data = create_cause_data(initial(woyer.caste_type), woyer) + carbon.last_damage_data = create_cause_data(initial(xeno.caste_type), xeno) - woyer.visible_message(SPAN_XENOWARNING("\The [woyer] hits [carbone] in the [target_limb? target_limb.display_name : "chest"] with a devastatingly powerful punch!"), \ - SPAN_XENOWARNING("You hit [carbone] in the [target_limb? target_limb.display_name : "chest"] with a devastatingly powerful punch!")) - var/S = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg') - playsound(carbone,S, 50, 1) - do_base_warrior_punch(carbone, target_limb) + xeno.visible_message(SPAN_XENOWARNING("[xeno] hits [carbon] in the [target_limb ? target_limb.display_name : "chest"] with a devastatingly powerful punch!"), \ + SPAN_XENOWARNING("You hit [carbon] in the [target_limb ? target_limb.display_name : "chest"] with a devastatingly powerful punch!")) + var/sound = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg') + playsound(carbon, sound, 50, 1) + do_base_warrior_punch(carbon, target_limb) apply_cooldown() return ..() -/datum/action/xeno_action/activable/warrior_punch/proc/do_base_warrior_punch(mob/living/carbon/carbone, obj/limb/target_limb) - var/mob/living/carbon/xenomorph/woyer = owner +/datum/action/xeno_action/activable/warrior_punch/proc/do_base_warrior_punch(mob/living/carbon/carbon, obj/limb/target_limb) + var/mob/living/carbon/xenomorph/xeno = owner var/damage = rand(base_damage, base_damage + damage_variance) - if(ishuman(carbone)) + if(ishuman(carbon)) if((target_limb.status & LIMB_SPLINTED) && !(target_limb.status & LIMB_SPLINTED_INDESTRUCTIBLE)) //If they have it splinted, the splint won't hold. target_limb.status &= ~LIMB_SPLINTED - playsound(get_turf(carbone), 'sound/items/splintbreaks.ogg', 20) - to_chat(carbone, SPAN_DANGER("The splint on your [target_limb.display_name] comes apart!")) - carbone.pain.apply_pain(PAIN_BONE_BREAK_SPLINTED) + playsound(get_turf(carbon), 'sound/items/splintbreaks.ogg', 20) + to_chat(carbon, SPAN_DANGER("The splint on your [target_limb.display_name] comes apart!")) + carbon.pain.apply_pain(PAIN_BONE_BREAK_SPLINTED) + + if(ishuman_strict(carbon)) + carbon.apply_effect(3, SLOW) - if(ishuman_strict(carbone)) - carbone.apply_effect(3, SLOW) - if(isyautja(carbone)) + if(isyautja(carbon)) damage = rand(base_punch_damage_pred, base_punch_damage_pred + damage_variance) else if(target_limb.status & (LIMB_ROBOT|LIMB_SYNTHSKIN)) damage = rand(base_punch_damage_synth, base_punch_damage_synth + damage_variance) - carbone.apply_armoured_damage(get_xeno_damage_slash(carbone, damage), ARMOR_MELEE, BRUTE, target_limb? target_limb.name : "chest") + carbon.apply_armoured_damage(get_xeno_damage_slash(carbon, damage), ARMOR_MELEE, BRUTE, target_limb ? target_limb.name : "chest") // Hmm today I will kill a marine while looking away from them - woyer.face_atom(carbone) - woyer.animation_attack_on(carbone) - woyer.flick_attack_overlay(carbone, "punch") - shake_camera(carbone, 2, 1) - step_away(carbone, woyer, 2) + xeno.face_atom(carbon) + xeno.animation_attack_on(carbon) + xeno.flick_attack_overlay(carbon, "punch") + shake_camera(carbon, 2, 1) + step_away(carbon, xeno, 2) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm index 7c8edace81e4..869d7c12ec52 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm @@ -72,41 +72,41 @@ lunged.set_effect(0, WEAKEN) return ..() -/mob/living/carbon/xenomorph/warrior/start_pulling(atom/movable/AM, lunge) +/mob/living/carbon/xenomorph/warrior/start_pulling(atom/movable/movable_atom, lunge) if (!check_state() || agility) return FALSE - if(!isliving(AM)) + if(!isliving(movable_atom)) return FALSE - var/mob/living/L = AM - var/should_neckgrab = !(src.can_not_harm(L)) && lunge + var/mob/living/living_mob = movable_atom + var/should_neckgrab = !(src.can_not_harm(living_mob)) && lunge - if(!QDELETED(L) && !QDELETED(L.pulledby) && L != src ) //override pull of other mobs - visible_message(SPAN_WARNING("[src] has broken [L.pulledby]'s grip on [L]!"), null, null, 5) - L.pulledby.stop_pulling() + if(!QDELETED(living_mob) && !QDELETED(living_mob.pulledby) && living_mob != src ) //override pull of other mobs + visible_message(SPAN_WARNING("[src] has broken [living_mob.pulledby]'s grip on [living_mob]!"), null, null, 5) + living_mob.pulledby.stop_pulling() - . = ..(L, lunge, should_neckgrab) + . = ..(living_mob, lunge, should_neckgrab) if(.) //successful pull - if(isxeno(L)) - var/mob/living/carbon/xenomorph/X = L - if(X.tier >= 2) // Tier 2 castes or higher immune to warrior grab stuns - return . - - if(should_neckgrab && L.mob_size < MOB_SIZE_BIG) - L.drop_held_items() - L.apply_effect(get_xeno_stun_duration(L, 2), WEAKEN) - L.pulledby = src - visible_message(SPAN_XENOWARNING("\The [src] grabs [L] by the throat!"), \ - SPAN_XENOWARNING("You grab [L] by the throat!")) + if(isxeno(living_mob)) + var/mob/living/carbon/xenomorph/xeno = living_mob + if(xeno.tier >= 2) // Tier 2 castes or higher immune to warrior grab stuns + return + + if(should_neckgrab && living_mob.mob_size < MOB_SIZE_BIG) + living_mob.drop_held_items() + living_mob.apply_effect(get_xeno_stun_duration(living_mob, 2), WEAKEN) + living_mob.pulledby = src + visible_message(SPAN_XENOWARNING("[src] grabs [living_mob] by the throat!"), \ + SPAN_XENOWARNING("You grab [living_mob] by the throat!")) lunging = TRUE - addtimer(CALLBACK(src, PROC_REF(stop_lunging)), get_xeno_stun_duration(L, 2) SECONDS + 1 SECONDS) + addtimer(CALLBACK(src, PROC_REF(stop_lunging)), get_xeno_stun_duration(living_mob, 2) SECONDS + 1 SECONDS) /mob/living/carbon/xenomorph/warrior/proc/stop_lunging(world_time) lunging = FALSE -/mob/living/carbon/xenomorph/warrior/hitby(atom/movable/AM) - if(ishuman(AM)) +/mob/living/carbon/xenomorph/warrior/hitby(atom/movable/movable_atom) + if(ishuman(movable_atom)) return ..() @@ -120,7 +120,7 @@ var/color = "#6c6f24" var/emote_cooldown = 0 -/datum/behavior_delegate/warrior_base/melee_attack_additional_effects_target(mob/living/carbon/A) +/datum/behavior_delegate/warrior_base/melee_attack_additional_effects_target(mob/living/carbon/carbon) ..() if(SEND_SIGNAL(bound_xeno, COMSIG_XENO_PRE_HEAL) & COMPONENT_CANCEL_XENO_HEAL)