Navigation Menu

Skip to content

Commit

Permalink
Merged PR 915: 1065_support_native_mode
Browse files Browse the repository at this point in the history
Related work items: #1065
  • Loading branch information
Allen B. Cummings committed Apr 13, 2021
1 parent cf95071 commit 5250c8f
Show file tree
Hide file tree
Showing 63 changed files with 344 additions and 484 deletions.
7 changes: 2 additions & 5 deletions lib/commands/baseCommand.c
Expand Up @@ -22,12 +22,9 @@ public void SetupCommand()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
{
SetupCommand();
}
SetupCommand();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
13 changes: 5 additions & 8 deletions lib/commands/commandRegistry.c
Expand Up @@ -93,15 +93,12 @@ public nomask int isInitialized()
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg)
{
commands = ([]);
registerPlayerCommands();
registerWizardCommands();
IsInitialized = 1;
}
commands = ([]);
registerPlayerCommands();
registerWizardCommands();
IsInitialized = 1;
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 2 additions & 5 deletions lib/core/baseSelector.c
Expand Up @@ -31,12 +31,9 @@ public void InitializeSelector()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
{
InitializeSelector();
}
InitializeSelector();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
15 changes: 6 additions & 9 deletions lib/core/stateMachine.c
Expand Up @@ -16,16 +16,13 @@ protected void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
{
InitialState = "";
CurrentState = "default";
stateActors = ({});
stateTree = ([]);
Setup();
}
InitialState = "";
CurrentState = "default";
stateActors = ({});
stateTree = ([]);
Setup();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
9 changes: 3 additions & 6 deletions lib/dictionaries/attacks/baseAttack.c
Expand Up @@ -216,11 +216,8 @@ public void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
{
initialized = 1;
Setup();
}
initialized = 1;
Setup();
}
11 changes: 4 additions & 7 deletions lib/dictionaries/backgrounds/baseBackground.c
Expand Up @@ -11,15 +11,12 @@ protected void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
if (!SetupCompleted)
{
if (!SetupCompleted)
{
Setup();
SetupCompleted = 1;
}
Setup();
SetupCompleted = 1;
}
}

Expand Down
13 changes: 5 additions & 8 deletions lib/dictionaries/environmentDictionary.c
Expand Up @@ -529,15 +529,12 @@ private nomask void calculateTimeOfDay()
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg)
{
loadEnvironmentalData();
calculateSeason();
calculateTimeOfDay();
advanceTime();
}
loadEnvironmentalData();
calculateSeason();
calculateTimeOfDay();
advanceTime();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 2 additions & 5 deletions lib/dictionaries/groups/baseGroup.c
Expand Up @@ -21,12 +21,9 @@ protected void applyGroupDetails()
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg)
{
applyGroupDetails();
}
applyGroupDetails();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 2 additions & 5 deletions lib/dictionaries/partyDictionary.c
Expand Up @@ -179,10 +179,7 @@ public nomask void acceptPartyRequest(object target)
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg)
{
PersistentParties = partyService->loadPartyList();
}
PersistentParties = partyService->loadPartyList();
}
21 changes: 12 additions & 9 deletions lib/environment/environment.c
Expand Up @@ -171,16 +171,8 @@ public void init()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void reset()
{
if (!arg)
{
if (!SetupCompleted)
{
Setup();
SetupCompleted = 1;
}
}
object shopObj = getShop();
if (objectp(shopObj))
{
Expand All @@ -189,6 +181,17 @@ public void reset(int arg)
createStateObjects();
}

/////////////////////////////////////////////////////////////////////////////
public nomask void create()
{
if (!SetupCompleted)
{
Setup();
SetupCompleted = 1;
}
reset();
}

/////////////////////////////////////////////////////////////////////////////
public int moveFromIsAllowed(object user, object fromLocation)
{
Expand Down
43 changes: 23 additions & 20 deletions lib/environment/environmentalElement.c
Expand Up @@ -55,29 +55,11 @@ public string Type()
}

/////////////////////////////////////////////////////////////////////////////
public void Setup()
public nomask void reset()
{
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
{
if (!arg)
{
if (!elementName)
{
Setup();
}

if (getDictionary("environment") && stringp(elementName) &&
!getDictionary("environment")->isValidEnvironmentItem(elementName))
{
getDictionary("environment")->registerElement(program_name(this_object()));
}
}

object *harvestItems = m_values(
filter(harvestData, (: $1 == $2->name() :)));

if (sizeof(harvestItems))
{
foreach(object harvestItem in harvestItems)
Expand All @@ -98,6 +80,27 @@ public nomask void reset(int arg)
}
}

/////////////////////////////////////////////////////////////////////////////
public void Setup()
{
}

/////////////////////////////////////////////////////////////////////////////
public nomask void create()
{
if (!elementName)
{
Setup();
}

if (getDictionary("environment") && stringp(elementName) &&
!getDictionary("environment")->isValidEnvironmentItem(elementName))
{
getDictionary("environment")->registerElement(program_name(this_object()));
}
reset();
}

/////////////////////////////////////////////////////////////////////////////
private nomask string translateStringToLanguage(string text, string language)
{
Expand Down
7 changes: 6 additions & 1 deletion lib/environment/legacyRoomConverter.c
Expand Up @@ -93,7 +93,12 @@ public void set_terrain(string terrain)
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
}

/////////////////////////////////////////////////////////////////////////////
public void reset()
{
}

Expand Down
4 changes: 2 additions & 2 deletions lib/environment/region.c
Expand Up @@ -229,9 +229,9 @@ public void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg && !setupCompleted)
if (!setupCompleted)
{
Setup();
setupCompleted = 1;
Expand Down
7 changes: 2 additions & 5 deletions lib/items/item.c
Expand Up @@ -63,12 +63,9 @@ protected void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
{
Setup();
}
Setup();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
11 changes: 4 additions & 7 deletions lib/modules/conversations/baseConversation.c
Expand Up @@ -21,15 +21,12 @@ protected void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
if (!SetupCompleted)
{
if (!SetupCompleted)
{
Setup();
SetupCompleted = 1;
}
Setup();
SetupCompleted = 1;
}
}

Expand Down
13 changes: 5 additions & 8 deletions lib/modules/domains/domainResearchItem.c
Expand Up @@ -95,13 +95,10 @@ protected void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public void create()
{
if (!arg)
{
addSpecification("type", "domain");
addSpecification("scope", "domain");
addSpecification("effect", "strategic");
Setup();
}
addSpecification("type", "domain");
addSpecification("scope", "domain");
addSpecification("effect", "strategic");
Setup();
}
7 changes: 2 additions & 5 deletions lib/modules/factions/baseFaction.c
Expand Up @@ -12,12 +12,9 @@ protected void Setup()
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg)
{
Setup();
}
Setup();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
21 changes: 9 additions & 12 deletions lib/modules/guilds/baseGuild.c
Expand Up @@ -134,21 +134,18 @@ public void SetupGuild()
}

/////////////////////////////////////////////////////////////////////////////
public nomask void reset(int arg)
public nomask void create()
{
if (!arg)
if (guildName == "BaseGuild")
{
if (guildName == "BaseGuild")
{
SetupGuild();
}
SetupGuild();
}

object guildDictionary = getDictionary("guilds");
if (guildDictionary && (guildName != "BaseGuild") &&
(member(guildDictionary->validGuilds(), guildName) == -1))
{
guildDictionary->registerGuild(program_name(this_object()));
}
object guildDictionary = getDictionary("guilds");
if (guildDictionary && (guildName != "BaseGuild") &&
(member(guildDictionary->validGuilds(), guildName) == -1))
{
guildDictionary->registerGuild(program_name(this_object()));
}
}

Expand Down
11 changes: 4 additions & 7 deletions lib/modules/quests/questItem.c
Expand Up @@ -63,14 +63,11 @@ private object configuration =
// "is final state": "failure",

/////////////////////////////////////////////////////////////////////////////
public void reset(int arg)
public nomask void create()
{
if (!arg)
{
Name = 0;
Description = "";
stateMachine::reset(arg);
}
Name = 0;
Description = "";
stateMachine::create();
}

/////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 5250c8f

Please sign in to comment.