mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] usr to user up to player effects (#9552)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a7e4ef7dad
commit
0180cc74c5
@@ -114,14 +114,14 @@
|
||||
time_since_fail = 0 //losing charge faster than we can draw from PN
|
||||
last_stored_charge = stored_charge
|
||||
|
||||
/obj/machinery/shield_capacitor/tgui_act(action, params)
|
||||
/obj/machinery/shield_capacitor/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("toggle")
|
||||
if(!active && !anchored)
|
||||
to_chat(usr, span_red("The [src] needs to be firmly secured to the floor first."))
|
||||
to_chat(ui.user, span_red("The [src] needs to be firmly secured to the floor first."))
|
||||
return
|
||||
active = !active
|
||||
. = TRUE
|
||||
|
||||
@@ -200,14 +200,14 @@
|
||||
else
|
||||
average_field_strength = 0
|
||||
|
||||
/obj/machinery/shield_gen/tgui_act(action, params)
|
||||
/obj/machinery/shield_gen/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("toggle")
|
||||
if (!active && !anchored)
|
||||
to_chat(usr, span_red("The [src] needs to be firmly secured to the floor first."))
|
||||
to_chat(ui.user, span_red("The [src] needs to be firmly secured to the floor first."))
|
||||
return
|
||||
toggle()
|
||||
. = TRUE
|
||||
|
||||
@@ -458,8 +458,8 @@
|
||||
if("begin_shutdown")
|
||||
if(running < SHIELD_RUNNING) // Discharging or off
|
||||
return
|
||||
var/alert = tgui_alert(usr, "Are you sure you wish to do this? It will drain the power inside the internal storage rapidly.", "Are you sure?", list("Yes", "No"))
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
var/alert = tgui_alert(ui.user, "Are you sure you wish to do this? It will drain the power inside the internal storage rapidly.", "Are you sure?", list("Yes", "No"))
|
||||
if(tgui_status(ui.user, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(running < SHIELD_RUNNING)
|
||||
return
|
||||
@@ -485,7 +485,7 @@
|
||||
if(!running)
|
||||
return TRUE
|
||||
|
||||
var/choice = tgui_alert(usr, "Are you sure that you want to initiate an emergency shield shutdown? This will instantly drop the shield, and may result in unstable release of stored electromagnetic energy. Proceed at your own risk.", "Confirmation", list("No", "Yes"))
|
||||
var/choice = tgui_alert(ui.user, "Are you sure that you want to initiate an emergency shield shutdown? This will instantly drop the shield, and may result in unstable release of stored electromagnetic energy. Proceed at your own risk.", "Confirmation", list("No", "Yes"))
|
||||
if((choice != "Yes") || !running)
|
||||
return TRUE
|
||||
|
||||
@@ -493,7 +493,7 @@
|
||||
offline_for = round(current_energy / (SHIELD_SHUTDOWN_DISPERSION_RATE / 1.5))
|
||||
var/old_energy = current_energy
|
||||
shutdown_field()
|
||||
log_and_message_admins("has triggered \the [src]'s emergency shutdown!", usr)
|
||||
log_and_message_admins("has triggered \the [src]'s emergency shutdown!", ui.user)
|
||||
spawn()
|
||||
empulse(src, old_energy / 60000000, old_energy / 32000000, 1) // If shields are charged at 450 MJ, the EMP will be 7.5, 14.0625. 90 MJ, 1.5, 2.8125
|
||||
old_energy = 0
|
||||
@@ -505,14 +505,14 @@
|
||||
|
||||
switch(action)
|
||||
if("set_range")
|
||||
var/new_range = tgui_input_number(usr, "Enter new field range (1-[world.maxx]). Leave blank to cancel.", "Field Radius Control", field_radius, world.maxx, 1)
|
||||
var/new_range = tgui_input_number(ui.user, "Enter new field range (1-[world.maxx]). Leave blank to cancel.", "Field Radius Control", field_radius, world.maxx, 1)
|
||||
if(!new_range)
|
||||
return TRUE
|
||||
target_radius = between(1, new_range, world.maxx)
|
||||
return TRUE
|
||||
|
||||
if("set_input_cap")
|
||||
var/new_cap = round(tgui_input_number(usr, "Enter new input cap (in kW). Enter 0 or nothing to disable input cap.", "Generator Power Control", round(input_cap / 1000)))
|
||||
var/new_cap = round(tgui_input_number(ui.user, "Enter new input cap (in kW). Enter 0 or nothing to disable input cap.", "Generator Power Control", round(input_cap / 1000)))
|
||||
if(!new_cap)
|
||||
input_cap = 0
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user