mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01:00
Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-sync
This commit is contained in:
@@ -178,6 +178,7 @@
|
||||
#include "holder_loving.dm"
|
||||
#include "holidays.dm"
|
||||
#include "holofan_placement.dm"
|
||||
#include "huds.dm"
|
||||
#include "hulk.dm"
|
||||
#include "human_through_recycler.dm"
|
||||
#include "hunger_curse.dm"
|
||||
|
||||
@@ -32,16 +32,31 @@
|
||||
human.mind = new /datum/mind(null) // Add brain for the food buff
|
||||
|
||||
// It's a piece of cake to bake a pretty cake
|
||||
var/sanity = 0
|
||||
while(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/sugar) < sugar_required && beaker.reagents.total_volume < total_volume)
|
||||
sugar_bag.melee_attack_chain(human, beaker)
|
||||
sanity++
|
||||
if(sanity > 50)
|
||||
TEST_FAIL("Failed to add sugar to beaker!")
|
||||
return
|
||||
sanity = 0
|
||||
while(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/flour) < flour_required && beaker.reagents.total_volume < total_volume)
|
||||
flour_bag.melee_attack_chain(human, beaker)
|
||||
sanity++
|
||||
if(sanity > 50)
|
||||
TEST_FAIL("Failed to add flour to beaker!")
|
||||
return
|
||||
sanity = 0
|
||||
while((beaker.reagents.get_reagent_amount(/datum/reagent/consumable/eggyolk) < eggyolk_required \
|
||||
|| beaker.reagents.get_reagent_amount(/datum/reagent/consumable/eggwhite) < eggwhite_required) \
|
||||
&& beaker.reagents.total_volume < total_volume \
|
||||
&& beaker.reagents.total_volume >= (sugar_required + flour_required)) // Make sure that we won't miss the reaction
|
||||
var/obj/item/egg = egg_box.contents[1]
|
||||
egg.melee_attack_chain(human, beaker, list(RIGHT_CLICK = TRUE))
|
||||
sanity++
|
||||
if(sanity > 50)
|
||||
TEST_FAIL("Failed to add egg to beaker!")
|
||||
return
|
||||
var/obj/item/food/cake_batter = locate(/obj/item/food/cakebatter) in table_loc
|
||||
TEST_ASSERT_NOTNULL(cake_batter, "Failed making cake batter!")
|
||||
TEST_ASSERT_EQUAL(beaker.reagents.total_volume, 0, "Cake batter did not consume all beaker reagents!")
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/// Tests huds are applied and removed correctly when relevant traits are added/removed
|
||||
/datum/unit_test/huds
|
||||
|
||||
/datum/unit_test/huds/Run()
|
||||
var/datum/atom_hud/testhud = GLOB.huds[GLOB.trait_to_hud[TRAIT_SECURITY_HUD]]
|
||||
var/mob/living/carbon/human/consistent/dummy = allocate(__IMPLIED_TYPE__)
|
||||
|
||||
ADD_TRAIT(dummy, TRAIT_SECURITY_HUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!!testhud.hud_users_all_z_levels[dummy], "HUD not applied when trait of HUD was added")
|
||||
|
||||
ADD_TRAIT(dummy, TRAIT_BLOCK_SECHUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!testhud.hud_users_all_z_levels[dummy], "HUD not removed when trait blocking HUD was added")
|
||||
|
||||
REMOVE_TRAIT(dummy, TRAIT_BLOCK_SECHUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!!testhud.hud_users_all_z_levels[dummy], "HUD not reapplied when trait blocking HUD was removed")
|
||||
|
||||
REMOVE_TRAIT(dummy, TRAIT_SECURITY_HUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!testhud.hud_users_all_z_levels[dummy], "HUD not removed when trait of HUD was removed")
|
||||
@@ -23,7 +23,7 @@
|
||||
// INGEST
|
||||
TEST_ASSERT_EQUAL(human.fire_stacks, 0, "Human has fire stacks before taking phlogiston")
|
||||
drink.reagents.add_reagent(/datum/reagent/phlogiston, 10)
|
||||
drink.attack(human, human)
|
||||
drink.melee_attack_chain(human, human)
|
||||
TEST_ASSERT_EQUAL(human.fire_stacks, 1, "Human does not have fire stacks after taking phlogiston")
|
||||
human.Life(SSMOBS_DT)
|
||||
TEST_ASSERT(human.fire_stacks > 1, "Human fire stacks did not increase after life tick")
|
||||
|
||||
Reference in New Issue
Block a user