From 97c8e481874982c7ffc848a1e968540f607d31c2 Mon Sep 17 00:00:00 2001 From: pixelkitty286 <78038207+pixelkitty286@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:33:26 -0500 Subject: [PATCH] Bug fix / refactor-ish to cyborg resting procs (#1657) ## About The Pull Request Fixes bug caused by https://github.com/Bubberstation/Bubberstation/pull/1641 not allowing non small quad cyborgs to change rest states Adds missing verbs for some cyborgs back. ## Why It's Good For The Game It fixes a bug I caused sorrwwyy. ## Proof Of Testing Not sure how to show it working other than saying I compiled it gave the missing verbs back that were gone. ## Changelog :cl: del: dogborgs (they are quadrupeds now) fix: Verbs not being available to both tall and dog borgs to rest code: See refactor. Removed dogborg procs(commented them out) refactor: small quadrupeds, large quadrupeds, and Tall cyborgs resting verb and how it populates /:cl: --- .../mob/living/silicon/robot/robot_model.dm | 5 ++-- .../modules/borgs/code/robot_items.dm | 13 ++++++--- .../modules/borgs/code/robot_model.dm | 9 ++++--- .../code/modules/borgs/code/robot_model.dm | 27 ++++++++++++++----- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/robot_model.dm b/code/modules/mob/living/silicon/robot/robot_model.dm index d99340394a0..7f8a0d3ca25 100644 --- a/code/modules/mob/living/silicon/robot/robot_model.dm +++ b/code/modules/mob/living/silicon/robot/robot_model.dm @@ -247,12 +247,13 @@ log_silicon("CYBORG: [key_name(cyborg)] has transformed into the [new_model] model.") //SKYRAT EDIT ADDITION BEGIN - ALTBORGS - Old check for 'dogborg' var no longer necessary, refactored into model_features instead. - new_model.update_dogborg() + //new_model.update_dogborg() // BUBBER REMOVAL new_model.update_tallborg() //SKYRAT EDIT ADDITION END //BUBBER EDIT ADDTION BEGIN - new_model.update_squadruped() + new_model.update_quadruped() new_model.update_lightweight() + new_model.update_robot_rest() //BUBBER EDIT ADDTION END INVOKE_ASYNC(new_model, PROC_REF(do_transform_animation)) diff --git a/modular_skyrat/modules/borgs/code/robot_items.dm b/modular_skyrat/modules/borgs/code/robot_items.dm index 563a2bebf55..40ba60c558b 100644 --- a/modular_skyrat/modules/borgs/code/robot_items.dm +++ b/modular_skyrat/modules/borgs/code/robot_items.dm @@ -729,9 +729,12 @@ user.bubble_icon = "robot" active = TRUE user.update_icons() - user.model.update_dogborg() + //user.model.update_dogborg() //BUBBER REMOVAL user.model.update_tallborg() - user.model.update_squadruped() //BUBBER ADDITION + //BUBBER EDIT ADDTION BEGIN + user.model.update_quadruped() + user.model.update_robot_rest() + //BUBBER EDIT ADDTION END if(listeningTo == user) return @@ -755,8 +758,12 @@ user.bubble_icon = saved_bubble_icon active = FALSE user.update_icons() - user.model.update_dogborg() + //user.model.update_dogborg() //BUBBER REMOVAL user.model.update_tallborg() + //BUBBER EDIT ADDTION BEGIN + user.model.update_quadruped() + user.model.update_robot_rest() + //BUBBER EDIT ADDTION END /obj/item/borg_shapeshifter/proc/disrupt(mob/living/silicon/robot/user) SIGNAL_HANDLER diff --git a/modular_skyrat/modules/borgs/code/robot_model.dm b/modular_skyrat/modules/borgs/code/robot_model.dm index 3f660d87956..366989e0ea4 100644 --- a/modular_skyrat/modules/borgs/code/robot_model.dm +++ b/modular_skyrat/modules/borgs/code/robot_model.dm @@ -14,7 +14,7 @@ if (model_features && (TRAIT_R_TALL in model_features)) cyborg.maptext_height = 48 //Runechat blabla cyborg.AddElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE) - add_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) + //add_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down)// BUBBER REMOVAL - Moved into update_robot_rest() switch(cyborg_base_icon) if("mekamine") cyborg.AddComponent(/datum/component/robot_smoke) @@ -23,12 +23,13 @@ else cyborg.maptext_height = initial(cyborg.maptext_height) cyborg.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE) - remove_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) + //remove_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down)// BUBBER REMOVAL - Moved into update_robot_rest() if(cyborg.GetComponent(/datum/component/robot_smoke)) qdel(cyborg.GetComponent(/datum/component/robot_smoke)) QDEL_NULL(cyborg.particles) // Removing left over particles - +//BUBBER REMOVAL BEGIN - replaced with update_quadruped() +/* /obj/item/robot_model/proc/update_dogborg() var/mob/living/silicon/robot/cyborg = robot || loc if (!istype(robot)) @@ -42,6 +43,8 @@ cyborg.set_base_pixel_x(0) remove_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) remove_verb(cyborg, /mob/living/silicon/robot/proc/rest_style) +*/ +//BUBBER REMOVAL END //STANDARD /obj/item/robot_model/standard diff --git a/modular_zubbers/code/modules/borgs/code/robot_model.dm b/modular_zubbers/code/modules/borgs/code/robot_model.dm index 73475100f3a..e8316780648 100644 --- a/modular_zubbers/code/modules/borgs/code/robot_model.dm +++ b/modular_zubbers/code/modules/borgs/code/robot_model.dm @@ -1,18 +1,20 @@ // The actual code to work these in -// Cyborg model types +// Cyborg model trait procs below -//For small quadruped 32 X 32 cyborgs suchs as F3-LINE cyborgs -/obj/item/robot_model/proc/update_squadruped() +//For all quadruped cyborgs +/obj/item/robot_model/proc/update_quadruped() var/mob/living/silicon/robot/cyborg = robot || loc if (!istype(robot)) return - if (model_features && (TRAIT_R_SQUADRUPED in model_features)) + if (model_features && ((TRAIT_R_SQUADRUPED in model_features) || (TRAIT_R_WIDE in model_features))) hat_offset = INFINITY - add_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) + if (model_features && (TRAIT_R_WIDE in model_features)) + cyborg.set_base_pixel_x(-16) add_verb(cyborg, /mob/living/silicon/robot/proc/rest_style) else - remove_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) + if (model_features && !(TRAIT_R_WIDE in model_features)) + cyborg.set_base_pixel_x(0) remove_verb(cyborg, /mob/living/silicon/robot/proc/rest_style) //For cyborgs who have a lighter chassis @@ -28,6 +30,19 @@ cyborg.can_be_held = FALSE cyborg.held_w_class = WEIGHT_CLASS_NORMAL +//For cyborgs that can rest +// Must have a resting state! +/obj/item/robot_model/proc/update_robot_rest() + var/mob/living/silicon/robot/cyborg = robot || loc + if (!istype(robot)) + return + if (model_features && ((TRAIT_R_SQUADRUPED in model_features) || (TRAIT_R_WIDE in model_features) || (TRAIT_R_TALL in model_features))) + add_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) + else + remove_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down) + +// Cyborg model types below + // Centcom cyborgs /obj/item/robot_model/centcom name = "Central Command"