Files
GS13NG/code/modules/power/tracker.dm
Poojawa a24788842b dogborg tweaks, so fuggin DUMB (#5202)
* apparantly you need shuttles, who knew

* some tweaks

Sprites need adjustments
Janidogs need adjustments in UI

* Hm, maybe a fix. Revert attempt to rename sprites

* [MIRROR] Better Chat Squashing (#5193)

* Merge pull request #35058 from uraniummeltdown/chatsquash

Better Chat Squashing

* Better Chat Squashing

* [MIRROR] Sexy Solar Sprites (#5191)

* replaced solar panel sprites with better ones

* Sexy Solar Sprites

* Automatic changelog generation for PR #5191 [ci skip]

* [MIRROR] New Coffin Sprite (#5190)

* coffins have a new sprite (#34995)

* New Coffin Sprite

* Automatic changelog generation for PR #5190 [ci skip]

* [MIRROR] Makes fire colorful and anime (#5187)

* Makes fire colorful and anime (#34977)

* - Makes fire colorful and anime

* - Updates light color on fires
- Makes fire update color less often (1/7th as often)

* - Changes the transition from blue to purple to be much more gradual, it starts at 40000 and peaks at 120000 Kelvin now
- Changes fusion fire (>4 million Kelvin) to have a slight colorshift to it (It's just the druggy overlay).

* - Moves fire above gas (and everything else)
- Changes fire alpha for low temperature fires to compensate for items no longer rendering on top of fire

* - Makes the new fire layer a define and makes sure it isn't above "Hyperspace Ripples" whatever that is

* - Removes comment

* - FIRE_LAYER is already defined for burning humans.

* Makes fire colorful and anime

* Automatic changelog generation for PR #5187 [ci skip]

* [MIRROR] Expand Cyborg (#5183)

* Expand Cyborg (#34958)

* Expand Cyborg

* i ded pls nerf

* Oh sheet

* Expand Cyborg

* Automatic changelog generation for PR #5183 [ci skip]

* [MIRROR] Cosmic Bedsheet (#5170)

* adds cosmic space bedsheet

* Cosmic Bedsheet

* [MIRROR] The punisher no longer punishes ticker subsystems with delayed fires (#5174)

* Merge pull request #34964 from MrStonedOne/patch-463

The punisher no longer punishes ticker subsystems with delayed fires

* The punisher no longer punishes ticker subsystems with delayed fires

* Fuck this I'm done with it
2018-01-30 15:17:46 -06:00

98 lines
3.2 KiB
Plaintext

//Solar tracker
//Machine that tracks the sun and reports it's direction to the solar controllers
//As long as this is working, solar panels on same powernet will track automatically
/obj/machinery/power/tracker
name = "solar tracker"
desc = "A solar directional tracker."
icon = 'goon/icons/obj/power.dmi'
icon_state = "tracker"
anchored = TRUE
density = TRUE
use_power = NO_POWER_USE
max_integrity = 250
integrity_failure = 50
var/id = 0
var/sun_angle = 0 // sun angle as set by sun datum
var/obj/machinery/power/solar_control/control = null
/obj/machinery/power/tracker/Initialize(mapload, obj/item/solar_assembly/S)
. = ..()
Make(S)
connect_to_network()
/obj/machinery/power/tracker/Destroy()
unset_control() //remove from control computer
return ..()
//set the control of the tracker to a given computer if closer than SOLAR_MAX_DIST
/obj/machinery/power/tracker/proc/set_control(obj/machinery/power/solar_control/SC)
if(!SC || (get_dist(src, SC) > SOLAR_MAX_DIST))
return 0
control = SC
SC.connected_tracker = src
return 1
//set the control of the tracker to null and removes it from the previous control computer if needed
/obj/machinery/power/tracker/proc/unset_control()
if(control)
control.connected_tracker = null
control = null
/obj/machinery/power/tracker/proc/Make(obj/item/solar_assembly/S)
if(!S)
S = new /obj/item/solar_assembly(src)
S.glass_type = /obj/item/stack/sheet/glass
S.tracker = 1
S.anchored = TRUE
S.forceMove(src)
update_icon()
//updates the tracker icon and the facing angle for the control computer
/obj/machinery/power/tracker/proc/set_angle(angle)
sun_angle = angle
//set icon dir to show sun illumination
setDir(turn(NORTH, -angle - 22.5) )// 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST
if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet
control.currentdir = angle
/obj/machinery/power/tracker/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/crowbar))
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar tracker.", "<span class='notice'>You begin to take the glass off the solar tracker...</span>")
if(do_after(user, 50*W.toolspeed, target = src))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off the tracker.", "<span class='notice'>You take the glass off the tracker.</span>")
deconstruct(TRUE)
else
return ..()
/obj/machinery/power/tracker/obj_break(damage_flag)
if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
playsound(loc, 'sound/effects/glassbr3.ogg', 100, 1)
stat |= BROKEN
unset_control()
/obj/machinery/power/solar/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(stat & BROKEN)
else
playsound(src, "shatter", 70, 1)
new /obj/item/shard(src.loc)
new /obj/item/shard(src.loc)
qdel(src)
// Tracker Electronic
/obj/item/electronics/tracker
name = "tracker electronics"