From 16cefc3437e1b58e3cb2885526fba62753a9d18c Mon Sep 17 00:00:00 2001 From: Geeves Date: Sat, 4 Jan 2025 02:02:49 +0200 Subject: [PATCH] Psi Flipping (#20242) * Psionic apexes now more reliably flip bottles upright or onto their cap. --- .../reagents/reagent_containers/food/drinks.dm | 16 +++++++++++++--- html/changelogs/geeves-psi_flipping.yml | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 html/changelogs/geeves-psi_flipping.yml diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm index 3e9b12b4302..3e16c1df4f5 100644 --- a/code/modules/reagents/reagent_containers/food/drinks.dm +++ b/code/modules/reagents/reagent_containers/food/drinks.dm @@ -263,11 +263,21 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e AddOverlays(filling) //heehoo bottle flipping -/obj/item/reagent_containers/food/drinks/waterbottle/throw_impact() +/obj/item/reagent_containers/food/drinks/waterbottle/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) . = ..() + + // this next part is the bottle flipping code + // when a bottle impacts something, it'll determine whether it lands on its side, upright, or on its cap, just like bottle flipping irl + // people with apex psionics have a better chance of hitting the flip, because it's funny. if(!QDELETED(src)) - if(prob(10)) // landed upright in some way - if(prob(10)) // landed upright on ITS CAP (1% chance) + var/is_psi_apex_or_higher = FALSE + var/mob/living/thrower = throwingdatum.thrower?.resolve() + if(istype(thrower)) + is_psi_apex_or_higher = thrower.psi && thrower.psi.get_rank() >= PSI_RANK_APEX + var/upright_chance = is_psi_apex_or_higher ? 100 : 10 + var/cap_chance = is_psi_apex_or_higher ? 50 : 10 + if(prob(upright_chance)) // landed upright in some way + if(prob(cap_chance)) // landed upright on ITS CAP (1% chance) src.visible_message(SPAN_NOTICE("\The [src] lands upright on its cap!")) animate(src, transform = matrix(prob(50)? 180 : -180, MATRIX_ROTATE), time = 3, loop = 0) else diff --git a/html/changelogs/geeves-psi_flipping.yml b/html/changelogs/geeves-psi_flipping.yml new file mode 100644 index 00000000000..6926a2f47e0 --- /dev/null +++ b/html/changelogs/geeves-psi_flipping.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Psionic apexes now more reliably flip bottles upright or onto their cap."