From: Jens G. <fi...@us...> - 2013-01-05 17:38:49
|
gemrb: Infinity Engine emulator The branch master has been updated via 6c6f233c28dd198f1ac255aca9acdd46f471a759 (commit) via 730f6592b75d6659370e2e036d6b8fa26af5272c (commit) Summary of changes: gemrb/GUIScripts/GUIREC.py | 6 +++--- gemrb/GUIScripts/TextScreen.py | 17 ++++++++++++++--- gemrb/core/Game.cpp | 39 +++++++++++++++++++++++++++++++++++++-- gemrb/core/Game.h | 1 + 4 files changed, 55 insertions(+), 8 deletions(-) from 03b20bf51334f5a4cc4092ea580f742fd2fff555 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=6c6f233c28dd198f1ac255aca9acdd46f471a759 commit 6c6f233c28dd198f1ac255aca9acdd46f471a759 Author: Jens Granseuer <je...@gm...> Date: Sat Jan 5 18:36:27 2013 +0100 bg1: add support for dream sequences diff --git a/gemrb/GUIScripts/TextScreen.py b/gemrb/GUIScripts/TextScreen.py index cd36ce5..e229ea9 100644 --- a/gemrb/GUIScripts/TextScreen.py +++ b/gemrb/GUIScripts/TextScreen.py @@ -34,21 +34,28 @@ def FindTextRow (Table): #this is still not the full implementation, but the original engine never used this stuff Row = Table.GetRowIndex("DEFAULT") if Table.GetValue (Row, 1)== -1: - Row = Table.GetRowIndex("GOOD_REPUTATION") + if GemRB.GameGetReputation() >= 100: + Row = Table.GetRowIndex("GOOD_REPUTATION") + else: + Row = Table.GetRowIndex("BAD_REPUTATION") return def StartTextScreen (): global TextScreen, TextArea, Chapter, TableName, Row GemRB.GamePause (1, 3) - GemRB.DisplayString (17556, 0xff0000) #Paused for chapter text + + LoadPic = TableName = GemRB.GetGameString (STR_LOADMOS) + if TableName[:6] == "drmtxt": + GemRB.DisplayString (17558, 0xff0000) #Paused for rest + else: + GemRB.DisplayString (17556, 0xff0000) #Paused for chapter text if GUICommon.GameIsIWD2(): GemRB.LoadWindowPack ("GUICHAP", 800, 600) else: GemRB.LoadWindowPack ("GUICHAP", 640, 480) - LoadPic = TableName = GemRB.GetGameString (STR_LOADMOS) #if there is no preset loadpic, try to determine it from the chapter #fixme: we always assume there isn't for non-bg2 if GUICommon.GameIsBG2(): @@ -59,6 +66,8 @@ def StartTextScreen (): EndTextScreen () return ID = 62 + elif TableName[:6] == "drmtxt": + ID = 50 + (GemRB.GetGameVar("DREAM") & 0x7fffffff) else: ID = GemRB.GetGameVar("CHAPTER") & 0x7fffffff Chapter = ID + 1 @@ -114,6 +123,8 @@ def StartTextScreen (): Button.SetText (16510) Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, ReplayTextScreen) + #if this was opened from somewhere other than game control close that window + GUICommon.CloseOtherWindow(None) GemRB.HideGUI () GUICommon.GameWindow.SetVisible(WINDOW_INVISIBLE) #removing the gamecontrol screen TextScreen.SetVisible (WINDOW_VISIBLE) diff --git a/gemrb/core/Game.cpp b/gemrb/core/Game.cpp index b002a0c..f1163c5 100644 --- a/gemrb/core/Game.cpp +++ b/gemrb/core/Game.cpp @@ -1508,6 +1508,38 @@ void Game::PlayerDream() delete( gs ); } +//Start a TextScreen dream for the protagonist +void Game::TextDream() +{ + ieDword dream, chapter; + locals->Lookup("CHAPTER", chapter); + if (!locals->Lookup("DREAM", dream)) { + dream = 1; + } + snprintf(LoadMos, sizeof(ieResRef)-1, "drmtxt%d", dream+1); + if ((chapter > dream) && (core->Roll(1, 100, 0) <= 33) + && gamedata->Exists(LoadMos, IE_2DA_CLASS_ID)) { + + // give innate spell to protagonist + AutoTable drm(LoadMos); + if (drm) { + const char *repLabel; + if (Reputation >= 100) + repLabel = "GOOD_POWER"; + else + repLabel = "BAD_POWER"; + int row = drm->GetRowIndex(repLabel); + if (row != -1) { + Actor *actor = GetPC(0, false); + actor->LearnSpell(drm->QueryField(row, 0), LS_MEMO|LS_LEARN); + } + } + + locals->SetAt("DREAM", dream+1); + core->SetEventFlag(EF_TEXTSCREEN); + } +} + //noareacheck = no random encounters //dream = 0 - based on area non-0 - select from list //-1 no dream @@ -1604,11 +1636,14 @@ void Game::RestParty(int checks, int dream, int hp) return; } - //movie and cutscene dreams + //movie, cutscene, and still frame dreams if (dream>=0) { //cutscene dreams - if (gamedata->Exists("player1d",IE_BCS_CLASS_ID, true)) + if (gamedata->Exists("player1d",IE_BCS_CLASS_ID, true)) { PlayerDream(); + } else if (gamedata->Exists("drmtxt2", IE_2DA_CLASS_ID, true)) { + TextDream(); + } //select dream based on area ieResRef *movie; diff --git a/gemrb/core/Game.h b/gemrb/core/Game.h index c6e4749..0133623 100644 --- a/gemrb/core/Game.h +++ b/gemrb/core/Game.h @@ -502,6 +502,7 @@ private: bool DetermineStartPosType(const TableMgr *strta); ieResRef *GetDream(Map *area); void PlayerDream(); + void TextDream(); }; } http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=730f6592b75d6659370e2e036d6b8fa26af5272c commit 730f6592b75d6659370e2e036d6b8fa26af5272c Author: Jens Granseuer <je...@gm...> Date: Sat Jan 5 14:08:05 2013 +0100 bg1 doesn't have a resistances strref diff --git a/gemrb/GUIScripts/GUIREC.py b/gemrb/GUIScripts/GUIREC.py index 83ffdba..905dfc2 100644 --- a/gemrb/GUIScripts/GUIREC.py +++ b/gemrb/GUIScripts/GUIREC.py @@ -602,10 +602,10 @@ def GetStatOverview (pc, LevelDiff=[0,0,0]): # only bg2 displayed all the resistances, but it is useful information # Resistances - if GUICommon.GameIsIWD1(): + if GUICommon.GameIsBG2(): + stats.append(32204) + elif not GUICommon.GameIsBG1(): stats.append (15544) - else: - stats.append (32204) # 32213 Normal Fire # 32222 Magic Fire # 32214 Normal Cold ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |