diff --git a/GainStation13/code/datums/components/fattening_door.dm b/GainStation13/code/datums/components/fattening_door.dm index 1e88b76a..7a548786 100644 --- a/GainStation13/code/datums/components/fattening_door.dm +++ b/GainStation13/code/datums/components/fattening_door.dm @@ -1,10 +1,6 @@ /datum/component/fattening_door var/fatten = FALSE // whether player will be fattened var/fat_to_add = 2 // fatness per tick stunned - var/stuck = FALSE // whether player is stuck - var/stuck_delay = 0 // set in proc/Fatten - // var/fatten_delay = 1 // ticks per periodic loop - // var/blocked = FALSE // whether door is blocked // Unneeded now as FatStun replaces this loop requirement. /datum/component/fattening_door/Initialize() if(!istype(parent, /obj/structure/mineral_door)) // if the attached object isn't a door, return incompatible! @@ -14,62 +10,37 @@ /datum/component/fattening_door/proc/Fatten() //GS13 - to_chat(world, "fattenPass1") - //blocked = FALSE - + var/stuck_delay = 0 var/turf/T = get_turf(parent) + for(var/mob/living/carbon/M in T) - //blocked = TRUE - stuck = M.AmountFatStunned() // determine if mob should get stuck and be fattened - if(M.fatness >= FATNESS_LEVEL_BARELYMOBILE) + if(M.fatness >= FATNESS_LEVEL_FAT) fatten = TRUE - if(!stuck) - stuck_delay = 120 - M.visible_message( - "[M] gets stuck in the doorway!", - "You feel yourself get stuck in the doorway!") - else if(M.fatness >= FATNESS_LEVEL_MORBIDLY_OBESE) - fatten = TRUE - if(!stuck) - stuck_delay = 50 - M.visible_message( - "[M] barely squeezes through the doorway!", - "You feel your sides barely squeeze through the doorway!") - else if(M.fatness >= FATNESS_LEVEL_FATTER) - fatten = TRUE - if(!stuck) - stuck_delay = 15 - M.visible_message( - "[M]'s sides briefly smush against the doorway.", - "You feel your sides smush against the doorway!.") - else if(M.fatness >= FATNESS_LEVEL_FAT) - fatten = TRUE - if(!stuck) + if(!M.AmountFatStunned()) stuck_delay = 5 M.visible_message( "[M]'s sides briefly brush against the doorway.", "You feel your sides briefly brush against the doorway!") - else - fatten = FALSE - stuck = FALSE - stuck_delay = 0 + + // Scales depending on this switch. + switch(M.fatness) + if(FATNESS_LEVEL_BARELYMOBILE to INFINITY) + stuck_delay = 120 + M.visible_message( + "[M] gets stuck in the doorway!", + "You feel yourself get stuck in the doorway!") + if((FATNESS_LEVEL_FATTER+1) to FATNESS_LEVEL_MORBIDLY_OBESE) + stuck_delay = 50 + M.visible_message( + "[M] barely squeezes through the doorway!", + "You feel your sides barely squeeze through the doorway!") + if((FATNESS_LEVEL_FAT+1) to FATNESS_LEVEL_FATTER) + stuck_delay = 15 + M.visible_message( + "[M]'s sides briefly smush against the doorway.", + "You feel your sides smush against the doorway!.") - // This requires a rework unfortunately now that its moved into a datum component. - // I'll just make a custom status effect which stuns the player and while stunned, adds fatness :3 - // if (fatten) // get stuck - // if (!stuck) - // M.Stun(stuck_delay/2) // give player time to escape - // stuck = TRUE - // if (stuck_delay > 0) // wait for stun to end - // stuck_delay = stuck_delay - fatten_delay - // if (stuck_delay <= 0) - // stuck_delay = 0 - // // gain weight while stuck - // M.adjust_fatness(fat_to_add, FATTENING_TYPE_ITEM) - + // Apply the fatstun if(fatten) M.FatStun(stuck_delay, fatAmount = fat_to_add) - - // if (!blocked) - // stuck = FALSE // ready to go again diff --git a/GainStation13/code/obj/structure/calorite_doors.dm b/GainStation13/code/obj/structure/calorite_doors.dm index e2b5ff71..1f24ceae 100644 --- a/GainStation13/code/obj/structure/calorite_doors.dm +++ b/GainStation13/code/obj/structure/calorite_doors.dm @@ -5,10 +5,14 @@ sheetType = /obj/item/stack/sheet/mineral/calorite max_integrity = 200 light_range = 1 + // Sets it open by default state = TRUE + density = FALSE +// If you ever want to make any door like this, just simply add the component like this :3 /obj/structure/mineral_door/calorite/Initialize() . = ..() AddComponent(/datum/component/fattening_door) - update_icon() + + update_icon() // Updates the sprite when spawned in cause it's closed by default.