Skip to content
Permalink
Browse files

Merged PR 464: Merge 573_tactical_troop_management to master

Related work items: #573
  • Loading branch information...
realms-mud committed Mar 14, 2019
1 parent 85f0876 commit 94378e153bf5b1b8139ada9c1d74c3250f95cd92
@@ -64,9 +64,25 @@ public nomask mapping getTopLevelDomainMenu(object user)
"lib/instances/research/domains/tasks/basicTasks.c",
"persuasion")
]),
"6":([
"name":"Manage Troops",
"description" : "This option lets you create and manage "
"your troops and their activities.\n",
"selector": "troops",
"selector file": sprintf(DomainSelectorBase, "troops"),
"canShow": user->canApplyResearchBonus(
"lib/instances/research/domains/troops/basicTroops.c",
"persuasion")
]),
]);
}

/////////////////////////////////////////////////////////////////////////////
public nomask mapping getTroopsMenu(object user)
{
return ([]);
}

/////////////////////////////////////////////////////////////////////////////
public nomask mapping getTaskMenu(object user)
{
@@ -0,0 +1,20 @@
//*****************************************************************************
// Copyright (c) 2019 - Allen Cummings, RealmsMUD, All rights reserved. See
// the accompanying LICENSE file for details.
//*****************************************************************************
inherit "/lib/modules/research/knowledgeResearchItem.c";

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
{
if (!arg)
{
knowledgeResearchItem::reset(arg);
addSpecification("name", "Basic Troops");
addSpecification("source", "domains");
addSpecification("description", "This skill provides the user with the "
"knowledge required to form armies, use formations, and assign "
"activities.");
addSpecification("research type", "granted");
}
}
@@ -0,0 +1,44 @@
//*****************************************************************************
// Copyright (c) 2019 - Allen Cummings, RealmsMUD, All rights reserved. See
// the accompanying LICENSE file for details.
//*****************************************************************************
inherit "/lib/core/baseSelector.c";

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
{
if (!arg)
{
AllowUndo = 0;
AllowAbort = 1;
Description = "Main Menu";
Type = "Troop Management";
Data = ([]);
}
}

/////////////////////////////////////////////////////////////////////////////
protected nomask void setUpUserForSelection()
{
object dictionary = load_object("/lib/dictionaries/domainDictionary.c");
if (dictionary)
{
Data = dictionary->getTroopsMenu(User);
}
Data[to_string(sizeof(Data) + 1)] = ([
"name":"Exit Troop Management Menu",
"type" : "exit",
"description" : "This option lets you exit the troop management menu.\n",
"canShow" : 1
]);
}

/////////////////////////////////////////////////////////////////////////////
public nomask void onSelectorCompleted(object caller)
{
if (User)
{
tell_object(User, displayMessage());
}
caller->cleanUp();
}
@@ -214,4 +214,4 @@ public nomask varargs void updateFactionDisposition(string faction, int reputati
public nomask void toggleUnsafeFactionInteractions()
{

}
}
@@ -37,8 +37,9 @@ void TopLevelMenuWithoutAnyPrereqsMetDisplaysCorrectly()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -56,8 +57,9 @@ void SelectUnavailableOptionReturnsToMainMenu()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -75,8 +77,9 @@ void TopLevelMenuWithAdministrationProjectPrereqMetDisplaysCorrectly()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -94,8 +97,9 @@ void TopLevelMenuWithBuildingProjectPrereqMetDisplaysCorrectly()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -113,8 +117,9 @@ void TopLevelMenuWithHiringPrereqMetDisplaysCorrectly()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;32mHire New Henchmen\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -132,8 +137,9 @@ void TopLevelMenuWithHoldingsPrereqMetDisplaysCorrectly()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;32mResources and Holdings\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -151,8 +157,29 @@ void TopLevelMenuWithTaskPrereqMetDisplaysCorrectly()
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;32mManage Tasks\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 6.\n\x1b[0m"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;31mManage Troops \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
}

/////////////////////////////////////////////////////////////////////////////
void TopLevelMenuWithTroopsPrereqMetDisplaysCorrectly()
{
ExpectTrue(Player->initiateResearch("lib/instances/research/domains/troops/basicTroops.c"), "added research");
Selector->initiateSelector(Player);

ExpectEq("\x1b[0;36mDomain Management - \x1b[0m\x1b[0;37;1mMain Menu\x1b[0m:\n"
"[\x1b[0;31;1m1\x1b[0m] - \x1b[0;31mAdministration Projects \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m2\x1b[0m] - \x1b[0;31mBuilding Projects \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m3\x1b[0m] - \x1b[0;31mResources and Holdings \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m4\x1b[0m] - \x1b[0;31mHire New Henchmen \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m5\x1b[0m] - \x1b[0;31mManage Tasks \x1b[0m\x1b[0;35m(Missing Prerequisites)\x1b[0m\n"
"[\x1b[0;31;1m6\x1b[0m] - \x1b[0;32mManage Troops\x1b[0m\n"
"[\x1b[0;31;1m7\x1b[0m] - \x1b[0;32mExit Domain Management Menu\x1b[0m\n"
"\x1b[0;32;1mYou must select a number from 1 to 7.\n\x1b[0m"
"\x1b[0;32mType 'exit' if you do not wish to make a selection at this time.\n\x1b[0m"
"\x1b[0;32mFor details on a given choice, type 'describe X' (or '? X') where\nX is the option about which you would like further details.\n\x1b[0m\x1b[0;32;1m\x1b[0m",
Player->caughtMessage());
@@ -213,6 +240,17 @@ void SelectingHiringMovesToTaskMenu()
Player->caughtMessage());
}

/////////////////////////////////////////////////////////////////////////////
void SelectingTroopsMovesToTroopsMenu()
{
ExpectTrue(Player->initiateResearch("lib/instances/research/domains/troops/basicTroops.c"), "added research");
Selector->initiateSelector(Player);
command("6", Player);

ExpectSubStringMatch("Exit Troop Management Menu",
Player->caughtMessage());
}

/////////////////////////////////////////////////////////////////////////////
void DescriptionsAreDisplayed()
{
@@ -233,7 +271,7 @@ void ExitCleansUpSelector()
ExpectEq(0, subscriber->TimesEventReceived());

ExpectTrue(present(Selector, Player));
command("6", Player);
command("7", Player);
ExpectSubStringMatch("You have selected 'Exit Domain Management Menu'",
Player->caughtMessage());

@@ -121,6 +121,93 @@ private void GutsEqualSpilled()
addResponseTopic("that's distracting", "Who's bleeding on the ground?",
"I don't know");
addResponseTopic("that's distracting", "My turn...", "I don't know");

addResponse("I don't know", "It depends on what you say...",
"@D@@C@##InitiatorName## ##ResponseInfinitive::say##, @S@`Tell me "
"and I will consider your request. Tell me not and you will die very "
"soon.'");
addResponse("I don't know", "You might live @A@Intimidation@E@",
"@D@@C@##InitiatorName## ##ResponseInfinitive::glare## menacingly at "
"the figure and ##ResponseInfinitive::add##, @S@`Tell me "
"and I will consider your request. Tell me not and you will die very "
"soon.'");
addResponsePrerequisite("I don't know", "You might live @A@Intimidation@E@",
(["intimidation":(["type":"skill", "value" : 5])]), 1);
addResponseEffect("I don't know", "You might live @A@Intimidation@E@",
(["experience":(["guild":"background", "amount" : 25])]));

addResponse("I don't know", "Come now @A@Diplomacy@E@",
"@D@@C@##InitiatorName## ##ResponseInfinitive::smile## slightly at "
"the figure and ##ResponseInfinitive::add##, @S@`Come now. You want "
"to live and I want to let you live. Things would go far toward those "
"goals if you shared your knowledge with us.'");
addResponsePrerequisite("I don't know", "Come now @A@Diplomacy@E@",
(["diplomacy":(["type":"skill", "value" : 5])]), 1);
addResponseEffect("I don't know", "Come now @A@Diplomacy@E@",
(["experience":(["guild":"background", "amount" : 25])]));
}

/////////////////////////////////////////////////////////////////////////////
private void GutsEqualSpilledPartTwo()
{
addTopic("very well", "@S@`Very well...' @D@the black-robed man "
"sobs desperately, @S@`Make your way into the heart of the temple. "
"There, you will find the Nightmaster and his Orb of Obedience. The "
"orb creates small spheres of energy that are implanted into the "
"corpses. It is these that give them the power of the beyond.' @D@"
"The man shrugs slightly as he adds, @S@`Our understanding is "
"imperfect, only recently having acquired this orb. We were told "
"that eventually, they will have minds of their own, that we would "
"only require suggestion rather than nearly full control. Our "
"amulets are the key. We tell the corpses to go somewhere and so "
"they obey. If we do not concentrate our will on them, they are "
"useless mounds of flesh, much like they were in life.'");
addResponseTopic("I don't know", "It depends on what you say...", "very well");
addResponseTopic("I don't know", "You might live @A@Intimidation@E@",
"very well");
addResponseTopic("I don't know", "Come now @A@Diplomacy@E@", "very well");

addResponse("very well", "Useless? Seriously?",
"@D@@C@##InitiatorName## ##ResponseInfinitive::smirk##, @S@`Useless "
"as they were in life? For that arrogant jab alone, I might end you.'");
addResponse("very well", "What else?",
"@D@@C@##InitiatorName## ##ResponseInfinitive::say##, @S@`What other "
"information can you provide? Quickly... Time is running out.'");

addTopic("please don't kill me", "@D@The man looks absolutely terrified. "
"He pleads, @S@`Please, I have told you all you need to know. Release "
"me!' @D@When he realizes that his release is not imminent, he adds, "
"@S@`The Nightmaster is one of the twelve living gerents of Xyris, "
"lord of the dead. He commands us to prepare an army for his conquest "
"of Eledhel. Enter his abode and you shall gladly serve him in death. "
"Flee this place now lest you get ensnared by his web as I have. I "
"beg of thee... Flee while there is time. He is aware of you. There "
"is no more I can say. Release me!'");
addTopicEvent("please don't kill me", "enterTheLair");
addResponseTopic("very well", "Useless? Seriously?", "please don't kill me");
addResponseTopic("very well", "What else?", "please don't kill me");

addResponse("please don't kill me", "Yeah, sure. @I@Kill Prisoner@E@",
"@D@@C@##InitiatorName## ##ResponseInfinitive::shake## "
"##InitiatorPossessive## head and ##ResponseInfinitive::say##, "
"@S@`No... it's time to die.'");
addResponseEffect("please don't kill me", "Yeah, sure. @I@Kill Prisoner@E@",
(["attack":1]));

addResponse("please don't kill me", "Donald?",
"@D@@C@##InitiatorName## ##ResponseInfinitive::ask##, @S@`Sir?'");
addResponse("please don't kill me", "@I@Continue@E@", "");

addTopic("please don't kill me part 2", "@D@The man looks expectantly at "
"##InitiatorName## and adds, @S@`I have done my part. Release me.'");
addResponseTopic("please don't kill me", "Donald?",
"please don't kill me part 2");
addResponseTopic("please don't kill me", "@I@Continue@E@",
"please don't kill me part 2");

addTopicInterjection("please don't kill me part 2",
"/lib/tutorial/characters/donald/donald.c",
"grant him his release", 1);
}

/////////////////////////////////////////////////////////////////////////////
@@ -130,5 +217,5 @@ protected void Setup()
SoIPickMyDeath();
ThatIsDistracting();
GutsEqualSpilled();

GutsEqualSpilledPartTwo();
}
Oops, something went wrong.

0 comments on commit 94378e1

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