|
From: <nu...@us...> - 2006-04-14 17:35:45
|
Revision: 798 Author: nuance Date: 2006-04-14 10:35:20 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/pcgen/?rev=798&view=rev Log Message: ----------- Temporary fix for [ 1463228 ] LEVEL:x:FEAT:TYPE.type broken Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PCTemplate.java Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PCTemplate.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PCTemplate.java 2006-04-14 07:48:03 UTC (rev 797) +++ Trunk/pcgen/code/src/java/pcgen/core/PCTemplate.java 2006-04-14 17:35:20 UTC (rev 798) @@ -931,7 +931,7 @@ /** * Set the override that this template applies to subracetype * - * @param argSubRace The new subracetype + * @param argSubRace The new subrace type */ public void setSubRace(final String argSubRace) { @@ -996,7 +996,7 @@ /** - * Query whether this Template is removable. Factors in the visability of + * Query whether this Template is removable. Factors in the visibility of * the Template * * @return whether this Template is removable @@ -1121,7 +1121,7 @@ * Manipulate the list of subTypes that this Template add or removes from * the creature it is applied to. * - * Takes a | separated list of subtypes to add. may opttionally be prefaced + * Takes a | separated list of subtypes to add. may optionally be prefaced * with .REMOVE. in which case the subtype is removed. * * @param aString the string to process @@ -1893,7 +1893,7 @@ /** - * Get a list of subsidiary Templates taht will be added by this template + * Get a list of subsidiary Templates that will be added by this template * * @return a list of Templates */ @@ -2043,7 +2043,9 @@ final String featKey, final PlayerCharacter aPC) { - if (contains(levelString, "FEAT:")) + + + if (contains(levelString, "FEAT:")) { String featName = getStringAfter("FEAT:", levelString); @@ -2092,8 +2094,14 @@ break; } + + final LevelAbility la = LevelAbility.createAbility(this, lvl, "FEAT(" + featName + ")"); - addChosenFeat(featKey, featName); + aPC.setAllowFeatPoolAdjustment(false); + la.process(null, aPC, null); + aPC.setAllowFeatPoolAdjustment(true); + + addChosenFeat(featKey, featName); } } Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2006-04-14 07:48:03 UTC (rev 797) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2006-04-14 17:35:20 UTC (rev 798) @@ -201,6 +201,9 @@ // Whether one can trust the most recently calculated virtualFeatList private boolean virtualFeatsStable = false; + // whether to adjust the feat pool when requested + private boolean allowFeatPoolAdjustment = true; + // pool of feats remaining to distribute private double feats = 0; private int age = 0; @@ -1640,13 +1643,19 @@ public void adjustFeats(final double arg) { - feats += arg; + if (allowFeatPoolAdjustment) + { + feats += arg; + } setDirty(true); } public void setFeats(final double arg) { - feats = arg; + if (allowFeatPoolAdjustment) + { + feats = arg; + } setDirty(true); } @@ -15689,6 +15698,17 @@ { return processLevelAbilities; } + + /** + * Whether to allow adjustment of the Global Feat pool + * + * @param allow + */ + public void setAllowFeatPoolAdjustment(boolean allow) { + this.allowFeatPoolAdjustment = allow; + } + + /* * For debugging purposes * Dumps contents of spellbooks to System.err This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |