Skip to content

Commit

Permalink
Large Pack of Stuff (Roguelighting split, stew code and weaving addit…
Browse files Browse the repository at this point in the history
…ions) (#1210)

* Large Pack of Stuff

* Removes that change

* Brings back the big_fireplace and candle lamps

---------

Co-authored-by: NPC1314 <110836368+NPC1314@users.noreply.github.com>
  • Loading branch information
BadAtThisGame302 and NPC1314 authored Dec 13, 2024
1 parent 8abe39d commit 6ead225
Show file tree
Hide file tree
Showing 11 changed files with 1,100 additions and 1,026 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@
/area/rogue/indoors/vampire_manor)
"bG" = (
/obj/structure/fluff/wallclock/vampire,
/obj/machinery/light/rogue/hearth/big_fireplace,
/obj/machinery/light/rogue/wallfire/big_fireplace,
/turf/open/floor/rogue/hexstone,
/area/rogue/indoors/vampire_manor)
"bH" = (
Expand Down
6 changes: 3 additions & 3 deletions code/datums/pollutants/foods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
name = "cooked sausage"
scent = "cooked sausage"

/datum/pollutant/food/sausage
name = "cooked sausage"
scent = "cooked sausage"
/datum/pollutant/food/wiener
name = "cooked wiener"
scent = "cooked wiener"

/datum/pollutant/food/fried_cabbage
name = "fried cabbage"
Expand Down
185 changes: 185 additions & 0 deletions code/game/objects/lighting/_base_roguelight.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/obj/machinery/light/rogue
icon = 'icons/roguetown/misc/lighting.dmi'
brightness = 8
nightshift_allowed = FALSE
fueluse = 60 MINUTES
bulb_colour = "#f9ad80"
bulb_power = 1
var/datum/looping_sound/soundloop = /datum/looping_sound/fireloop
pass_flags = LETPASSTHROW
flags_1 = NODECONSTRUCT_1
var/cookonme = FALSE
var/crossfire = TRUE
var/can_damage = FALSE

/obj/machinery/light/rogue/Initialize()
if(soundloop)
soundloop = new soundloop(src, FALSE)
soundloop.start()
GLOB.fires_list += src
if(fueluse)
fueluse = fueluse - (rand(fueluse*0.1,fueluse*0.3))
update_icon()
seton(TRUE)
. = ..()

/obj/machinery/light/rogue/weather_trigger(W)
if(W==/datum/weather/rain)
START_PROCESSING(SSweather,src)

/obj/machinery/light/rogue/OnCrafted(dirin)
. = ..()
can_damage = TRUE
burn_out()

/obj/machinery/light/rogue/examine(mob/user)
. = ..()
if(Adjacent(user))
if(fueluse > 0)
var/minsleft = fueluse / 600
minsleft = round(minsleft)
if(minsleft <= 1)
minsleft = "less than a minute"
else
minsleft = "[round(minsleft)] minutes"
. += span_info("The fire will last for [minsleft].")
else
if(initial(fueluse) > 0)
. += span_warning("The fire is burned out and hungry...")


/obj/machinery/light/rogue/extinguish()
if(on)
burn_out()
new /obj/effect/temp_visual/small_smoke(src.loc)
..()



/obj/machinery/light/rogue/burn_out()
if(soundloop)
soundloop.stop()
if(on)
playsound(src.loc, 'sound/items/firesnuff.ogg', 100)
..()
update_icon()

/obj/machinery/light/rogue/update_icon()
if(on)
icon_state = "[base_state]1"
else
icon_state = "[base_state]0"

/obj/machinery/light/rogue/update()
. = ..()
if(on)
GLOB.fires_list |= src
else
GLOB.fires_list -= src

/obj/machinery/light/rogue/Destroy()
QDEL_NULL(soundloop)
GLOB.fires_list -= src
. = ..()

/obj/machinery/light/rogue/fire_act(added, maxstacks)
if(!on && ((fueluse > 0) || (initial(fueluse) == 0)))
playsound(src.loc, 'sound/items/firelight.ogg', 100)
on = TRUE
update()
update_icon()
if(soundloop)
soundloop.start()
addtimer(CALLBACK(src, PROC_REF(trigger_weather)), rand(5,20))
return TRUE

/obj/proc/trigger_weather()
if(!QDELETED(src))
if(isturf(loc))
var/turf/T = loc
T.trigger_weather(src)

/obj/machinery/light/rogue/Crossed(atom/movable/AM, oldLoc)
..()
if(crossfire)
if(on)
AM.fire_act(1,5)

/obj/machinery/light/rogue/spark_act()
fire_act()

/obj/machinery/light/rogue/attackby(obj/item/W, mob/living/user, params)
if(cookonme)
if(istype(W, /obj/item/reagent_containers/food/snacks))
if(istype(W, /obj/item/reagent_containers/food/snacks/egg))
to_chat(user, span_warning("I wouldn't be able to cook this over the fire..."))
return FALSE
var/obj/item/A = user.get_inactive_held_item()
if(A)
var/foundstab = FALSE
for(var/X in A.possible_item_intents)
var/datum/intent/D = new X
if(D.blade_class == BCLASS_STAB)
foundstab = TRUE
break
if(foundstab)
var/prob2spoil = 33
if(user.mind.get_skill_level(/datum/skill/craft/cooking))
prob2spoil = 1
user.visible_message(span_notice("[user] starts to cook [W] over [src]."))
for(var/i in 1 to 6)
if(do_after(user, 30, target = src))
var/obj/item/reagent_containers/food/snacks/S = W
var/obj/item/C
if(prob(prob2spoil))
user.visible_message(span_warning("[user] burns [S]."))
if(user.client?.prefs.showrolls)
to_chat(user, span_warning("Critfail... [prob2spoil]%."))
C = S.cooking(1000, null)
else
C = S.cooking(S.cooktime/4, src)
if(C)
user.dropItemToGround(S, TRUE)
qdel(S)
C.forceMove(get_turf(user))
user.put_in_hands(C)
break
else
break
return
if(W.firefuel)
if(initial(fueluse))
if(fueluse > initial(fueluse) - 5 SECONDS)
to_chat(user, span_warning("[src] is fully fueled."))
return
else
if(!on)
return
if (alert(usr, "Feed [W] to the fire?", "ROGUETOWN", "Yes", "No") != "Yes")
return
qdel(W)
user.visible_message(span_warning("[user] feeds [W] to [src]."))
if(initial(fueluse))
fueluse = fueluse + W.firefuel
if(fueluse > initial(fueluse)) //keep it at the max
fueluse = initial(fueluse)
return
else
if(on)
if(istype(W, /obj/item/natural/dirtclod))
if(!user.temporarilyRemoveItemFromInventory(W))
return
on = FALSE
set_light(0)
update_icon()
qdel(W)
src.visible_message(span_warning("[user] snuffs the fire."))
return
if(user.used_intent?.type != INTENT_SPLASH)
W.spark_act()
. = ..()

/obj/machinery/light/rogue/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
if(!can_damage)
return
. = ..()
54 changes: 54 additions & 0 deletions code/game/objects/lighting/_base_roguestreet.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/obj/machinery/light/roguestreet
icon = 'icons/roguetown/misc/tallstructure.dmi'
icon_state = "slamp1"
base_state = "slamp"
brightness = 10
//nightshift_allowed = FALSE
fueluse = 0
bulb_colour = "#f9e080"
bulb_power = 1
max_integrity = 0
pass_flags = LETPASSTHROW

/obj/machinery/light/roguestreet/midlamp
icon = 'icons/roguetown/misc/64x64.dmi'
icon_state = "midlamp1"
base_state = "midlamp"
pixel_x = -16
density = TRUE

/obj/machinery/light/roguestreet/proc/lights_out()
on = FALSE
set_light(0)
update_icon()
addtimer(CALLBACK(src, PROC_REF(lights_on)), 5 MINUTES)

/obj/machinery/light/roguestreet/proc/lights_on()
on = TRUE
update()
update_icon()

/obj/machinery/light/roguestreet/update_icon()
if(on)
icon_state = "[base_state]1"
else
icon_state = "[base_state]0"

/obj/machinery/light/roguestreet/update()
. = ..()
if(on)
GLOB.fires_list |= src
else
GLOB.fires_list -= src

/obj/machinery/light/roguestreet/Initialize()
lights_on()
GLOB.streetlamp_list += src
update_icon()
. = ..()

/obj/machinery/light/roguestreet/update_icon()
if(on)
icon_state = "[base_state]1"
else
icon_state = "[base_state]0"
Loading

0 comments on commit 6ead225

Please sign in to comment.