Skip to content
Permalink
Browse files

Merged PR 453: 559_displayMessage

Fixed displayMessage

Related Work Items: #558, #559

Related work items: #558, #559
  • Loading branch information...
realms-mud committed Feb 26, 2019
1 parent 69069e6 commit b92a4d654c184c279cd2b9cb3587089cb10d5370
@@ -7,12 +7,6 @@
//*****************************************************************************
private string MaterialAttributes = "lib/modules/materialAttributes.c";

/////////////////////////////////////////////////////////////////////////////
private nomask string formatText(string text, int colorInfo, object viewer)
{
return color(viewer->query("term"), viewer, colorInfo, format(text, 78));
}

/////////////////////////////////////////////////////////////////////////////
private nomask int isValidAttacker(object attacker)
{
@@ -396,10 +390,8 @@ public nomask string parseTemplate(string template, string perspective,

/////////////////////////////////////////////////////////////////////////////
public nomask varargs void displayMessage(string message, object initiator,
object target)
object target, string textClass, string type)
{
// This annoying loop handles the fact that everyone has different
// setting for color.
if (environment(initiator))
{
object *characters = filter(all_inventory(environment(initiator)),
@@ -426,22 +418,27 @@ public nomask varargs void displayMessage(string message, object initiator,
parsedMessage = parseTemplate(message, "other",
initiator, target);
}
tell_object(person, format(parsedMessage, 78));

object configuration =
load_object("/lib/dictionaries/configurationDictionary.c");

tell_object(person, configuration->decorate(
format(parsedMessage, 78),
textClass, type, person->colorConfiguration()));
}
}
}
}

/////////////////////////////////////////////////////////////////////////////
public nomask void displayMessageToSelf(string message, object initiator)
public nomask string displayMessageToSelf(string message, object initiator)
{
string ret = message;

if (initiator && objectp(initiator))
{
string parsedMessage;

parsedMessage = parseTemplate(message, "initiator", initiator,
ret = parseTemplate(message, "initiator", initiator,
initiator);

tell_object(initiator, format(parsedMessage, 78));
}
return ret;
}
@@ -67,3 +67,4 @@ for details.

[Adding conversations to the creatures you make is discussed here.](conversations.md)


@@ -0,0 +1,13 @@
//*****************************************************************************
// Copyright (c) 2019 - Allen Cummings, RealmsMUD, All rights reserved. See
// the accompanying LICENSE file for details.
//*****************************************************************************
inherit "/lib/environment/features/baseFeature.c";

/////////////////////////////////////////////////////////////////////////////
public void Setup()
{
Name("road");

addDescriptionTemplate("a road");
}
@@ -23,6 +23,7 @@ private nosave string Yellow = "\x1b[0;33m%s\x1b[0m";
private nosave string Blue = "\x1b[0;34m%s\x1b[0m";
private nosave string Magenta = "\x1b[0;35m%s\x1b[0m";

/////////////////////////////////////////////////////////////////////////////
private nosave mapping decorators = ([
"dividers":([
"any": ([
@@ -0,0 +1,17 @@
//*****************************************************************************
// Copyright (c) 2019 - Allen Cummings, RealmsMUD, All rights reserved. See
// the accompanying LICENSE file for details.
//*****************************************************************************
virtual inherit "/lib/items/food.c";

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
{
if (!arg)
{
set("name", "Cucumber");
set("short", "Cucumber");
set("aliases", ({ "cucumber" }));
set("blueprint", "cucumber");
}
}
@@ -72,5 +72,3 @@ public nomask object getParty()
}
return ret;
}

//TODO [226]: To, in fact, do.
@@ -452,4 +452,4 @@ void DisplayPrerequisitesCorrectlyDisplaysPresenceWithPresencePrerequisites()

ExpectEq("\x1b[0;36mPrerequisites:\n\x1b[0m\x1b[0;36m Presence: \x1b[0m\x1b[0;35mFred\n\x1b[0m",
Prerequisite->displayPrerequisites(colorConfiguration, Configuration));
}
}
@@ -93,4 +93,4 @@ void CheckPrerequsistesCorrectlyHandlesRaceKillChecks()
foe->effectiveLevel(18);
Researcher->generateCombatStatistics(foe);
ExpectTrue(Prerequisite->checkPrerequisites(Researcher), "two orcs killed");
}
}
@@ -377,4 +377,4 @@ void AdminIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -367,4 +367,4 @@ void ApprenticeIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void ArchwizardIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void WizardIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void DemigodIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void ElderIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void GodIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void HighWizardIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void OwnerIsOwnerOfOtherClosed()
{
ExpectTrue(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectTrue(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -373,4 +373,4 @@ void PlayerIsNotOwnerOfOtherClosed()
{
ExpectFalse(Player->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Player->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void SageIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -377,4 +377,4 @@ void SeniorIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -387,4 +387,4 @@ void TrainingWizardIsNotOwnerOfOtherClosed()
{
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed"));
ExpectFalse(Wizard->hasOwnershipAccess("/players/fred/closed/blah.c"));
}
}
@@ -198,10 +198,8 @@ public int placeRune(string rune)
load_object("/lib/dictionaries/configurationDictionary.c");

object messageParser = load_object("/lib/core/messageParser.c");
messageParser->displayMessage(configuration->decorate(
sprintf(msg, whichRune),
"rune wall", "tutorial", this_player()->colorConfiguration()),
this_player());
messageParser->displayMessage(sprintf(msg, whichRune), this_player(), 0,
"rune wall", "tutorial");

if (whichRune == "resistance")
{

0 comments on commit b92a4d6

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