diff --git a/code/__DEFINES/mecha.dm b/code/__DEFINES/mecha.dm index f5fad9cdf68..72839d293c7 100644 --- a/code/__DEFINES/mecha.dm +++ b/code/__DEFINES/mecha.dm @@ -4,13 +4,15 @@ #define MECHA_INT_TANK_BREACH (1<<3) #define MECHA_INT_CONTROL_LOST (1<<4) -#define ADDING_ACCESS_POSSIBLE (1<<0) +#define ADDING_ACCESS_POSSIBLE (1<<0) #define ADDING_MAINT_ACCESS_POSSIBLE (1<<1) -#define CANSTRAFE (1<<2) -#define LIGHTS_ON (1<<3) -#define SILICON_PILOT (1<<4) -#define IS_ENCLOSED (1<<5) -#define HAS_LIGHTS (1<<6) +#define CANSTRAFE (1<<2) +#define LIGHTS_ON (1<<3) +#define SILICON_PILOT (1<<4) +#define IS_ENCLOSED (1<<5) +#define HAS_LIGHTS (1<<6) +#define QUIET_STEPS (1<<7) +#define QUIET_TURNS (1<<8) #define MECHA_MELEE (1 << 0) #define MECHA_RANGED (1 << 1) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 87356282b27..de0a65f9b55 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -2,6 +2,9 @@ GLOBAL_VAR_INIT(admin_notice, "") // Admin notice that all clients see when join GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks. +GLOBAL_VAR_INIT(year, time2text(world.realtime,"YYYY")) +GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013??? + // For FTP requests. (i.e. downloading runtime logs.) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. GLOBAL_VAR_INIT(fileaccess_timer, 0) diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 20fdffdfa8d..dbf4a8ade64 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -101,13 +101,13 @@ ///Typepath for the wreckage it spawns when destroyed var/wreckage - var/list/equipment = new + var/list/equipment = list() ///Current active equipment var/obj/item/mecha_parts/mecha_equipment/selected ///Maximum amount of equipment we can have var/max_equip = 3 - ///Whether our steps are silent, for example in zero-G + ///Whether our steps are silent due to no gravity var/step_silent = FALSE ///Sound played when the mech moves var/stepsound = 'sound/mecha/mechstep.ogg' @@ -575,8 +575,9 @@ ///Plays the mech step sound effect. Split from movement procs so that other mechs (HONK) can override this one specific part. /obj/vehicle/sealed/mecha/proc/play_stepsound() SIGNAL_HANDLER - if(stepsound) - playsound(src,stepsound,40,1) + if(mecha_flags & QUIET_STEPS) + return + playsound(src, stepsound, 40, TRUE) /obj/vehicle/sealed/mecha/proc/disconnect_air() SIGNAL_HANDLER @@ -598,10 +599,9 @@ to_chat(occupants, "[icon2html(src, occupants)]The [src] push off [backup] to propel yourself.") return TRUE - if(movedelay <= world.time && active_thrusters && movement_dir && active_thrusters.thrust(movement_dir)) + if(active_thrusters?.thrust(movement_dir)) step_silent = TRUE return TRUE - return FALSE /obj/vehicle/sealed/mecha/vehicle_move(direction, forcerotate = FALSE) @@ -670,9 +670,9 @@ //if we're not facing the way we're going rotate us if(dir != direction && !strafe || forcerotate || keyheld) - setDir(direction) - if(turnsound && dir != direction) + if(dir != direction && !(mecha_flags & QUIET_TURNS) && !step_silent) playsound(src,turnsound,40,TRUE) + setDir(direction) return TRUE set_glide_size(DELAY_TO_GLIDE_SIZE(movedelay)) @@ -1113,13 +1113,6 @@ req_access = list() return allowed(M) -//////////////////////////////// -/////// Messages and Log /////// -//////////////////////////////// - -GLOBAL_VAR_INIT(year, time2text(world.realtime,"YYYY")) -GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013??? -//why is this in mecha /////////////////////// ///// Power stuff ///// diff --git a/code/modules/vehicles/mecha/combat/reticence.dm b/code/modules/vehicles/mecha/combat/reticence.dm index 9d2698c1a03..999a4897ce8 100644 --- a/code/modules/vehicles/mecha/combat/reticence.dm +++ b/code/modules/vehicles/mecha/combat/reticence.dm @@ -11,13 +11,11 @@ wreckage = /obj/structure/mecha_wreckage/reticence operation_req_access = list(ACCESS_THEATRE) internals_req_access = list(ACCESS_MECH_SCIENCE, ACCESS_THEATRE) - mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS + mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS | QUIET_STEPS | QUIET_TURNS internal_damage_threshold = 25 max_equip = 2 step_energy_drain = 3 color = "#87878715" - stepsound = null - turnsound = null /obj/vehicle/sealed/mecha/combat/reticence/loaded/Initialize() . = ..()