diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm index 86c43d15907..90724a2f984 100644 --- a/code/__DEFINES/MC.dm +++ b/code/__DEFINES/MC.dm @@ -51,19 +51,3 @@ #define SS_PAUSED 3 //paused by mc_tick_check #define SS_SLEEPING 4 //fire() slept. #define SS_PAUSING 5 //in the middle of pausing - - -//Timing subsystem -//Don't run if there is an identical unique timer active -#define TIMER_UNIQUE 0x1 -//For unique timers: Replace the old timer rather then not start this one -#define TIMER_OVERRIDE 0x2 -//Timing should be based on how timing progresses on clients, not the sever. -// tracking this is more expensive, -// should only be used in conjuction with things that have to progress client side, such as animate() or sound() -#define TIMER_CLIENT_TIME 0x4 -//Timer can be stopped using deltimer() -#define TIMER_STOPPABLE 0x8 -//To be used with TIMER_UNIQUE -//prevents distinguishing identical timers with the wait variable -#define TIMER_NO_HASH_WAIT 0x10 \ No newline at end of file diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm new file mode 100644 index 00000000000..ed5259fb291 --- /dev/null +++ b/code/__DEFINES/subsystems.dm @@ -0,0 +1,19 @@ + +//Timing subsystem +//Don't run if there is an identical unique timer active +#define TIMER_UNIQUE 0x1 +//For unique timers: Replace the old timer rather then not start this one +#define TIMER_OVERRIDE 0x2 +//Timing should be based on how timing progresses on clients, not the sever. +// tracking this is more expensive, +// should only be used in conjuction with things that have to progress client side, such as animate() or sound() +#define TIMER_CLIENT_TIME 0x4 +//Timer can be stopped using deltimer() +#define TIMER_STOPPABLE 0x8 +//To be used with TIMER_UNIQUE +//prevents distinguishing identical timers with the wait variable +#define TIMER_NO_HASH_WAIT 0x10 + +//For servers that can't do with any additional lag, set this to none in flightpacks.dm in subsystem/processing. +#define FLIGHTSUIT_PROCESSING_NONE 0 +#define FLIGHTSUIT_PROCESSING_FULL 1 diff --git a/code/controllers/subsystem/processing/flightpacks.dm b/code/controllers/subsystem/processing/flightpacks.dm index fee475d7305..18a3cd5e811 100644 --- a/code/controllers/subsystem/processing/flightpacks.dm +++ b/code/controllers/subsystem/processing/flightpacks.dm @@ -6,6 +6,24 @@ var/datum/controller/subsystem/processing/flightpacks/SSflightpacks wait = 2 stat_tag = "FM" flags = SS_NO_INIT|SS_TICKER|SS_KEEP_TIMING + var/flightsuit_processing = FLIGHTSUIT_PROCESSING_FULL /datum/controller/subsystem/processing/flightpacks/New() NEW_SS_GLOBAL(SSflightpacks) + +/datum/controller/subsystem/processing/flightpacks/Initialize() + sync_flightsuit_processing() + +/datum/controller/subsystem/processing/flightpacks/vv_edit_var(var_name, var_value) + ..() + switch(var_name) + if("flightsuit_processing") + sync_flightsuit_processing() + +/datum/controller/subsystem/processing/flightpacks/proc/sync_flightsuit_processing() + for(var/obj/item/device/flightpack/FP in processing) + FP.sync_processing(src) + if(flightsuit_processing == FLIGHTSUIT_PROCESSING_NONE) //Don't even bother firing. + can_fire = FALSE + else + can_fire = TRUE diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm index 5c15d28cc5f..f557c35d584 100644 --- a/code/modules/clothing/spacesuits/flightsuit.dm +++ b/code/modules/clothing/spacesuits/flightsuit.dm @@ -24,6 +24,8 @@ slot_flags = SLOT_BACK resistance_flags = FIRE_PROOF + var/processing_mode = FLIGHTSUIT_PROCESSING_FULL + var/obj/item/clothing/suit/space/hardsuit/flightsuit/suit = null var/mob/living/carbon/human/wearer = null var/slowdown_ground = 1 @@ -104,14 +106,15 @@ //Start/Stop processing the item to use momentum and flight mechanics. -/obj/item/device/flightpack/New() +/obj/item/device/flightpack/Initialize() ion_trail = new ion_trail.set_up(src) START_PROCESSING(SSflightpacks, src) - ..() update_parts() + sync_processing(SSflightpacks) + ..() -/obj/item/device/flightpack/full/New() +/obj/item/device/flightpack/full/Initialize() part_manip = new /obj/item/weapon/stock_parts/manipulator/pico(src) part_scan = new /obj/item/weapon/stock_parts/scanning_module/phasic(src) part_cap = new /obj/item/weapon/stock_parts/capacitor/super(src) @@ -120,6 +123,18 @@ assembled = TRUE ..() +/obj/item/device/flightpack/proc/sync_processing(datum/controller/subsystem/processing/flightpacks/FPS) + processing_mode = FPS.flightsuit_processing + if(processing_mode == FLIGHTSUIT_PROCESSING_NONE) + momentum_x = 0 + momentum_y = 0 + momentum_speed_x = 0 + momentum_speed_y = 0 + momentum_speed = 0 + boost_charge = 0 + boost = FALSE + update_slowdown() + /obj/item/device/flightpack/proc/update_parts() boost_chargerate = initial(boost_chargerate) boost_drain = initial(boost_drain) @@ -339,7 +354,7 @@ suit.slowdown = slowdown_air /obj/item/device/flightpack/process() - if(!suit) + if(!suit || (processing_mode == FLIGHTSUIT_PROCESSING_NONE)) return FALSE update_slowdown() update_icon() @@ -451,7 +466,7 @@ wearer.visible_message("[wearer] is knocked flying by the impact!") /obj/item/device/flightpack/proc/flight_impact(atom/unmovablevictim, crashdir) //Yes, victim. - if((unmovablevictim == wearer) || crashing) + if((unmovablevictim == wearer) || crashing || (processing_mode == FLIGHTSUIT_PROCESSING_NONE)) return FALSE crashing = TRUE var/crashpower = 0 diff --git a/tgstation.dme b/tgstation.dme index 1b5046b4bb7..467dad6c325 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -56,6 +56,7 @@ #include "code\__DEFINES\shuttles.dm" #include "code\__DEFINES\sight.dm" #include "code\__DEFINES\sound.dm" +#include "code\__DEFINES\subsystems.dm" #include "code\__DEFINES\stat.dm" #include "code\__DEFINES\status_effects.dm" #include "code\__DEFINES\tgui.dm"