mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-19 14:51:27 +00:00
* CI change * world.dm * .dme world.dm * subsystem renaming * .dme for subsystems * ai_laws.dm * armor.dm * emote.dm * logging.dm * spell.dm * air_alarm.dm * crew.dm * decal.dm * emissive_blocker.dm * footstep.dm * spawner.dm * fire.dm * carbon.dm * living.dm * mob.dm * movement.dm * thermal_drill.dm * plasmamen.dm * lavaland.dm * chaplain.dm * lightning.dm * magnet.dm * mimic.dm * wizard.dm * morph.dm * vampire.dm * click.dm * self.dm * radiation_storm.dm * airlock.dm * autolathe.dm * mulebot.dm * nuclearbomb.dm * particle_accelerator.dm * smartfridge.dm * syndicatebomb.dm * vending.dm * wires.dm * sound.dm * mining.dm * syndicate_space_base.dm * monkey.dm * guardian.dm * bomb.dm * standard.dm * nuclear.dm * pinpointer.dm * access.dm * departments.dm * job.dm * science.dm * buttons.dm * cloning.dm * igniter.dm * wishgranter.dm * atmos_control.dm * message.dm * power_monitor.dm * mecha.dm * combat.dm * mining_tools.dm * meteors.dm * spiders.dm * contraband.dm * aliens.dm * uplinks.dm * voice.dm * intercom.dm * lights.dm * robot_items.dm * mineral.dm * dice.dm * extinguisher.dm * paint.dm * signs.dm * staff.dm * smokebomb.dm * boxes.dm * random.dm * janicart.dm * statue.dm * cargo.dm * asteroid.dm * headslug.dm * fulton.dm * atmospherics.dm * pump.dm * corpse.dm * oldstation.dm * gps.dm * preferences.dm * clothing.dm * ears.dm * glasses.dm * boxing.dm * color.dm * renames ninja gear files * recipes.dm * error_handler.dm * anomaly.dm * floorcluwne.dm * undead.dm * overmind.dm * shield.dm * bottle.dm * organ.dm * piano.dm * plasma_fist.dm * language.dm * mob_defines.dm * mob_helpers.dm * damage_procs.dm * _defines.dm * empress.dm and queen.dm * brain.dm * organ file renaming * subsystems.dm * constructs.dm * bot.dm * pet.dm * nature.dm * magic.dm * colors.dm * drugs.dm * medicine.dm * toxins.dm * shuttle.dm * surgery.dm * moves a bunch of define files * traits.dm * names.dm * other_mobs.dm * flags.dm * some final define files * well turns out contractor_pinpointer.dm was taken * I forgot to remove this file * how in the hell did this get unticked * I DID INCLUDE IT, but there was a "w" there * swaps the world definitions * camera renamed to SScamera * examine -> alien_examine
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
SUBSYSTEM_DEF(sun)
|
|
name = "Sun"
|
|
wait = 600
|
|
flags = SS_NO_TICK_CHECK
|
|
init_order = INIT_ORDER_SUN
|
|
offline_implications = "Solar panels will no longer rotate. No immediate action is needed."
|
|
cpu_display = SS_CPUDISPLAY_LOW
|
|
var/angle
|
|
var/dx
|
|
var/dy
|
|
var/rate
|
|
var/list/solars = list()
|
|
var/solar_gen_rate = 1500
|
|
|
|
/datum/controller/subsystem/sun/Initialize()
|
|
// Lets work out an angle for the "sun" to rotate around the station
|
|
angle = rand (0,360) // the station position to the sun is randomised at round start
|
|
rate = rand(50,200)/100 // 50% - 200% of standard rotation
|
|
if(prob(50)) // same chance to rotate clockwise than counter-clockwise
|
|
rate = -rate
|
|
|
|
// Solar consoles need to load after machines init, so this handles that
|
|
for(var/obj/machinery/power/solar_control/SC in solars)
|
|
SC.setup()
|
|
|
|
|
|
/datum/controller/subsystem/sun/get_stat_details()
|
|
return "P:[length(solars)]"
|
|
|
|
/datum/controller/subsystem/sun/fire()
|
|
angle = (360 + angle + rate * 6) % 360 // increase/decrease the angle to the sun, adjusted by the rate
|
|
|
|
// now calculate and cache the (dx,dy) increments for line drawing
|
|
var/s = sin(angle)
|
|
var/c = cos(angle)
|
|
|
|
// Either "abs(s) < abs(c)" or "abs(s) >= abs(c)"
|
|
// In both cases, the greater is greater than 0, so, no "if 0" check is needed for the divisions
|
|
|
|
if(abs(s) < abs(c))
|
|
dx = s / abs(c)
|
|
dy = c / abs(c)
|
|
else
|
|
dx = s / abs(s)
|
|
dy = c / abs(s)
|
|
|
|
//now tell the solar control computers to update their status and linked devices
|
|
for(var/obj/machinery/power/solar_control/SC in solars)
|
|
if(!SC.powernet)
|
|
solars.Remove(SC)
|
|
continue
|
|
SC.update()
|