mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
moves the announcement threshold to a global var. Fixes ghost interaction.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#define MINIMUM_POWER 1 MW
|
||||
|
||||
/// How much energy do you have to sell in order to get an announcement. Increases each time we reach it.
|
||||
GLOBAL_VAR_INIT(announcement_threshold, 1 MJ)
|
||||
|
||||
/obj/machinery/power/transmission_laser
|
||||
name = "power transmission laser"
|
||||
desc = "Sends power over a giant laser beam to an NT power processing facility."
|
||||
@@ -52,8 +55,6 @@
|
||||
|
||||
/// How much energy have we sold in total (Joules)
|
||||
var/total_energy = 0
|
||||
/// How much energy do you have to sell in order to get an announcement
|
||||
var/announcement_threshold = 1 MJ
|
||||
|
||||
/// How much credits we have earned in total
|
||||
var/total_earnings = 0
|
||||
@@ -211,21 +212,21 @@
|
||||
// The message we send
|
||||
var/message
|
||||
var/flavor_text
|
||||
if(announcement_threshold == 1 MJ)
|
||||
if(GLOB.announcement_threshold == 1 MJ)
|
||||
message = "PTL account successfully made"
|
||||
flavor_text = "From now on, you will receive regular updates on the power exported via the onboard PTL. Good luck [station_name()]!"
|
||||
announcement_threshold = 100 MJ
|
||||
GLOB.announcement_threshold = 100 MJ
|
||||
|
||||
message = "New milestone reached!\n[DisplayJoules(announcement_threshold)]\n[flavor_text]"
|
||||
message = "New milestone reached!\n[DisplayJoules(GLOB.announcement_threshold)]\n[flavor_text]"
|
||||
|
||||
announcer.Announce(message)
|
||||
|
||||
announcement_threshold = min(announcement_threshold * 5, announcement_threshold + 200 GJ)
|
||||
GLOB.announcement_threshold = min(GLOB.announcement_threshold * 5, GLOB.announcement_threshold + 200 GJ)
|
||||
|
||||
/obj/machinery/power/transmission_laser/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/power/apc/attack_ghost(mob/user)
|
||||
/obj/machinery/power/transmission_laser/attack_ghost(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/power/transmission_laser/ui_interact(mob/user, datum/tgui/ui)
|
||||
@@ -305,7 +306,7 @@
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
if(total_energy >= announcement_threshold)
|
||||
if(total_energy >= GLOB.announcement_threshold)
|
||||
send_ptl_announcement()
|
||||
|
||||
var/last_disp = return_charge()
|
||||
|
||||
Reference in New Issue
Block a user