mirror of
https://github.com/KabKebab/GS13.git
synced 2026-02-09 15:17:41 +00:00
calorite doors
tl;dr the fatter you are, the longer you get stuck and the more you fatten (thank you surftheseawing for immense help with the code)
This commit is contained in:
@@ -290,13 +290,14 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \
|
||||
sheettype = "calorite"
|
||||
materials = list(MAT_CALORITE=MINERAL_MATERIAL_AMOUNT)
|
||||
novariants = TRUE
|
||||
grind_results = list(/datum/reagent/consumable/lipoifier = 5)
|
||||
grind_results = list(/datum/reagent/consumable/lipoifier = 3)
|
||||
point_value = 40
|
||||
merge_type = /obj/item/stack/sheet/mineral/calorite
|
||||
|
||||
GLOBAL_LIST_INIT(calorite_recipes, list ( \
|
||||
new/datum/stack_recipe("calorite tile", /obj/item/stack/tile/mineral/calorite, 1, 4, 20), \
|
||||
new/datum/stack_recipe("Fatty Statue", /obj/structure/statue/calorite/fatty, 5, one_per_turf = 1, on_floor = 1),
|
||||
new/datum/stack_recipe("Calorite tile", /obj/item/stack/tile/mineral/calorite, 1, 4, 20), \
|
||||
new/datum/stack_recipe("Fatty statue", /obj/structure/statue/calorite/fatty, 5, one_per_turf = 1, on_floor = 1),
|
||||
new/datum/stack_recipe("Calorite doors", /obj/structure/statue/calorite/fatty, 5, one_per_turf = 1, on_floor = 1),
|
||||
))
|
||||
|
||||
/obj/item/stack/sheet/mineral/calorite/Initialize(mapload, new_amount, merge = TRUE)
|
||||
|
||||
@@ -167,6 +167,97 @@
|
||||
/obj/structure/mineral_door/uranium/ComponentInitialize()
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/mineral_door/calorite //GS13
|
||||
name = "calorite door"
|
||||
icon_state = "paperframe"
|
||||
sheetType = /obj/item/stack/sheet/mineral/calorite
|
||||
max_integrity = 200
|
||||
light_range = 1
|
||||
var/fatten = FALSE // whether player will be fattened
|
||||
var/fatten_delay = 1 // ticks per periodic loop
|
||||
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/blocked = FALSE // whether door is blocked
|
||||
|
||||
// override /obj/structure/mineral_door/proc/Open()
|
||||
/obj/structure/mineral_door/calorite/Open() //GS13
|
||||
isSwitchingStates = 1
|
||||
playsound(src, openSound, 100, 1)
|
||||
set_opacity(FALSE)
|
||||
flick("[initial_state]opening",src)
|
||||
sleep(10)
|
||||
density = FALSE
|
||||
state = 1
|
||||
air_update_turf(1)
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
|
||||
if(close_delay != -1)
|
||||
addtimer(CALLBACK(src, .proc/Close), close_delay)
|
||||
|
||||
// start periodic loop
|
||||
stuck = FALSE
|
||||
addtimer(CALLBACK(src, .proc/Fatten), fatten_delay)
|
||||
|
||||
/obj/structure/mineral_door/calorite/proc/Fatten() //GS13
|
||||
if(state == 1) // door must be open
|
||||
// check periodically
|
||||
addtimer(CALLBACK(src, .proc/Fatten), fatten_delay)
|
||||
// check for mobs in open door
|
||||
var/turf/T = get_turf(src)
|
||||
blocked = FALSE
|
||||
for(var/mob/living/carbon/M in T)
|
||||
blocked = TRUE
|
||||
// determine if mob should get stuck and be fattened
|
||||
if(M.fatness >= FATNESS_LEVEL_BARELYMOBILE)
|
||||
fatten = TRUE
|
||||
if (!stuck)
|
||||
stuck_delay = 120
|
||||
M.visible_message(
|
||||
"<span class='boldnotice'>[M] gets stuck in the doorway!</span>",
|
||||
"<span class='boldwarning'>You feel yourself get stuck in the doorway!</span>")
|
||||
else if(M.fatness >= FATNESS_LEVEL_MORBIDLY_OBESE)
|
||||
fatten = TRUE
|
||||
if (!stuck)
|
||||
stuck_delay = 50
|
||||
M.visible_message(
|
||||
"<span class='boldnotice'>[M] barely squeezes through the doorway!</span>",
|
||||
"<span class='boldwarning'>You feel your sides barely squeeze through the doorway!</span>")
|
||||
else if(M.fatness >= FATNESS_LEVEL_FATTER)
|
||||
fatten = TRUE
|
||||
if (!stuck)
|
||||
stuck_delay = 15
|
||||
M.visible_message(
|
||||
"<span class='boldnotice'>[M]'s sides briefly brush against the doorway.</span>",
|
||||
"<span class='boldwarning'>You feel your sides smush against the doorway!.</span>")
|
||||
else if(M.fatness >= FATNESS_LEVEL_FAT)
|
||||
fatten = TRUE
|
||||
if (!stuck)
|
||||
stuck_delay = 5
|
||||
M.visible_message(
|
||||
"<span class='boldnotice'>[M]'s sides briefly brush against the doorway.</span>",
|
||||
"<span class='boldwarning'>You feel your sides briefly brush against the doorway!</span>")
|
||||
else
|
||||
fatten = FALSE
|
||||
stuck = FALSE
|
||||
stuck_delay = 0
|
||||
|
||||
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)
|
||||
|
||||
if (!blocked)
|
||||
stuck = FALSE // ready to go again
|
||||
|
||||
/obj/structure/mineral_door/sandstone
|
||||
name = "sandstone door"
|
||||
icon_state = "sandstone"
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
|
||||
defer_change = 1
|
||||
mineralSpawnChanceList = list(
|
||||
/turf/closed/mineral/uranium/volcanic = 35, /turf/closed/mineral/diamond/volcanic = 30, /turf/closed/mineral/gold/volcanic = 45, /turf/closed/mineral/titanium/volcanic = 45,
|
||||
/turf/closed/mineral/uranium/volcanic = 35, /turf/closed/mineral/diamond/volcanic = 30, /turf/closed/mineral/calorite = 30, /turf/closed/mineral/gold/volcanic = 45, /turf/closed/mineral/titanium/volcanic = 45,
|
||||
/turf/closed/mineral/silver/volcanic = 50, /turf/closed/mineral/plasma/volcanic = 50, /turf/closed/mineral/bscrystal/volcanic = 20)
|
||||
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
export_types = list(/obj/structure/statue/bananium/clown)
|
||||
|
||||
/datum/export/large/fattystatue //GS13
|
||||
cost = 2000
|
||||
cost = 1500
|
||||
unit_name = "Fatty statue"
|
||||
export_types = list(/obj/structure/statue/calorite/fatty)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user