Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converts oil for borgs into a status effect and rebalances it #17618

Merged
merged 7 commits into from Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/datums/movement_modifier/movement_modifiers.dm
Expand Up @@ -102,8 +102,11 @@
health_deficiency_adjustment = -INFINITY
mob_pull_multiplier = 0.2 //make borgs pull mobs slightly slower than full speed (roundstart light borg will pull a corpse at ~1.3 delay, as opposed to ~1 when unencumbered)

/datum/movement_modifier/robot_oil/fresh
multiplicative_slowdown = 0.5

/datum/movement_modifier/robot_oil
additive_slowdown = -0.5
multiplicative_slowdown = 0.85

/datum/movement_modifier/spry
additive_slowdown = -0.25
Expand Down
1 change: 0 additions & 1 deletion code/mob/living/life/Life.dm
Expand Up @@ -213,7 +213,6 @@
add_lifeprocess(/datum/lifeprocess/robot_statusupdate)
add_lifeprocess(/datum/lifeprocess/stuns_lying)
add_lifeprocess(/datum/lifeprocess/blindness)
add_lifeprocess(/datum/lifeprocess/robot_oil)
add_lifeprocess(/datum/lifeprocess/robot_locks)
add_lifeprocess(/datum/lifeprocess/disability)

Expand Down
18 changes: 9 additions & 9 deletions code/mob/living/silicon/robot.dm
Expand Up @@ -2424,7 +2424,11 @@
if (R.activated)
if (efficient) power_use_tally += R.drainrate / 2
else power_use_tally += R.drainrate
if (src.oil && power_use_tally > 0) power_use_tally /= 1.5

if (src.hasStatus("freshly_oiled") && power_use_tally > 0)
power_use_tally *= 0.5
if (src.hasStatus("oiled") && power_use_tally > 0)
power_use_tally *= 0.85

if (src.cell.genrate) power_use_tally -= src.cell.genrate

Expand Down Expand Up @@ -2508,7 +2512,10 @@
var/delta = src.max_upgrades - initial(src.max_upgrades)
power_use_tally += 3 ** delta

if (src.oil && power_use_tally > 0) power_use_tally /= 1.5
if (src.hasStatus("freshly_oiled") && power_use_tally > 0)
power_use_tally *= 0.5
if (src.hasStatus("oiled") && power_use_tally > 0)
power_use_tally *= 0.85

src.cell.use(power_use_tally)

Expand Down Expand Up @@ -2548,13 +2555,6 @@

if (src.dizziness) dizziness--

proc/add_oil(var/amt)
if (oil <= 0)
APPLY_ATOM_PROPERTY(src, PROP_MOB_STUN_RESIST, "robot_oil", 25)
APPLY_ATOM_PROPERTY(src, PROP_MOB_STUN_RESIST_MAX, "robot_oil", 25)
APPLY_MOVEMENT_MODIFIER(src, /datum/movement_modifier/robot_oil, "oil")
src.oil += amt

proc/borg_death_alert(modifier = ROBOT_DEATH_MOD_NONE)
var/message = null
var/net_id = generate_net_id(src)
Expand Down
11 changes: 0 additions & 11 deletions code/mob/living/silicon/robot_oil.dm

This file was deleted.

2 changes: 1 addition & 1 deletion code/modules/chemistry/Reagents-Misc.dm
Expand Up @@ -1307,7 +1307,7 @@ datum
if (method == TOUCH)
if (isrobot(M))
var/mob/living/silicon/robot/R = M
R.add_oil(volume * 2)
R.changeStatus("freshly_oiled", (volume * 5)) // You need at least 30u to get max duration
boutput(R, SPAN_NOTICE("Your joints and servos begin to run more smoothly."))
else boutput(M, SPAN_ALERT("You feel greasy and gross."))

Expand Down
52 changes: 52 additions & 0 deletions code/modules/status_system/statusEffects.dm
Expand Up @@ -2400,6 +2400,58 @@
if (R.activated) R.upgrade_deactivate(robot)
. = ..()

/datum/statusEffect/oiled
id = "oiled"
name = "Oiled"
icon_state = "oil"
maxDuration = 6 MINUTES
movement_modifier = /datum/movement_modifier/robot_oil

getTooltip()
. = "You have been oiled, your movement delay and passive power consumption have been reduced by 15%, and you feel more ready to resist anything that may stun you in your tracks."

onAdd(optional=null)
..()
var/mob/M = owner
APPLY_ATOM_PROPERTY(M, PROP_MOB_STUN_RESIST, "robot_oil", 25)
APPLY_ATOM_PROPERTY(M, PROP_MOB_STUN_RESIST_MAX, "robot_oil", 25)

onRemove()
..()
var/mob/M = owner
REMOVE_ATOM_PROPERTY(M, PROP_MOB_STUN_RESIST, "robot_oil")
REMOVE_ATOM_PROPERTY(M, PROP_MOB_STUN_RESIST_MAX, "robot_oil")

/datum/statusEffect/oiled/fresh
id = "freshly_oiled"
name = "Freshly oiled"
icon_state = "fresh_oil"
maxDuration = 15 SECONDS
movement_modifier = /datum/movement_modifier/robot_oil/fresh
/// Duration of the oiled status effect a person has before more oil is applied.
var/oiledDuration = 0
/// How long have we had the status effect for
var/tickspassed = 0

getTooltip()
. = "You have recently been oiled, your movement delay and passive power consumption have been reduced by 50%, and you feel more ready to resist anything that may stun you in your tracks."

onAdd(optional=null)
..()
var/mob/M = owner
if(M.hasStatus("oiled"))
oiledDuration = M.getStatusDuration("oiled")
M.delStatus("oiled")

onUpdate(timePassed) // I gotta do it this way trust me on this
. = ..()
tickspassed += timePassed

onRemove()
..()
var/mob/M = owner
M.changeStatus("oiled", (min(tickspassed, maxDuration) * 24 + oiledDuration)) // freshly oiled decays into oiled status with 12 times the duration that the status effect has peaked at.

/datum/statusEffect/criticalcondition
id = "critical_condition"
name = "Critical Condition"
Expand Down
1 change: 0 additions & 1 deletion goonstation.dme
Expand Up @@ -587,7 +587,6 @@ var/datum/preMapLoad/preMapLoad = new
#include "code\mob\living\silicon\hivebot.dm"
#include "code\mob\living\silicon\robot.dm"
#include "code\mob\living\silicon\robot_locks.dm"
#include "code\mob\living\silicon\robot_oil.dm"
#include "code\mob\living\silicon\robot_statusupdate.dm"
#include "code\mob\living\silicon\ai\ai_abilities.dm"
#include "code\mob\living\silicon\ai\camera_handling.dm"
Expand Down
Binary file modified icons/ui/statussystem.dmi
Binary file not shown.