mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
[MIRROR] Fermichem 2.4 - C2 medicine recipe adaptations and atunements to the new mechanics (#3701)
* Fermichem 2.4 - C2 medicine recipe adaptations and atunements to the new mechanics * Update human_defense.dm Co-authored-by: Thalpy <33956696+Thalpy@users.noreply.github.com> Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Thalpy
Gandalf2k15
parent
9b408206ec
commit
4032c73891
@@ -7,6 +7,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
/datum/hallucination/battle = 20,
|
||||
/datum/hallucination/dangerflash = 15,
|
||||
/datum/hallucination/hudscrew = 12,
|
||||
/datum/hallucination/fake_health_doll = 12,
|
||||
/datum/hallucination/fake_alert = 12,
|
||||
/datum/hallucination/weird_sounds = 8,
|
||||
/datum/hallucination/stationmessage = 7,
|
||||
@@ -1152,6 +1153,62 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
target.clear_alert(alert_type, clear_override = TRUE)
|
||||
qdel(src)
|
||||
|
||||
///Causes the target to see incorrect health damages on the healthdoll
|
||||
/datum/hallucination/fake_health_doll
|
||||
var/timer_id = null
|
||||
|
||||
///Creates a specified doll hallucination, or picks one randomly
|
||||
/datum/hallucination/fake_health_doll/New(mob/living/carbon/human/human_mob, forced = TRUE, specific_limb, severity, duration = 500)
|
||||
. = ..()
|
||||
if(!specific_limb)
|
||||
specific_limb = pick(list(SCREWYDOLL_HEAD, SCREWYDOLL_CHEST, SCREWYDOLL_L_ARM, SCREWYDOLL_R_ARM, SCREWYDOLL_L_LEG, SCREWYDOLL_R_LEG))
|
||||
if(!severity)
|
||||
severity = rand(1, 5)
|
||||
LAZYSET(human_mob.hal_screwydoll, specific_limb, severity)
|
||||
human_mob.update_health_hud()
|
||||
|
||||
timer_id = addtimer(CALLBACK(src, .proc/cleanup), duration, TIMER_STOPPABLE)
|
||||
|
||||
///Increments the severity of the damage seen on the doll
|
||||
/datum/hallucination/fake_health_doll/proc/increment_fake_damage()
|
||||
if(!ishuman(target))
|
||||
stack_trace("Somehow [target] managed to get a fake health doll hallucination, while not being a human mob.")
|
||||
var/mob/living/carbon/human/human_mob = target
|
||||
for(var/entry in human_mob.hal_screwydoll)
|
||||
human_mob.hal_screwydoll[entry] = clamp(human_mob.hal_screwydoll[entry]+1, 1, 5)
|
||||
human_mob.update_health_hud()
|
||||
|
||||
///Adds a fake limb to the hallucination datum effect
|
||||
/datum/hallucination/fake_health_doll/proc/add_fake_limb(specific_limb, severity)
|
||||
if(!specific_limb)
|
||||
specific_limb = pick(list(SCREWYDOLL_HEAD, SCREWYDOLL_CHEST, SCREWYDOLL_L_ARM, SCREWYDOLL_R_ARM, SCREWYDOLL_L_LEG, SCREWYDOLL_R_LEG))
|
||||
if(!severity)
|
||||
severity = rand(1, 5)
|
||||
var/mob/living/carbon/human/human_mob = target
|
||||
LAZYSET(human_mob.hal_screwydoll, specific_limb, severity)
|
||||
target.update_health_hud()
|
||||
|
||||
/datum/hallucination/fake_health_doll/target_deleting()
|
||||
if(isnull(timer_id))
|
||||
return
|
||||
deltimer(timer_id)
|
||||
timer_id = null
|
||||
..()
|
||||
|
||||
///Cleans up the hallucinations - this deletes any overlap, but that shouldn't happen.
|
||||
/datum/hallucination/fake_health_doll/proc/cleanup()
|
||||
qdel(src)
|
||||
|
||||
//So that the associated addition proc cleans it up correctly
|
||||
/datum/hallucination/fake_health_doll/Destroy()
|
||||
if(!ishuman(target))
|
||||
stack_trace("Somehow [target] managed to get a fake health doll hallucination, while not being a human mob.")
|
||||
var/mob/living/carbon/human/human_mob = target
|
||||
LAZYNULL(human_mob.hal_screwydoll)
|
||||
human_mob.update_health_hud()
|
||||
..()
|
||||
|
||||
|
||||
/datum/hallucination/items/New(mob/living/carbon/C, forced = TRUE)
|
||||
set waitfor = FALSE
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user