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

Smelling salts behaviour changes + 'Inhaled' trigger #16703

Merged
merged 14 commits into from Nov 5, 2023
2 changes: 1 addition & 1 deletion code/modules/chemistry/Chemistry-Holder.dm
Expand Up @@ -762,7 +762,7 @@ proc/chem_helmet_check(mob/living/carbon/human/H, var/what_liquid="hot")
if(ismob(A) && !isobserver(A))
//SPAWN(0)
//if (current_reagent) //This is in a spawn. Between our first check and the execution, this may be bad.
if (!current_reagent.reaction_mob(A, INGEST, current_reagent.volume*volume_fraction))
if (!current_reagent.reaction_mob(A, INGEST, current_reagent.volume*volume_fraction, paramslist))
.+= current_id
if(isturf(A))
//SPAWN(0)
Expand Down
19 changes: 16 additions & 3 deletions code/modules/chemistry/Reagents-Medical.dm
Expand Up @@ -710,14 +710,27 @@ datum
var/mob/M = holder.my_atom
REMOVE_ATOM_PROPERTY(M, PROP_MOB_STAMINA_REGEN_BONUS, "r_smelling_salt")
..()
reaction_mob(var/mob/M, var/method=TOUCH, var/volume_passed, var/list/paramslist = 0)
if(method == INGEST && volume_passed >= 3)
if(isliving(M) && !M.hasStatus("smelling_salts") && ("inhaled" in paramslist))
var/mob/living/H = M
H.delStatus("drowsy")
H.delStatus("passing_out")
if (H.stamina < 0 || H.hasStatus("weakened") || H.hasStatus("paralysis")) //enhanced effects if you're downed (also implies a second person is applying this)
H.TakeDamage("chest", 0, 10, 0, DAMAGE_BURN) // a little damage penalty
if (H.use_stamina)
H.stamina = max(H.stamina_max*0.2,H.stamina)
H.changeStatus("paralysis", -20 SECONDS)
H.changeStatus("weakened", -20 SECONDS)
if (H.sleeping == TRUE)
H.sleeping = 0
H.setStatus("smelling_salts", 6 MINUTES)
..()

on_mob_life(var/mob/M, var/mult = 1)
if(!M)
M = holder.my_atom
flush(holder, 3 * mult, flushed_reagents)

if (M.health < -5 && M.health > -30)
M.HealDamage("All", 1 * mult, 1 * mult, 1 * mult)
if(M.getStatusDuration("radiation") && prob(30))
M.take_radiation_dose(-0.005 SIEVERTS * mult)
if (prob(5))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/chemistry/tools/ampoules.dm
Expand Up @@ -35,8 +35,8 @@
user.visible_message("<span class='alert'>[user] forces [target] to inhale [src]!</span>", \
"<span class='alert'>You force [target] to inhale [src]!</span>")
logTheThing(LOG_COMBAT, user, "[user == target ? "inhales" : "makes [constructTarget(target,"combat")] inhale"] an ampoule [log_reagents(src)] at [log_loc(user)].")
reagents.reaction(target, INGEST, 5, paramslist = list("inhaled"))
reagents.trans_to(target, 5)
reagents.reaction(target, INGEST)
expended = TRUE
icon_state = "amp-broken"
playsound(user.loc, 'sound/impact_sounds/Generic_Snap_1.ogg', 50, 1)
Expand Down
1 change: 1 addition & 0 deletions code/modules/fluids/air.dm
Expand Up @@ -108,6 +108,7 @@
var/turf/T = get_turf(src)
var/list/plist = list()
plist["dmg_multiplier"] = 0.08
plist += "inhaled"
if (T) //average that shit with the air temp
var/turftemp = T.temperature
plist["override_can_burn"] = (src.group.reagents.total_temperature + turftemp + turftemp) / 3
Expand Down
41 changes: 40 additions & 1 deletion code/modules/status_system/statusEffects.dm
Expand Up @@ -2471,7 +2471,46 @@
/datum/statusEffect/loose_brain
id = "loose_brain"
name = "Loose Brain"
desc = "You get the feeling that fliping with your brain exposed might not be a good idea..."
desc = "You get the feeling that flipping with your brain exposed might not be a good idea..."
icon_state = "brain"
maxDuration = 2 MINUTES // I made this long so you can do gags where you fling your brain at someone
effect_quality = STATUS_QUALITY_NEGATIVE

/datum/statusEffect/smellingsalts //Status effect from inhaling smelling salts
id = "smelling_salts"
name = "Perked up"
desc = "Smelling salts have knocked you back into being awake!"
icon_state = "smelling_salts"
maxDuration = 6 MINUTES
effect_quality = STATUS_QUALITY_POSITIVE
var/max_health_bonus = 30
var/benefit_duration = 60 SECONDS // how long the positives apply
var/current_bonus = 0

getTooltip()
if (duration > 5 MINUTES)
return "Smelling salts have knocked you back into being awake!"
else
return "Your sinuses are burning! Smelling salts can't perk you up."

onUpdate(optional=null)
var/bonus_remaining = max(0,1+(duration-maxDuration)/benefit_duration)
affectHealth(round(max_health_bonus * bonus_remaining))
if(bonus_remaining == 0)
icon_state = "smelling_salts_low"
else
icon_state = "smelling_salts"
return

preCheck(atom/A)
. = ..()
if (!ismob(A))
. = FALSE

proc/affectHealth(var/newBonus)
if (current_bonus != newBonus)
var/change = newBonus - current_bonus
var/mob/M = owner
M.max_health += change
current_bonus = newBonus
health_update_queue |= M
TDHooligan marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions code/obj/item/cigarette.dm
Expand Up @@ -298,7 +298,7 @@
if (prob(1))
H.contract_disease(/datum/ailment/malady/heartdisease,null,null,1)
src.reagents.trans_to(M, puffrate)
src.reagents.reaction(M, INGEST, puffrate)
src.reagents.reaction(M, INGEST, puffrate, paramslist = list("inhaled"))
//lung damage
if (prob(40))
if (prob(70))
Expand All @@ -309,7 +309,7 @@
H.organHolder.damage_organ(0, 0, 1, "right_lung")
else
src.reagents.trans_to(M, puffrate)
src.reagents.reaction(M, INGEST, puffrate)
src.reagents.reaction(M, INGEST, puffrate, paramslist = list("inhaled"))
else if (src?.reagents) //ZeWaka: Copied Wire's fix for null.remove_any() below
src.reagents.remove_any(puffrate)

Expand Down
2 changes: 1 addition & 1 deletion code/obj/item/clothing/injector_mask_belt.dm
Expand Up @@ -235,7 +235,7 @@ TYPEINFO(/obj/item/clothing/mask/gas/injector_mask)

boutput(src.owner, "<span class='notice'>Your [src] activates.</span>")

src.container.reagents.reaction(src.owner, INGEST)
src.container.reagents.reaction(src.owner, INGEST, paramslist = list("inhaled"))
SPAWN(1.5 SECONDS)
src.container.reagents.trans_to(src.owner, src.inj_amount)

Expand Down
Binary file modified icons/ui/statussystem.dmi
Binary file not shown.