Skip to content
Permalink
Browse files

Merged PR 518: Merge 610_player_domains to master

Related work items: #610, #611
  • Loading branch information...
realms-mud committed Jun 18, 2019
1 parent 8302545 commit efd7d0d75a08a8d0c8025d347ff32f8a261b40df
@@ -36,7 +36,7 @@ private nosave string *validEventHandlers = ({ "onDeath", "onHeartBeat",
"onSaveSucceeded", "onRestoreSucceeded", "onRestoreFailed", "onStateChanged",
"onConversationResponse", "receiveEvent", "onCraftingStarted",
"onCraftingCompleted", "onCraftingAborted", "onTriggerConversation",
"onMessageReceived"
"onMessageReceived", "onConstructionStarted", "onConstructionCompleted"
});

private nosave mapping eventList = ([ ]);
@@ -856,3 +856,9 @@ public nomask int isValidHenchman(mapping data)
member(data, "level") && member(data, "vitals") &&
member(data, "activity");
}

/////////////////////////////////////////////////////////////////////////////
public nomask int isValidActivity(string location, mapping activity)
{
return 1;
}
@@ -83,7 +83,7 @@ private mapping races = ([
"draconid": 8,
"common": 5
]),
"research trees": ({ "lib/instances/research/draconidResearchTree.c" }),
"research trees": ({ "lib/instances/research/races/draconidResearchTree.c" }),
"starting skill points": 8,
"background trait value": 4
]),
@@ -109,7 +109,7 @@ private mapping races = ([
"spell points": 15,
"stamina points": 15,
"bonus heal hit points rate": 2,
"research trees": ({ "lib/instances/research/maegenstrydResearchTree.c" }),
"research trees": ({ "lib/instances/research/races/maegenstrydResearchTree.c" }),
"skills": ([
"ancient history": 3,
"spellcraft": 3,
@@ -298,7 +298,7 @@ private mapping races = ([
"hit points": 25,
"spell points": 50,
"bonus heal spell points rate": 2,
"research trees": ({ "lib/instances/research/highElfResearchTree.c" }),
"research trees": ({ "lib/instances/research/races/highElfResearchTree.c" }),
"skills": ([
"spellcraft": 5,
"blacksmithing": 3,
@@ -1036,6 +1036,21 @@ private nosave mapping decorators = ([
"8-bit": "\x1b[0;38;5;190m",
"24-bit": "\x1b[0;38;2;200;200;0m"
]),
"low end worker": ([
"3-bit": "\x1b[0;31;1m",
"8-bit": "\x1b[0;38;5;9;1m",
"24-bit": "\x1b[0;38;2;200;0;0;1m"
]),
"average worker": ([
"3-bit": "\x1b[0;33m",
"8-bit": "\x1b[0;38;5;190m",
"24-bit": "\x1b[0;38;2;200;200;0m"
]),
"elite worker": ([
"3-bit": "\x1b[0;33;1m",
"8-bit": "\x1b[0;38;5;190;1m",
"24-bit": "\x1b[0;38;2;200;200;0;1m"
]),
"total": ([
"3-bit": "\x1b[0;32m",
"8-bit": "\x1b[0;38;5;212m",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -3,6 +3,7 @@
// the accompanying LICENSE file for details.
//*****************************************************************************
virtual inherit "/lib/items/item.c";

private object configuration =
load_object("/lib/dictionaries/configurationDictionary.c");
private object display =
@@ -48,7 +48,7 @@ protected nomask void setUpUserForSelection()
{
Description = (member(ConstructionData, "name") ?
(dictionary->generateTitle(ConstructionData["name"]) + ":\n") :
"Main Menu:\n") +
"Buildings:\n") +
configuration->decorate(format(sprintf("From this menu, you can "
"initiate, modify, or abort projects in your holdings at %s.",
dictionary->getLocationDisplayName(Location)), 78),
@@ -79,6 +79,8 @@ public nomask void onSelectorCompleted(object caller)
{
if (User)
{
HoldingType = 0;
Component = 0;
setUpUserForSelection();
tell_object(User, displayMessage());
}
@@ -48,7 +48,7 @@ protected nomask void setUpUserForSelection()
{
Description = (member(MaterialData, "name") ?
(dictionary->generateTitle(MaterialData["name"]) + ":\n") :
"Main Menu:\n") +
"Materials:\n") +
configuration->decorate(format(sprintf("From this menu, you can "
"initiate, modify, or abort projects in your holdings at %s.",
dictionary->getLocationDisplayName(Location)), 78),
@@ -48,7 +48,7 @@ protected nomask void setUpUserForSelection()
{
Description = (member(SectionData, "name") ?
(dictionary->generateTitle(SectionData["name"]) + ":\n") :
"Main Menu:\n") +
"Building Sections:\n") +
configuration->decorate(format(sprintf("From this menu, you can "
"initiate, modify, or abort projects in your holdings at %s.",
dictionary->getLocationDisplayName(Location)), 78),
@@ -33,7 +33,7 @@ public nomask void reset(int arg)
AllowUndo = 0;
AllowAbort = 1;
SuppressColon = 1;
Description = "Select Workers";
Description = "Assign Workers";
Type = "Building Projects";
Data = ([]);
}
@@ -46,10 +46,9 @@ protected nomask void setUpUserForSelection()

if (dictionary && WorkerData)
{
printf("%O\n", WorkerData);
Description = (member(WorkerData, "name") ?
(dictionary->generateTitle(WorkerData["name"]) + ":\n") :
"Main Menu:\n") +
"Assign Workers:\n") +
configuration->decorate(format(sprintf("From this menu, you can "
"select the workers who will be executing your %s project "
"in your holdings at %s.", WorkerData["display name"],
@@ -16,9 +16,8 @@ public void reset(int arg)
addSpecification("opposing root", "legitimate");
addSpecification("opinion", -25);
addSpecification("penalty to persuasion", 5);
addSpecification("research tree", "lib/instances/research/bastardResearchTree.c");
addSpecification("research tree", "lib/instances/research/traits/bastardResearchTree.c");
addSpecification("cost", -1);
"baseTrait"::reset(arg);
}
}

@@ -17,9 +17,8 @@ public void reset(int arg)
addSpecification("opinion", -15);
addSpecification("penalty to charisma", 1);
addSpecification("penalty to intelligence", 1);
addSpecification("research tree", "lib/instances/research/senileResearchTree.c");
addSpecification("research tree", "lib/instances/research/traits/senileResearchTree.c");
addSpecification("cost", -1);
"baseTrait"::reset(arg);
}
}

@@ -20,9 +20,8 @@ public void reset(int arg)
addSpecification("opinion", -25);
addSpecification("penalty to wisdom", 2);
addSpecification("penalty to persuasion", 5);
addSpecification("research tree", "lib/instances/research/insaneResearchTree.c");
addSpecification("research tree", "lib/instances/research/traits/insaneResearchTree.c");
addSpecification("cost", -2);
"baseTrait"::reset(arg);
}
}

@@ -19,4 +19,3 @@ public void reset(int arg)
"baseTrait"::reset(arg);
}
}

@@ -10,7 +10,9 @@ virtual inherit "/lib/modules/crafting.c";
virtual inherit "/lib/modules/personas.c";
virtual inherit "/lib/modules/combatChatter.c";

private object leader;
private object Leader;
private string Location;
private mapping Activity = ([]);

/////////////////////////////////////////////////////////////////////////////
public nomask int isRealizationOfHenchman()
@@ -48,16 +50,49 @@ public nomask void setMaxStaminaPoints(int value)
/////////////////////////////////////////////////////////////////////////////
public nomask void setLeader(object player)
{
leader = player;
Leader = player;
}

/////////////////////////////////////////////////////////////////////////////
public nomask void setLocation(string location)
{
if (Leader && Leader->getDomainType(location))
{
Location = location;
}
}

/////////////////////////////////////////////////////////////////////////////
public nomask string location()
{
return Location;
}

/////////////////////////////////////////////////////////////////////////////
public nomask void setActivity(mapping activity)
{
object dictionary = load_object("/lib/dictionaries/domainDictionary.c");

if (Leader && Leader->getDomainType(Location) &&
dictionary->isValidActivity(Location, activity))
{
Activity = activity + ([]);
}
}

/////////////////////////////////////////////////////////////////////////////
public nomask mapping activity()
{
return Activity + ([]);
}

/////////////////////////////////////////////////////////////////////////////
public nomask string partyName()
{
string ret = 0;
if (leader)
if (Leader)
{
ret = leader->RealName();
ret = Leader->RealName();
}
return ret;
}
@@ -66,9 +101,9 @@ public nomask string partyName()
public nomask object getParty()
{
object ret = this_object();
if (leader && leader->getParty())
if (Leader && Leader->getParty())
{
ret = leader->getParty();
ret = Leader->getParty();
}
return ret;
}
@@ -269,7 +269,7 @@ void CanSelectResearchChoice()
command("1", Player);
command("4", Player);
ExpectFalse(Player->isResearched("lib/guilds/scion/paths/sword/root.c"));
ExpectEq(({ "lib/instances/research/highElfResearchTree.c",
ExpectEq(({ "lib/instances/research/races/highElfResearchTree.c",
"lib/guilds/scion/common/mana-shield/mana-shield.c" }),
Player->availableResearchTrees());

@@ -287,7 +287,7 @@ void CanSelectResearchChoice()

command("1", Player);
ExpectTrue(Player->isResearched("lib/guilds/scion/paths/sword/root.c"));
ExpectEq(({ "lib/instances/research/highElfResearchTree.c",
ExpectEq(({ "lib/instances/research/races/highElfResearchTree.c",
"lib/guilds/scion/common/mana-shield/mana-shield.c",
"lib/guilds/scion/paths/sword.c" }),
Player->availableResearchTrees());
@@ -321,7 +321,7 @@ void CanSelectResearchWhenAllChoicesMade()

ExpectTrue(Player->isResearched("lib/guilds/scion/paths/sword/root.c"));
ExpectTrue(Player->isResearched("lib/guilds/scion/paths/sword/flame/root.c"));
ExpectEq(({ "lib/instances/research/highElfResearchTree.c",
ExpectEq(({ "lib/instances/research/races/highElfResearchTree.c",
"lib/guilds/scion/paths/sword.c", "lib/guilds/scion/paths/sword/flame.c",
"lib/guilds/scion/common/mana-shield/mana-shield.c" }),
Player->availableResearchTrees());
@@ -80,3 +80,28 @@ void TopLevelMenuWithoutAnyPrereqsMetDisplaysCorrectly()
"X is the option about which you would like further details.\n",
Player->caughtMessage());
}

/////////////////////////////////////////////////////////////////////////////
void CorrectlyDisplaysWorkerMenu()
{
Selector->initiateSelector(Player);

command("4", Player);

ExpectEq("Building Projects - Assign Workers:\n"
"From this menu, you can select the workers who will be executing your Stone\n"
"Keep project in your holdings at Argalach Castle.\n"
"\n"
"[1] - Exit Building Menu \n"
"You must select a number from 1 to 1.\n"
"Type 'exit' if you do not wish to make a selection at this time.\n"
"For details on a given choice, type 'describe X' (or '? X') where\n"
"X is the option about which you would like further details.\n",
Player->caughtMessage());
}

/////////////////////////////////////////////////////////////////////////////
void CorrectlyDisplaysSectionMenu()
{

}
@@ -78,7 +78,6 @@ void TopLevelMenuWithoutAnyPrereqsMetDisplaysCorrectly()
Player->caughtMessage());
}


/////////////////////////////////////////////////////////////////////////////
void CanSelectConstructBuildings()
{
@@ -227,7 +226,7 @@ void CanSelectFromConstructComponentMenu()
}

/////////////////////////////////////////////////////////////////////////////
void CorrectlyDisplayCastleWithPreVuiltComponents()
void CorrectlyDisplayCastleWithPreBuiltComponents()
{
Player->buildDomainUpgrade("argalach castle", "keep", "stone keep");
Player->buildDomainUpgrade("argalach castle", "northwest tower", "mage northwest tower");
@@ -304,30 +303,50 @@ void CorrectlyDisplayCastleWithPreVuiltComponents()
}

/////////////////////////////////////////////////////////////////////////////
void CorrectlyDisplaysWorkerMenu()
void CorrectlyRevertsToTopLevelMenuOnCompletion()
{
Selector->initiateSelector(Player);
Player->buildDomainUpgrade("argalach castle", "northwest tower",
"archer's northwest tower");

command("4", Player);
command("1", Player);
command("1", Player);
Player->resetCatchList();
command("5", Player);
command("7", Player);

ExpectEq("Building Projects - Main Menu:\n"
"From this menu, you can select the workers who will be executing your Archer's\n"
"Tower project in your holdings at Argalach Castle.\n"
"\n"
"[1] - Exit Building Menu \n"
"You must select a number from 1 to 1.\n"
"From this menu, you can initiate, modify, or abort projects in your holdings\n"
"at Argalach Castle.\n\n"
" \n"
" ...... ......... ...... \n"
" . .............. .............. . \n"
" . .?. ......... .?. . \n"
" .. ... ... .. \n"
" . .. +====+ ... ...... .. . \n"
" . ?. |+--+|....... ........ . .? . \n"
" . .. |+--+ .?. .?. . .. . \n"
" . += ... ... .. . \n"
" . . .. .. . . \n"
" .... . ?. ......... .? . .... \n"
" . . . .. . . .. . . . \n"
" . . ... . . ... . . \n"
" . . ... . . ... . . \n"
" . . . .. ......... .. . . . \n"
" .... . ?. .? . .... \n"
" . . .. .. . . \n"
" . .. ... ... .. . \n"
" . .. . .?. .?. . .. . \n"
" . ?. . ........ ........ . .? . \n"
" . .. ...... ... ...... .. . \n"
"[1] - Construct Building .. ... ... .. \n"
"[2] - Construct Keep . .?. ......... .?. . \n"
"[3] - Construct Moat . .............. .............. . \n"
"[4] - Construct Tower ...... ......... ...... \n"
"[5] - Construct Wall \n"
"[6] - Exit Building Projects Menu\n"
"You must select a number from 1 to 6.\n"
"Type 'exit' if you do not wish to make a selection at this time.\n"
"For details on a given choice, type 'describe X' (or '? X') where\n"
"X is the option about which you would like further details.\n",
Player->caughtMessage());
}

/////////////////////////////////////////////////////////////////////////////
void CorrectlyDisplaysSectionMenu()
{

}

0 comments on commit efd7d0d

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