From 848eea75c52be1baf5a32058b29d7e3d708c3eef Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:09:46 +0100 Subject: [PATCH] Borg RCD nerf + migration to new attack chain (#27857) * RCD nerf + migration * Warrior review * Fixes weird behaviour --- code/game/mecha/equipment/tools/work_tools.dm | 4 +- code/game/objects/items/weapons/RCD.dm | 59 ++++++++++--------- .../mob/living/silicon/robot/robot_mob.dm | 4 +- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 49e958586f6..c78c0fd5d54 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -205,7 +205,7 @@ range = MECHA_MELEE | MECHA_RANGED flags_2 = NO_MAT_REDEMPTION_2 var/mode = MECH_RCD_MODE_DECONSTRUCT - var/canRwall = 0 + var/can_rwall = 0 toolspeed = 1 usesound = 'sound/items/deconstruct.ogg' @@ -231,7 +231,7 @@ switch(mode) if(MECH_RCD_MODE_DECONSTRUCT) if(iswallturf(target)) - if((isreinforcedwallturf(target) && !canRwall) || istype(target, /turf/simulated/wall/indestructible)) + if((isreinforcedwallturf(target) && !can_rwall) || istype(target, /turf/simulated/wall/indestructible)) return 0 var/turf/simulated/wall/W = target occupant_message("Deconstructing [target]...") diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 7ba89187f25..d09f84a766f 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -161,7 +161,7 @@ /datum/rcd_act/remove_wall/can_act(atom/A, obj/item/rcd/rcd) if(!..()) return FALSE - if(isreinforcedwallturf(A) && !rcd.canRwall) + if(isreinforcedwallturf(A) && !rcd.can_rwall) return FALSE if(istype(A, /turf/simulated/wall/indestructible)) return FALSE @@ -230,6 +230,7 @@ req_access = list(ACCESS_ENGINE) armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 100, ACID = 50) resistance_flags = FIRE_PROOF + new_attack_chain = TRUE /// No ammo warning var/no_ammo_message = "The \'Low Ammo\' light on the device blinks yellow." /// The spark system used to create sparks when the user interacts with the RCD. @@ -241,7 +242,7 @@ /// The RCD's current build mode. var/mode = MODE_TURF /// If the RCD can deconstruct reinforced walls. - var/canRwall = FALSE + var/can_rwall = FALSE /// Is the RCD's airlock access selection menu locked? var/locked = TRUE /// The current airlock type that will be build. @@ -357,7 +358,7 @@ return OBLITERATION user.visible_message("[user] puts the barrel of [src] into [user.p_their()] mouth and pulls the trigger. It looks like [user.p_theyre()] trying to commit suicide!") - if(!afterattack__legacy__attackchain(suicide_tile, user, TRUE)) + if(!interact_with_atom(suicide_tile, user, TRUE)) flags &= ~NODROP return SHAME user.visible_message("[user] explodes as [src] builds a structure inside [user.p_them()]!") @@ -413,11 +414,13 @@ update_icon(UPDATE_OVERLAYS) SStgui.update_uis(src) -/obj/item/rcd/attackby__legacy__attackchain(obj/item/W, mob/user, params) - if(!istype(W, /obj/item/rcd_ammo)) +/obj/item/rcd/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/rcd_ammo)) return ..() - var/obj/item/rcd_ammo/R = W - load(R, user) + var/obj/item/rcd_ammo/ammo = used + load(ammo, user) + return ITEM_INTERACT_COMPLETE + /** * Creates and displays a radial menu to a user when they trigger the `attack_self` of the RCD. * @@ -464,8 +467,9 @@ playsound(src, 'sound/effects/pop.ogg', 50, 0) to_chat(user, "You change [src]'s mode to '[choice]'.") - -/obj/item/rcd/attack_self__legacy__attackchain(mob/user) +/obj/item/rcd/activate_self(mob/user) + if(..()) + return //Change the mode // Oh I thought the UI was just for fucking staring at radial_menu(user) @@ -598,20 +602,19 @@ else return FALSE -/obj/item/rcd/afterattack__legacy__attackchain(atom/A, mob/user, proximity) - if(!proximity) +/obj/item/rcd/interact_with_atom(atom/target, mob/living/user, list/modifiers) + . = ..() + if(istype(target, /turf/space/transit)) return FALSE - if(istype(A, /turf/space/transit)) - return FALSE - if(!is_type_in_list(A, allowed_targets)) + if(!is_type_in_list(target, allowed_targets)) return FALSE for(var/datum/rcd_act/act in possible_actions) - if(act.can_act(A, src)) - . = act.try_act(A, src, user) + if(act.can_act(target, src)) + . = act.try_act(target, src, user) update_icon(UPDATE_OVERLAYS) SStgui.update_uis(src) - return + return ITEM_INTERACT_COMPLETE if(mode == MODE_DECON) to_chat(user, "You can't deconstruct that!") @@ -656,20 +659,20 @@ add_overlay("[icon_state]_charge[ratio]") /obj/item/rcd/borg - canRwall = TRUE - /// A multipler which is applied to matter amount checks. A higher number means more power usage per RCD usage. - var/power_use_multiplier = 160 + can_rwall = TRUE + matter = 100 /obj/item/rcd/borg/syndicate - power_use_multiplier = 80 + /// A multipler which is applied to matter amount checks. A higher number means more power usage per RCD usage. + var/power_use_multiplier = 80 -/obj/item/rcd/borg/use(amount) +/obj/item/rcd/borg/syndicate/use(amount) var/mob/living/silicon/robot/R = usr if(!istype(R)) return FALSE return R.cell.use(amount * power_use_multiplier) -/obj/item/rcd/borg/tool_use_check(mob/user, amount) +/obj/item/rcd/borg/syndicate/tool_use_check(mob/user, amount) if(!isrobot(user)) return FALSE var/mob/living/silicon/robot/R = user @@ -701,7 +704,7 @@ item_state = "crcd" max_matter = 500 matter = 500 - canRwall = TRUE + can_rwall = TRUE /obj/item/rcd_ammo name = "compressed matter cartridge" @@ -714,13 +717,15 @@ anchored = FALSE origin_tech = "materials=3" materials = list(MAT_METAL=16000, MAT_GLASS=8000) + new_attack_chain = TRUE var/ammoamt = 20 -/obj/item/rcd_ammo/attackby__legacy__attackchain(obj/item/I, mob/user) - if(!istype(I, /obj/item/rcd) || issilicon(user)) +/obj/item/rcd_ammo/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/rcd)) return ..() - var/obj/item/rcd/R = I + var/obj/item/rcd/R = used R.load(src, user) + return ITEM_INTERACT_COMPLETE /obj/item/rcd_ammo/large ammoamt = 100 diff --git a/code/modules/mob/living/silicon/robot/robot_mob.dm b/code/modules/mob/living/silicon/robot/robot_mob.dm index 9260a3abe7d..6103cce93fe 100644 --- a/code/modules/mob/living/silicon/robot/robot_mob.dm +++ b/code/modules/mob/living/silicon/robot/robot_mob.dm @@ -1458,7 +1458,9 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( set category = "IC" var/obj/item/W = get_active_hand() - if(W) + if(W.new_attack_chain) + W.activate_self(src) + else W.attack_self__legacy__attackchain(src) /mob/living/silicon/robot/proc/SetLockdown(state = TRUE)