-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame_Screen_Scenario.c
140 lines (123 loc) · 4.44 KB
/
Game_Screen_Scenario.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include "Xinaga.h"
#include "GameData.h"
#if defined(__APPLE2__)
#pragma code-name (push, "LC")
#endif
#if defined (__NES__)
#pragma code-name (push, "SCENARIO")
#pragma rodata-name (push, "SCENARIO")
//#pragma data-name (push, "XRAM")
//#pragma bss-name (push, "XRAM")
#endif
byte QuestOrigin;
byte QuestType;
byte QuestGiver;
byte QuestTarget;
byte QuestLocation;
//Quests are like stars in Mario 64
//Each world is like a level, each continent/quest is like a star
//100 coin star?
const char* const questOrigin[4] = { "the castle", "a tavern rumor", "your library studies", "a dream at the inn"};
//Map Location Types (rule of fours, four tileset variations of each of four options)
//Primary Settlement:
// Castle
// City
// Seaport
// Outpost
//Secondary Settlement:
// Village
// Library Scholar Library, Wizard's Collection, War Records, Ruined Archive
// Inn
// Abandoned Cabin
//Dungeon: Cavern
// Tower
// Ruins
// Portal Crystal Rift, Nightmare, Clouds, Lunar
//Landmark: Forrest Open Fields, Dense Woods, Swamp, Giant Stump
// Seaside Dock, Beach, Waterfall, Lake
// Shipwreck Ship, Airship, Siege Engine, Leviathan Fossil
// Tomb Pyramid, Crypt, Graveyard, Catacombs
const char* const questGiver[4][4] = {
/*Castle*/ {"King", "Blacksmith", "Guildmaster", "Council"},
/*Town Tavern*/ {"Innkeeper", "Shadow", "Guildmaster", "People"},
/*Library Book*/ {"History Book", "Librarian", "Scholar", "Shadow"},
/*Dream*/ {"Statue", "Spirit", "Animal", "Wise Tree"}
};
const char* const questType[6] = { "kill", "retrieve", "map out", "solve a puzzle in", "visit", "play cards with"};
const char* const questTarget[6][4] = { //Point of Interest
/*Kill*/ {"Dragon", "Vampire", "Wizard", "Owlbear"},
/*Retrieve*/ {"Scroll", "Gauntlet", "Orb", "Artifact"},
/*Explore*/ {"Cavern", "Hidden Cellar", "Burial Site", "Treasure Room"},
/*PuzzleSolve*/ {"Crypt", "Shipwreck", "Magic Device", "Steam Device"},
/*Visit*/ {"Crypt", "Water's Edge", "Monument", "Wise Tree"},
/*PlayCards*/ {"Shadow", "Lost Knight", "Animal", "Wizard"}
};
const char* const questLocation[6][4] = { //Map Location
/*Kill*/ {"Forrest", "Dungeon", "Dwarven Tower", "Wormhole"},
/*Retrieve*/ {"Archive", "Dungeon", "Oubliette", "Dwarven Tower"},
/*Explore*/ {"Siege Engine", "Archive", "Dwarven Tower", "Wormhole"},
/*PuzzleSolve*/ {"Clock Tower", "Library", "Siege Engine", "Windmill"},
/*Visit*/ {"Ruins", "Lake", "Open Plains", "Forrest"},
/*Play Cards*/ {"Castle", "Forrest", "Wormhole", "Tavern"}
};
void setSeed(uint16_t seed)
{
srand(seed);
srand (rand());
}
void GenerateContinent()
{
QuestOrigin = rand() % 4;
QuestType = rand() % 6;
QuestGiver = rand() % 4;
QuestTarget = rand() % 4;
QuestLocation = rand() % 4;
sprintf(strTemp, "In %s, the %s asks you to %s the %s at the %s@", questOrigin[QuestOrigin], questGiver[QuestOrigin][QuestGiver], questType[QuestType], questTarget[QuestType][QuestTarget], questLocation[QuestType][QuestLocation]);
WriteLineMessageWindow(strTemp, 1);
WriteLineMessageWindow("@", 0);
//Add Landmarks
//Landmark 1 - Quest Origin
//Landmark 2 - Quest Destination (Is this the same as the origin?)
//Landmark 3 - Do we have a town/castle yet? Else random non-town; Ensure we have a ferry station to reach next continent
//Landmark 4 - Do we have a dungeon yet? Else small outpost/encampment; Ensure we have somewhere to grind for exp/resources
//Landmark 5 - Do we have an interesting non-combat area?
//Random number 0-3 for additional dungeons/non-combat locations
}
screenName Update_Scenario()
{
bool exit = false;
uint16_t scenarioSeed = 0;
ResizeMessageWindow(consolePosX, consolePosY, consoleWidth, consoleHeight);
{
ResetMenu("@", contextMenuPosX, contextMenuPosY, contextMenuWidth, contextMenuHeight, selectionCount);
SetMenuItem(0, "Next@");
SetMenuItem(1, "Last@");
SetMenuItem(2, "Go@");
SetMenuItem(3, "End@");
while (!exit)
{
sprintf(strTemp, "Continent: %u @", scenarioSeed);
SetLineMessageWindow(strTemp, 0);
switch (GetMenuSelection())
{
case 0:
++scenarioSeed;
break;
case 1:
--scenarioSeed;
break;
case 2:
setSeed(scenarioSeed);
GenerateContinent();
++randseed;
break;
case 3:
exit = true;
break;
default:
break;
}
}
}
return EditParty;
}