From: Laszlo T. <ave...@us...> - 2005-06-23 20:17:33
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1581 Modified Files: Actions.cpp Actor.cpp Game.cpp Log Message: Incrementing death variable on actor's death incrementing 'chapter' to 0 first. Commented out most of TextArea action, it will be written in Python Index: Actor.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Actor.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** Actor.cpp 20 Jun 2005 17:15:25 -0000 1.110 --- Actor.cpp 23 Jun 2005 20:17:22 -0000 1.111 *************** *** 266,270 **** Color* color; if (Modified[IE_UNSELECTABLE]) { ! color = &magenta; } else if (GetMod(IE_MORALE)<0) {//if current morale < the max morale ? color = &yellow; --- 266,270 ---- Color* color; if (Modified[IE_UNSELECTABLE]) { ! color = &magenta; } else if (GetMod(IE_MORALE)<0) {//if current morale < the max morale ? color = &yellow; *************** *** 653,662 **** ClearActions(); if (InternalFlags&IF_GIVEXP) { //give experience to party ! core->GetGame()->ShareXP(GetStat(IE_XPVALUE), true ); //handle reputation here // } DropItem("",0); //remove all effects that are not 'permanent after death' here --- 653,684 ---- ClearActions(); + Game *game = core->GetGame(); if (InternalFlags&IF_GIVEXP) { //give experience to party ! game->ShareXP(GetStat(IE_XPVALUE), true ); //handle reputation here // } + if (KillVar[0]) { + if (core->HasFeature(GF_HAS_KAPUTZ) ) { + ieDword value = 0; + + game->kaputz->Lookup(KillVar, value); + game->kaputz->SetAt(KillVar, value+1); + } else { + ieDword value = 0; + + game->locals->Lookup(KillVar, value); + game->locals->SetAt(KillVar, value+1); + } + } else { + char varname[33]; + ieDword value = 0; + + snprintf(varname, 32, "SPRITE_IS_DEAD%s", scriptName); + game->locals->Lookup(varname, value); + game->locals->SetAt(KillVar, value+1); + } + DropItem("",0); //remove all effects that are not 'permanent after death' here Index: Actions.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Actions.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Actions.cpp 22 Jun 2005 15:55:24 -0000 1.6 --- Actions.cpp 23 Jun 2005 20:17:22 -0000 1.7 *************** *** 2427,2430 **** --- 2427,2431 ---- void GameScript::TextScreen(Scriptable* /*Sender*/, Action* parameters) { + /* int chapter; ieDword line; *************** *** 2448,2452 **** TableMgr *table = core->GetTable(chapter); ! strnuprcpy(core->GetGame()->LoadMos, table->QueryField(0xffffffff),8); GameControl *gc=core->GetGameControl(); if (gc) { --- 2449,2454 ---- TableMgr *table = core->GetTable(chapter); ! strnuprcpy(core->GetGame()->LoadMos, table->QueryField(),8); ! GameControl *gc=core->GetGameControl(); if (gc) { *************** *** 2455,2458 **** --- 2457,2461 ---- core->DisplayString(str); free(str); + int cols = table->GetColumnCount(line); strref = table->QueryField(line, 1); str=core->GetString( strtol(strref,NULL,0) ); *************** *** 2461,2464 **** --- 2464,2469 ---- } core->DelTable(chapter); + */ + strnuprcpy(core->GetGame()->LoadMos, parameters->string0Parameter,8); core->GetGUIScriptEngine()->RunFunction( "StartTextScreen" ); } Index: Game.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Game.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Game.cpp 22 Jun 2005 21:21:15 -0000 1.80 --- Game.cpp 23 Jun 2005 20:17:22 -0000 1.81 *************** *** 696,708 **** void Game::IncrementChapter() { ! //clear statistics ! for (unsigned int i=0; i<PCs.size(); i++) { //all PCs must have this! PCs[i]->PCStats->IncrementChapter(); } - ieDword chapter = 0; - locals->Lookup("CHAPTER",chapter); - locals->SetAt("CHAPTER",chapter+1); } --- 696,708 ---- void Game::IncrementChapter() { ! //chapter first set to 0 (prologue) ! ieDword chapter = (ieDword) -1; ! locals->Lookup("CHAPTER",chapter); ! locals->SetAt("CHAPTER",chapter+1); ! //clear statistics for (unsigned int i=0; i<PCs.size(); i++) { //all PCs must have this! PCs[i]->PCStats->IncrementChapter(); } } |