Merge pull request #8816 from atlantiscze/nanocrusade-two

Nano Crusade 2
This commit is contained in:
Zuhayr
2015-05-23 20:44:28 +09:30
5 changed files with 335 additions and 206 deletions
+33 -3
View File
@@ -120,10 +120,15 @@
if(lum != light_range || clr != light_color)
set_light(lum, l_color = clr)
/obj/machinery/power/supermatter/proc/announce_warning()
/obj/machinery/power/supermatter/proc/get_integrity()
var/integrity = damage / explosion_point
integrity = round(100 - integrity * 100)
integrity = integrity < 0 ? 0 : integrity
return integrity
/obj/machinery/power/supermatter/proc/announce_warning()
var/integrity = get_integrity()
var/alert_msg = " Integrity at [integrity]%"
if(damage > emergency_point)
@@ -267,11 +272,11 @@
if(Adjacent(user))
return attack_hand(user)
else
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
ui_interact(user)
return
/obj/machinery/power/supermatter/attack_ai(mob/user as mob)
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
ui_interact(user)
/obj/machinery/power/supermatter/attack_hand(mob/user as mob)
user.visible_message("<span class=\"warning\">\The [user] reaches out and touches \the [src], inducing a resonance... \his body starts to glow and bursts into flames before flashing into ash.</span>",\
@@ -280,6 +285,31 @@
Consume(user)
// This is purely informational UI that may be accessed by AIs or robots
/obj/machinery/power/supermatter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
data["integrity_percentage"] = round(get_integrity())
var/datum/gas_mixture/env = null
if(!istype(src.loc, /turf/space))
env = src.loc.return_air()
if(!env)
data["ambient_temp"] = 0
data["ambient_pressure"] = 0
else
data["ambient_temp"] = round(env.temperature)
data["ambient_pressure"] = round(env.return_pressure())
data["detonating"] = grav_pulling
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "supermatter_crystal.tmpl", "Supermatter Crystal", 500, 300)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/*
/obj/machinery/power/supermatter/proc/transfer_energy()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)