mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
Adds Bonfire Grills (#1003)
This commit is contained in:
committed by
Poojawa
parent
1b39381ee7
commit
fadbb378aa
@@ -107,20 +107,45 @@
|
|||||||
anchored = TRUE
|
anchored = TRUE
|
||||||
buckle_lying = 0
|
buckle_lying = 0
|
||||||
var/burning = 0
|
var/burning = 0
|
||||||
|
var/grill = FALSE
|
||||||
var/fire_stack_strength = 5
|
var/fire_stack_strength = 5
|
||||||
|
|
||||||
/obj/structure/bonfire/attackby(obj/item/W, mob/user, params)
|
/obj/structure/bonfire/attackby(obj/item/W, mob/user, params)
|
||||||
if(istype(W, /obj/item/stack/rods) && !can_buckle)
|
if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill)
|
||||||
var/obj/item/stack/rods/R = W
|
var/obj/item/stack/rods/R = W
|
||||||
|
var/choice = input(user, "What would you like to construct?", "Bonfire") as null|anything in list("Stake","Grill")
|
||||||
|
switch(choice)
|
||||||
|
if("Stake")
|
||||||
R.use(1)
|
R.use(1)
|
||||||
can_buckle = 1
|
can_buckle = TRUE
|
||||||
buckle_requires_restraints = 1
|
buckle_requires_restraints = TRUE
|
||||||
to_chat(user, "<span class='italics'>You add a rod to [src].")
|
to_chat(user, "<span class='italics'>You add a rod to \the [src].")
|
||||||
var/mutable_appearance/rod_underlay = mutable_appearance('icons/obj/hydroponics/equipment.dmi', "bonfire_rod")
|
var/mutable_appearance/rod_underlay = mutable_appearance('icons/obj/hydroponics/equipment.dmi', "bonfire_rod")
|
||||||
rod_underlay.pixel_y = 16
|
rod_underlay.pixel_y = 16
|
||||||
underlays += rod_underlay
|
underlays += rod_underlay
|
||||||
|
if("Grill")
|
||||||
|
R.use(1)
|
||||||
|
grill = TRUE
|
||||||
|
to_chat(user, "<span class='italics'>You add a grill to \the [src].")
|
||||||
|
var/mutable_appearance/grill_overlay = mutable_appearance('icons/obj/hydroponics/equipment.dmi', "bonfire_grill")
|
||||||
|
overlays += grill_overlay
|
||||||
|
else
|
||||||
|
return ..()
|
||||||
if(W.is_hot())
|
if(W.is_hot())
|
||||||
StartBurning()
|
StartBurning()
|
||||||
|
if(grill)
|
||||||
|
if(user.a_intent != INTENT_HARM && !(W.flags & ABSTRACT))
|
||||||
|
if(user.temporarilyRemoveItemFromInventory(W))
|
||||||
|
W.forceMove(get_turf(src))
|
||||||
|
var/list/click_params = params2list(params)
|
||||||
|
//Center the icon where the user clicked.
|
||||||
|
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
|
||||||
|
return
|
||||||
|
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
|
||||||
|
W.pixel_x = Clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||||
|
W.pixel_y = Clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||||
|
else
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
|
||||||
/obj/structure/bonfire/attack_hand(mob/user)
|
/obj/structure/bonfire/attack_hand(mob/user)
|
||||||
@@ -158,7 +183,7 @@
|
|||||||
StartBurning()
|
StartBurning()
|
||||||
|
|
||||||
/obj/structure/bonfire/Crossed(atom/movable/AM)
|
/obj/structure/bonfire/Crossed(atom/movable/AM)
|
||||||
if(burning)
|
if(burning & !grill)
|
||||||
Burn()
|
Burn()
|
||||||
|
|
||||||
/obj/structure/bonfire/proc/Burn()
|
/obj/structure/bonfire/proc/Burn()
|
||||||
@@ -175,11 +200,27 @@
|
|||||||
L.adjust_fire_stacks(fire_stack_strength)
|
L.adjust_fire_stacks(fire_stack_strength)
|
||||||
L.IgniteMob()
|
L.IgniteMob()
|
||||||
|
|
||||||
|
/obj/structure/bonfire/proc/Cook()
|
||||||
|
var/turf/current_location = get_turf(src)
|
||||||
|
for(var/A in current_location)
|
||||||
|
if(A == src)
|
||||||
|
continue
|
||||||
|
else if(isliving(A)) //It's still a fire, idiot.
|
||||||
|
var/mob/living/L = A
|
||||||
|
L.adjust_fire_stacks(fire_stack_strength)
|
||||||
|
L.IgniteMob()
|
||||||
|
else if(istype(A, /obj/item) && prob(20))
|
||||||
|
var/obj/item/O = A
|
||||||
|
O.microwave_act()
|
||||||
|
|
||||||
/obj/structure/bonfire/process()
|
/obj/structure/bonfire/process()
|
||||||
if(!CheckOxygen())
|
if(!CheckOxygen())
|
||||||
extinguish()
|
extinguish()
|
||||||
return
|
return
|
||||||
|
if(!grill)
|
||||||
Burn()
|
Burn()
|
||||||
|
else
|
||||||
|
Cook()
|
||||||
|
|
||||||
/obj/structure/bonfire/extinguish()
|
/obj/structure/bonfire/extinguish()
|
||||||
if(burning)
|
if(burning)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user