diff --git a/code/game/objects/structures/barricade/barricade.dm b/code/game/objects/structures/barricade/barricade.dm index 2412c4557c32..705ec4bb16ed 100644 --- a/code/game/objects/structures/barricade/barricade.dm +++ b/code/game/objects/structures/barricade/barricade.dm @@ -44,12 +44,12 @@ addtimer(CALLBACK(src, PROC_REF(update_icon)), 0) starting_maxhealth = maxhealth -/obj/structure/barricade/initialize_pass_flags(datum/pass_flags_container/PF) +/obj/structure/barricade/initialize_pass_flags(datum/pass_flags_container/pass_flags) ..() - if (PF) - PF.flags_can_pass_all = NONE - PF.flags_can_pass_front = NONE - PF.flags_can_pass_behind = PASS_OVER^(PASS_OVER_ACID_SPRAY|PASS_OVER_THROW_MOB) + if (pass_flags) + pass_flags.flags_can_pass_all = NONE + pass_flags.flags_can_pass_front = NONE + pass_flags.flags_can_pass_behind = PASS_OVER^(PASS_OVER_ACID_SPRAY|PASS_OVER_THROW_MOB) flags_can_pass_front_temp = PASS_OVER_THROW_MOB flags_can_pass_behind_temp = PASS_OVER_THROW_MOB @@ -108,34 +108,34 @@ ..() -/obj/structure/barricade/hitby(atom/movable/AM) - if(AM.throwing && is_wired) - if(iscarbon(AM)) - var/mob/living/carbon/C = AM - if(C.mob_size <= MOB_SIZE_XENO) - C.visible_message(SPAN_DANGER("The barbed wire slices into [C]!"), +/obj/structure/barricade/hitby(atom/movable/atom_movable) + if(atom_movable.throwing && is_wired) + if(iscarbon(atom_movable)) + var/mob/living/carbon/living_carbon = atom_movable + if(living_carbon.mob_size <= MOB_SIZE_XENO) + living_carbon.visible_message(SPAN_DANGER("The barbed wire slices into [living_carbon]!"), SPAN_DANGER("The barbed wire slices into you!")) - C.apply_damage(10) - C.apply_effect(2, WEAKEN) //Leaping into barbed wire is VERY bad - playsound(C, "bonk", 75, FALSE) + living_carbon.apply_damage(10) + living_carbon.apply_effect(2, WEAKEN) //Leaping into barbed wire is VERY bad + playsound(living_carbon, "bonk", 75, FALSE) ..() -/obj/structure/barricade/Collided(atom/movable/AM) +/obj/structure/barricade/Collided(atom/movable/atom_movable) ..() - if(istype(AM, /mob/living/carbon/xenomorph/crusher)) - var/mob/living/carbon/xenomorph/crusher/C = AM + if(istype(atom_movable, /mob/living/carbon/xenomorph/crusher)) + var/mob/living/carbon/xenomorph/crusher/living_carbon = atom_movable - if (!C.throwing) + if (!living_carbon.throwing) return if(crusher_resistant) - visible_message(SPAN_DANGER("[C] smashes into [src]!")) + visible_message(SPAN_DANGER("[living_carbon] smashes into [src]!")) take_damage(150) playsound(src, barricade_hitsound, 25, TRUE) - else if(!C.stat) - visible_message(SPAN_DANGER("[C] smashes through [src]!")) + else if(!living_carbon.stat) + visible_message(SPAN_DANGER("[living_carbon] smashes through [src]!")) deconstruct(FALSE) playsound(src, barricade_hitsound, 25, TRUE) @@ -165,8 +165,8 @@ if(closed) return NO_BLOCKED_MOVEMENT - var/obj/structure/S = locate(/obj/structure) in get_turf(mover) - if(S && S.climbable && !(S.flags_atom & ON_BORDER) && climbable && isliving(mover)) //Climbable objects allow you to universally climb over others + var/obj/structure/structure = locate(/obj/structure) in get_turf(mover) + if(structure && structure.climbable && !(structure.flags_atom & ON_BORDER) && climbable && isliving(mover)) //Climbable objects allow you to universally climb over others return NO_BLOCKED_MOVEMENT return ..() @@ -182,33 +182,33 @@ /obj/structure/barricade/attack_animal(mob/user as mob) return attack_alien(user) -/obj/structure/barricade/attackby(obj/item/W, mob/user) - if(istype(W, /obj/item/weapon/zombie_claws)) +/obj/structure/barricade/attackby(obj/item/item, mob/user) + if(istype(item, /obj/item/weapon/zombie_claws)) user.visible_message(SPAN_DANGER("The zombie smashed at the [src.barricade_type] barricade!"), SPAN_DANGER("You smack the [src.barricade_type] barricade!")) if(barricade_hitsound) playsound(src, barricade_hitsound, 35, 1) - hit_barricade(W) + hit_barricade(item) return - for(var/obj/effect/xenomorph/acid/A in src.loc) - if(A.acid_t == src) + for(var/obj/effect/xenomorph/acid/acid in src.loc) + if(acid.acid_t == src) to_chat(user, "You can't get near that, it's melting!") return - if(istype(W, /obj/item/stack/barbed_wire)) - var/obj/item/stack/barbed_wire/B = W + if(istype(item, /obj/item/stack/barbed_wire)) + var/obj/item/stack/barbed_wire/B = item if(can_wire) - user.visible_message(SPAN_NOTICE("[user] starts setting up [W.name] on [src]."), - SPAN_NOTICE("You start setting up [W.name] on [src].")) + user.visible_message(SPAN_NOTICE("[user] starts setting up [item.name] on [src]."), + SPAN_NOTICE("You start setting up [item.name] on [src].")) if(do_after(user, 20, INTERRUPT_NO_NEEDHAND|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src) && can_wire) // Make sure there's still enough wire in the stack - if(!B.use(1)) + if(!barricade.use(1)) return playsound(src.loc, 'sound/effects/barbed_wire_movement.ogg', 25, 1) - user.visible_message(SPAN_NOTICE("[user] sets up [W.name] on [src]."), - SPAN_NOTICE("You set up [W.name] on [src].")) + user.visible_message(SPAN_NOTICE("[user] sets up [item.name] on [src]."), + SPAN_NOTICE("You set up [item.name] on [src].")) maxhealth += 50 update_health(-50) @@ -220,7 +220,7 @@ update_icon() return - if(HAS_TRAIT(W, TRAIT_TOOL_WIRECUTTERS)) + if(HAS_TRAIT(item, TRAIT_TOOL_WIRECUTTERS)) if(is_wired) user.visible_message(SPAN_NOTICE("[user] begin removing the barbed wire on [src]."), SPAN_NOTICE("You begin removing the barbed wire on [src].")) @@ -242,27 +242,27 @@ new/obj/item/stack/barbed_wire( src.loc ) return - if(W.force > force_level_absorption) + if(item.force > force_level_absorption) ..() if(barricade_hitsound) playsound(src, barricade_hitsound, 35, 1) - hit_barricade(W) + hit_barricade(item) -/obj/structure/barricade/bullet_act(obj/item/projectile/P) - bullet_ping(P) +/obj/structure/barricade/bullet_act(obj/item/projectile/bullet) + bullet_ping(bullet) - if(P.ammo.damage_type == BURN) - P.damage = P.damage * burn_multiplier + if(bullet.ammo.damage_type == BURN) + bullet.damage = bullet.damage * burn_multiplier else - P.damage = P.damage * brute_projectile_multiplier + bullet.damage = bullet.damage * brute_projectile_multiplier - if(istype(P.ammo, /datum/ammo/xeno/boiler_gas)) + if(istype(bullet.ammo, /datum/ammo/xeno/boiler_gas)) take_damage(round(50 * burn_multiplier)) - else if(P.ammo.flags_ammo_behavior & AMMO_ANTISTRUCT) - take_damage(P.damage * ANTISTRUCT_DMG_MULT_BARRICADES) + else if(bullet.ammo.flags_ammo_behavior & atom_movableMO_ANTISTRUCT) + take_damage(bullet.damage * ANTISTRUCT_DMG_MULT_BARRICADES) - take_damage(P.damage) + take_damage(bullet.damage) return TRUE @@ -284,11 +284,11 @@ /obj/structure/barricade/ex_act(severity, direction, cause_data) - for(var/obj/structure/barricade/B in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade - if(B.dir == reverse_direction(dir)) + for(var/obj/structure/barricade/barricade in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade + if(barricade.dir == reverse_direction(dir)) spawn(1) - if(B) - B.ex_act(severity, direction) + if(barricade) + barricade.ex_act(severity, direction) if(health <= 0) var/location = get_turf(src) handle_debris(severity, direction) @@ -325,13 +325,13 @@ /obj/structure/barricade/flamer_fire_act(dam = BURN_LEVEL_TIER_1) take_damage(dam * burn_flame_multiplier) -/obj/structure/barricade/proc/hit_barricade(obj/item/I) - take_damage(I.force * 0.5 * brute_multiplier) +/obj/structure/barricade/proc/hit_barricade(obj/item/item) + take_damage(item.force * 0.5 * brute_multiplier) /obj/structure/barricade/proc/take_damage(damage) - for(var/obj/structure/barricade/B in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade - if(B.dir == reverse_direction(dir)) - B.update_health(damage) + for(var/obj/structure/barricade/barricade in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade + if(barricade.dir == reverse_direction(dir)) + barricade.update_health(damage) update_health(damage) @@ -359,12 +359,12 @@ if(50 to 75) damage_state = BARRICADE_DMG_SLIGHT if(75 to INFINITY) damage_state = BARRICADE_DMG_NONE -/obj/structure/barricade/proc/weld_cade(obj/item/tool/weldingtool/WT, mob/user) +/obj/structure/barricade/proc/weld_cade(obj/item/tool/weldingtool/welder, mob/user) if(!metallic) user.visible_message(SPAN_WARNING("You can't weld \the [src]!")) return FALSE - if(!(WT.remove_fuel(2, user))) + if(!(welder.remove_fuel(2, user))) return FALSE user.visible_message(SPAN_NOTICE("[user] begins repairing damage to [src]."), @@ -415,20 +415,20 @@ return ..() -/obj/structure/barricade/proc/try_nailgun_usage(obj/item/W, mob/user) - if(length(repair_materials) == 0 || health >= maxhealth || !istype(W, /obj/item/weapon/gun/smg/nailgun)) +/obj/structure/barricade/proc/try_nailgun_usage(obj/item/item, mob/user) + if(length(repair_materials) == 0 || health >= maxhealth || !istype(item, /obj/item/weapon/gun/smg/nailgun)) return FALSE - var/obj/item/weapon/gun/smg/nailgun/NG = W + var/obj/item/weapon/gun/smg/nailgun/nailgun = item - if(!NG.in_chamber || !NG.current_mag || NG.current_mag.current_rounds < 3) + if(!nailgun.in_chamber || !nailgun.current_mag || nailgun.current_mag.current_rounds < 3) to_chat(user, SPAN_WARNING("You require at least 4 nails to complete this task!")) return FALSE // Check if either hand has a metal stack by checking the weapon offhand // Presume the material is a sheet until proven otherwise. var/obj/item/stack/sheet/material = null - if(user.l_hand == NG) + if(user.l_hand == nailgun) material = user.r_hand else material = user.l_hand @@ -447,8 +447,8 @@ to_chat(user, SPAN_WARNING("You'll need some adequate repair material in your other hand to patch up [src]!")) return FALSE - var/soundchannel = playsound(src, NG.repair_sound, 25, 1) - if(!do_after(user, NG.nailing_speed, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, src)) + var/soundchannel = playsound(src, nailgun.repair_sound, 25, 1) + if(!do_after(user, nailgun.nailing_speed, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, src)) playsound(src, null, channel = soundchannel) return FALSE @@ -456,7 +456,7 @@ to_chat(user, SPAN_WARNING("You seems to have misplaced the repair material!")) return FALSE - if(!NG.in_chamber || !NG.current_mag || NG.current_mag.current_rounds < 3) + if(!nailgun.in_chamber || !nailgun.current_mag || nailgun.current_mag.current_rounds < 3) to_chat(user, SPAN_WARNING("You require at least 4 nails to complete this task!")) return FALSE @@ -464,7 +464,7 @@ to_chat(user, SPAN_WARNING("You nail [material] to [src], restoring some of its integrity!")) update_damage_state() material.use(1) - NG.current_mag.current_rounds -= 3 - NG.in_chamber = null - NG.load_into_chamber() + nailgun.current_mag.current_rounds -= 3 + nailgun.in_chamber = null + nailgun.load_into_chamber() return TRUE diff --git a/code/game/objects/structures/barricade/metal.dm b/code/game/objects/structures/barricade/metal.dm index ab18c9f469e1..4056ac9021f8 100644 --- a/code/game/objects/structures/barricade/metal.dm +++ b/code/game/objects/structures/barricade/metal.dm @@ -42,9 +42,9 @@ if(BARRICADE_UPGRADE_ANTIFF) . += SPAN_NOTICE("The cade is protected by a composite upgrade.") -/obj/structure/barricade/metal/attackby(obj/item/W, mob/user) - if(iswelder(W)) - if(!HAS_TRAIT(W, TRAIT_TOOL_BLOWTORCH)) +/obj/structure/barricade/metal/attackby(obj/item/item, mob/user) + if(iswelder(item)) + if(!HAS_TRAIT(item, TRAIT_TOOL_BLOWTORCH)) to_chat(user, SPAN_WARNING("You need a stronger blowtorch!")) return if(user.action_busy) @@ -52,7 +52,7 @@ if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED)) to_chat(user, SPAN_WARNING("You're not trained to repair [src]...")) return - var/obj/item/tool/weldingtool/WT = W + var/obj/item/tool/weldingtool/welder = item if(damage_state == BARRICADE_DMG_HEAVY) to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired.")) return @@ -61,10 +61,10 @@ to_chat(user, SPAN_WARNING("[src] doesn't need repairs.")) return - weld_cade(WT, user) + weld_cade(welder, user) return - if(try_nailgun_usage(W, user)) + if(try_nailgun_usage(item, user)) return for(var/obj/effect/xenomorph/acid/A in src.loc) @@ -74,7 +74,7 @@ switch(build_state) if(BARRICADE_BSTATE_SECURED) //Fully constructed step. Use screwdriver to remove the protection panels to reveal the bolts - if(HAS_TRAIT(W, TRAIT_TOOL_SCREWDRIVER)) + if(HAS_TRAIT(item, TRAIT_TOOL_SCREWDRIVER)) if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED)) to_chat(user, SPAN_WARNING("You are not trained to touch [src]...")) return @@ -88,14 +88,14 @@ build_state = BARRICADE_BSTATE_UNSECURED return - if(istype(W, /obj/item/stack/sheet/metal)) + if(istype(item, /obj/item/stack/sheet/metal)) if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED)) to_chat(user, SPAN_WARNING("You are not trained to touch [src]...")) return if(upgraded) to_chat(user, SPAN_NOTICE("This barricade is already upgraded.")) return - var/obj/item/stack/sheet/metal/M = W + var/obj/item/stack/sheet/metal/metal = item if(user.client?.prefs?.no_radials_preference) var/choice = tgui_input_list(user, "Choose an upgrade to apply to the barricade", "Apply Upgrade", list(BARRICADE_UPGRADE_BURN, BARRICADE_UPGRADE_BRUTE, BARRICADE_UPGRADE_ANTIFF)) if(!choice) @@ -106,11 +106,11 @@ if(upgraded) to_chat(user, SPAN_NOTICE("This barricade is already upgraded.")) return - if(M.get_amount() < 2) + if(metal.get_amount() < 2) to_chat(user, SPAN_NOTICE("You lack the required metal.")) return - if((usr.get_active_hand()) != M) - to_chat(user, SPAN_WARNING("You must be holding the [M] to upgrade \the [src]!")) + if((usr.get_active_hand()) != metal) + to_chat(user, SPAN_WARNING("You must be holding the [metal] to upgrade \the [src]!")) return switch(choice) @@ -131,7 +131,7 @@ upgraded = BARRICADE_UPGRADE_ANTIFF to_chat(user, SPAN_NOTICE("You applied a composite upgrade.")) - M.use(2) + metal.use(2) user.count_niche_stat(STATISTICS_NICHE_UPGRADE_CADES) update_icon() return @@ -146,11 +146,11 @@ if(upgraded) to_chat(user, SPAN_NOTICE("This barricade is already upgraded.")) return - if(M.get_amount() < 2) + if(metal.get_amount() < 2) to_chat(user, SPAN_NOTICE("You lack the required metal.")) return - if((usr.get_active_hand()) != M) - to_chat(user, SPAN_WARNING("You must be holding the [M] to upgrade \the [src]!")) + if((usr.get_active_hand()) != metal) + to_chat(user, SPAN_WARNING("You must be holding the [metal] to upgrade \the [src]!")) return switch(choice) @@ -171,12 +171,12 @@ upgraded = BARRICADE_UPGRADE_ANTIFF to_chat(user, SPAN_NOTICE("You applied a composite upgrade.")) - M.use(2) + metal.use(2) user.count_niche_stat(STATISTICS_NICHE_UPGRADE_CADES) update_icon() return - if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL)) + if(HAS_TRAIT(item, TRAIT_TOOL_MULTITOOL)) if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED)) to_chat(user, SPAN_WARNING("You are not trained to touch [src]...")) return @@ -197,7 +197,7 @@ return if(BARRICADE_BSTATE_UNSECURED) //Protection panel removed step. Screwdriver to put the panel back, wrench to unsecure the anchor bolts - if(HAS_TRAIT(W, TRAIT_TOOL_SCREWDRIVER)) + if(HAS_TRAIT(item, TRAIT_TOOL_SCREWDRIVER)) if(user.action_busy) return if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED)) @@ -209,7 +209,7 @@ SPAN_NOTICE("You set [src]'s protection panel back.")) build_state = BARRICADE_BSTATE_SECURED return - if(HAS_TRAIT(W, TRAIT_TOOL_WRENCH)) + if(HAS_TRAIT(item, TRAIT_TOOL_WRENCH)) if(user.action_busy) return if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED)) @@ -224,7 +224,7 @@ update_icon() //unanchored changes layer return if(BARRICADE_BSTATE_MOVABLE) //Anchor bolts loosened step. Apply crowbar to unseat the panel and take apart the whole thing. Apply wrench to resecure anchor bolts - if(HAS_TRAIT(W, TRAIT_TOOL_WRENCH)) + if(HAS_TRAIT(item, TRAIT_TOOL_WRENCH)) if(user.action_busy) return if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED)) @@ -234,8 +234,8 @@ if(B != src && B.dir == dir) to_chat(user, SPAN_WARNING("There's already a barricade here.")) return - var/turf/open/T = loc - if(!(istype(T) && T.allow_construction)) + var/turf/open/turf = loc + if(!(istype(turf) && turf.allow_construction)) to_chat(user, SPAN_WARNING("[src] must be secured on a proper surface!")) return playsound(src.loc, 'sound/items/Ratchet.ogg', 25, 1) @@ -246,7 +246,7 @@ anchored = TRUE update_icon() //unanchored changes layer return - if(HAS_TRAIT(W, TRAIT_TOOL_CROWBAR)) + if(HAS_TRAIT(item, TRAIT_TOOL_CROWBAR)) if(user.action_busy) return if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED))