Merges the Hug Module With the Cyborg Gripper (#26007)

* Hugs

* Update cyborg_gripper.dm

* Update cyborg_gripper.dm

* Update cyborg_gripper.dm

* AGHHH!

* Update code/game/objects/items/robot/cyborg_gripper.dm

Co-authored-by: Sheep <46016730+Scribble-Sheep@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* Update cyborg_gripper.dm

* Fixing some minor typos for cyborg upgrade flavour text

Throws in some missing apostrophes, capitalisation, and the letter "s."

* Briefcase Full of Cash buff

Increases the amount of cash in the Syndicate Briefcase Full of Cash from 600 Cr to 1000 Cr

* Reverts double-feature PR

* Reverts a broken revert

* Reverting again because Ebba told me to

* And reverting yet again

* Update robot_upgrades.dm

* Update cyborg_gripper.dm

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* Update robot_modules.dm

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* Update code/game/objects/items/robot/cyborg_gripper.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

---------

Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: Sheep <46016730+Scribble-Sheep@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
CRUNCH
2024-08-07 13:07:36 +00:00
committed by GitHub
co-authored by Sheep Burzah
parent 9e02af5154
commit 2c1fcbd7da
3 changed files with 356 additions and 293 deletions
+148 -46
View File
@@ -1,10 +1,11 @@
/* CONTENTS:
0. generic define gripper
1. UNIVERSAL GRIPPER
2. MEDICAL GRIPPER
3. SERVICE GRIPPER
4. MINING GRIPPER
5. ENGINEERING GRIPPER
* 0. Generic Gripper
* 1. Gripper Types
* 1.1 Universal Gripper
* 1.2 Medical Gripper
* 1.3 Service Gripper
* 1.4 Mining Gripper
* 1.5 Engineering Gripper
*/
// Generic gripper. This should never appear anywhere.
@@ -16,12 +17,12 @@
actions_types = list(/datum/action/item_action/drop_gripped_item)
/// Set to TRUE to removal of cells/lights from machine objects containing them.
var/engineering_machine_interaction = FALSE
/// Set to TRUE to allow the gripper to shake people awake and help them up.
var/can_help_up = FALSE
/// Defines what items the gripper can carry.
var/list/can_hold = list()
/// Set to TRUE to allow ANY item to be held, bypassing can_hold checks.
var/can_hold_all_items = FALSE
/// Set to TRUE to allow the gripper to shake people awake and help them up.
var/can_help_up = FALSE
/// The item currently being held.
var/obj/item/gripped_item
@@ -39,7 +40,6 @@
. += "Companies like Nanotrasen use software to limit the items that a cyborg can manipulate to a specific pre-defined list, \
as part of their multi-layered protections to try and eliminate the chance of a hypothetical synthetic uprising, not wishing to see a repeat of the IPC uprising in 2525."
/obj/item/gripper/Initialize(mapload)
. = ..()
can_hold = typecacheof(can_hold)
@@ -62,9 +62,6 @@
return
gripped_item.attack_self(user)
/obj/item/gripper/attack(mob/living/carbon/M, mob/living/carbon/user)
return
// This is required to ensure that the forceMove checks on some objects don't rip the gripper out of the borg's inventory and toss it on the floor. That would hurt, a lot!
/obj/item/gripper/forceMove(atom/destination)
return
@@ -103,24 +100,8 @@
to_chat(user, "<span class='warning'>You hold your gripper over [target], but no matter how hard you try, you cannot make yourself grab it.</span>")
return
// Have we come across a poor soul on the floor that has fallen and can't get up?
if(ishuman(target) && can_help_up)
var/mob/living/carbon/human/pickup_target = target
if(!IS_HORIZONTAL(pickup_target))
return
pickup_target.AdjustSleeping(-10 SECONDS)
pickup_target.AdjustParalysis(-6 SECONDS)
pickup_target.AdjustStunned(-6 SECONDS)
pickup_target.AdjustWeakened(-6 SECONDS)
pickup_target.AdjustKnockDown(-6 SECONDS)
pickup_target.adjustStaminaLoss(-10)
pickup_target.resting = FALSE
pickup_target.stand_up()
playsound(user.loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
user.visible_message(
"<span class='notice'>[user] shakes [pickup_target] trying to wake [pickup_target.p_them()] up!</span>",
"<span class='notice'>You shake [pickup_target] trying to wake [pickup_target.p_them()] up!</span>"
)
// Attack code will handle this.
if(ismob(target))
return
// Everything past this point requires being able to engineer.
@@ -169,10 +150,139 @@
"<span class='notice'>You remove [L] from [light].</span>"
)
////////////////////////////////
// MARK: UNIVERSAL GRIPPER
////////////////////////////////
/// Universal gripper. Not supplied to any cyborg by default. Could be varedited onto a borg for event stuff. Functions almost like a real hand!
/obj/item/gripper/emag_act(mob/user)
emagged = !emagged
..()
return TRUE
/obj/item/gripper/attack(mob/living/M, mob/living/silicon/robot/user, params)
if(gripped_item)
return
// If a human target is horizonal, try to help them up. Unless you're trying to kill them.
if(ishuman(M) && user.a_intent == INTENT_HELP && can_help_up)
var/mob/living/carbon/human/pickup_target = M
if(IS_HORIZONTAL(pickup_target))
// Same restorative effects as when a human tries to help someone up.
pickup_target.AdjustSleeping(-10 SECONDS)
pickup_target.AdjustParalysis(-6 SECONDS)
pickup_target.AdjustStunned(-6 SECONDS)
pickup_target.AdjustWeakened(-6 SECONDS)
pickup_target.AdjustKnockDown(-6 SECONDS)
pickup_target.adjustStaminaLoss(-10)
pickup_target.resting = FALSE
pickup_target.stand_up()
playsound(user.loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
user.visible_message(
"<span class='notice'>[user] shakes [pickup_target] trying to wake [pickup_target.p_them()] up!</span>",
"<span class='notice'>You shake [pickup_target] trying to wake [pickup_target.p_them()] up!</span>"
)
return
if(user.a_intent == INTENT_HELP)
if(M == user)
user.visible_message(
"<span class='notice'>[user] gives [user.p_themselves()] a hug to make [user.p_themselves()] feel better.</span>",
"<span class='notice'>You give yourself a hug to make yourself feel better.</span>"
)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
return
// Checks if holder_type exists to prevent picking up animals like mice, because we're about to use the hands that borgs secretly have.
if(isanimal(M) && !M.holder_type)
var/list/modifiers = params2list(params)
// This enables borgs to get the floating heart icon and mob emote from simple_animals that have petbonus == TRUE.
M.attack_hand(user, modifiers)
if(user.zone_selected == BODY_ZONE_HEAD)
user.visible_message(
"<span class='notice'>[user] playfully boops [M] on the head.</span>",
"<span class='notice'>You playfully boop [M] on the head.</span>"
)
user.do_attack_animation(M, ATTACK_EFFECT_BOOP)
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1)
return
if(ishuman(M))
user.visible_message(
"<span class='notice'>[user] hugs [M] to make [M.p_them()] feel better.</span>",
"<span class='notice'>You hug [M] to make [M.p_them()] feel better.</span>"
)
else
user.visible_message(
"<span class='notice'>[user] pets [M]!</span>",
"<span class='notice'>You pet [M]!</span>"
)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
return
if(user.a_intent == INTENT_HARM && !emagged)
if(M == user)
user.visible_message(
"<span class='notice'>[user] gives [user.p_themselves()] a firm bear-hug to make [user.p_themselves()] feel better.</span>",
"<span class='notice'>You give yourself a firm bear-hug to make yourself feel better.</span>"
)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
return
if(!ishuman(M) || user.zone_selected == BODY_ZONE_HEAD)
user.visible_message(
"<span class='warning'>[user] bops [M] on the head!</span>",
"<span class='warning'>You bop [M] on the head!</span>"
)
user.do_attack_animation(M, ATTACK_EFFECT_PUNCH)
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1)
else
user.visible_message(
"<span class='warning'>[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...</span>",
"<span class='warning'>You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...</span>"
)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
return
// Just in case.
if(!emagged)
return
if(M == user)
user.visible_message(
"<span class='danger'>[user] punches [user.p_themselves()] in the face!.</span>",
"<span class='userdanger'>You punch yourself in the face!</span>"
)
user.do_attack_animation(M, ATTACK_EFFECT_PUNCH)
playsound(loc, 'sound/weapons/smash.ogg', 50, TRUE, -1)
user.adjustBruteLoss(15)
return
if(ishuman(M))
// Try to punch them in the face... Unless it fell off or something.
if(user.zone_selected == BODY_ZONE_HEAD && M.get_organ("head"))
user.visible_message(
"<span class='danger'>[user] punches [M] squarely in the face!</span>",
"<span class='danger'>You punch [M] in the face!</span>"
)
var/obj/item/organ/external/head/their_face = M.get_organ("head")
user.do_attack_animation(M, ATTACK_EFFECT_PUNCH)
playsound(loc, 'sound/weapons/smash.ogg', 50, TRUE, -1)
their_face.receive_damage(15)
M.UpdateDamageIcon()
return
user.visible_message(
"<span class='danger'>[user] crushes [M] in [user.p_their()] grip!</span>",
"<span class='danger'>You crush [M] in your grip!</span>"
)
playsound(loc, 'sound/weapons/smash.ogg', 50, TRUE, -1)
M.adjustBruteLoss(15)
// MARK: Gripper Types
/*
* Universal Gripper
* Not supplied to any cyborg by default.
* Can be varedited onto a borg for event stuff.
* Functions almost like a real hand!
*/
/obj/item/gripper/universal
name = "cyborg gripper"
desc = "A grasping tool for cyborgs. This one is not restricted by any restraining software, allowing it to handle any object the user wishes."
@@ -185,9 +295,7 @@
. = ..()
ADD_TRAIT(src,TRAIT_SURGICAL_OPEN_HAND, ROUNDSTART_TRAIT)
////////////////////////////////
// MARK: MEDICAL GRIPPER
////////////////////////////////
// Medical Gripper
// For medical borgs, for doing medical stuff!
// Not giving this anything to hold yet, but stuff may be added in the future. Organs/implants are currently viewed as too strong to hold.
/obj/item/gripper/medical
@@ -202,9 +310,7 @@
. = ..()
ADD_TRAIT(src,TRAIT_SURGICAL_OPEN_HAND, ROUNDSTART_TRAIT)
////////////////////////////////
// MARK: SERVICE GRIPPER
////////////////////////////////
// Service Gripper
// For service borgs. To make them slightly better at their job.
/obj/item/gripper/service
name = "service gripper"
@@ -221,9 +327,7 @@
/obj/item/toy/plushie
)
////////////////////////////////
// MARK: MINING GRIPPER
////////////////////////////////
// Mining Gripper
// For mining borgs. Mostly for self-application of goliath armour.
/obj/item/gripper/mining
name = "mining gripper"
@@ -234,9 +338,7 @@
/obj/item/survivalcapsule
)
////////////////////////////////
// MARK: ENGINEERING GRIPPER
////////////////////////////////
// Engineering Gripper
// For engineering and sabotage borgs, and drones.
/obj/item/gripper/engineering
name = "engineering gripper"
@@ -34,109 +34,3 @@ Keeping it in for adminabuse but the malf one is /obj/item/melee/baton/borg_stun
playsound(loc, 'sound/weapons/egloves.ogg', 50, TRUE, -1)
add_attack_logs(user, M, "Stunned with [src] ([uppertext(user.a_intent)])")
#define CYBORG_HUGS 0
#define CYBORG_HUG 1
#define CYBORG_SHOCK 2
#define CYBORG_CRUSH 3
/obj/item/borg/cyborghug
name = "hugging module"
icon_state = "hugmodule"
desc = "For when a someone really needs a hug."
var/mode = CYBORG_HUGS //0 = Hugs 1 = "Hug" 2 = Shock 3 = CRUSH
var/ccooldown = 0
var/scooldown = 0
var/shockallowed = FALSE //Can it be a stunarm when emagged. Only PK borgs get this by default.
/obj/item/borg/cyborghug/attack_self(mob/living/user)
if(isrobot(user))
var/mob/living/silicon/robot/P = user
if(P.emagged && shockallowed)
if(mode < CYBORG_CRUSH)
mode++
else
mode = CYBORG_HUGS
else if(mode < CYBORG_HUG)
mode++
else
mode = CYBORG_HUGS
switch(mode)
if(CYBORG_HUGS)
to_chat(user, "Power reset. Hugs!")
if(CYBORG_HUG)
to_chat(user, "Power increased!")
if(CYBORG_SHOCK)
to_chat(user, "BZZT. Electrifying arms...")
if(CYBORG_CRUSH)
to_chat(user, "ERROR: ARM ACTUATORS OVERLOADED.")
/obj/item/borg/cyborghug/attack(mob/living/M, mob/living/silicon/robot/user, params)
if(M == user)
return
switch(mode)
if(CYBORG_HUGS)
if(M.health >= 0)
if(isanimal(M) && !M.holder_type) // checks if holder_type exists to prevent picking up animals like mice
var/list/modifiers = params2list(params)
M.attack_hand(user, modifiers) //This enables borgs to get the floating heart icon and mob emote from simple_animal's that have petbonus == true.
return
if(user.zone_selected == BODY_ZONE_HEAD)
user.visible_message("<span class='notice'>[user] playfully boops [M] on the head!</span>", "<span class='notice'>You playfully boop [M] on the head!</span>")
user.do_attack_animation(M, ATTACK_EFFECT_BOOP)
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1)
else if(ishuman(M))
if(M.resting)
user.visible_message("<span class='notice'>[user] shakes [M] trying to get [M.p_them()] up!</span>", "<span class='notice'>You shake [M] trying to get [M.p_them()] up!</span>")
M.stand_up()
else
user.visible_message("<span class='notice'>[user] hugs [M] to make [M.p_them()] feel better!</span>", "<span class='notice'>You hug [M] to make [M.p_them()] feel better!</span>")
else
user.visible_message("<span class='notice'>[user] pets [M]!</span>", "<span class='notice'>You pet [M]!</span>")
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
if(CYBORG_HUG)
if(M.health >= 0)
if(ishuman(M))
if(M.resting)
user.visible_message("<span class='notice'>[user] shakes [M] trying to get [M.p_them()] up!</span>", "<span class='notice'>You shake [M] trying to get [M.p_them()] up!</span>")
M.resting = FALSE
M.stand_up()
else if(user.zone_selected == BODY_ZONE_HEAD)
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", "<span class='warning'>You bop [M] on the head!</span>")
user.do_attack_animation(M, ATTACK_EFFECT_PUNCH)
else
user.visible_message("<span class='warning'>[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...</span>", "<span class='warning'>You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...</span>")
else
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", "<span class='warning'>You bop [M] on the head!</span>")
playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1)
if(CYBORG_SHOCK)
if(scooldown < world.time)
if(M.health >= 0)
if(ishuman(M))
M.electrocute_act(5, "[user]", flags = SHOCK_NOGLOVES)
user.visible_message("<span class='userdanger'>[user] electrocutes [M] with [user.p_their()] touch!</span>", "<span class='danger'>You electrocute [M] with your touch!</span>")
else
if(!isrobot(M))
M.adjustFireLoss(10)
user.visible_message("<span class='userdanger'>[user] shocks [M]!</span>", "<span class='danger'>You shock [M]!</span>")
else
user.visible_message("<span class='userdanger'>[user] shocks [M]. It does not seem to have an effect</span>", "<span class='danger'>You shock [M] to no effect.</span>")
playsound(loc, 'sound/effects/sparks2.ogg', 50, TRUE, -1)
user.cell.use(500)
scooldown = world.time + 20
if(CYBORG_CRUSH)
if(ccooldown < world.time)
if(M.health >= 0)
if(ishuman(M))
user.visible_message("<span class='userdanger'>[user] crushes [M] in [user.p_their()] grip!</span>", "<span class='danger'>You crush [M] in your grip!</span>")
else
user.visible_message("<span class='userdanger'>[user] crushes [M]!</span>", "<span class='danger'>You crush [M]!</span>")
playsound(loc, 'sound/weapons/smash.ogg', 50, TRUE, -1)
M.adjustBruteLoss(15)
user.cell.use(300)
ccooldown = world.time + 10
#undef CYBORG_HUGS
#undef CYBORG_HUG
#undef CYBORG_SHOCK
#undef CYBORG_CRUSH