Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenith00000 committed May 23, 2024
1 parent a8d733b commit 85ec902
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions code/game/machinery/hybrisa_lights.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var/power_gen_percent = 0 //100,000W at full capacity
var/power_generation_max = 100000 //Full capacity
var/powernet_connection_failed = 0 //Logic checking for powernets
var/buildstate = 1 //What state of building it are we on, 0-3, 1 is "broken", the default
var/buildstate = SENSORTOWER_BUILDSTATE_BLOWTORCH //What state of building it are we on, 0-3, 1 is "broken", the default

Check failure on line 14 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

unknown variable: SENSORTOWER_BUILDSTATE_BLOWTORCH
var/is_on = FALSE //Is this damn thing on or what?
var/fail_rate = 10 //% chance of failure each fail_tick check
var/fail_check_ticks = 100 //Check for failure every this many ticks
Expand All @@ -38,10 +38,10 @@
icon_state = "off"
desc = "A thermoelectric generator sitting atop a borehole dug deep in the planet's surface. It generates energy by boiling the plasma steam that rises from the well.\nIt is old technology and has a large failure rate, and must be repaired frequently.\nIt is currently turned off and silent."
else
if(buildstate == 1)
if(buildstate == SENSORTOWER_BUILDSTATE_BLOWTORCH)

Check failure on line 41 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_BLOWTORCH"
icon_state = "weld"
desc = "A thermoelectric generator sitting atop a plasma-filled borehole. This one is heavily damaged. Use a blowtorch, wirecutters, then wrench to repair it."
else if(buildstate == 2)
else if(buildstate == SENSORTOWER_BUILDSTATE_WIRECUTTERS)

Check failure on line 44 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_WIRECUTTERS"
icon_state = "wire"
desc = "A thermoelectric generator sitting atop a plasma-filled borehole. This one is damaged. Use a wirecutters, then wrench to repair it."
else
Expand Down Expand Up @@ -89,11 +89,11 @@
if(rand(1,100) < fail_rate) //Oh snap, we failed! Shut it down!
if(rand(0,3) == 0)
visible_message("[icon2html(src, viewers(src))] [SPAN_NOTICE("<b>[src]</b> beeps wildly and a fuse blows! Use wirecutters, then a wrench to repair it.")]")
buildstate = 2
buildstate = SENSORTOWER_BUILDSTATE_WIRECUTTERS

Check failure on line 92 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_WIRECUTTERS"
icon_state = "wire"
else
visible_message("[icon2html(src, viewers(src))] [SPAN_NOTICE("<b>[src]</b> beeps wildly and sprays random pieces everywhere! Use a wrench to repair it.")]")
buildstate = 3
buildstate = SENSORTOWER_BUILDSTATE_WRENCH

Check failure on line 96 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_WRENCH"
icon_state = "wrench"
is_on = FALSE
power_gen_percent = 0
Expand All @@ -118,13 +118,13 @@
to_chat(user, SPAN_WARNING("You have no clue how this thing works..."))
return FALSE

if(buildstate == 1)
if(buildstate == SENSORTOWER_BUILDSTATE_BLOWTORCH)

Check failure on line 121 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_BLOWTORCH"
to_chat(usr, SPAN_INFO("Use a blowtorch, then wirecutters, then wrench to repair it."))
return FALSE
else if (buildstate == 2)
else if (buildstate == SENSORTOWER_BUILDSTATE_WIRECUTTERS)

Check failure on line 124 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_WIRECUTTERS"
to_chat(usr, SPAN_INFO("Use a wirecutters, then wrench to repair it."))
return FALSE
else if (buildstate == 3)
else if (buildstate == SENSORTOWER_BUILDSTATE_WRENCH)

Check failure on line 127 in code/game/machinery/hybrisa_lights.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "SENSORTOWER_BUILDSTATE_WRENCH"
to_chat(usr, SPAN_INFO("Use a wrench to repair it."))
return FALSE
if(is_on)
Expand All @@ -148,7 +148,7 @@
if(!HAS_TRAIT(O, TRAIT_TOOL_BLOWTORCH))
to_chat(user, SPAN_WARNING("You need a stronger blowtorch!"))
return
if(buildstate == 1 && !is_on)
if(buildstate == SENSORTOWER_BUILDSTATE_BLOWTORCH && !is_on)
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_ENGI))
to_chat(user, SPAN_WARNING("You have no clue how to repair this thing."))
return FALSE
Expand All @@ -159,10 +159,10 @@
user.visible_message(SPAN_NOTICE("[user] starts welding [src]'s internal damage."),
SPAN_NOTICE("You start welding [src]'s internal damage."))
if(do_after(user, 200 * user.get_skill_duration_multiplier(SKILL_ENGINEER), INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
if(buildstate != 1 || is_on || !welder.isOn())
if(buildstate != SENSORTOWER_BUILDSTATE_BLOWTORCH || is_on || !welder.isOn())
return FALSE
playsound(loc, 'sound/items/Welder2.ogg', 25, 1)
buildstate = 2
buildstate = SENSORTOWER_BUILDSTATE_WIRECUTTERS
user.visible_message(SPAN_NOTICE("[user] welds [src]'s internal damage."),
SPAN_NOTICE("You weld [src]'s internal damage."))
update_icon()
Expand All @@ -171,35 +171,35 @@
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return
else if(HAS_TRAIT(O, TRAIT_TOOL_WIRECUTTERS))
if(buildstate == 2 && !is_on)
if(buildstate == SENSORTOWER_BUILDSTATE_WIRECUTTERS && !is_on)
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_ENGI))
to_chat(user, SPAN_WARNING("You have no clue how to repair this thing."))
return FALSE
playsound(loc, 'sound/items/Wirecutter.ogg', 25, 1)
user.visible_message(SPAN_NOTICE("[user] starts securing [src]'s wiring."),
SPAN_NOTICE("You start securing [src]'s wiring."))
if(do_after(user, 120 * user.get_skill_duration_multiplier(SKILL_ENGINEER), INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, numticks = 12))
if(buildstate != 2 || is_on)
if(buildstate != SENSORTOWER_BUILDSTATE_WIRECUTTERS || is_on)
return FALSE
playsound(loc, 'sound/items/Wirecutter.ogg', 25, 1)
buildstate = 3
buildstate = SENSORTOWER_BUILDSTATE_WRENCH
user.visible_message(SPAN_NOTICE("[user] secures [src]'s wiring."),
SPAN_NOTICE("You secure [src]'s wiring."))
update_icon()
return TRUE
else if(HAS_TRAIT(O, TRAIT_TOOL_WRENCH))
if(buildstate == 3 && !is_on)
if(buildstate == SENSORTOWER_BUILDSTATE_WRENCH && !is_on)
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_ENGI))
to_chat(user, SPAN_WARNING("You have no clue how to repair this thing."))
return FALSE
playsound(loc, 'sound/items/Ratchet.ogg', 25, 1)
user.visible_message(SPAN_NOTICE("[user] starts repairing [src]'s tubing and plating."),
SPAN_NOTICE("You start repairing [src]'s tubing and plating."))
if(do_after(user, 150 * user.get_skill_duration_multiplier(SKILL_ENGINEER), INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
if(buildstate != 3 || is_on)
if(buildstate != SENSORTOWER_BUILDSTATE_WRENCH || is_on)
return FALSE
playsound(loc, 'sound/items/Ratchet.ogg', 25, 1)
buildstate = 0
buildstate = SENSORTOWER_BUILDSTATE_WORKING
user.count_niche_stat(STATISTICS_NICHE_REPAIR_GENERATOR)
user.visible_message(SPAN_NOTICE("[user] repairs [src]'s tubing and plating."),
SPAN_NOTICE("You repair [src]'s tubing and plating."))
Expand Down Expand Up @@ -382,10 +382,10 @@

/obj/structure/machinery/engineerconsole_switch/process()
var/lightpower = 0
for(var/obj/structure/machinery/colony_floodlight/engineer_circular/C in floodlist)
if(!C.is_lit)
for(var/obj/structure/machinery/colony_floodlight/engineer_circular/colony_floodlight in floodlist)
if(!colony_floodlight.is_lit)
continue
lightpower += C.power_tick
lightpower += colony_floodlight.power_tick
use_power(lightpower)

/obj/structure/machinery/engineerconsole_switch/power_change()
Expand Down

0 comments on commit 85ec902

Please sign in to comment.