Skip to content

Commit

Permalink
Cyborg Damage, Movement, and Power Overhaul (#25252)
Browse files Browse the repository at this point in the history
* Adding defines

* More signals for external power

* Gets the reboot working

* renaming a proc

* config stuff

* Working on cyborg movement

* Update code/modules/mob/living/silicon/robot/robot_damage.dm

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

* Update code/modules/mob/living/silicon/robot/robot_damage.dm

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

* Update code/modules/mob/living/silicon/robot/robot_damage.dm

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

* IOSYS where'd you come from

* begon return 0

* VTEC caps slowdown

* Adjusting EMPs

* Funny arm is GONE

* Oh yeah regenerating stamina might be a good thing

* Forgot you could uninstall vtec

* icon machine broke

* Cell-less borgs can enter chargers to stay powered

* oh that was almost bad

* Fixes some logic

* its a surprise tool that will help us later

* Adjusting some numbers

* Adds a sound to go along with the text alarm

* dead things can still charge

* Another logic error

* Xenos too

* sorry linter

* fixes CL

* Slightly more slowdown on stam damage

* neurotoxin won't stun

* SOUNDS!

* 3 flashes to stun instead of 4

* Slightly longer stun

* SPEEDING UP BORGS JUST FOR THE TM SINCE CONFIG DONT WORK

* Keep borgs stunned forever

* Power loss is more dangerous

* Adds a stamina hud to borgs

* Cyborgs now heal up properly

* Removes an outdated comment

* Replacing parts works better now

* EMPs disable components for a brief time

* More missed rebalances

* When you forget to remove debug messages

* WHAT

* Cult magic works + borgs can be silenced

* 2 flashes to stun, flashes confuse now

* Update code/game/objects/items/devices/flash.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Abductors can stun borgs

* Watcher/cyro rays deal stam to brog

* Fixes a rounding error when healing borgs back to full HP

* Fixed span

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Fixed whitespace

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Guard clausify

* Indents a message

* Update code/modules/mob/living/silicon/robot/robot_damage.dm

Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/mob/living/silicon/robot/component.dm

Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/mob/living/silicon/robot/robot_damage.dm

Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* that's not what stat does

* No more hardcoded speed, don't TM this branch

---------

Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
  • Loading branch information
6 people authored Jul 9, 2024
1 parent cd88b3d commit ec88636
Show file tree
Hide file tree
Showing 35 changed files with 279 additions and 136 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/combat_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define MAGIC "magic"

#define STUN "stun"
#define STAM_CRIT "stam_crit"
#define WEAKEN "weaken"
#define KNOCKDOWN "knockdown"
#define PARALYZE "paralize"
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@
#define COMPONENT_NO_ATTACH (1<<0)
///sent from borg recharge stations: (amount, repairs)
#define COMSIG_PROCESS_BORGCHARGER_OCCUPANT "living_charge"
///sent when a mob enters a borg charger
#define COMSIG_ENTERED_BORGCHARGER "enter_charger"
///sent when a mob exits a borg charger
#define COMSIG_EXITED_BORGCHARGER "exit_charger"
///sent when a mob/login() finishes: (client)
#define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login"
///sent from borg mobs to itself, for tools to catch an upcoming destroy() due to safe decon (rather than detonation)
Expand Down
2 changes: 2 additions & 0 deletions code/_onclick/hud/robot_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
//Health
mymob.healths = new /atom/movable/screen/healths/robot()
infodisplay += mymob.healths
mymob.staminas = new /atom/movable/screen/healths/stamina()
infodisplay += mymob.staminas

//Installed Module
mymobR.hands = new /atom/movable/screen/robot/module()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/// Move delay for humanoids
var/human_delay = 1.5
/// Move delay for cyborgs
var/robot_delay = 2.5
var/robot_delay = 1.5
/// Move delay for xenomorphs
var/alien_delay = 1.5
/// Move delay for slimes (xenobio, not slimepeople)
Expand Down
5 changes: 2 additions & 3 deletions code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,10 @@

/datum/status_effect/cult_stun_mark/on_apply()
. = ..()
if(!ishuman(owner))
if(!isliving(owner))
return
overlay = mutable_appearance('icons/effects/cult_effects.dmi', "cult-mark", ABOVE_MOB_LAYER)
var/mob/living/carbon/human/H = owner
H.add_overlay(overlay)
owner.add_overlay(overlay)

/datum/status_effect/cult_stun_mark/on_remove()
owner.cut_overlay(overlay)
Expand Down
10 changes: 5 additions & 5 deletions code/game/gamemodes/cult/blood_magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -468,20 +468,20 @@
else
to_chat(user, "<span class='cultitalic'>In a brilliant flash of red, [L] falls to the ground!</span>")

L.KnockDown(10 SECONDS)
L.apply_damage(60, STAMINA)
L.apply_status_effect(STATUS_EFFECT_CULT_STUN)
L.flash_eyes(1, TRUE)
L.Silence(6 SECONDS)
if(issilicon(target))
var/mob/living/silicon/S = L
S.emp_act(EMP_HEAVY)
else if(iscarbon(target))
var/mob/living/carbon/C = L
C.Silence(6 SECONDS)
C.KnockDown(10 SECONDS)
C.apply_damage(60, STAMINA)
C.flash_eyes(1, TRUE)
C.Stuttering(16 SECONDS)
C.CultSlur(20 SECONDS)
C.Jitter(16 SECONDS)
to_chat(user, "<span class='boldnotice'>Stun mark applied! Stab them with a dagger, sword or blood spear to stun them fully!</span>")
to_chat(user, "<span class='boldnotice'>Stun mark applied! Stab them with a dagger, sword or blood spear to stun them fully!</span>")
user.do_attack_animation(target)
uses--
..()
Expand Down
7 changes: 4 additions & 3 deletions code/game/gamemodes/miniantags/abduction/abduction_gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ CONTENTS:
if(!isabductor(user))
return

if(isrobot(target))
..()
return

if(!isliving(target))
return
Expand All @@ -299,6 +296,10 @@ CONTENTS:

user.do_attack_animation(L)

if(isrobot(L))
L.apply_damage(120, STAMINA) //Force a reboot instantly
return

if(ishuman(L))
var/mob/living/carbon/human/H = L
if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK))
Expand Down
15 changes: 5 additions & 10 deletions code/game/machinery/rechargestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
/obj/machinery/recharge_station/proc/go_out()
if(!occupant)
return
SEND_SIGNAL(occupant, COMSIG_EXITED_BORGCHARGER)
UnregisterSignal(occupant, COMSIG_MOVABLE_MOVED)
occupant.forceMove(loc)
occupant = null
Expand Down Expand Up @@ -200,18 +201,11 @@
var/can_accept_user
if(isrobot(target))
var/mob/living/silicon/robot/R = target

if(R.stat == DEAD)
//Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO
return

if(occupant)
to_chat(R, "<span class='warning'>The cell is already occupied!</span>")
return
if(!R.cell)
to_chat(R, "<span class='warning'>Without a power cell, you can't be recharged.</span>")
//Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO
return
can_accept_user = 1
can_accept_user = TRUE

else if(ishuman(target))
var/mob/living/carbon/human/H = target
Expand All @@ -224,14 +218,15 @@
if(!ismodcontrol(H.back))
if(!H.get_int_organ(/obj/item/organ/internal/cell))
return
can_accept_user = 1
can_accept_user = TRUE

if(!can_accept_user)
to_chat(user, "<span class='notice'>Only non-organics may enter the recharger!</span>")
return

target.stop_pulling()
QDEL_LIST_CONTENTS(target.grabbed_by)
SEND_SIGNAL(target, COMSIG_ENTERED_BORGCHARGER)
target.forceMove(src)
occupant = target
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(go_out))
Expand Down
19 changes: 9 additions & 10 deletions code/game/objects/items/devices/flash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
/obj/item/flash/proc/clown_check(mob/user)
if(user && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
flash_carbon(user, user, 30 SECONDS, 0)
return 0
return 1
return FALSE
return TRUE

/obj/item/flash/attackby(obj/item/I, mob/user, params)
if(can_overcharge)
Expand Down Expand Up @@ -66,7 +66,7 @@
/obj/item/flash/proc/flash_recharge(mob/user)
if(prob(times_used * 2)) //if you use it 5 times in a minute it has a 10% chance to break!
burn_out()
return 0
return FALSE

var/deciseconds_passed = world.time - last_used
for(var/seconds = deciseconds_passed/10, seconds>=10, seconds-=10) //get 1 charge every 10 seconds
Expand Down Expand Up @@ -122,20 +122,19 @@

/obj/item/flash/attack(mob/living/M, mob/user)
if(!try_use_flash(user))
return 0
return FALSE
if(iscarbon(M))
flash_carbon(M, user, 10 SECONDS, 1)
if(overcharged)
M.adjust_fire_stacks(6)
M.IgniteMob()
burn_out()
return 1
return TRUE
else if(issilicon(M))
add_attack_logs(user, M, "Flashed with [src]")
if(M.flash_eyes(affect_silicon = 1))
M.Weaken(rand(8 SECONDS, 12 SECONDS))
if(M.flash_eyes(intensity = 1.25, affect_silicon = TRUE)) // 40 * 1.25 = 50 stamina damage
user.visible_message("<span class='disarm'>[user] overloads [M]'s sensors with [src]!</span>", "<span class='danger'>You overload [M]'s sensors with [src]!</span>")
return 1
return TRUE
user.visible_message("<span class='disarm'>[user] fails to blind [M] with [src]!</span>", "<span class='warning'>You fail to blind [M] with [src]!</span>")

/obj/item/flash/afterattack(atom/target, mob/living/user, proximity, params)
Expand All @@ -155,7 +154,7 @@

/obj/item/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0)
if(!try_use_flash(user))
return 0
return FALSE
user.visible_message("<span class='disarm'>[user]'s [name] emits a blinding light!</span>", "<span class='danger'>Your [name] emits a blinding light!</span>")
for(var/mob/living/carbon/M in oviewers(3, null))
flash_carbon(M, user, 6 SECONDS, 0)
Expand All @@ -168,7 +167,7 @@

/obj/item/flash/emp_act(severity)
if(!try_use_flash())
return 0
return FALSE
for(var/mob/living/carbon/M in viewers(3, null))
flash_carbon(M, null, 20 SECONDS, 0)
burn_out()
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/devices/laserpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@
var/mob/living/silicon/S = target
//20% chance to actually hit the sensors
if(prob(effectchance * diode.rating))
S.flash_eyes(affect_silicon = 1)
S.Weaken(rand(10 SECONDS, 20 SECONDS))
S.flash_eyes(affect_silicon = TRUE)
to_chat(S, "<span class='warning'>Your sensors were overloaded by a laser!</span>")
outmsg = "<span class='notice'>You overload [S] by shining [src] at [S.p_their()] sensors.</span>"

Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/devices/traitordevices.dm
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@
if(!M.client)
continue
if(issilicon(M))
M.Weaken(10 SECONDS)
var/mob/living/silicon/robot/R = M
R.flash_eyes(3, affect_silicon = TRUE) //Enough stamina damage to instantly force a reboot
else
M.Confused(45 SECONDS)
M.adjustBrainLoss(10)
Expand Down
9 changes: 4 additions & 5 deletions code/game/objects/items/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
icon = 'icons/mob/robot_items.dmi'
var/powerneeded // Percentage of power remaining required to run item

/*
The old, instant-stun borg arm.
Keeping it in for adminabuse but the malf one is /obj/item/melee/baton/borg_stun_arm
*/
/obj/item/borg/stun
name = "electrically-charged arm"
icon_state = "elecarm"
Expand Down Expand Up @@ -136,8 +140,3 @@
#undef CYBORG_HUG
#undef CYBORG_SHOCK
#undef CYBORG_CRUSH

/obj/item/borg/overdrive
name = "Overdrive"
icon = 'icons/obj/decals.dmi'
icon_state = "shock"
1 change: 0 additions & 1 deletion code/game/objects/items/robot/robot_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@

var/datum/robot_component/cell_component = O.components["power cell"]
cell_component.install(chest.cell)
chest.cell.forceMove(O)
chest.cell = null

M.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/robot/robot_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@

/obj/item/borg/upgrade/vtec
name = "robotic VTEC Module"
desc = "Used to activate a cyborg's VTEC systems, increasing their speed."
desc = "Used to activate a cyborg's VTEC systems, allowing them to retain more speed when damaged. Alternatively speeds up slow vehicles."
icon_state = "cyborg_upgrade2"
require_module = TRUE
origin_tech = "engineering=4;materials=5;programming=4"
Expand All @@ -264,7 +264,7 @@
to_chat(usr, "<span class='notice'>There's no room for another VTEC unit!</span>")
return

R.speed -= 1 // Gotta go fast.
R.slowdown_cap = 3.5
return TRUE

/***********************/
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/weapons/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,8 @@
/obj/item/melee/baton/cattleprod/baton_stun(mob/living/L, mob/user, skip_cooldown = FALSE, ignore_shield_check = FALSE)
if(sparkler.activate())
return ..()

/obj/item/melee/baton/loaded/borg_stun_arm
name = "electrically-charged arm"
desc = "A piece of scrap metal wired directly to your power cell."
hitcost = 100
4 changes: 3 additions & 1 deletion code/modules/antagonists/changeling/powers/shriek.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
SEND_SOUND(M, sound('sound/effects/clingscream.ogg'))

if(issilicon(M))
var/mob/living/silicon/robot/R = M
R.disable_component("actuator", 7 SECONDS)
SEND_SOUND(M, sound('sound/weapons/flash.ogg'))
M.Weaken(rand(10 SECONDS, 20 SECONDS))
R.flash_eyes(2, affect_silicon = TRUE) //80 Stamina damage

for(var/obj/machinery/light/L in range(4, user))
L.on = TRUE
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@
if(!message)
return

if(HAS_TRAIT(speaker, TRAIT_MUTE))
return

var/log_message = "(ROBOT) [message]"
log_say(log_message, speaker)
speaker.create_log(SAY_LOG, log_message)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/carbon_status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
stam_regen_start_time = world.time + (STAMINA_REGEN_BLOCK_TIME * stamina_regen_block_modifier)
var/prev = stam_paralyzed
stam_paralyzed = TRUE
ADD_TRAIT(src, TRAIT_IMMOBILIZED, "stam_crit") // make defines later
ADD_TRAIT(src, TRAIT_FLOORED, "stam_crit")
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, "stam_crit")
ADD_TRAIT(src, TRAIT_IMMOBILIZED, STAM_CRIT)
ADD_TRAIT(src, TRAIT_FLOORED, STAM_CRIT)
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, STAM_CRIT)
if(!prev && getStaminaLoss() < 120) // Puts you a little further into the initial stamcrit, makes stamcrit harder to outright counter with chems.
adjustStaminaLoss(30, FALSE)
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/carbon_update_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
else if(stam_paralyzed)
SEND_SIGNAL(src, COMSIG_CARBON_EXIT_STAMINACRIT)
stam_paralyzed = FALSE
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, "stam_crit") // make defines later
REMOVE_TRAIT(src, TRAIT_FLOORED, "stam_crit")
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, "stam_crit")
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, STAM_CRIT)
REMOVE_TRAIT(src, TRAIT_FLOORED, STAM_CRIT)
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, STAM_CRIT)

/mob/living/carbon/can_hear()
. = FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key)
S.message = cultslur(S.message)
verb = "slurs"

if(!IsVocal())
if(!IsVocal() || HAS_TRAIT(src, TRAIT_MUTE))
S.message = ""
return list("verb" = verb)

Expand Down
8 changes: 2 additions & 6 deletions code/modules/mob/living/silicon/ai/ai_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(

/mob/living/silicon/ai/emp_act(severity)
..()
if(prob(30))
switch(pick(1,2))
if(1)
view_core()
if(2)
ai_call_shuttle()
Stun((12 SECONDS) / severity)
view_core()

/mob/living/silicon/ai/ex_act(severity)
..()
Expand Down
Loading

0 comments on commit ec88636

Please sign in to comment.