Fixes an alexander harddel as well as an alexander exploit (#85147)

## About The Pull Request

mighty_shield will probably always harddel since its ref is never
cleared. Also, since the for loop never broke, it was theoretically
possible to infinitely stack block chance on shields that were not
picked by the drink, since it only ever removed blockchance off mighty
shield.
## Why It's Good For The Game

bugs bad exploits bad
## Changelog
🆑
fix: Alexander no longer causes harddels
fix: Removed a theoretical infinite block exploit from alexander
/🆑
This commit is contained in:
nikothedude
2024-07-23 00:54:11 -04:00
committed by SkyratBot
parent 0e34165df8
commit e2da2480e4
@@ -1755,28 +1755,32 @@
quality = DRINK_GOOD
taste_description = "bitter, creamy cacao"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
var/obj/item/shield/mighty_shield
var/datum/weakref/mighty_shield
/datum/reagent/consumable/ethanol/alexander/on_mob_metabolize(mob/living/drinker)
. = ..()
if(ishuman(drinker))
var/mob/living/carbon/human/the_human = drinker
for(var/obj/item/shield/the_shield in the_human.contents)
mighty_shield = the_shield
mighty_shield.block_chance += 10
mighty_shield = WEAKREF(the_shield)
the_shield.block_chance += 10
to_chat(the_human, span_notice("[the_shield] appears polished, although you don't recall polishing it."))
break
/datum/reagent/consumable/ethanol/alexander/on_mob_life(mob/living/drinker, seconds_per_tick, times_fired)
if(mighty_shield && !(mighty_shield in drinker.contents)) //If you had a shield and lose it, you lose the reagent as well. Otherwise this is just a normal drink.
var/obj/item/shield/the_shield = mighty_shield?.resolve()
if(the_shield && !(the_shield in drinker.contents)) //If you had a shield and lose it, you lose the reagent as well. Otherwise this is just a normal drink.
holder.remove_reagent(type, volume)
return
return ..()
/datum/reagent/consumable/ethanol/alexander/on_mob_end_metabolize(mob/living/drinker)
. = ..()
if(mighty_shield)
mighty_shield.block_chance -= 10
to_chat(drinker,span_notice("You notice [mighty_shield] looks worn again. Weird."))
var/obj/item/shield/the_shield = mighty_shield?.resolve()
if(the_shield)
the_shield.block_chance -= 10
to_chat(drinker,span_notice("You notice [the_shield] looks worn again. Weird."))
mighty_shield = null
/datum/reagent/consumable/ethanol/amaretto_alexander
name = "Amaretto Alexander"