From: Laszlo T. <ave...@us...> - 2004-08-18 21:55:51
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19785 Modified Files: Game.cpp Game.h GameScript.cpp GameScript.h Interface.cpp Interface.h Log Message: Some more scripting actions: QuitGame, PlaySoundNoRange, StopMoving, etc. Index: GameScript.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.h,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** GameScript.h 18 Aug 2004 21:18:28 -0000 1.129 --- GameScript.h 18 Aug 2004 21:55:35 -0000 1.130 *************** *** 1075,1079 **** --- 1075,1081 ---- static void PlaySong(Scriptable* Sender, Action* parameters); static void PlaySound(Scriptable* Sender, Action* parameters); + static void PlaySoundNotRanged(Scriptable* Sender, Action* parameters); static void PlaySoundPoint(Scriptable* Sender, Action* parameters); + static void QuitGame(Scriptable* Sender, Action* parameters); static void RealSetGlobalTimer(Scriptable* Sender, Action* parameters); static void Recoil(Scriptable* Sender, Action* parameters); *************** *** 1136,1139 **** --- 1138,1142 ---- static void StartMovie(Scriptable* Sender, Action* parameters); static void StartSong(Scriptable* Sender, Action* parameters); + static void StopMoving(Scriptable* Sender, Action* parameters); static void StorePartyLocation(Scriptable *Sender, Action* parameters); static void Swing(Scriptable* Sender, Action* parameters); Index: Interface.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.h,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Interface.h 12 Aug 2004 23:26:38 -0000 1.109 --- Interface.h 18 Aug 2004 21:55:35 -0000 1.110 *************** *** 339,343 **** GameControl *GetGameControl(); ! void QuitGame(); void LoadGame(int index); /*reads the filenames of the sounds folder into a list */ --- 339,343 ---- GameControl *GetGameControl(); ! void QuitGame(bool backtomain); void LoadGame(int index); /*reads the filenames of the sounds folder into a list */ Index: Game.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Game.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Game.cpp 7 Aug 2004 00:46:59 -0000 1.54 --- Game.cpp 18 Aug 2004 21:55:19 -0000 1.55 *************** *** 492,496 **** continue; } ! PCs[i]->NewStat(IE_XP,xp,0); } //core->DisplayConstantString(); //you have gained ... xp --- 492,496 ---- continue; } ! PCs[i]->NewStat(IE_XP,xp,MOD_ADDITIVE); } //core->DisplayConstantString(); //you have gained ... xp *************** *** 546,547 **** --- 546,553 ---- } + void Game::ReputationAltered() + { + for(unsigned int i=0; i<PCs.size(); i++) { + PCs[i]->NewStat(IE_REPUTATION, Reputation, MOD_ABSOLUTE); + } + } Index: GameScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.cpp,v retrieving revision 1.182 retrieving revision 1.183 diff -C2 -d -r1.182 -r1.183 *** GameScript.cpp 18 Aug 2004 21:18:27 -0000 1.182 --- GameScript.cpp 18 Aug 2004 21:55:35 -0000 1.183 *************** *** 283,286 **** --- 283,287 ---- {"deactivate", GameScript::Deactivate,0}, {"debug", GameScript::Debug,0}, + {"debugoutput", GameScript::Debug,0}, {"destroyalldestructableequipment", GameScript::DestroyAllDestructableEquipment,0}, {"destroyallequipment", GameScript::DestroyAllEquipment,0}, *************** *** 398,402 **** --- 399,405 ---- {"playsong", GameScript::PlaySong,0}, {"playsound", GameScript::PlaySound,0}, + {"playsoundnotranged", GameScript::PlaySoundNotRanged,0}, {"playsoundpoint", GameScript::PlaySoundPoint,0}, + {"quitgame", GameScript::QuitGame, 0}, {"realsetglobaltimer", GameScript::RealSetGlobalTimer,AF_MERGESTRINGS}, {"recoil", GameScript::Recoil,0}, *************** *** 408,411 **** --- 411,416 ---- {"removepaladinhood", GameScript::RemovePaladinHood,0}, {"removerangerhood", GameScript::RemoveRangerHood,0}, + {"reputationinc", GameScript::ReputationInc,0}, + {"reputationset", GameScript::ReputationSet,0}, {"restorepartylocations", GameScript:: RestorePartyLocation,0}, //this is in iwd2, same as movetosavedlocation, with a default variable *************** *** 474,477 **** --- 479,483 ---- {"startmovie", GameScript::StartMovie,AF_BLOCKING}, {"startsong", GameScript::StartSong,0}, + {"stopmoving", GameScript::StopMoving,0}, {"storepartylocations", GameScript::StorePartyLocation,0}, {"stuffglobalrandom", GameScript::SetGlobalRandom,0}, *************** *** 5594,5597 **** --- 5600,5609 ---- } + void GameScript::PlaySoundNotRanged(Scriptable* Sender, Action* parameters) + { + printf( "PlaySound(%s)\n", parameters->string0Parameter ); + core->GetSoundMgr()->Play( parameters->string0Parameter, 0, 0, 0); + } + void GameScript::CreateVisualEffectCore(int X, int Y, const char *effect) { *************** *** 7119,7136 **** void GameScript::ReputationSet(Scriptable* Sender, Action* parameters) { - if(Sender->Type==ST_ACTOR) { - Actor *scr = (Actor *) Sender; - scr->SetStat(IE_REPUTATION, parameters->int0Parameter); - } core->GetGame()->Reputation = (unsigned int) parameters->int0Parameter; } void GameScript::ReputationInc(Scriptable* Sender, Action* parameters) { - if(Sender->Type==ST_ACTOR) { - Actor *scr = (Actor *) Sender; - scr->NewStat(IE_REPUTATION, parameters->int0Parameter, MOD_ADDITIVE); - } core->GetGame()->Reputation += (unsigned int) parameters->int0Parameter; } --- 7131,7142 ---- void GameScript::ReputationSet(Scriptable* Sender, Action* parameters) { core->GetGame()->Reputation = (unsigned int) parameters->int0Parameter; + core->GetGame()->ReputationAltered(); } void GameScript::ReputationInc(Scriptable* Sender, Action* parameters) { core->GetGame()->Reputation += (unsigned int) parameters->int0Parameter; + core->GetGame()->ReputationAltered(); } *************** *** 7400,7405 **** //slot == -1 here means money if(slot==-1) { ! scr->NewStat(IE_GOLD,-money,0); ! snd->NewStat(IE_GOLD,money,0); return; } --- 7406,7411 ---- //slot == -1 here means money if(slot==-1) { ! scr->NewStat(IE_GOLD,-money,MOD_ADDITIVE); ! snd->NewStat(IE_GOLD,money,MOD_ADDITIVE); return; } *************** *** 7432,7433 **** --- 7438,7454 ---- map->RestHeader.NightChance = parameters->int1Parameter; } + + void GameScript::QuitGame(Scriptable *Sender, Action *parameters) + { + core->QuitGame(true); + } + + void GameScript::StopMoving(Scriptable *Sender, Action *parameters) + { + if(Sender->Type!=ST_ACTOR) { + return; + } + Actor *actor = (Actor *) Sender; + actor->ClearPath(); + } + Index: Interface.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.cpp,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** Interface.cpp 12 Aug 2004 23:26:38 -0000 1.197 --- Interface.cpp 18 Aug 2004 21:55:35 -0000 1.198 *************** *** 2014,2018 **** } ! void Interface::QuitGame() { DelWindow(0xffff); //delete all windows, including GameControl --- 2014,2018 ---- } ! void Interface::QuitGame(bool BackToMain) { DelWindow(0xffff); //delete all windows, including GameControl *************** *** 2021,2024 **** --- 2021,2028 ---- game=NULL; } + if(BackToMain) { + strcpy(NextScript, "Start"); + ChangeScript = true; + } } Index: Game.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Game.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Game.h 6 Aug 2004 23:41:16 -0000 1.38 --- Game.h 18 Aug 2004 21:55:20 -0000 1.39 *************** *** 199,202 **** --- 199,203 ---- bool PartyMemberDied(); void IncrementChapter(); + void ReputationAltered(); }; |