From: Andrew R. <aar...@us...> - 2007-04-30 02:58:48
|
Update of /cvsroot/planeshift/planeshift/src/server/bulkobjects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28615 Modified Files: pscharacter.cpp psitem.cpp Log Message: *** 2007-04-30 by Andrew Robberts - Changed the way compound functions work in mathscript. In the old version, something like Target:blah(23) would become blah(Target, 23) and the custom blah function would need to be specifically defined in mathscript. In the new system, Target:blah(23) becomes customCompoundFunc3(A, Target, 23) where A is the index of the word "blah" in a lookup table. This allows for functions to be specified solely in the iScritableVar and not need any special code in mathscript. - Removed specific server mathscript functions from mathscript.cpp; they now use the new system. Index: pscharacter.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/pscharacter.cpp,v retrieving revision 1.482 retrieving revision 1.483 diff -C2 -d -r1.482 -r1.483 *** pscharacter.cpp 30 Apr 2007 01:42:47 -0000 1.482 --- pscharacter.cpp 30 Apr 2007 02:58:48 -0000 1.483 *************** *** 2723,2728 **** if (!strcasecmp(functionName, "GetStatValue")) { ! psCharacter *my_char = (psCharacter *)(intptr_t)params[0]; ! PSITEMSTATS_STAT stat = (PSITEMSTATS_STAT)(int)params[1]; return (double)my_char->GetAttributes()->GetStat(stat); --- 2723,2728 ---- if (!strcasecmp(functionName, "GetStatValue")) { ! psCharacter *my_char = this; ! PSITEMSTATS_STAT stat = (PSITEMSTATS_STAT)(int)params[0]; return (double)my_char->GetAttributes()->GetStat(stat); *************** *** 2730,2737 **** else if (!strcasecmp(functionName, "GetAverageSkillValue")) { ! psCharacter *my_char = (psCharacter *)(intptr_t)params[0]; ! PSSKILL skill1 = (PSSKILL)(int)params[1]; ! PSSKILL skill2 = (PSSKILL)(int)params[2]; ! PSSKILL skill3 = (PSSKILL)(int)params[3]; double v1 = my_char->GetSkills()->GetSkillRank(skill1); --- 2730,2737 ---- else if (!strcasecmp(functionName, "GetAverageSkillValue")) { ! psCharacter *my_char = this; ! PSSKILL skill1 = (PSSKILL)(int)params[0]; ! PSSKILL skill2 = (PSSKILL)(int)params[1]; ! PSSKILL skill3 = (PSSKILL)(int)params[2]; double v1 = my_char->GetSkills()->GetSkillRank(skill1); *************** *** 2755,2760 **** else if (!strcasecmp(functionName, "GetSkillValue")) { ! psCharacter *my_char = (psCharacter *)(intptr_t)params[0]; ! PSSKILL skill = (PSSKILL)(int)params[1]; double value = my_char->GetSkills()->GetSkillRank(skill); --- 2755,2760 ---- else if (!strcasecmp(functionName, "GetSkillValue")) { ! psCharacter *my_char = this; ! PSSKILL skill = (PSSKILL)(int)params[0]; double value = my_char->GetSkills()->GetSkillRank(skill); Index: psitem.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/psitem.cpp,v retrieving revision 1.266 retrieving revision 1.267 diff -C2 -d -r1.266 -r1.267 *** psitem.cpp 30 Apr 2007 01:42:47 -0000 1.266 --- psitem.cpp 30 Apr 2007 02:58:48 -0000 1.267 *************** *** 1793,1798 **** if (!strcasecmp(functionName, "GetArmorVSWeaponResistance")) { ! psItem *weapon = (psItem *)(intptr_t)params[0]; ! psItem *armor = (psItem *)(intptr_t)params[1]; // if no armor return 1 --- 1793,1798 ---- if (!strcasecmp(functionName, "GetArmorVSWeaponResistance")) { ! psItem *weapon = this; ! psItem *armor = (psItem *)(intptr_t)params[0]; // if no armor return 1 |