diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 121cf5a072d..756d78c1723 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -7,6 +7,11 @@ /// if it only allows one, and new instances just instead refresh the timer #define STATUS_EFFECT_REFRESH 3 +/// Use in status effect "duration" to make it last forever +#define STATUS_EFFECT_PERMANENT -1 +/// Use in status effect "tick_interval" to prevent it from calling tick() +#define STATUS_EFFECT_NO_TICK -1 + ///Processing flags - used to define the speed at which the status will work ///This is fast - 0.2s between ticks (I believe!) #define STATUS_EFFECT_FAST_PROCESS 0 diff --git a/code/__DEFINES/time.dm b/code/__DEFINES/time.dm index 51283ef98a8..5edba8746f8 100644 --- a/code/__DEFINES/time.dm +++ b/code/__DEFINES/time.dm @@ -57,8 +57,6 @@ When using time2text(), please use "DDD" to find the weekday. Refrain from using #define SATURDAY "Sat" #define SUNDAY "Sun" -#define INFINITE -1 // -1 is commonly used to indicate an infinite time duration - #define MILLISECONDS *0.01 #define DECISECONDS *1 //the base unit all of these defines are scaled by, because byond uses that as a unit of measurement for some fucking reason diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index bbc21becc0f..f19d2a99e36 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -551,10 +551,10 @@ SUBSYSTEM_DEF(air) // Taking advantage of current cycle being set to negative before this run to do A->B B->A prevention for(var/turf/open/potential_diff as anything in difference_check) // I can't use 0 here, so we're gonna do this instead. If it ever breaks I'll eat my shoe - potential_diff.current_cycle = -INFINITE + potential_diff.current_cycle = -INFINITY for(var/turf/open/enemy_tile as anything in potential_diff.atmos_adjacent_turfs) // If it's already been processed, then it's already talked to us - if(enemy_tile.current_cycle == -INFINITE) + if(enemy_tile.current_cycle == -INFINITY) continue // .air instead of .return_air() because we can guarantee that the proc won't do anything if(potential_diff.air.compare(enemy_tile.air, MOLES)) diff --git a/code/datums/ai/movement/ai_movement_complete_stop.dm b/code/datums/ai/movement/ai_movement_complete_stop.dm index 2b39e162719..e9609a30dda 100644 --- a/code/datums/ai/movement/ai_movement_complete_stop.dm +++ b/code/datums/ai/movement/ai_movement_complete_stop.dm @@ -1,6 +1,6 @@ /// Come to a complete stop for a set amount of time. /datum/ai_movement/complete_stop - max_pathing_attempts = INFINITE // path all you want, you can not escape your fate + max_pathing_attempts = INFINITY // path all you want, you can not escape your fate /datum/ai_movement/complete_stop/start_moving_towards(datum/ai_controller/controller, atom/current_movement_target, min_distance) . = ..() diff --git a/code/datums/elements/organ_set_bonus.dm b/code/datums/elements/organ_set_bonus.dm index 082933e409e..118c64fbeaf 100644 --- a/code/datums/elements/organ_set_bonus.dm +++ b/code/datums/elements/organ_set_bonus.dm @@ -42,8 +42,8 @@ /datum/status_effect/organ_set_bonus id = "organ_set_bonus" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK alert_type = null ///how many organs the carbon with this has in the set var/organs = 0 diff --git a/code/datums/elements/watery_tile.dm b/code/datums/elements/watery_tile.dm index 6e32c7bb155..36e893fe0fc 100644 --- a/code/datums/elements/watery_tile.dm +++ b/code/datums/elements/watery_tile.dm @@ -51,7 +51,7 @@ /datum/status_effect/watery_tile_wetness id = "watery_tile_wetness" alert_type = null - duration = -1 + duration = STATUS_EFFECT_PERMANENT status_type = STATUS_EFFECT_UNIQUE /datum/status_effect/washing_regen/tick(seconds_between_ticks) diff --git a/code/datums/station_traits/negative_traits.dm b/code/datums/station_traits/negative_traits.dm index b113589b702..17175561d20 100644 --- a/code/datums/station_traits/negative_traits.dm +++ b/code/datums/station_traits/negative_traits.dm @@ -502,7 +502,7 @@ ///The max intensity of a nebula VAR_PROTECTED/maximum_nebula_intensity = 2 HOURS ///How long it takes to go to the next nebula level/intensity - VAR_PROTECTED/intensity_increment_time = INFINITE + VAR_PROTECTED/intensity_increment_time = 30 MINUTES ///Objects that we use to calculate the current shielding level var/list/shielding = list() diff --git a/code/datums/status_effects/_status_effect.dm b/code/datums/status_effects/_status_effect.dm index 637f2c3a076..df525fa8c81 100644 --- a/code/datums/status_effects/_status_effect.dm +++ b/code/datums/status_effects/_status_effect.dm @@ -6,7 +6,7 @@ /// When set initially / in on_creation, this is how long the status effect lasts in deciseconds. /// While processing, this becomes the world.time when the status effect will expire. /// -1 = infinite duration. - var/duration = -1 + var/duration = STATUS_EFFECT_PERMANENT /// When set initially / in on_creation, this is how long between [proc/tick] calls in deciseconds. /// Note that this cannot be faster than the processing subsystem you choose to fire the effect on. (See: [var/processing_speed]) /// While processing, this becomes the world.time when the next tick will occur. @@ -50,9 +50,13 @@ LAZYADD(owner.status_effects, src) RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, PROC_REF(remove_effect_on_heal)) - if(duration != -1) + if(duration == INFINITY) + // we will optionally allow INFINITY, because i imagine it'll be convenient in some places, + // but we'll still set it to -1 / STATUS_EFFECT_PERMANENT for proper unified handling + duration = STATUS_EFFECT_PERMANENT + if(duration != STATUS_EFFECT_PERMANENT) duration = world.time + duration - if(tick_interval != -1) + if(tick_interval != STATUS_EFFECT_NO_TICK) tick_interval = world.time + tick_interval if(alert_type) @@ -107,7 +111,7 @@ qdel(src) return - if(tick_interval != -1 && tick_interval < world.time) + if(tick_interval != STATUS_EFFECT_NO_TICK && tick_interval < world.time) var/tick_length = initial(tick_interval) tick(tick_length / (1 SECONDS)) tick_interval = world.time + tick_length @@ -115,7 +119,7 @@ // tick deleted us, no need to continue return - if(duration != -1) + if(duration != STATUS_EFFECT_PERMANENT) if(duration < world.time) qdel(src) return @@ -170,7 +174,7 @@ /// has its duration refreshed in apply_status_effect - is passed New() args /datum/status_effect/proc/refresh(effect, ...) var/original_duration = initial(duration) - if(original_duration == -1) + if(original_duration == STATUS_EFFECT_PERMANENT) return duration = world.time + original_duration @@ -194,7 +198,7 @@ /// Remove [seconds] of duration from the status effect, qdeling / ending if we eclipse the current world time. /datum/status_effect/proc/remove_duration(seconds) - if(duration == -1) // Infinite duration + if(duration == STATUS_EFFECT_PERMANENT) // Infinite duration return FALSE duration -= seconds @@ -213,6 +217,18 @@ SHOULD_CALL_PARENT(FALSE) return +/datum/status_effect/vv_edit_var(var_name, var_value) + . = ..() + if(!.) + return + if(var_name == NAMEOF(src, duration)) + if(var_value == INFINITY) + duration = STATUS_EFFECT_PERMANENT + update_shown_duration() + + if(var_name == NAMEOF(src, show_duration)) + update_shown_duration() + /// Alert base type for status effect alerts /atom/movable/screen/alert/status_effect name = "Curse of Mundanity" diff --git a/code/datums/status_effects/agent_pinpointer.dm b/code/datums/status_effects/agent_pinpointer.dm index c22242be400..68b01a3eb1f 100644 --- a/code/datums/status_effects/agent_pinpointer.dm +++ b/code/datums/status_effects/agent_pinpointer.dm @@ -10,7 +10,7 @@ /datum/status_effect/agent_pinpointer id = "agent_pinpointer" - duration = -1 + duration = STATUS_EFFECT_PERMANENT tick_interval = PINPOINTER_PING_TIME alert_type = /atom/movable/screen/alert/status_effect/agent_pinpointer ///The minimum range to start pointing towards your target. diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 3b197ec7f97..2b6f948b659 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -2,7 +2,7 @@ /datum/status_effect/his_grace id = "his_grace" - duration = -1 + duration = STATUS_EFFECT_PERMANENT tick_interval = 0.4 SECONDS alert_type = /atom/movable/screen/alert/status_effect/his_grace var/bloodlust = 0 @@ -75,7 +75,7 @@ /datum/status_effect/blooddrunk id = "blooddrunk" duration = 10 - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK alert_type = /atom/movable/screen/alert/status_effect/blooddrunk /atom/movable/screen/alert/status_effect/blooddrunk @@ -250,7 +250,7 @@ /datum/status_effect/hippocratic_oath id = "Hippocratic Oath" status_type = STATUS_EFFECT_UNIQUE - duration = -1 + duration = STATUS_EFFECT_PERMANENT tick_interval = 2.5 SECONDS alert_type = null @@ -502,7 +502,7 @@ /datum/status_effect/nest_sustenance id = "nest_sustenance" - duration = -1 + duration = STATUS_EFFECT_PERMANENT tick_interval = 0.4 SECONDS alert_type = /atom/movable/screen/alert/status_effect/nest_sustenance @@ -534,8 +534,8 @@ */ /datum/status_effect/blessing_of_insanity id = "blessing_of_insanity" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK alert_type = /atom/movable/screen/alert/status_effect/blessing_of_insanity /atom/movable/screen/alert/status_effect/blessing_of_insanity diff --git a/code/datums/status_effects/buffs/bioware/_bioware.dm b/code/datums/status_effects/buffs/bioware/_bioware.dm index c2f7259f270..24443f4f1ee 100644 --- a/code/datums/status_effects/buffs/bioware/_bioware.dm +++ b/code/datums/status_effects/buffs/bioware/_bioware.dm @@ -6,8 +6,8 @@ /datum/status_effect/bioware id = "bioware" alert_type = null - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK /datum/status_effect/bioware/on_apply() if(!ishuman(owner)) diff --git a/code/datums/status_effects/buffs/stun_absorption.dm b/code/datums/status_effects/buffs/stun_absorption.dm index 9532d79c4f5..393a6031e83 100644 --- a/code/datums/status_effects/buffs/stun_absorption.dm +++ b/code/datums/status_effects/buffs/stun_absorption.dm @@ -9,7 +9,7 @@ */ /datum/status_effect/stun_absorption id = "absorb_stun" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK alert_type = null status_type = STATUS_EFFECT_MULTIPLE diff --git a/code/datums/status_effects/debuffs/blindness.dm b/code/datums/status_effects/debuffs/blindness.dm index fb87d2fde85..06a5a46b942 100644 --- a/code/datums/status_effects/debuffs/blindness.dm +++ b/code/datums/status_effects/debuffs/blindness.dm @@ -5,7 +5,7 @@ /// Nearsighted /datum/status_effect/grouped/nearsighted id = "nearsighted" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK alert_type = null // This is not "remove on fullheal" as in practice, // fullheal should instead remove all the sources and in turn cure this @@ -59,7 +59,7 @@ /// Blindness /datum/status_effect/grouped/blindness id = "blindness" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK alert_type = /atom/movable/screen/alert/status_effect/blind // This is not "remove on fullheal" as in practice, // fullheal should instead remove all the sources and in turn cure this diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm index 806bbc39d8b..3cf51d34c48 100644 --- a/code/datums/status_effects/debuffs/debuffs.dm +++ b/code/datums/status_effects/debuffs/debuffs.dm @@ -8,7 +8,7 @@ //Largely negative status effects go here, even if they have small beneficial effects //STUN EFFECTS /datum/status_effect/incapacitating - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_REPLACE alert_type = null remove_on_fullheal = TRUE @@ -139,7 +139,7 @@ if(!.) return if(HAS_TRAIT(owner, TRAIT_SLEEPIMMUNE)) - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK else ADD_TRAIT(owner, TRAIT_KNOCKEDOUT, TRAIT_STATUS_EFFECT(id)) RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_SLEEPIMMUNE), PROC_REF(on_owner_insomniac)) @@ -156,7 +156,7 @@ /datum/status_effect/incapacitating/sleeping/proc/on_owner_insomniac(mob/living/source) SIGNAL_HANDLER REMOVE_TRAIT(owner, TRAIT_KNOCKEDOUT, TRAIT_STATUS_EFFECT(id)) - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK ///If the mob has the TRAIT_SLEEPIMMUNE but somehow looses it we make him sleep and restart the tick() /datum/status_effect/incapacitating/sleeping/proc/on_owner_sleepy(mob/living/source) @@ -256,7 +256,7 @@ //STASIS /datum/status_effect/grouped/stasis id = "stasis" - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = /atom/movable/screen/alert/status_effect/stasis var/last_dead_time @@ -308,7 +308,7 @@ /datum/status_effect/his_wrath //does minor damage over time unless holding His Grace id = "his_wrath" - duration = -1 + duration = STATUS_EFFECT_PERMANENT tick_interval = 0.4 SECONDS alert_type = /atom/movable/screen/alert/status_effect/his_wrath @@ -331,7 +331,7 @@ /datum/status_effect/cultghost //is a cult ghost and can't use manifest runes id = "cult_ghost" - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null /datum/status_effect/cultghost/on_apply() @@ -401,7 +401,7 @@ id = "neck_slice" status_type = STATUS_EFFECT_UNIQUE alert_type = null - duration = -1 + duration = STATUS_EFFECT_PERMANENT /datum/status_effect/neck_slice/on_apply() if(!ishuman(owner)) @@ -526,7 +526,7 @@ /datum/status_effect/gonbola_pacify id = "gonbolaPacify" status_type = STATUS_EFFECT_MULTIPLE - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK alert_type = null /datum/status_effect/gonbola_pacify/on_apply() diff --git a/code/datums/status_effects/debuffs/dna_transformation.dm b/code/datums/status_effects/debuffs/dna_transformation.dm index 33b6eb1d913..150ca8fa96c 100644 --- a/code/datums/status_effects/debuffs/dna_transformation.dm +++ b/code/datums/status_effects/debuffs/dna_transformation.dm @@ -2,7 +2,7 @@ /// then turns them back to how they were before transformation. /datum/status_effect/temporary_transformation id = "temp_dna_transformation" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK duration = 1 MINUTES // set in on creation, this just needs to be any value to process alert_type = null /// A reference to a COPY of the DNA that the mob will be transformed into. @@ -16,7 +16,7 @@ QDEL_NULL(old_dna) /datum/status_effect/temporary_transformation/on_creation(mob/living/new_owner, new_duration = 1 MINUTES, datum/dna/dna_to_copy) - src.duration = (new_duration == INFINITY) ? -1 : new_duration + src.duration = new_duration src.new_dna = new() src.old_dna = new() dna_to_copy.copy_dna(new_dna) @@ -79,11 +79,11 @@ // Pause if we're dead, appear dead, or in stasis if(source.stat == DEAD || HAS_TRAIT(source, TRAIT_DEATHCOMA) || HAS_TRAIT(source, TRAIT_STASIS)) - if(duration == -1) + if(duration == STATUS_EFFECT_PERMANENT) return // Already paused time_before_pause = duration - world.time - duration = -1 + duration = STATUS_EFFECT_PERMANENT // Resume if we're none of the above and also were paused else if(time_before_pause != -1) diff --git a/code/datums/status_effects/debuffs/fire_stacks.dm b/code/datums/status_effects/debuffs/fire_stacks.dm index a575d2619fe..83510a2ded2 100644 --- a/code/datums/status_effects/debuffs/fire_stacks.dm +++ b/code/datums/status_effects/debuffs/fire_stacks.dm @@ -1,5 +1,5 @@ /datum/status_effect/fire_handler - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null status_type = STATUS_EFFECT_REFRESH //Custom code on_remove_on_mob_delete = TRUE diff --git a/code/datums/status_effects/debuffs/genetic_damage.dm b/code/datums/status_effects/debuffs/genetic_damage.dm index 21b6f1db218..21435f476c0 100644 --- a/code/datums/status_effects/debuffs/genetic_damage.dm +++ b/code/datums/status_effects/debuffs/genetic_damage.dm @@ -5,7 +5,7 @@ id = "genetic_damage" alert_type = null status_type = STATUS_EFFECT_REFRESH // New effects will add to total_damage - duration = -1 + duration = STATUS_EFFECT_PERMANENT tick_interval = 2 SECONDS on_remove_on_mob_delete = TRUE // Need to unregister from owner, be_replaced() would cause runtimes remove_on_fullheal = TRUE diff --git a/code/datums/status_effects/debuffs/hallucination.dm b/code/datums/status_effects/debuffs/hallucination.dm index 22c74f72cbd..3f24ab02e60 100644 --- a/code/datums/status_effects/debuffs/hallucination.dm +++ b/code/datums/status_effects/debuffs/hallucination.dm @@ -82,7 +82,7 @@ /datum/status_effect/hallucination/sanity id = "low sanity" status_type = STATUS_EFFECT_REFRESH - duration = -1 // This lasts "forever", only goes away with sanity gain + duration = STATUS_EFFECT_PERMANENT // This lasts "forever", only goes away with sanity gain /datum/status_effect/hallucination/sanity/on_health_scan(datum/source, list/render_list, advanced, mob/user, mode, tochat) return diff --git a/code/datums/status_effects/debuffs/hooked.dm b/code/datums/status_effects/debuffs/hooked.dm index 3eb7caf1c37..d7fcb2b1821 100644 --- a/code/datums/status_effects/debuffs/hooked.dm +++ b/code/datums/status_effects/debuffs/hooked.dm @@ -1,8 +1,8 @@ ///Status effect applied when casting a fishing rod at someone, provided the attached fishing hook allows it. /datum/status_effect/grouped/hooked id = "hooked" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_MULTIPLE alert_type = /atom/movable/screen/alert/status_effect/hooked diff --git a/code/datums/status_effects/debuffs/speech_debuffs.dm b/code/datums/status_effects/debuffs/speech_debuffs.dm index 4963a660b22..a557f7ddd4d 100644 --- a/code/datums/status_effects/debuffs/speech_debuffs.dm +++ b/code/datums/status_effects/debuffs/speech_debuffs.dm @@ -2,7 +2,7 @@ id = null alert_type = null remove_on_fullheal = TRUE - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK /// If TRUE, TTS will say the original message rather than what we changed it to var/make_tts_message_original = FALSE /// If set, this will be appended to the TTS filter of the message diff --git a/code/datums/status_effects/debuffs/stamcrit.dm b/code/datums/status_effects/debuffs/stamcrit.dm index c0359c7ddf3..74c3fde12f5 100644 --- a/code/datums/status_effects/debuffs/stamcrit.dm +++ b/code/datums/status_effects/debuffs/stamcrit.dm @@ -1,8 +1,8 @@ /datum/status_effect/incapacitating/stamcrit status_type = STATUS_EFFECT_UNIQUE // Lasts until we go back to 0 stamina, which is handled by the mob - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK /// Cooldown between displaying warning messages that we hit diminishing returns COOLDOWN_DECLARE(warn_cd) /// A counter that tracks every time we've taken enough damage to trigger diminishing returns diff --git a/code/datums/status_effects/debuffs/tower_of_babel.dm b/code/datums/status_effects/debuffs/tower_of_babel.dm index a56ea1ac6d9..bd2d38e7546 100644 --- a/code/datums/status_effects/debuffs/tower_of_babel.dm +++ b/code/datums/status_effects/debuffs/tower_of_babel.dm @@ -32,7 +32,7 @@ // Used by wizard magic and tower of babel event /datum/status_effect/tower_of_babel/magical id = "tower_of_babel_magic" // do we need a new id? - duration = -1 + duration = STATUS_EFFECT_PERMANENT trait_source = TRAUMA_TRAIT /datum/status_effect/tower_of_babel/magical/on_apply() diff --git a/code/datums/status_effects/drug_effects.dm b/code/datums/status_effects/drug_effects.dm index 4fd45908d5d..7e8466f3372 100644 --- a/code/datums/status_effects/drug_effects.dm +++ b/code/datums/status_effects/drug_effects.dm @@ -1,6 +1,6 @@ /datum/status_effect/woozy id = "woozy" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/woozy @@ -14,7 +14,7 @@ /datum/status_effect/high_blood_pressure id = "high_blood_pressure" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/high_blood_pressure @@ -40,7 +40,7 @@ /datum/status_effect/seizure id = "seizure" - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/seizure diff --git a/code/datums/status_effects/gas.dm b/code/datums/status_effects/gas.dm index f06a289da78..1dc39e81bf2 100644 --- a/code/datums/status_effects/gas.dm +++ b/code/datums/status_effects/gas.dm @@ -55,7 +55,7 @@ /datum/status_effect/freon/lasting id = "lasting_frozen" - duration = -1 + duration = STATUS_EFFECT_PERMANENT /datum/status_effect/hypernob_protection id = "hypernob_protection" diff --git a/code/datums/status_effects/limited_effect.dm b/code/datums/status_effects/limited_effect.dm index 0f56e72da52..b577248d35e 100644 --- a/code/datums/status_effects/limited_effect.dm +++ b/code/datums/status_effects/limited_effect.dm @@ -1,7 +1,7 @@ /// These effects reapply their on_apply() effect when refreshed while stacks < max_stacks. /datum/status_effect/limited_buff id = "limited_buff" - duration = -1 + duration = STATUS_EFFECT_PERMANENT status_type = STATUS_EFFECT_REFRESH ///How many stacks we currently have var/stacks = 1 diff --git a/code/datums/status_effects/neutral.dm b/code/datums/status_effects/neutral.dm index d7bc350ffbd..b2869b6a30e 100644 --- a/code/datums/status_effects/neutral.dm +++ b/code/datums/status_effects/neutral.dm @@ -2,8 +2,8 @@ /datum/status_effect/crusher_damage id = "crusher_damage" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = null /// How much damage? @@ -71,7 +71,7 @@ /datum/status_effect/in_love id = "in_love" - duration = -1 + duration = STATUS_EFFECT_PERMANENT status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/in_love var/hearts @@ -146,8 +146,8 @@ // heldup is for the person being aimed at /datum/status_effect/grouped/heldup id = "heldup" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_MULTIPLE alert_type = /atom/movable/screen/alert/status_effect/heldup @@ -167,8 +167,8 @@ // holdup is for the person aiming /datum/status_effect/holdup id = "holdup" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/holdup @@ -187,8 +187,8 @@ // this status effect is used to negotiate the high-fiving capabilities of all concerned parties /datum/status_effect/offering id = "offering" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = null /// The people who were offered this item at the start @@ -349,8 +349,8 @@ //this effect gives the user an alert they can use to surrender quickly /datum/status_effect/grouped/surrender id = "surrender" - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/surrender @@ -394,7 +394,7 @@ /datum/status_effect/caltropped id = "caltropped" duration = 1 SECONDS - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK status_type = STATUS_EFFECT_REFRESH alert_type = null @@ -596,8 +596,8 @@ /datum/status_effect/gutted id = "gutted" alert_type = null - duration = -1 - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT + tick_interval = STATUS_EFFECT_NO_TICK /datum/status_effect/gutted/on_apply() RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(stop_gutting)) @@ -612,7 +612,7 @@ /datum/status_effect/washing_regen id = "shower_regen" - duration = -1 + duration = STATUS_EFFECT_PERMANENT status_type = STATUS_EFFECT_UNIQUE alert_type = /atom/movable/screen/alert/status_effect/washing_regen ///The screen alert shown if you hate water diff --git a/code/datums/status_effects/stacking_effect.dm b/code/datums/status_effects/stacking_effect.dm index b0d00a92ba0..3ed7846f6ff 100644 --- a/code/datums/status_effects/stacking_effect.dm +++ b/code/datums/status_effects/stacking_effect.dm @@ -2,7 +2,7 @@ /// Status effects that can stack. /datum/status_effect/stacking id = "stacking_base" - duration = -1 // Only removed under specific conditions. + duration = STATUS_EFFECT_PERMANENT // Only removed under specific conditions. tick_interval = 1 SECONDS // Deciseconds between decays, once decay starts alert_type = null /// How many stacks are currently accumulated. diff --git a/code/datums/status_effects/wound_effects.dm b/code/datums/status_effects/wound_effects.dm index 30361dc9cf1..8d36aaf287f 100644 --- a/code/datums/status_effects/wound_effects.dm +++ b/code/datums/status_effects/wound_effects.dm @@ -28,7 +28,7 @@ /datum/status_effect/limp id = "limp" status_type = STATUS_EFFECT_REPLACE - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK alert_type = /atom/movable/screen/alert/status_effect/limp var/msg_stage = 0//so you dont get the most intense messages immediately /// The left leg of the limping person diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 03e53a87db3..2b6aaebeda7 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -66,7 +66,7 @@ /obj/item/laser_pointer/infinite_range name = "infinite laser pointer" desc = "Used to shine in the eyes of Cyborgs who need a bit of a push, this works through camera consoles." - max_range = INFINITE + max_range = INFINITY /obj/item/laser_pointer/infinite_range/Initialize(mapload) . = ..() @@ -203,7 +203,7 @@ to_chat(user, span_warning("Your fingers can't press the button!")) return - if(max_range != INFINITE) + if(max_range != INFINITY) if(!IN_GIVEN_RANGE(target, user, max_range)) to_chat(user, span_warning("\The [target] is too far away!")) return diff --git a/code/modules/antagonists/heretic/magic/shadow_cloak.dm b/code/modules/antagonists/heretic/magic/shadow_cloak.dm index ca0ca1fa15b..8b068fbefa1 100644 --- a/code/modules/antagonists/heretic/magic/shadow_cloak.dm +++ b/code/modules/antagonists/heretic/magic/shadow_cloak.dm @@ -126,7 +126,7 @@ /datum/status_effect/shadow_cloak id = "shadow_cloak" alert_type = null - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK /// How much damage we've been hit with var/damage_sustained = 0 /// How much damage we can be hit with before it starts rolling reveal chances diff --git a/code/modules/antagonists/heretic/status_effects/buffs.dm b/code/modules/antagonists/heretic/status_effects/buffs.dm index 4a4083e0ac4..3004bdd9ee0 100644 --- a/code/modules/antagonists/heretic/status_effects/buffs.dm +++ b/code/modules/antagonists/heretic/status_effects/buffs.dm @@ -138,7 +138,7 @@ id = "Silver Knives" alert_type = null status_type = STATUS_EFFECT_MULTIPLE - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK /// The number of blades we summon up to. var/max_num_blades = 4 /// The radius of the blade's orbit. @@ -154,7 +154,7 @@ /datum/status_effect/protective_blades/on_creation( mob/living/new_owner, - new_duration = -1, + new_duration = STATUS_EFFECT_PERMANENT, max_num_blades = 4, blade_orbit_radius = 20, time_between_initial_blades = 0.25 SECONDS, @@ -256,7 +256,7 @@ /datum/status_effect/protective_blades/recharging/on_creation( mob/living/new_owner, - new_duration = -1, + new_duration = STATUS_EFFECT_PERMANENT, max_num_blades = 4, blade_orbit_radius = 20, time_between_initial_blades = 0.25 SECONDS, @@ -278,7 +278,7 @@ /datum/status_effect/caretaker_refuge id = "Caretaker’s Last Refuge" status_type = STATUS_EFFECT_REFRESH - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null var/static/list/caretaking_traits = list(TRAIT_GODMODE, TRAIT_HANDS_BLOCKED, TRAIT_IGNORESLOWDOWN, TRAIT_SECLUDED_LOCATION) diff --git a/code/modules/antagonists/heretic/status_effects/debuffs.dm b/code/modules/antagonists/heretic/status_effects/debuffs.dm index 8b1751bccde..7bb2ebbd0e7 100644 --- a/code/modules/antagonists/heretic/status_effects/debuffs.dm +++ b/code/modules/antagonists/heretic/status_effects/debuffs.dm @@ -161,7 +161,7 @@ alert_type = /atom/movable/screen/alert/status_effect/heretic_lastresort duration = 12 SECONDS status_type = STATUS_EFFECT_REPLACE - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK /atom/movable/screen/alert/status_effect/heretic_lastresort name = "Last Resort" @@ -183,7 +183,7 @@ /datum/status_effect/moon_converted id = "moon converted" alert_type = /atom/movable/screen/alert/status_effect/moon_converted - duration = -1 + duration = STATUS_EFFECT_PERMANENT status_type = STATUS_EFFECT_REPLACE ///used to track damage var/damage_sustained = 0 diff --git a/code/modules/antagonists/heretic/status_effects/ghoul.dm b/code/modules/antagonists/heretic/status_effects/ghoul.dm index b212f1a024a..34778d380fb 100644 --- a/code/modules/antagonists/heretic/status_effects/ghoul.dm +++ b/code/modules/antagonists/heretic/status_effects/ghoul.dm @@ -1,7 +1,7 @@ /datum/status_effect/ghoul id = "ghoul" status_type = STATUS_EFFECT_UNIQUE - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = /atom/movable/screen/alert/status_effect/ghoul /// The new max health value set for the ghoul, if supplied var/new_max_health diff --git a/code/modules/antagonists/heretic/status_effects/void_chill.dm b/code/modules/antagonists/heretic/status_effects/void_chill.dm index ed4bf1f3cb5..c286fcd2982 100644 --- a/code/modules/antagonists/heretic/status_effects/void_chill.dm +++ b/code/modules/antagonists/heretic/status_effects/void_chill.dm @@ -84,7 +84,7 @@ /datum/status_effect/void_chill/lasting id = "lasting_void_chill" - duration = -1 + duration = STATUS_EFFECT_PERMANENT /datum/movespeed_modifier/void_chill variable = TRUE diff --git a/code/modules/antagonists/heretic/structures/lock_final.dm b/code/modules/antagonists/heretic/structures/lock_final.dm index 295ecbb3a2b..cd187641f73 100644 --- a/code/modules/antagonists/heretic/structures/lock_final.dm +++ b/code/modules/antagonists/heretic/structures/lock_final.dm @@ -1,7 +1,7 @@ /obj/structure/lock_tear name = "???" desc = "It stares back. There's no reason to remain. Run." - max_integrity = INFINITE + max_integrity = INFINITY resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF icon = 'icons/obj/anomaly.dmi' icon_state = "bhole3" diff --git a/code/modules/antagonists/voidwalker/voidwalker_status_effects.dm b/code/modules/antagonists/voidwalker/voidwalker_status_effects.dm index 7934e757077..6b7f733265c 100644 --- a/code/modules/antagonists/voidwalker/voidwalker_status_effects.dm +++ b/code/modules/antagonists/voidwalker/voidwalker_status_effects.dm @@ -5,7 +5,7 @@ /// Regenerate in space /datum/status_effect/space_regeneration id = "space_regeneration" - duration = INFINITE + duration = STATUS_EFFECT_PERMANENT alert_type = null // How much do we heal per tick? var/healing = 1.5 @@ -20,7 +20,7 @@ /datum/status_effect/planet_allergy id = "planet_allergy" - duration = INFINITE + duration = STATUS_EFFECT_PERMANENT alert_type = /atom/movable/screen/alert/status_effect/veryhighgravity /datum/status_effect/planet_allergy/tick() diff --git a/code/modules/antagonists/wizard/equipment/teleport_rod.dm b/code/modules/antagonists/wizard/equipment/teleport_rod.dm index e0a5ce31145..47187dcc4f7 100644 --- a/code/modules/antagonists/wizard/equipment/teleport_rod.dm +++ b/code/modules/antagonists/wizard/equipment/teleport_rod.dm @@ -174,7 +174,7 @@ particle_effect.alpha = 200 var/original_duration = initial(duration) - if(original_duration == -1) + if(original_duration == STATUS_EFFECT_PERMANENT) return animate(particle_effect, alpha = 50, time = original_duration) @@ -185,7 +185,7 @@ /datum/status_effect/teleport_flux/perma id = "perma_teleport_flux" status_type = STATUS_EFFECT_REPLACE - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = /atom/movable/screen/alert/status_effect/teleport_flux/perma remove_on_fullheal = FALSE diff --git a/code/modules/mining/equipment/monster_organs/brimdust_sac.dm b/code/modules/mining/equipment/monster_organs/brimdust_sac.dm index d58ecf4da42..d6767fe913b 100644 --- a/code/modules/mining/equipment/monster_organs/brimdust_sac.dm +++ b/code/modules/mining/equipment/monster_organs/brimdust_sac.dm @@ -71,7 +71,7 @@ id = "brimdust_coating" stacks = 0 max_stacks = 3 - tick_interval = -1 + tick_interval = STATUS_EFFECT_NO_TICK consumed_on_threshold = FALSE alert_type = /atom/movable/screen/alert/status_effect/brimdust_coating status_type = STATUS_EFFECT_REFRESH // Allows us to add one stack at a time by just applying the effect diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index e89522b6360..4efc847805f 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -668,7 +668,7 @@ return 0 // Infinite duration status effects technically are not "timed status effects" // by name or nature, but support is included just in case. - if(existing.duration == -1) + if(existing.duration == STATUS_EFFECT_PERMANENT) return INFINITY return existing.duration - world.time diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 227f1be5165..9376ca9441f 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -59,8 +59,8 @@ /datum/status_effect/slimerecall id = "slime_recall" - duration = -1 //Will be removed by the extract. - tick_interval = -1 + duration = STATUS_EFFECT_PERMANENT //Will be removed by the extract. + tick_interval = STATUS_EFFECT_NO_TICK alert_type = null var/interrupted = FALSE var/mob/target @@ -96,7 +96,7 @@ /datum/status_effect/frozenstasis id = "slime_frozen" status_type = STATUS_EFFECT_UNIQUE - duration = -1 //Will remove self when block breaks. + duration = STATUS_EFFECT_PERMANENT //Will remove self when block breaks. alert_type = /atom/movable/screen/alert/status_effect/freon/stasis var/obj/structure/ice_stasis/cube @@ -125,7 +125,7 @@ /datum/status_effect/slime_clone id = "slime_cloned" status_type = STATUS_EFFECT_UNIQUE - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null var/mob/living/clone var/datum/mind/originalmind //For when the clone gibs. @@ -169,7 +169,7 @@ /datum/status_effect/slime_clone_decay id = "slime_clonedecay" status_type = STATUS_EFFECT_UNIQUE - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = /atom/movable/screen/alert/status_effect/clone_decay /datum/status_effect/slime_clone_decay/tick(seconds_between_ticks) @@ -230,7 +230,7 @@ /datum/status_effect/rebreathing id = "rebreathing" - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null /datum/status_effect/rebreathing/tick(seconds_between_ticks) @@ -440,7 +440,7 @@ /datum/status_effect/stabilized //The base stabilized extract effect, has no effect of its' own. id = "stabilizedbase" - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null /// Item which provides this buff var/obj/item/slimecross/stabilized/linked_extract @@ -836,7 +836,7 @@ /datum/status_effect/pinkdamagetracker id = "pinkdamagetracker" - duration = -1 + duration = STATUS_EFFECT_PERMANENT alert_type = null var/damage = 0 var/lasthealth diff --git a/code/modules/spells/spell_types/tower_of_babel.dm b/code/modules/spells/spell_types/tower_of_babel.dm index 618711a8d95..6c7374b4420 100644 --- a/code/modules/spells/spell_types/tower_of_babel.dm +++ b/code/modules/spells/spell_types/tower_of_babel.dm @@ -53,7 +53,7 @@ GLOBAL_DATUM(tower_of_babel, /datum/tower_of_babel) to_chat(to_curse, span_notice("You have a strange feeling for a moment, but then it passes.")) return - to_curse.apply_status_effect(/datum/status_effect/tower_of_babel/magical, INFINITE) + to_curse.apply_status_effect(/datum/status_effect/tower_of_babel/magical, INFINITY) return TRUE /// Mainly so admin triggered tower of babel can be undone diff --git a/code/modules/surgery/organs/autosurgeon.dm b/code/modules/surgery/organs/autosurgeon.dm index 296b40beea9..83fb98e4844 100644 --- a/code/modules/surgery/organs/autosurgeon.dm +++ b/code/modules/surgery/organs/autosurgeon.dm @@ -8,7 +8,7 @@ w_class = WEIGHT_CLASS_SMALL /// How many times you can use the autosurgeon before it becomes useless - var/uses = INFINITE + var/uses = INFINITY /// What organ will the autosurgeon sub-type will start with. ie, CMO autosurgeon start with a medi-hud. var/starting_organ /// The organ currently loaded in the autosurgeon, ready to be implanted. @@ -40,7 +40,7 @@ to_chat(user, span_alert("[src] already has an implant stored.")) return - if(uses == 0) + if(uses <= 0) to_chat(user, span_alert("[src] is used up and cannot be loaded with more implants.")) return @@ -69,7 +69,7 @@ to_chat(user, span_alert("[src] currently has no implant stored.")) return - if(!uses) + if(uses <= 0) to_chat(user, span_alert("[src] has already been used. The tools are dull and won't reactivate.")) return @@ -96,9 +96,8 @@ playsound(target.loc, 'sound/items/weapons/circsawhit.ogg', 50, vary = TRUE) update_appearance() - if(uses) - uses-- - if(uses == 0) + uses-- + if(uses <= 0) desc = "[initial(desc)] Looks like it's been used up." /obj/item/autosurgeon/attack_self(mob/user)//when the object it used... @@ -129,9 +128,8 @@ stored_organ = null screwtool.play_tool_sound(src) - if (uses) - uses-- - if(!uses) + uses-- + if(uses <= 0) desc = "[initial(desc)] Looks like it's been used up." update_appearance(UPDATE_ICON) return TRUE diff --git a/code/modules/unit_tests/status_effect_ticks.dm b/code/modules/unit_tests/status_effect_ticks.dm index 6f3c43c7ada..d60ba187abc 100644 --- a/code/modules/unit_tests/status_effect_ticks.dm +++ b/code/modules/unit_tests/status_effect_ticks.dm @@ -3,21 +3,21 @@ /datum/unit_test/status_effect_ticks/Run() for(var/datum/status_effect/checking as anything in subtypesof(/datum/status_effect)) - var/checking_tick = initial(checking.tick_interval) - if(checking_tick == -1) + var/tick_speed = initial(checking.tick_interval) + if(tick_speed == STATUS_EFFECT_NO_TICK) continue - if(checking_tick == INFINITY) - TEST_FAIL("Status effect [checking] has tick_interval set to INFINITY, this is not how you prevent ticks - use tick_interval = -1 instead.") + if(tick_speed == INFINITY) + TEST_FAIL("Status effect [checking] has tick_interval set to INFINITY, this is not how you prevent ticks - use tick_interval = STATUS_EFFECT_NO_TICK instead.") continue - if(checking_tick == 0) - TEST_FAIL("Status effect [checking] has tick_interval set to 0, this is not how you prevent ticks - use tick_interval = -1 instead.") + if(tick_speed == 0) + TEST_FAIL("Status effect [checking] has tick_interval set to 0, this is not how you prevent ticks - use tick_interval = STATUS_EFFECT_NO_TICK instead.") continue switch(initial(checking.processing_speed)) if(STATUS_EFFECT_FAST_PROCESS) - if(checking_tick < SSfastprocess.wait) - TEST_FAIL("Status effect [checking] has tick_interval set to [checking_tick], which is faster than SSfastprocess can tick ([SSfastprocess.wait]).") + if(tick_speed < SSfastprocess.wait) + TEST_FAIL("Status effect [checking] has tick_interval set to [tick_speed], which is faster than SSfastprocess can tick ([SSfastprocess.wait]).") if(STATUS_EFFECT_NORMAL_PROCESS) - if(checking_tick < SSprocessing.wait) - TEST_FAIL("Status effect [checking] has tick_interval set to [checking_tick], which is faster than SSprocessing can tick ([SSprocessing.wait]).") + if(tick_speed < SSprocessing.wait) + TEST_FAIL("Status effect [checking] has tick_interval set to [tick_speed], which is faster than SSprocessing can tick ([SSprocessing.wait]).") else TEST_FAIL("Invalid processing speed for status effect [checking] : [initial(checking.processing_speed)]")