Implemented SI prefixes (KILO, MEGA, GIGA, TERA etc.) (#18874)

Implemented SI prefixes (KILO, MEGA, GIGA, TERA etc.)
This commit is contained in:
Fluffy
2024-04-12 22:22:14 +00:00
committed by GitHub
parent 610d3daa44
commit 5888de6ea0
26 changed files with 102 additions and 40 deletions
+1
View File
@@ -111,6 +111,7 @@
#include "code\__DEFINES\rust_g_overrides.dm"
#include "code\__DEFINES\ship_weapons.dm"
#include "code\__DEFINES\shuttle.dm"
#include "code\__DEFINES\si.dm"
#include "code\__DEFINES\singletons.dm"
#include "code\__DEFINES\smart_token_bucket.dm"
#include "code\__DEFINES\solar.dm"
+2 -3
View File
@@ -1,6 +1,5 @@
#define KILOWATTS *1000
#define MEGAWATTS *1000000
#define GIGAWATTS *1000000000
//Watts, yes this is stupid but it's just for visual reference to the code reader, so deal with it
#define WATTS *1
/**
* Multiplier for watts per tick <> cell storage (e.g., 0.02 means if there is a load of 1000 watts, 20 units will be taken from a cell per second)
+21
View File
@@ -0,0 +1,21 @@
// Prefix values.
#define QUECTO * 1e-30
#define RONTO * 1e-27
#define YOCTO * 1e-24
#define ZEPTO * 1e-21
#define ATTO * 1e-18
#define FEMPTO * 1e-15
#define PICO * 1e-12
#define NANO * 1e-9
#define MICRO * 1e-6
#define MILLI * 1e-3
#define KILO * 1e3
#define MEGA * 1e6
#define GIGA * 1e9
#define TERA * 1e12
#define PETA * 1e15
#define EXA * 1e18
#define ZETTA * 1e21
#define YOTTA * 1e24
#define RONNA * 1e27
#define QUETTA * 1e30
@@ -206,7 +206,7 @@
if(!ability_pay(user,price))
return
M.use_power_oneoff(250 KILOWATTS)
M.use_power_oneoff(250 KILO WATTS)
// Trigger a powernet alarm. Careful engineers will probably notice something is going on.
var/area/temp_area = get_area(M)
+1 -1
View File
@@ -221,7 +221,7 @@
if(stat & NOPOWER)
return FALSE
src.use_power_oneoff(2 KILOWATTS)
src.use_power_oneoff(2 KILO WATTS)
//Set it to unwillful sleep
occupant_resolved.Sleeping(3.5*seconds_per_tick)
+1 -1
View File
@@ -6,7 +6,7 @@
icon_state = "ccharger"
anchored = TRUE
idle_power_usage = 5
active_power_usage = 90 KILOWATTS
active_power_usage = 90 KILO WATTS
power_channel = EQUIP
update_icon_on_init = TRUE
+3 -3
View File
@@ -402,7 +402,7 @@
QDEL_NULL(pb3)
/obj/machinery/crusher_piston/proc/extend_0_1()
use_power_oneoff(5 KILOWATTS)
use_power_oneoff(5 KILO WATTS)
var/turf/T = get_turf(src)
if(!can_extend_into(T))
return 0
@@ -414,7 +414,7 @@
return 1
/obj/machinery/crusher_piston/proc/extend_1_2()
use_power_oneoff(5 KILOWATTS)
use_power_oneoff(5 KILO WATTS)
var/turf/T = get_turf(pb1)
var/turf/extension_turf = get_step(T,SOUTH)
if(!can_extend_into(extension_turf))
@@ -427,7 +427,7 @@
return 1
/obj/machinery/crusher_piston/proc/extend_2_3()
use_power_oneoff(5 KILOWATTS)
use_power_oneoff(5 KILO WATTS)
var/turf/T = get_turf(pb2)
var/turf/extension_turf = get_step(T,SOUTH)
if(!can_extend_into(extension_turf))
+2 -2
View File
@@ -7,8 +7,8 @@
anchored = 0
density = 1
idle_power_usage = 1 KILOWATTS
active_power_usage = 10 KILOWATTS
idle_power_usage = 1 KILO WATTS
active_power_usage = 10 KILO WATTS
var/active = FALSE
var/static/list/whispers = list(
+5 -5
View File
@@ -7,11 +7,11 @@
layer = ABOVE_TILE_LAYER
anchored = TRUE
idle_power_usage = 300 // Some electronics, passive drain.
active_power_usage = 90 KILOWATTS // When charging
active_power_usage = 90 KILO WATTS // When charging
var/mob/living/heavy_vehicle/charging
var/base_charge_rate = 90 KILOWATTS
var/repair_power_usage = 15 KILOWATTS // Per 1 HP of health.
var/base_charge_rate = 90 KILO WATTS
var/repair_power_usage = 15 KILO WATTS // Per 1 HP of health.
var/repair = 0
var/charge
@@ -118,9 +118,9 @@
desc = "A massive vehicle dock elevated slightly above the ground, constructed for equally massive charging speeds."
icon_state = "supermechcharger"
idle_power_usage = 400
active_power_usage = 120 KILOWATTS
active_power_usage = 120 KILO WATTS
base_charge_rate = 120 KILOWATTS
base_charge_rate = 120 KILO WATTS
repair = 1
component_types = list(
+1 -1
View File
@@ -100,7 +100,7 @@
return FALSE
//Wikipedia says this is the upper limit for a medium non directional beacon, deal with it
use_power_oneoff(2 KILOWATTS)
use_power_oneoff(2 KILO WATTS)
var/datum/radio_frequency/frequency = SSradio.return_frequency(freq)
+2 -2
View File
@@ -7,7 +7,7 @@
icon_state = "recharger_off"
anchored = 1
idle_power_usage = 6
active_power_usage = 45 KILOWATTS
active_power_usage = 45 KILO WATTS
pass_flags = PASSTABLE
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
var/charging_efficiency = 1.3
@@ -176,7 +176,7 @@
desc = "A heavy duty wall recharger specialized for energy weaponry."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "wrecharger_off"
active_power_usage = 75 KILOWATTS
active_power_usage = 75 KILO WATTS
allowed_devices = list(
/obj/item/gun/energy,
/obj/item/melee/baton,
+1 -1
View File
@@ -9,7 +9,7 @@
clicksound = /singleton/sound_category/switch_sound
var/on = FALSE
var/active = 0
var/heating_power = 40 KILOWATTS
var/heating_power = 40 KILO WATTS
var/set_temperature = T0C + 20
var/obj/item/cell/apc/cell
@@ -11,7 +11,7 @@
desc = "A dish-shaped machine used to broadcast processed subspace signals."
telecomms_type = /obj/machinery/telecomms/broadcaster
idle_power_usage = 100 // WATTS
active_power_usage = 3 KILOWATTS
active_power_usage = 3 KILO WATTS
produces_heat = FALSE
delay = 7
circuitboard = "/obj/item/circuitboard/telecomms/broadcaster"
@@ -12,8 +12,8 @@
icon_state = "bus"
desc = "A mighty piece of hardware used to send massive amounts of data quickly."
telecomms_type = /obj/machinery/telecomms/bus
idle_power_usage = 1 KILOWATTS
active_power_usage = 3 KILOWATTS
idle_power_usage = 1 KILO WATTS
active_power_usage = 3 KILO WATTS
circuitboard = "/obj/item/circuitboard/telecomms/bus"
netspeed = 40
var/change_frequency = 0
@@ -15,8 +15,8 @@
telecomms_type = /obj/machinery/telecomms/hub
density = TRUE
anchored = TRUE
idle_power_usage = 1.6 KILOWATTS
active_power_usage = 5 KILOWATTS
idle_power_usage = 1.6 KILO WATTS
active_power_usage = 5 KILO WATTS
circuitboard = "/obj/item/circuitboard/telecomms/hub"
netspeed = 40
@@ -20,7 +20,7 @@
density = TRUE
anchored = TRUE
idle_power_usage = 300 // WATTS
active_power_usage = 1 KILOWATTS
active_power_usage = 1 KILO WATTS
circuitboard = "/obj/item/circuitboard/telecomms/server"
var/list/log_entries = list()
var/totaltraffic = 0 // gigabytes (if > 1024, divide by 1024 -> terrabytes)
@@ -22,7 +22,7 @@
density = TRUE
anchored = TRUE
idle_power_usage = 600 // WATTS
active_power_usage = 2 KILOWATTS
active_power_usage = 2 KILO WATTS
var/list/links = list() // list of machines this machine is linked to
/*
@@ -8,10 +8,10 @@
off_icon = "fryer_off"
food_color = "#ffad33"
appliancetype = FRYER
active_power_usage = 12 KILOWATTS
active_power_usage = 12 KILO WATTS
heating_power = 12000
optimal_power = 1.35
idle_power_usage = 3.6 KILOWATTS
idle_power_usage = 3.6 KILO WATTS
//Power used to maintain temperature once it's heated.
//Going with 25% of the active power. This is a somewhat arbitrary value
resistance = 10000 // Approx. 4 minutes.
@@ -7,11 +7,11 @@
appliancetype = OVEN
food_color = "#a34719"
can_burn_food = TRUE
active_power_usage = 6 KILOWATTS
active_power_usage = 6 KILO WATTS
heating_power = 6000
//Based on a double deck electric convection oven
resistance = 10000 // Approx. 4 minutes.
idle_power_usage = 2 KILOWATTS
idle_power_usage = 2 KILO WATTS
//uses ~30% power to stay warm
optimal_power = 1.2
light_x = 2
@@ -6,14 +6,14 @@
appliancetype = SKILLET | SAUCEPAN | POT
food_color = "#a34719"
can_burn_food = TRUE
active_power_usage = 6 KILOWATTS
active_power_usage = 6 KILO WATTS
heating_power = 6000
on_icon = "stove"
off_icon = "stove"
place_verb = "onto"
resistance = 5000 // Approx. 2 minutes.
idle_power_usage = 1 KILOWATTS
idle_power_usage = 1 KILO WATTS
//uses ~30% power to stay warm
optimal_temp = T0C + 100 // can boil water!
optimal_power = 1.2
@@ -13,7 +13,7 @@
var/mech_layer = MECH_GEAR_LAYER
var/equipment_delay = 0
var/passive_power_use = 0
var/active_power_use = 1 KILOWATTS
var/active_power_use = 1 KILO WATTS
var/require_adjacent = TRUE
var/active = FALSE //For gear that has an active state (ie, floodlights)
@@ -335,7 +335,7 @@
else
STOP_PROCESSING(SSprocessing, src)
active = aura.active
passive_power_use = active ? 1 KILOWATTS : 0
passive_power_use = active ? 1 KILO WATTS : 0
owner.update_icon()
/obj/item/mecha_equipment/shield/deactivate()
@@ -209,7 +209,7 @@
update_icon()
owner.update_icon()
active = on
passive_power_use = on ? 0.1 KILOWATTS : 0
passive_power_use = on ? 0.1 KILO WATTS : 0
/obj/item/mecha_equipment/light/deactivate()
if(on)
@@ -658,7 +658,7 @@
restricted_hardpoints = list(HARDPOINT_BACK)
w_class = ITEMSIZE_HUGE
origin_tech = list(TECH_MATERIAL = 6, TECH_ENGINEERING = 6, TECH_BLUESPACE = 6)
active_power_use = 88 KILOWATTS
active_power_use = 88 KILO WATTS
var/obj/item/anomaly_core/AC
var/image/anomaly_overlay
@@ -9,7 +9,7 @@
origin_tech = list(TECH_POWER = 2, TECH_DATA = 3)
var/obj/item/aicard/stored_card
var/power_usage_idle = 100
var/power_usage_occupied = 2 KILOWATTS
var/power_usage_occupied = 2 KILO WATTS
/obj/item/computer_hardware/ai_slot/proc/update_power_usage()
if(!stored_card?.carded_ai)
@@ -15,8 +15,8 @@
layer = ABOVE_HUMAN_LAYER
use_power = POWER_USE_OFF //Start off.
idle_power_usage = 100 KILOWATTS
active_power_usage = 20 MEGAWATTS
idle_power_usage = 100 KILO WATTS
active_power_usage = 20 MEGA WATTS
var/obj/machinery/power/smes/buildable/smes
/obj/machinery/ship_weapon/leviathan/Destroy()
@@ -0,0 +1,41 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: FluffyGhost
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- refactor: "Implemented SI prefixes (KILO, MEGA, GIGA, TERA etc.)."