Skip to content

Commit

Permalink
#68 Prolog implementiert
Browse files Browse the repository at this point in the history
  • Loading branch information
romman8 committed Jan 14, 2018
1 parent de48c1a commit bd49cad
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Koramu/Koramu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@
<None Include="Scripts\Objects\Doors\ownHouseDoorExit.lua" />
<None Include="Scripts\Objects\NPCs\littleGirl.lua" />
<None Include="Scripts\Objects\player.lua" />
<None Include="Scripts\Quests\prologue\prologue.lua" />
<None Include="Scripts\Quests\prologue\startGame.lua" />
<None Include="Scripts\test\npc1.lua" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
9 changes: 9 additions & 0 deletions Koramu/Koramu.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<Filter Include="Lua Skripts\Quests\prologue">
<UniqueIdentifier>{3a6c60b8-2f92-4942-ac03-53c15cae6a8a}</UniqueIdentifier>
</Filter>
<Filter Include="Lua Skripts\Quests\fixWatch">
<UniqueIdentifier>{066a35a5-68c4-4a1a-9cbe-90fc3d172797}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
Expand Down Expand Up @@ -588,5 +591,11 @@
<None Include="Scripts\Objects\NPCs\littleGirl.lua">
<Filter>Lua Skripts\Objects\NPCs</Filter>
</None>
<None Include="Scripts\Quests\prologue\prologue.lua">
<Filter>Lua Skripts\Quests\prologue</Filter>
</None>
<None Include="Scripts\Quests\prologue\startGame.lua">
<Filter>Lua Skripts\Quests\prologue</Filter>
</None>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Koramu/PlayState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void FiniteStateMachine::PlayState::onEnter()
i->onCreate();
}

// Die Funktion onGameStart der Quest wird aufgerufen (es wird nicht empfohlen onGameStart tatsächlich für eine QUest zu implementieren)
// Die Funktion onGameStart der Quest wird aufgerufen (es wird nicht empfohlen onGameStart tatsächlich für eine Quest zu implementieren)
TheScriptManager::Instance()->getScriptById(TheGame::Instance()->getStory()->getPartQuest()).callFunction("onGameStart");

TheGame::Instance()->logStandard() << "Der 'PlayState' wurde betreten." << std::endl << std::endl;
Expand Down
25 changes: 25 additions & 0 deletions Koramu/Scripts/Quests/prologue/prologue.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- prologue.lua

--[[
prologue ist die allererste Quest im Spiel.
Sie endet sobald der Spieler sich aus seinem Haus (ownHouse) begibt.
]]--

local prologue = {}

function prologue:onStart ()
TheGame:addNote ("It has been two days since I have left London in order to visit my uncle's estate in X. He died at young age - for unknown reasons - having left no heir but me to take")
TheGame:addNote ("care of his properties. However, I don't consider the possibility of leading a peaceful and quiet life at my uncle's estate worth giving up my occupation as a detective for Scotland")
TheGame:addNote ("Yard. For the small, sleepy town his villa is located in, is way too quiet for my taste. Since my arival at X in the morning I have not met a single person. Even more")
TheGame:addNote ("disturbing is the fact, that in the very moment my coach passed the first building of this town, my watch stopped. Although I am not the superstitious kind of man,")
TheGame:addNote ("I still feel that behind those closed curtains and locked doos something is going terribly wrong.")
-- Das Notizbuch wird geöffnet
TheGame:openNotebook ()
end


function prologue:onDone ()

end

return prologue
15 changes: 15 additions & 0 deletions Koramu/Scripts/Quests/prologue/startGame.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- startGame.lua
--[[
Diese Quest ist direkt abgeschlossen, damit
onStart der ersten Quest aufgerufen werden kann.
Es wird lediglich die Map des eigenen hauses aufgestapelt.
]]--

local startGame = {}

function startGame:onGameStart ()
TheGame:enterMap ("ownHouse")
TheGame:nextQuest ()
end

return startGame
6 changes: 5 additions & 1 deletion Koramu/xmlFiles/quests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<quests>
<mainQuest id="prologue">
<partQuest id="firstDoNothingQuest"/>
<partQuest id="startGame"/>
<partQuest id="prologue"/>
</mainQuest>
<mainQuest id="fixWatch">
<partQuest id="findClockMaker1"/>
</mainQuest>
</quests>
2 changes: 1 addition & 1 deletion Koramu/xmlFiles/save.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<saveState>
<questState mainQuest="prologue" partQuest="firstDoNothingQuest"/>
<questState mainQuest="prologue" partQuest="startGame"/>
<mapStack>
<activeMap mapId="mainMap"/>
</mapStack>
Expand Down
2 changes: 2 additions & 0 deletions Koramu/xmlFiles/scripts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

<!--Quests-->
<!--mainQuest: prologue-->
<script id="startGame" path="Scripts/Quests/prologue/startGame.lua"/>
<script id="prologue" path="Scripts/Quests/prologue/prologue.lua"/>

<!--Items-->
<script id="itemList" path="Scripts/Inventory/itemList.lua"/>
Expand Down
2 changes: 1 addition & 1 deletion Koramu/xmlFiles/states.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<play>
<gameObjects>
<gameObject type="player" textureId="player"
xPos="1000" yPos="545" width="70" height="180"
xPos="1472" yPos="441" width="70" height="180"
numRows="4" numCols="4"
mapId="mainMap" animSpeed="200"
uniqueId="player"/>
Expand Down

0 comments on commit bd49cad

Please sign in to comment.