Skip to content
Permalink
Browse files

Merged PR 686: 663_resource_harvesting

Fixed broken build

Related Work Items: #663

Related work items: #663
  • Loading branch information
realms-mud committed Mar 16, 2020
1 parent cd592f6 commit 8f2e263c5519f58e796487927224ed5ffa9def60
Showing with 33 additions and 1 deletion.
  1. +1 −1 lib/tests/commands/player/traitsTest.c
  2. +32 −0 lib/tests/environment/harvestableResourceTest.c
@@ -569,7 +569,7 @@ void TraitDetailsDisplayTraitLimiters()
"\x1b[0m\x1b[0;34;1m(+10)\x1b[0m\x1b[0;33m Bonus Resist fire\n"
"\x1b[0m\x1b[0;34;1m(+2)\x1b[0m\x1b[0;33m Bonus Strength\n"
"\x1b[0m\x1b[0;34;1m(+1)\x1b[0m\x1b[0;33m Bonus Weapon attack\n\x1b[0m"
"\x1b[0;36mThis is only applied when opponent race is elf.\n\x1b[0m";
"\x1b[0;36mThis is only applied when the opponent race is elf.\n\x1b[0m";
object trait = load_object("/lib/tests/support/traits/testTrait.c");
trait->init();

@@ -89,3 +89,35 @@ void CanLimitHarvestableResourceByMoonPhase()
"waning\ncrescent, or waxing crescent.\n",
Resource->getHarvestStatistics(Environment, Player));
}

/////////////////////////////////////////////////////////////////////////////
void CanLimitHarvestableResourceByTimeOfDay()
{
Resource->setup("yew", 25, "/lib/instances/items/materials/wood/yew.c",
"a heavily-forested stand of yew trees. Several trees remain",
({ "conifer", "evergreen", "yew tree", "tree" }));

Resource->limitHarvestByTimeOfDay("noon");

Resource->resetQuantity(Environment);
ExpectEq("Name: Yew\n"
"There are 25 yew available for harvest.\n"
"This can only be harvested when the time of day is noon.\n",
Resource->getHarvestStatistics(Environment, Player));
}

/////////////////////////////////////////////////////////////////////////////
void CanLimitHarvestableResourceByState()
{
Resource->setup("yew", 25, "/lib/instances/items/materials/wood/yew.c",
"a heavily-forested stand of yew trees. Several trees remain",
({ "conifer", "evergreen", "yew tree", "tree" }));

Resource->limitHarvestByState("exploited");

Resource->resetQuantity(Environment);
ExpectEq("Name: Yew\n"
"There are 25 yew available for harvest.\n"
"This can only be harvested when the environment state is exploited.\n",
Resource->getHarvestStatistics(Environment, Player));
}

0 comments on commit 8f2e263

Please sign in to comment.
You can’t perform that action at this time.