From: Laszlo T. <ave...@us...> - 2005-09-02 21:08:58
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22306/plugins/Core Modified Files: Actor.cpp Actor.h Interface.cpp Interface.h Log Message: Added charisma/constitution bonus tables Index: Interface.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.cpp,v retrieving revision 1.347 retrieving revision 1.348 diff -C2 -d -r1.347 -r1.348 *** Interface.cpp 28 Aug 2005 13:20:19 -0000 1.347 --- Interface.cpp 2 Sep 2005 21:08:48 -0000 1.348 *************** *** 70,73 **** --- 70,75 ---- static ieWord *intmod = NULL; static ieWord *dexmod = NULL; + static ieWord *conmod = NULL; + static ieWord *chrmod = NULL; Interface::Interface(int iargc, char** iargv) *************** *** 414,417 **** --- 416,425 ---- free(dexmod); } + if (conmod) { + free(conmod); + } + if (chrmod) { + free(chrmod); + } } *************** *** 434,438 **** if (!dexmod) return false; ! return true; } --- 442,451 ---- if (!dexmod) return false; ! conmod = (ieWord *) malloc (tablesize * 5 * sizeof(ieWord) ); ! if (!conmod) ! return false; ! chrmod = (ieWord *) malloc (tablesize * 1 * sizeof(ieWord) ); ! if (!chrmod) ! return false; return true; } *************** *** 476,480 **** return ret; ret = ReadAbilityTable("dexmod", dexmod, 3, MaximumAbility + 1); ! return true; } --- 489,500 ---- return ret; ret = ReadAbilityTable("dexmod", dexmod, 3, MaximumAbility + 1); ! //no dexmod in iwd2??? ! ret = ReadAbilityTable("hpconbon", conmod, 5, MaximumAbility + 1); ! if (!ret) ! return ret; ! //this table is a single row (not a single column) ! ret = ReadAbilityTable("chrmodst", chrmod, MaximumAbility + 1, 1); ! if (!ret) ! return ret; return true; } *************** *** 3962,3963 **** --- 3982,4001 ---- } + int Interface::GetConstitutionBonus(int column, int value) + { + //normal, warrior, minimum, regen hp, regen fatigue + if (column<0 || column>4) + return -9999; + + return conmod[column*MaximumAbility+value]; + } + + int Interface::GetCharismaBonus(int column, int value) + { + //?reaction + if (column<0 || column>0) + return -9999; + + return chrmod[column*MaximumAbility+value]; + } + Index: Actor.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Actor.h,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Actor.h 15 Aug 2005 15:55:39 -0000 1.83 --- Actor.h 2 Sep 2005 21:08:48 -0000 1.84 *************** *** 302,306 **** /* Creates player statistics */ void CreateStats(); - int GetHPMod(); /* Heals actor by days */ void Heal(int days); --- 302,305 ---- Index: Interface.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Interface.h,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** Interface.h 28 Aug 2005 13:20:19 -0000 1.168 --- Interface.h 2 Sep 2005 21:08:48 -0000 1.169 *************** *** 423,426 **** --- 423,428 ---- int GetIntelligenceBonus(int column, int value); int GetDexterityBonus(int column, int value); + int GetConstitutionBonus(int column, int value); + int GetCharismaBonus(int column, int value); /** applies the spell on the target */ Index: Actor.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Actor.cpp,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** Actor.cpp 28 Aug 2005 13:20:19 -0000 1.124 --- Actor.cpp 2 Sep 2005 21:08:48 -0000 1.125 *************** *** 64,69 **** static char **clericspelltables=NULL; static char **wizardspelltables=NULL; ! static int constitution_normal[26]; ! static int constitution_fighter[26]; static void InitActorTables(); --- 64,69 ---- static char **clericspelltables=NULL; static char **wizardspelltables=NULL; ! //static int constitution_normal[26]; ! //static int constitution_fighter[26]; static void InitActorTables(); *************** *** 419,423 **** } core->DelTable( table ); ! //these will be moved to core table = core->LoadTable( "hpconbon" ); --- 419,423 ---- } core->DelTable( table ); ! /* //these will be moved to core table = core->LoadTable( "hpconbon" ); *************** *** 428,431 **** --- 428,432 ---- } core->DelTable( table ); + */ i = core->GetMaximumAbility(); maximum_values[IE_STR]=i; *************** *** 457,466 **** return true; } ! int Actor::GetHPMod() { return constitution_normal[Modified[IE_CON]]; } ! int Actor::GetMod(unsigned int StatIndex) { --- 458,467 ---- return true; } ! /* use core->GetConstitutionBonus(0,0,Modified[IE_CON]) int Actor::GetHPMod() { return constitution_normal[Modified[IE_CON]]; } ! */ int Actor::GetMod(unsigned int StatIndex) { |