mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[MIRROR] Fixes permanent sechud from ablative trenchcoat hood [MDB IGNORE] (#16807)
* Fixes permanent sechud from ablative trenchcoat hood * unit tests merge conflict Co-authored-by: GoblinBackwards <22856555+GoblinBackwards@users.noreply.github.com> Co-authored-by: Tastyfish <crazychris32@gmail.com>
This commit is contained in:
co-authored by
GoblinBackwards
Tastyfish
parent
5b804b24a9
commit
2ddb1dde6c
@@ -39,14 +39,14 @@
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/suit/hooded/ablative/ToggleHood()
|
||||
if (hood_up)
|
||||
return ..()
|
||||
. = ..()
|
||||
if (!hood_up)
|
||||
return
|
||||
var/mob/living/carbon/user = loc
|
||||
var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_SECURITY_ADVANCED]
|
||||
ADD_TRAIT(user, TRAIT_SECURITY_HUD, HELMET_TRAIT)
|
||||
hud.show_to(user)
|
||||
balloon_alert(user, "you put on the hood, and enable the hud")
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/suit/hooded/ablative/RemoveHood()
|
||||
if (!hood_up)
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
#include "~skyrat/opposing_force.dm"
|
||||
#include "~skyrat/automapper.dm"
|
||||
//SKYRAT EDIT END
|
||||
#include "ablative_hud.dm"
|
||||
#include "achievements.dm"
|
||||
#include "anchored_mobs.dm"
|
||||
#include "anonymous_themes.dm"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/// Check that player gains and loses sec hud when toggling the ablative hood
|
||||
/datum/unit_test/ablative_hood_hud
|
||||
|
||||
/datum/unit_test/ablative_hood_hud/Run()
|
||||
var/mob/living/carbon/human/person = allocate(/mob/living/carbon/human)
|
||||
var/obj/item/clothing/suit/hooded/ablative/coat = allocate(/obj/item/clothing/suit/hooded/ablative)
|
||||
person.equip_to_slot(coat, ITEM_SLOT_OCLOTHING)
|
||||
TEST_ASSERT(!HAS_TRAIT(person, TRAIT_SECURITY_HUD), "Person already had a sechud before trying to equip the ablative hood.")
|
||||
coat.ToggleHood()
|
||||
TEST_ASSERT(HAS_TRAIT(person, TRAIT_SECURITY_HUD), "Person toggled the ablative hood but didn't gain a sechud.")
|
||||
coat.ToggleHood()
|
||||
TEST_ASSERT(!HAS_TRAIT(person, TRAIT_SECURITY_HUD), "Person lowered their ablative hood but still has a sechud.")
|
||||
|
||||
// Check that player doesn't gain sec hud if the hood is toggled when already wearing a helmet
|
||||
/datum/unit_test/ablative_hood_hud_with_helmet
|
||||
|
||||
/datum/unit_test/ablative_hood_hud_with_helmet/Run()
|
||||
var/mob/living/carbon/human/person = allocate(/mob/living/carbon/human)
|
||||
var/obj/item/clothing/suit/hooded/ablative/coat = allocate(/obj/item/clothing/suit/hooded/ablative)
|
||||
var/obj/item/clothing/head/helmet/hat = allocate(/obj/item/clothing/head/helmet)
|
||||
person.equip_to_slot(coat, ITEM_SLOT_OCLOTHING)
|
||||
person.equip_to_slot(hat, ITEM_SLOT_HEAD)
|
||||
TEST_ASSERT(!HAS_TRAIT(person, TRAIT_SECURITY_HUD), "Person already had a sechud before trying to equip the ablative hood.")
|
||||
coat.ToggleHood()
|
||||
TEST_ASSERT(!HAS_TRAIT(person, TRAIT_SECURITY_HUD), "Person has gained a sechud from toggling the ablative hood despite already wearing a helmet.")
|
||||
Reference in New Issue
Block a user