mirror of
https://github.com/KabKebab/GS13.git
synced 2026-08-30 08:30:08 +01:00
Fixes up the stunlock.
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
// Cba making a define file just for status effects so all the helper stuff goes here!~
|
||||
#define STATUS_EFFECT_FATSTUN /datum/status_effect/incapacitating/fatstun //the affected is knocked down
|
||||
#define STATUS_EFFECT_FATSTUN /datum/status_effect/incapacitating/stun/fat //the affected is knocked down
|
||||
|
||||
////
|
||||
// Makes it so player is stunned and while stunned, fatness level grows.
|
||||
////
|
||||
/datum/status_effect/incapacitating/fatstun
|
||||
id = "fatstun"
|
||||
/datum/status_effect/incapacitating/stun/fat
|
||||
var/fatAmount = 1
|
||||
|
||||
/datum/status_effect/incapacitating/fatstun/on_creation(mob/living/new_owner, set_duration, updating_canmove, fatnessAmount)
|
||||
/datum/status_effect/incapacitating/stun/fat/on_creation(mob/living/new_owner, set_duration, updating_canmove, fatnessAmount)
|
||||
fatAmount = fatnessAmount
|
||||
..()
|
||||
|
||||
/datum/status_effect/incapacitating/fatstun/tick()
|
||||
/datum/status_effect/incapacitating/stun/fat/tick()
|
||||
var/mob/living/carbon/C = owner
|
||||
if(C)
|
||||
C.adjust_fatness(fatAmount, FATTENING_TYPE_ITEM) // simply adds/removes the fat overtime.
|
||||
to_chat(owner, "You feel larger...")
|
||||
// to_chat(owner, "You feel larger...") // debugging to see if the stun works.
|
||||
|
||||
////
|
||||
// Helpers so it applies to the mob. (I cannot be bothered making a new file for this AUGH)
|
||||
@@ -28,14 +27,14 @@
|
||||
return has_status_effect(STATUS_EFFECT_FATSTUN)
|
||||
|
||||
/mob/living/proc/AmountFatStunned() //How many deciseconds remain in our knockdown
|
||||
var/datum/status_effect/incapacitating/fatstun/F = IsFatStunned()
|
||||
var/datum/status_effect/incapacitating/stun/fat/F = IsFatStunned()
|
||||
if(F)
|
||||
return F.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/FatStun(amount, updating = TRUE, ignore_canstun = FALSE, fatAmount)
|
||||
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/fatstun/F = IsFatStunned()
|
||||
var/datum/status_effect/incapacitating/stun/fat/F = IsFatStunned()
|
||||
if(F)
|
||||
F.duration = max(world.time + amount, F.duration)
|
||||
else if(amount > 0)
|
||||
@@ -44,7 +43,7 @@
|
||||
|
||||
/mob/living/proc/SetFatStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
|
||||
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/fatstun/F = IsFatStunned()
|
||||
var/datum/status_effect/incapacitating/stun/fat/F = IsFatStunned()
|
||||
if(amount <= 0)
|
||||
if(F)
|
||||
qdel(F)
|
||||
@@ -57,7 +56,7 @@
|
||||
|
||||
/mob/living/proc/AdjustFatStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
|
||||
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/fatstun/F = IsFatStunned()
|
||||
var/datum/status_effect/incapacitating/stun/fat/F = IsFatStunned()
|
||||
if(F)
|
||||
F.duration += amount
|
||||
else if(amount > 0)
|
||||
|
||||
Reference in New Issue
Block a user