Skip to content

Commit 95f808f

Browse files
authoredFeb 7, 2024
Fix min skill points from class issue for pfsrd (#7053)
1 parent 13665a8 commit 95f808f

File tree

4 files changed

+77
-1
lines changed

4 files changed

+77
-1
lines changed
 

‎code/pluginbuild.xml

+7
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,13 @@ jar-all-plugins - Generate the plugin jar files
12641264
</patternset>
12651265
</fileset>
12661266
</jar>
1267+
<jar jarfile="${bonusplugins.dir}/BonusToken-MINCLASSSKILLPOINTS.jar" manifest="${src.java.dir}/plugin/exporttokens/manifest.mf">
1268+
<fileset dir="${build.classes.dir}">
1269+
<patternset>
1270+
<include name="plugin/bonustokens/MinClassSkillPts.class" />
1271+
</patternset>
1272+
</fileset>
1273+
</jar>
12671274
<jar jarfile="${bonusplugins.dir}/BonusToken-SKILL.jar" manifest="${src.java.dir}/plugin/exporttokens/manifest.mf">
12681275
<fileset dir="${build.classes.dir}">
12691276
<patternset>

‎code/src/java/pcgen/core/PlayerCharacter.java

+8
Original file line numberDiff line numberDiff line change
@@ -9364,8 +9364,10 @@ public int recalcSkillPointMod(PCClass pcClass, final int characterLevel)
93649364
{
93659365
// int spMod = getSkillPoints();
93669366
int spMod = pcClass.getSafe(FormulaKey.START_SKILL_POINTS).resolve(this, pcClass.getQualifiedKey()).intValue();
9367+
int classSp = spMod; // retain class based skillpoints mod
93679368

93689369
spMod += (int) getTotalBonusTo("SKILLPOINTS", "NUMBER");
9370+
int raceSp = spMod - classSp; // this should be the race based skillpoints mod
93699371

93709372
if (pcClass.isMonster())
93719373
{
@@ -9397,6 +9399,12 @@ else if (characterLevel == 1)
93979399
}
93989400

93999401
spMod = updateBaseSkillMod(pcClass, spMod);
9402+
int otherSp = spMod - classSp - raceSp; // should mostly be stat related skillpoints
9403+
final int classSpMin = (int) getTotalBonusTo("MINCLASSSKILLPOINTS", "NUMBER");
9404+
// if a MINCLASSSKILLPOINTS.NUMBER is defined and spMod was lower due to INT penalty
9405+
if (classSpMin>0 && (classSp+otherSp<classSpMin)) {
9406+
spMod = Math.max(classSpMin,classSp+otherSp)+raceSp;
9407+
}
94009408

94019409
if (characterLevel == 1)
94029410
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2002 (C) Greg Bingleman <byngl@hotmail.com>
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with this library; if not, write to the Free Software
16+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+
*/
18+
package plugin.bonustokens;
19+
20+
import pcgen.core.bonus.MultiTagBonusObj;
21+
22+
/**
23+
* Handles the BONUS:MINCLASSSKILLPOINTS token.
24+
*/
25+
public final class MinClassSkillPts extends MultiTagBonusObj
26+
{
27+
private static final String[] BONUS_TAGS = {"NUMBER", "LOCKNUMBER"};
28+
29+
/**
30+
* Return the bonus tag handled by this class.
31+
* @return The bonus handled by this class.
32+
*/
33+
@Override
34+
public String getBonusHandled()
35+
{
36+
return "MINCLASSSKILLPOINTS";
37+
}
38+
39+
/**
40+
* Get by index, an individual monster skill point attribute that may be bonused.
41+
* @param tagNumber the index of the monster skill point attribute type.
42+
* @see MultiTagBonusObj#getBonusTag(int)
43+
* @return The type of monster skill point attribute .
44+
*/
45+
@Override
46+
protected String getBonusTag(final int tagNumber)
47+
{
48+
return BONUS_TAGS[tagNumber];
49+
}
50+
51+
/**
52+
* Get the number of types of monster skill point attributes that may be bonused.
53+
* @see MultiTagBonusObj#getBonusTag(int)
54+
* @return The number of monster skill point attributes.
55+
*/
56+
@Override
57+
protected int getBonusTagLength()
58+
{
59+
return BONUS_TAGS.length;
60+
}
61+
}

‎data/pathfinder/paizo/roleplaying_game/core_rulebook/cr__stats.lst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Strength SORTKEY:1 ABB:STR KEY:STR STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:STR|SET|Mod MODIFY:STRSCORE|SET|Score DEFINE:PreStatScore_STR|0 DEFINE:MAXLEVELSTAT=STR|STRSCORE-10 DEFINE:LOADSCORE|0 DEFINE:TWOHANDDAMAGEDIVISOR|0 DEFINE:OFFHANDLIGHTBONUS|0 DEFINE:RacialVision|0 DEFINE:OversizeWeaponToHitBonus|0 BONUS:COMBAT|TOHIT.Melee|STR|TYPE=Ability|PREVAREQ:DisableToHitMeleeStr,0 BONUS:COMBAT|DAMAGE.Melee,DAMAGE.Thrown|STR|TYPE=Ability BONUS:COMBAT|DAMAGEMULT:0|if(STR>0,0.5,1) BONUS:COMBAT|DAMAGEMULT:1|1 BONUS:COMBAT|DAMAGEMULT:2|if(STR>0,1.5,1) BONUS:COMBAT|DAMAGE.Splash|-STR|TYPE=Ability DEFINE:AltSTRSCORE|0 BONUS:VAR|PreStatScore_STR|max(STRSCORE,AltSTRSCORE)|TYPE=Base BONUS:VAR|LOADSCORE|STRSCORE BONUS:VAR|TWOHANDDAMAGEDIVISOR,OFFHANDLIGHTBONUS|2 BONUS:VAR|RacialVision|1|TYPE=Racial|!PREABILITY:1,CATEGORY=Special Ability,TYPE.Racial Vision ABILITY:Internal|AUTOMATIC|Default
55
Dexterity SORTKEY:2 ABB:DEX KEY:DEX STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:DEX|SET|Mod MODIFY:DEXSCORE|SET|Score DEFINE:PreStatScore_DEX|0 DEFINE:FeatDexRequirement|0 DEFINE:MAXLEVELSTAT=DEX|DEXSCORE-10 DEFINE:INITCOMP|0 DEFINE:ACAbilityStat|0 DEFINE:MXDXEN|0 DEFINE:FightingDefensivelyACBonus|0 DEFINE:FightingDefensivelyAC|0 DEFINE:TotalDefenseACBonus|0 DEFINE:TotalDefenseAC|0 BONUS:COMBAT|TOHIT.Ranged|DEX|TYPE=Ability|PREVAREQ:DisableToHitRangedDex,0 BONUS:COMBAT|AC|10|TYPE=Base BONUS:COMBAT|AC|min(ACAbilityStat, min(MXDXEN,MODEQUIPMAXDEX))|TYPE=Ability|PREVAREQ:ACStatNotDex,0 BONUS:COMBAT|AC|max(FightingDefensivelyAC,TotalDefenseAC)|TYPE=Dodge DEFINE:AltDEXSCORE|0 BONUS:VAR|PreStatScore_DEX|max(DEXSCORE,AltDEXSCORE)|TYPE=Base BONUS:VAR|INITCOMP|DEX BONUS:VAR|ACAbilityStat|DEX BONUS:VAR|MXDXEN|1000|PREVAREQ:ENCUMBERANCE,0 BONUS:VAR|MXDXEN|3|PREVAREQ:ENCUMBERANCE,1 BONUS:VAR|MXDXEN|1|PREVAREQ:ENCUMBERANCE,2
66
Constitution SORTKEY:3 ABB:CON KEY:CON STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:CON|SET|Mod MODIFY:CONSCORE|SET|Score DEFINE:PreStatScore_CON|0 DEFINE:MAXLEVELSTAT=CON|CONSCORE-10 DEFINE:UseAlternateDamage|0 DEFINE:UseCombatManueverBonus|0 BONUS:HP|WOUNDPOINTS|CON BONUS:HP|BONUS|CON|PRERULE:1,DAMAGE_HP BONUS:HP|ALTHP|CONSCORE*2 DEFINE:AltCONSCORE|0 BONUS:VAR|PreStatScore_CON|max(CONSCORE,AltCONSCORE)|TYPE=Base BONUS:VAR|UseAlternateDamage|1|PRERULE:1,DAMAGE_VW BONUS:VAR|UseCombatManueverBonus|1|PRERULE:1,USE_CMB
7-
Intelligence SORTKEY:4 ABB:INT KEY:INT STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:INT|SET|Mod MODIFY:INTSCORE|SET|Score DEFINE:PreStatScore_INT|0 DEFINE:MAXLEVELSTAT=INT|MaxLevelStat_Int DEFINE:AdditionalLanguage|0 DEFINE:BonusRetroSkillPoints|0 DEFINE:MaxLevelStat_Int|0 DEFINE:AltINTSCORE|0 BONUS:VAR|PreStatScore_INT|max(INTSCORE,AltINTSCORE)|TYPE=Base BONUS:VAR|MaxLevelStat_Int|INTSCORE-10 BONUS:LANG|BONUS|max(INT,0)+var("AdditionalLanguage") BONUS:MODSKILLPOINTS|NUMBER|var("STAT.3.MOD.NOEQUIP.NOTEMP")+BonusRetroSkillPoints
7+
Intelligence SORTKEY:4 ABB:INT KEY:INT STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:INT|SET|Mod MODIFY:INTSCORE|SET|Score DEFINE:PreStatScore_INT|0 DEFINE:MAXLEVELSTAT=INT|MaxLevelStat_Int DEFINE:AdditionalLanguage|0 DEFINE:BonusRetroSkillPoints|0 DEFINE:MaxLevelStat_Int|0 DEFINE:AltINTSCORE|0 BONUS:VAR|PreStatScore_INT|max(INTSCORE,AltINTSCORE)|TYPE=Base BONUS:VAR|MaxLevelStat_Int|INTSCORE-10 BONUS:LANG|BONUS|max(INT,0)+var("AdditionalLanguage") BONUS:MODSKILLPOINTS|NUMBER|var("STAT.3.MOD.NOEQUIP.NOTEMP")+BonusRetroSkillPoints BONUS:MINCLASSSKILLPOINTS|NUMBER|1
88
Wisdom SORTKEY:5 ABB:WIS KEY:WIS STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:WIS|SET|Mod MODIFY:WISSCORE|SET|Score DEFINE:PreStatScore_WIS|0 DEFINE:MAXLEVELSTAT=WIS|WISSCORE-10 DEFINE:AltWISSCORE|0 BONUS:VAR|PreStatScore_WIS|max(WISSCORE,AltWISSCORE)|TYPE=Base
99
Charisma SORTKEY:6 ABB:CHA KEY:CHA STATMOD:floor(SCORE/2)-5 MODIFY:Score|SET|input("STATSCORE") MODIFY:Mod|SET|d20Mod(Score) MODIFY:CHA|SET|Mod MODIFY:CHASCORE|SET|Score DEFINE:PreStatScore_CHA|0 DEFINE:MAXLEVELSTAT=CHA|CHASCORE-10 DEFINE:BypassSizeMods|0 DEFINE:NormalMount|0 DEFINE:SizeIncrease|0 DEFINE:SizeDecrease|0 DEFINE:NormalFollower|0 BONUS:COMBAT|AC|min(CHA, min(MXDXEN,MODEQUIPMAXDEX))|TYPE=Ability|PREVAREQ:ACStatIsCha,1 DEFINE:AltCHASCORE|0 BONUS:VAR|PreStatScore_CHA|max(CHASCORE,AltCHASCORE)|TYPE=Base BONUS:VAR|NormalMount,NormalFollower|1

0 commit comments

Comments
 (0)
Please sign in to comment.