From fcd036dab5e7e9db6baea929d0b3ec61b4626093 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Thu, 7 Mar 2024 20:31:53 -0300 Subject: [PATCH] final stuff, i think? --- code/__byond_version_compat.dm | 8 ---- .../controllers/configuration/config_entry.dm | 4 +- code/game/objects/items/toys.dm | 9 ++-- .../clock_mobs/clockwork_guardian.dm | 12 +++--- code/modules/mafia/roles.dm | 1 - .../chemistry/reagents/alcohol_reagents.dm | 3 +- code/modules/surgery/organs/eyes.dm | 43 +++++++++++-------- .../code/modules/vectorcrafts/vectorcraft.dm | 10 ++--- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/code/__byond_version_compat.dm b/code/__byond_version_compat.dm index ee045ea7de..ff1a1a1d97 100644 --- a/code/__byond_version_compat.dm +++ b/code/__byond_version_compat.dm @@ -20,14 +20,6 @@ /savefile/byond_version = MIN_COMPILER_VERSION #endif -// Temporary 515 block until it is completely compatible. -// AnturK says there are issues with savefiles that would make it dangerous to test merge, -// and so this check is in place to stop serious damage. -// That being said, if you really are ready, you can give YES_I_WANT_515 to TGS. -#if !defined(YES_I_WANT_515) && DM_VERSION >= 515 -#error We do not yet completely support BYOND 515. -#endif - // 515 split call for external libraries into call_ext #if DM_VERSION < 515 #define LIBCALL call diff --git a/code/controllers/configuration/config_entry.dm b/code/controllers/configuration/config_entry.dm index a162b87986..114d9790c2 100644 --- a/code/controllers/configuration/config_entry.dm +++ b/code/controllers/configuration/config_entry.dm @@ -65,7 +65,7 @@ . &= !(protection & CONFIG_ENTRY_HIDDEN) /datum/config_entry/vv_edit_var(var_name, var_value) - var/static/list/banned_edits = list(NAMEOF(src, name), NAMEOF(src, vv_VAS), NAMEOF(src, default), NAMEOF(src, resident_file), NAMEOF(src, protection), NAMEOF(src, abstract_type), NAMEOF(src, modified), NAMEOF(src, dupes_allowed)) + var/static/list/banned_edits = list(NAMEOF_STATIC(src, name), NAMEOF_STATIC(src, vv_VAS), NAMEOF_STATIC(src, default), NAMEOF_STATIC(src, resident_file), NAMEOF_STATIC(src, protection), NAMEOF_STATIC(src, abstract_type), NAMEOF_STATIC(src, modified), NAMEOF_STATIC(src, dupes_allowed)) if(var_name == NAMEOF(src, config_entry_value)) if(protection & CONFIG_ENTRY_LOCKED) return FALSE @@ -135,7 +135,7 @@ return FALSE /datum/config_entry/number/vv_edit_var(var_name, var_value) - var/static/list/banned_edits = list(NAMEOF(src, max_val), NAMEOF(src, min_val), NAMEOF(src, integer)) + var/static/list/banned_edits = list(NAMEOF_STATIC(src, max_val), NAMEOF_STATIC(src, min_val), NAMEOF_STATIC(src, integer)) return !(var_name in banned_edits) && ..() /datum/config_entry/flag diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index ed90d17282..92c1351fde 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -834,15 +834,16 @@ update_icon() /obj/item/toy/cards/deck/update_icon_state() - switch(cards.len) - if(original_size*0.5 to INFINITY) + switch(LAZYLEN(cards)) + if(27 to INFINITY) icon_state = "deck_[deckstyle]_full" - if(original_size*0.25 to original_size*0.5) + if(11 to 27) icon_state = "deck_[deckstyle]_half" - if(1 to original_size*0.25) + if(1 to 11) icon_state = "deck_[deckstyle]_low" else icon_state = "deck_[deckstyle]_empty" + return ..() /obj/item/toy/cards/deck/attack_self(mob/user) if(cooldown < world.time - 50) diff --git a/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm b/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm index c937b27f16..1c1b35a12d 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm @@ -192,32 +192,32 @@ else var/healthpercent = (health/maxHealth) * 100 switch(healthpercent) - if(100 to 70) //Bonuses to speed and damage at high health + if(70 to 100) //Bonuses to speed and damage at high health speed = 0 melee_damage_lower = 16 melee_damage_upper = 16 attack_verb_continuous = "viciously slashes" - if(70 to 40) + if(40 to 70) speed = initial(speed) melee_damage_lower = initial(melee_damage_lower) melee_damage_upper = initial(melee_damage_upper) attack_verb_continuous = initial(attack_verb_continuous) - if(40 to 30) //Damage decrease, but not speed + if(30 to 40) //Damage decrease, but not speed speed = initial(speed) melee_damage_lower = 10 melee_damage_upper = 10 attack_verb_continuous = "lightly slashes" - if(30 to 20) //Speed decrease + if(20 to 30) //Speed decrease speed = 2 melee_damage_lower = 8 melee_damage_upper = 8 attack_verb_continuous = "lightly slashes" - if(20 to 10) //Massive speed decrease and weak melee attacks + if(10 to 20) //Massive speed decrease and weak melee attacks speed = 3 melee_damage_lower = 6 melee_damage_upper = 6 attack_verb_continuous = "weakly slashes" - if(10 to 0) //We are super weak and going to die + if(0 to 10) //We are super weak and going to die speed = 4 melee_damage_lower = 4 melee_damage_upper = 4 diff --git a/code/modules/mafia/roles.dm b/code/modules/mafia/roles.dm index 93d63a2473..d649081e49 100644 --- a/code/modules/mafia/roles.dm +++ b/code/modules/mafia/roles.dm @@ -467,7 +467,6 @@ /datum/mafia_role/lawyer/proc/release(datum/mafia_controller/game) SIGNAL_HANDLER - . = ..() if(current_target) current_target.role_flags &= ~ROLE_ROLEBLOCKED current_target = null diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index f2587bd5f4..44d38573c8 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -2574,7 +2574,8 @@ All effects don't start immediately, but rather get worse over time; the rate is generate_data_info(data) /datum/reagent/consumable/ethanol/fruit_wine/proc/generate_data_info(list/data) - var/minimum_percent = 0.15 //Percentages measured between 0 and 1. + // BYOND's compiler fails to catch non-consts in a ranged switch case, and it causes incorrect behavior. So this needs to explicitly be a constant. + var/const/minimum_percent = 0.15 //Percentages measured between 0 and 1. var/list/primary_tastes = list() var/list/secondary_tastes = list() glass_name = "glass of [name]" diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 037bf7f09d..51de372d26 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -87,28 +87,35 @@ /obj/item/organ/eyes/applyOrganDamage(d, maximum = maxHealth) . = ..() - if(!.) - return - var/old_damaged = eye_damaged - switch(damage) - if(INFINITY to maxHealth) - eye_damaged = BLIND_VISION_THREE - if(maxHealth to high_threshold) - eye_damaged = BLURRY_VISION_TWO - if(high_threshold to low_threshold) - eye_damaged = BLURRY_VISION_ONE - else + if(!owner) + return FALSE + apply_damaged_eye_effects() + +/// Applies effects to our owner based on how damaged our eyes are +/obj/item/organ/eyes/proc/apply_damaged_eye_effects() + // we're in healthy threshold, either try to heal (if damaged) or do nothing + if(damage <= low_threshold) + if(eye_damaged) eye_damaged = FALSE - if(eye_damaged == old_damaged || !owner) + // clear nearsightedness from damage + owner.clear_fullscreen(EYE_DAMAGE) + // and cure blindness from damage + owner.cure_blind(EYE_DAMAGE) return - if(old_damaged == BLIND_VISION_THREE) - owner.cure_blind(EYE_DAMAGE) - else if(eye_damaged == BLIND_VISION_THREE) + + //various degrees of "oh fuck my eyes", from "point a laser at your eye" to "staring at the Sun" intensities + // 50 - blind + // 49-31 - nearsighted (2 severity) + // 30-20 - nearsighted (1 severity) + if(organ_flags & ORGAN_FAILING) + // become blind from damage owner.become_blind(EYE_DAMAGE) - if(eye_damaged && eye_damaged != BLIND_VISION_THREE) - owner.overlay_fullscreen("eye_damage", /atom/movable/screen/fullscreen/scaled/impaired, eye_damaged) + else - owner.clear_fullscreen("eye_damage") + // become nearsighted from damage + owner.overlay_fullscreen(EYE_DAMAGE, /atom/movable/screen/fullscreen/scaled/impaired, damage > high_threshold ? 2 : 1) + + eye_damaged = TRUE /obj/item/organ/eyes/night_vision name = "shadow eyes" diff --git a/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm b/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm index 399a1c5f06..64d276dda7 100644 --- a/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm +++ b/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm @@ -467,15 +467,15 @@ if(driver.sprinting && !(boost_cooldown)) return WEST else switch(angle) - if(0 to -22) + if(-22 to 0) return EAST - if(-22 to -67) + if(-67 to -22) return SOUTHEAST - if(-67 to -112) + if(-112 to -67) return SOUTH - if(-112 to -157) + if(-157 to -112) return SOUTHWEST - if(-157 to -180) + if(-180 to -157) return WEST