mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 12:08:28 +01:00
Starts work on Organs affecting Reagent Processing
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
var/icon_scale_percent // Makes the holder's icon get scaled up or down.
|
||||
var/attack_speed_percent // Makes the holder's 'attack speed' (click delay) shorter or longer.
|
||||
var/pain_immunity // Makes the holder not care about pain while this is on. Only really useful to human mobs.
|
||||
var/pulse_modifier // Modifier for pulse, will be rounded on application, then added to the normal 'pulse' multiplier which ranges between 0 and 5 normally. Only applied if they're living.
|
||||
var/pulse_set_level // Positive number. If this is non-null, it will hard-set the pulse level to this. Pulse ranges from 0 to 5 normally.
|
||||
|
||||
/datum/modifier/New(var/new_holder, var/new_origin)
|
||||
holder = new_holder
|
||||
|
||||
@@ -268,3 +268,17 @@ the artifact triggers the rage.
|
||||
if(L.get_poison_protection() >= 1)
|
||||
return FALSE
|
||||
return TRUE
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
// Pulse modifier.
|
||||
/datum/modifier/false_pulse
|
||||
name = "false pulse"
|
||||
desc = "Your blood flows, despite all other factors."
|
||||
|
||||
on_created_text = "<span class='notice'>You feel alive.</span>"
|
||||
on_expired_text = "<span class='notice'>You feel.. different.</span>"
|
||||
stacks = MODIFIER_STACK_EXTEND
|
||||
|
||||
pulse_set_level = PULSE_NORM
|
||||
>>>>>>> 3661d6f... Merge pull request #6081 from Mechoid/PulseBasedReagentProcessing
|
||||
|
||||
@@ -1550,20 +1550,67 @@
|
||||
/mob/living/carbon/human/proc/handle_pulse()
|
||||
if(life_tick % 5) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
|
||||
|
||||
if(!internal_organs_by_name[O_HEART])
|
||||
return PULSE_NONE //No blood, no pulse.
|
||||
|
||||
if(stat == DEAD)
|
||||
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse
|
||||
|
||||
var/temp = PULSE_NORM
|
||||
|
||||
var/modifier_shift = 0
|
||||
var/modifier_set
|
||||
|
||||
if(modifiers && modifiers.len)
|
||||
for(var/datum/modifier/mod in modifiers)
|
||||
if(isnull(modifier_set) && !isnull(mod.pulse_set_level))
|
||||
modifier_set = round(mod.pulse_set_level) // Should be a whole number, but let's not take chances.
|
||||
else if(mod.pulse_set_level > modifier_set)
|
||||
modifier_set = round(mod.pulse_set_level)
|
||||
|
||||
modifier_set = max(0, modifier_set) // No setting to negatives.
|
||||
|
||||
if(mod.pulse_modifier)
|
||||
modifier_shift += mod.pulse_modifier
|
||||
|
||||
modifier_shift = round(modifier_shift)
|
||||
|
||||
if(!internal_organs_by_name[O_HEART])
|
||||
temp = PULSE_NONE
|
||||
if(!isnull(modifier_set))
|
||||
temp = modifier_set
|
||||
return temp //No blood, no pulse.
|
||||
|
||||
if(stat == DEAD)
|
||||
temp = PULSE_NONE
|
||||
if(!isnull(modifier_set))
|
||||
temp = modifier_set
|
||||
return temp //that's it, you're dead, nothing can influence your pulse, aside from outside means.
|
||||
|
||||
var/obj/item/organ/internal/heart/Pump = internal_organs_by_name[O_HEART]
|
||||
|
||||
if(Pump)
|
||||
temp += Pump.standard_pulse_level - PULSE_NORM
|
||||
|
||||
if(round(vessel.get_reagent_amount("blood")) <= BLOOD_VOLUME_BAD) //how much blood do we have
|
||||
temp = PULSE_THREADY //not enough :(
|
||||
temp = temp + 3 //not enough :(
|
||||
|
||||
if(status_flags & FAKEDEATH)
|
||||
temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds
|
||||
|
||||
if(!isnull(modifier_set))
|
||||
temp = modifier_set
|
||||
|
||||
temp = max(0, temp + modifier_shift) // No negative pulses.
|
||||
|
||||
if(Pump)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.id in bradycardics)
|
||||
if(temp <= Pump.standard_pulse_level + 3 && temp >= Pump.standard_pulse_level)
|
||||
temp--
|
||||
if(R.id in tachycardics)
|
||||
if(temp <= Pump.standard_pulse_level + 1 && temp >= PULSE_NONE)
|
||||
temp++
|
||||
if(R.id in heartstopper) //To avoid using fakedeath
|
||||
temp = PULSE_NONE
|
||||
if(R.id in cheartstopper) //Conditional heart-stoppage
|
||||
if(R.volume >= R.overdose)
|
||||
temp = PULSE_NONE
|
||||
return temp
|
||||
//handles different chems' influence on pulse
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.id in bradycardics)
|
||||
|
||||
Reference in New Issue
Block a user