From: <th...@us...> - 2009-03-07 22:25:41
|
Revision: 9609 http://pcgen.svn.sourceforge.net/pcgen/?rev=9609&view=rev Author: thpr Date: 2009-03-07 22:25:34 +0000 (Sat, 07 Mar 2009) Log Message: ----------- [ 2670164 ] BONUS:LANG|BONUS|x ignores PRE tags Issue#: 2670164 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-07 22:22:19 UTC (rev 9608) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-07 22:25:34 UTC (rev 9609) @@ -6862,6 +6862,14 @@ final List<BonusObj> aList = statList.getBonusListOfType(aType.toUpperCase(), aName .toUpperCase()); + for (Iterator<BonusObj> it = aList.iterator(); it.hasNext();) + { + BonusObj bo = it.next(); + if (!bo.qualifies(this)) + { + it.remove(); + } + } return calcBonusFromList(aList); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2009-03-09 05:20:26
|
Revision: 9625 http://pcgen.svn.sourceforge.net/pcgen/?rev=9625&view=rev Author: jdempsey Date: 2009-03-09 05:20:05 +0000 (Mon, 09 Mar 2009) Log Message: ----------- Fix bug: Raven familiar TODO msg incorrect too many languages taken Issue#: 1960095 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-08 21:51:23 UTC (rev 9624) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-09 05:20:05 UTC (rev 9625) @@ -9712,6 +9712,13 @@ return initmod; } + /** + * Calculates the number of languages that the character is qualified + * for. + * + * @param includeSpeakLanguage Should languages granted by the speak language skill be include + * @return The number of languages allowed + */ public int languageNum(final boolean includeSpeakLanguage) { @@ -9754,7 +9761,8 @@ ChoiceSet<?> ch = ptc.getChoices(); if (LANGUAGE_CLASS.equals(ch.getChoiceClass())) { - i += this.getAssocCount(ptc, AssociationListKey.ADD); + i += ptc.getCount().resolve(this, null).intValue(); + //i += this.getAssocCount(ptc, AssociationListKey.ADD); } } } @@ -10576,7 +10584,7 @@ return; } - final List<Skill> localSkillList = getSkillList(); + final List<Skill> localSkillList = new ArrayList<Skill>(getSkillList()); final SkillComparator comparator = new SkillComparator(this, sort, sortOrder); int nextOutputIndex = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-03-17 23:17:03
|
Revision: 9692 http://pcgen.svn.sourceforge.net/pcgen/?rev=9692&view=rev Author: thpr Date: 2009-03-17 23:16:47 +0000 (Tue, 17 Mar 2009) Log Message: ----------- [ 877582 ] Separate Meta data from implementation data in code Fix SVN 9655 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-17 22:52:38 UTC (rev 9691) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-17 23:16:47 UTC (rev 9692) @@ -10379,7 +10379,7 @@ } String subClassKey = getAssoc(pcClass, AssociationKey.SUBCLASS_KEY); PCClass evalClass = pcClass; - if (!subClassKey.equals("None")) + if (subClassKey != null && !subClassKey.equals("None")) { evalClass = pcClass.getSubClassKeyed(subClassKey); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-03-18 03:01:07
|
Revision: 9700 http://pcgen.svn.sourceforge.net/pcgen/?rev=9700&view=rev Author: thpr Date: 2009-03-18 03:00:58 +0000 (Wed, 18 Mar 2009) Log Message: ----------- [ 877582 ] Separate Meta data from implementation data in code Specifically eliminates the use of .clone() for Race objects Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-18 02:39:07 UTC (rev 9699) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-18 03:00:58 UTC (rev 9700) @@ -6394,7 +6394,7 @@ if (aRace != null) { - race = aRace.clone(); + race = aRace;//.clone(); } if (race != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2009-03-19 11:42:10
|
Revision: 9711 http://pcgen.svn.sourceforge.net/pcgen/?rev=9711&view=rev Author: jdempsey Date: 2009-03-19 11:41:58 +0000 (Thu, 19 Mar 2009) Log Message: ----------- Fix bug: Feats and AUTO:Feats not playing nicely together - Merge from 5.16.x branch Issue#: 2688464 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-19 11:39:03 UTC (rev 9710) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-19 11:41:58 UTC (rev 9711) @@ -16291,10 +16291,10 @@ * NB: Abilities are only returned in the category they are taken * in, so if parent catgeory is supplied only those taken directly in the * parent category will be returned. e.g. If asking for feats, Power Attack - * taken as a fighter feat will nto be returned. You would need to query + * taken as a fighter feat will not be returned. You would need to query * fighter feats to get that. <br> * NB: Duplicate abilities will not be retruned by this method. The order - * of priorty is normla, virtual then automatic. + * of priorty is normal, virtual then automatic. * * @param aCategory The ability category to be queried. * @return The list of abilities of the category regardless of nature. @@ -16359,8 +16359,12 @@ } else if (vFeat.getSafe(ObjectKey.MULTIPLE_ALLOWED)) { - Ability aggregateFeat = aHashMap.get(vFeat.getKeyName()); - aggregateFeat = aggregateFeat.clone(); + Ability aggregateFeatOrig = aHashMap.get(vFeat.getKeyName()); + Ability aggregateFeat = aggregateFeatOrig.clone(); + for (String aString : getAssociationList(aggregateFeatOrig)) + { + addAssociation(aggregateFeat, aString); + } for (String aString : getAssociationList(vFeat)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-03-20 01:10:47
|
Revision: 9717 http://pcgen.svn.sourceforge.net/pcgen/?rev=9717&view=rev Author: thpr Date: 2009-03-20 01:10:38 +0000 (Fri, 20 Mar 2009) Log Message: ----------- [ 2693532 ] LEVEL:x:DEFINE Broken (Change in Trunk) Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-20 01:10:28 UTC (rev 9716) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-20 01:10:38 UTC (rev 9717) @@ -3846,6 +3846,19 @@ .parseFloat(aString)); found = true; } + for (PCTemplate pct : obj.getConditionalTemplates(getTotalLevels(), + totalHitDice())) + { + final String vString = checkForVariableInList(pct, + variableString, isMax, found, value); + + if (vString.length() > 0) + { + value = getMinMaxFirstValue(found, isMax, value, Float + .parseFloat(vString)); + found = true; + } + } } for (CompanionMod obj : companionModList) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kar...@us...> - 2009-03-20 09:43:51
|
Revision: 9727 http://pcgen.svn.sourceforge.net/pcgen/?rev=9727&view=rev Author: karianna Date: 2009-03-20 09:43:45 +0000 (Fri, 20 Mar 2009) Log Message: ----------- Remove catch Exception construct in rebuildAggregateAbilityList() as catching raw Exception is bad practice. Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-20 09:42:09 UTC (rev 9726) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-20 09:43:45 UTC (rev 9727) @@ -231,7 +231,8 @@ private List<BonusObj> tempBonusList = new ArrayList<BonusObj>(); private Set<String> tempBonusFilters = new TreeSet<String>(); - private Map<String, String> activeBonusMap = new ConcurrentHashMap<String, String>(); + private Map<String, String> activeBonusMap = + new ConcurrentHashMap<String, String>(); private Race race = null; private PCClass selectedFavoredClass = null; private final StatList statList = new StatList(this); @@ -3847,15 +3848,17 @@ found = true; } for (PCTemplate pct : obj.getConditionalTemplates(getTotalLevels(), - totalHitDice())) + totalHitDice())) { - final String vString = checkForVariableInList(pct, - variableString, isMax, found, value); + final String vString = + checkForVariableInList(pct, variableString, isMax, + found, value); if (vString.length() > 0) { - value = getMinMaxFirstValue(found, isMax, value, Float - .parseFloat(vString)); + value = + getMinMaxFirstValue(found, isMax, value, Float + .parseFloat(vString)); found = true; } } @@ -4047,8 +4050,9 @@ // Try all possible CDOMObjects for (CDOMObject pobj : getCDOMObjectList()) { - List<String> profKeys = getAssocList(pobj, - AssociationListKey.SELECTED_WEAPON_PROF_BONUS); + List<String> profKeys = + getAssocList(pobj, + AssociationListKey.SELECTED_WEAPON_PROF_BONUS); if (profKeys != null) { Set<String> profKeyList = new TreeSet<String>(); @@ -4057,8 +4061,8 @@ { WeaponProf prof = Globals.getContext().ref - .silentlyGetConstructedCDOMObject(WeaponProf.class, - profKey); + .silentlyGetConstructedCDOMObject( + WeaponProf.class, profKey); if (prof != null) { ret.put(prof.getKeyName(), prof); @@ -4074,8 +4078,8 @@ ret.put(prof.getKeyName(), prof); } // AUTO:WEAPONPROF except LIST - List<WeaponProfProvider> potentialProfs = pobj - .getSafeListFor(ListKey.WEAPONPROF); + List<WeaponProfProvider> potentialProfs = + pobj.getSafeListFor(ListKey.WEAPONPROF); for (WeaponProfProvider wpp : potentialProfs) { if (wpp.qualifies(this)) @@ -4097,12 +4101,12 @@ } } Boolean all = - pobj.getSafe(ObjectKey.HAS_ALL_WEAPONPROF) - .getObject(this); + pobj.getSafe(ObjectKey.HAS_ALL_WEAPONPROF).getObject(this); if (all != null && all) { - Collection<WeaponProf> allwps = Globals.getContext().ref - .getConstructedCDOMObjects(WeaponProf.class); + Collection<WeaponProf> allwps = + Globals.getContext().ref + .getConstructedCDOMObjects(WeaponProf.class); for (WeaponProf wp : allwps) { ret.put(wp.getKeyName(), wp); @@ -6784,8 +6788,8 @@ * The info about conditions applied to the spell * @return spell range */ - public String getSpellRange(final CharacterSpell aSpell, final PObject owner, - final SpellInfo si) + public String getSpellRange(final CharacterSpell aSpell, + final PObject owner, final SpellInfo si) { String aRange = aSpell.getSpell().getRange(); final String aSpellClass = @@ -6856,7 +6860,8 @@ * @param aName * @return caster level for spell */ - public int getCasterLevelForSpell(final CharacterSpell aSpell, final String aName) + public int getCasterLevelForSpell(final CharacterSpell aSpell, + final String aName) { final String aSpellClass = "CLASS:" + aName; int casterLevel = @@ -7162,8 +7167,9 @@ return variableProcessor; } - public int getTotalCasterLevelWithSpellBonus(CharacterSpell acs, final Spell aSpell, - final String spellType, final String classOrRace, final int casterLev) + public int getTotalCasterLevelWithSpellBonus(CharacterSpell acs, + final Spell aSpell, final String spellType, final String classOrRace, + final int casterLev) { if (aSpell != null && acs.getFixedCasterLevel() != null) { @@ -8227,7 +8233,7 @@ { // Do chooser (if any) ChooserUtilities.modChoices(inTmpl, new ArrayList(), - new ArrayList(), true, this, true, null); + new ArrayList(), true, this, true, null); getSpellList(); feats(inTmpl, getTotalLevels(), totalHitDice(), true); @@ -8266,8 +8272,9 @@ pi.setSkillPointsRemaining(pi .getSkillPointsRemaining() + newSkillPointsGained - formerGained); - setAssoc(pcClass, AssociationKey.SKILL_POOL, pcClass.getSkillPool(this) - + newSkillPointsGained - formerGained); + setAssoc(pcClass, AssociationKey.SKILL_POOL, + pcClass.getSkillPool(this) + + newSkillPointsGained - formerGained); setSkillPoints(getSkillPoints() + newSkillPointsGained - formerGained); } @@ -9287,7 +9294,8 @@ for (int j = aList.size() - 1; j >= 0; --j) { final CharacterSpell cs = aList.get(j); - cs.removeSpellInfo(cs.getSpellInfoFor(this, aName, -1, -1)); + cs.removeSpellInfo(cs.getSpellInfoFor(this, aName, -1, + -1)); } } @@ -9782,8 +9790,8 @@ // for (CDOMObject cdo : getCDOMObjectList()) { - List<PersistentTransitionChoice<?>> adds = cdo - .getListFor(ListKey.ADD); + List<PersistentTransitionChoice<?>> adds = + cdo.getListFor(ListKey.ADD); if (adds != null) { for (PersistentTransitionChoice<?> ptc : adds) @@ -10011,13 +10019,15 @@ else { rebuildLists(bClass, aClass, aClass.getLevel(this), this); - bClass.setLevel(bClass.getLevel(this) + aClass.getLevel(this), this); + bClass.setLevel(bClass.getLevel(this) + aClass.getLevel(this), + this); for (int i = 0; i < aClass.getLevel(this); ++i) { PCClassLevel frompcl = aClass.getClassLevel(i + 1); Integer hp = getAssoc(frompcl, AssociationKey.HIT_POINTS); - PCClassLevel topcl = bClass.getClassLevel(bClass.getLevel(this) + i + 1); + PCClassLevel topcl = + bClass.getClassLevel(bClass.getLevel(this) + i + 1); setAssoc(topcl, AssociationKey.HIT_POINTS, hp); } @@ -10048,7 +10058,8 @@ .getKeyName(), cl.getKeyName()); } - setAssoc(bClass, AssociationKey.SKILL_POOL, aClass.getSkillPool(this)); + setAssoc(bClass, AssociationKey.SKILL_POOL, aClass + .getSkillPool(this)); } catch (NumberFormatException nfe) { @@ -10402,7 +10413,8 @@ maxClassLevel = pcClass.getLevel(this); maxClass = pcClass; } - else if ((pcClass.getLevel(this) > secondClassLevel) && (hasAny)) + else if ((pcClass.getLevel(this) > secondClassLevel) + && (hasAny)) { secondClassLevel = pcClass.getLevel(this); secondClass = pcClass; @@ -12034,7 +12046,8 @@ for (PCClass aClass : classList) { - lvlMap.put(aClass.getKeyName(), String.valueOf(aClass.getLevel(this))); + lvlMap.put(aClass.getKeyName(), String.valueOf(aClass + .getLevel(this))); } return lvlMap; @@ -12085,8 +12098,9 @@ final CharacterSpell cs = new CharacterSpell(race, sp); cs.setFixedCasterLevel(apo - .getAssociation(AssociationKey.CASTER_LEVEL)); - cs.setFixedDC(apo + .getAssociation(AssociationKey.CASTER_LEVEL)); + cs + .setFixedDC(apo .getAssociation(AssociationKey.DC_FORMULA)); SpellInfo si = cs.addInfo(0, resolvedTimes, book); si.setTimeUnit(timeunit); @@ -12201,7 +12215,7 @@ { // TheForken 20050124 adds bonus to feat addAssoc(anAbility, - AssociationListKey.SELECTED_WEAPON_PROF_BONUS, aString); + AssociationListKey.SELECTED_WEAPON_PROF_BONUS, aString); } featKey = ""; @@ -13525,17 +13539,17 @@ } // Handle any feat changes as a result of level changes - for (PCTemplate template : templateList) + for (PCTemplate template : templateList) + { + final List<String> templateFeats = + feats(template, getTotalLevels(), totalHitDice(), true); + + for (int j = 0, y = templateFeats.size(); j < y; ++j) { - final List<String> templateFeats = - feats(template, getTotalLevels(), totalHitDice(), true); - - for (int j = 0, y = templateFeats.size(); j < y; ++j) - { - AbilityUtilities.modFeatsFromList(this, null, templateFeats - .get(j), true, false); - } + AbilityUtilities.modFeatsFromList(this, null, templateFeats + .get(j), true, false); } + } setAggregateAbilitiesStable(null, false); // setAggregateFeatsStable(false); @@ -13899,7 +13913,9 @@ continue; } - int roll = rolls[i] + this.getAssoc(currentStat, AssociationKey.STAT_SCORE); + int roll = + rolls[i] + + this.getAssoc(currentStat, AssociationKey.STAT_SCORE); if (roll < currentStat.getMinValue()) { @@ -16297,7 +16313,6 @@ return abilities; } - /** * Retrieve a list of all abilities held by the character in the specified * category. <br> @@ -16312,7 +16327,8 @@ * @param aCategory The ability category to be queried. * @return The list of abilities of the category regardless of nature. */ - public List<Ability> getAggregateAbilityListNoDuplicates(final AbilityCategory aCategory) + public List<Ability> getAggregateAbilityListNoDuplicates( + final AbilityCategory aCategory) { List<Ability> aggregate = new ArrayList<Ability>(); final Map<String, Ability> aHashMap = new HashMap<String, Ability>(); @@ -16331,7 +16347,7 @@ aggregate.addAll(aHashMap.values()); return aggregate; } - + private List<Ability> rebuildFeatAggreagateList() { List<Ability> aggregate = new ArrayList<Ability>(); @@ -16362,7 +16378,8 @@ * @param aHashMap * @param abilityList TODO */ - private void addUniqueAbilitiesToMap(final Map<String, Ability> aHashMap, List<Ability> abilityList) + private void addUniqueAbilitiesToMap(final Map<String, Ability> aHashMap, + List<Ability> abilityList) { for (Ability vFeat : abilityList) { @@ -16533,7 +16550,8 @@ * @author boomer70 * @since 5.11.1 */ - public List<Ability> getAutomaticAbilityList(final Category<Ability> aCategory) + public List<Ability> getAutomaticAbilityList( + final Category<Ability> aCategory) { List<Ability> abilities = theAbilities.get(aCategory, Ability.Nature.AUTOMATIC); @@ -16554,22 +16572,9 @@ { rebuildingAbilities = true; getVariableProcessor().pauseCache(); - - try - { - rebuildAggregateAbilityListWorker(); - } - catch (Exception e) - { - Logging.errorPrint( - "Encountered error while rebuilding abilities list - ignoring", - e); - } - finally - { - getVariableProcessor().restartCache(); - rebuildingAbilities = false; - } + rebuildAggregateAbilityListWorker(); + getVariableProcessor().restartCache(); + rebuildingAbilities = false; } /** @@ -16685,18 +16690,19 @@ { continue; } - Nature nature = apo - .getAssociation(AssociationKey.NATURE); - Category<Ability> cat = apo - .getAssociation(AssociationKey.CATEGORY); - List<String> choices = apo - .getAssociation(AssociationKey.ASSOC_CHOICES); + Nature nature = + apo.getAssociation(AssociationKey.NATURE); + Category<Ability> cat = + apo.getAssociation(AssociationKey.CATEGORY); + List<String> choices = + apo + .getAssociation(AssociationKey.ASSOC_CHOICES); if (choices == null) { choices = Collections.emptyList(); } List<Ability> abilities = - theAbilities.get(cat, nature); + theAbilities.get(cat, nature); for (Ability ab : ref.getContainedObjects()) { Ability added = @@ -16785,8 +16791,9 @@ // if (getRace() != null) { - List<String> profKeys = getAssocList(getRace(), - AssociationListKey.SELECTED_WEAPON_PROF_BONUS); + List<String> profKeys = + getAssocList(getRace(), + AssociationListKey.SELECTED_WEAPON_PROF_BONUS); if (profKeys != null) { addAutoProfsToList(profKeys, abilities); @@ -16795,8 +16802,9 @@ for (final PCClass aClass : getClassList()) { - List<String> profKeys = getAssocList(aClass, - AssociationListKey.SELECTED_WEAPON_PROF_BONUS); + List<String> profKeys = + getAssocList(aClass, + AssociationListKey.SELECTED_WEAPON_PROF_BONUS); if (profKeys != null) { addAutoProfsToList(profKeys, abilities); @@ -16836,8 +16844,9 @@ } } } - List<String> profKeys = getAssocList(aTemplate, - AssociationListKey.SELECTED_WEAPON_PROF_BONUS); + List<String> profKeys = + getAssocList(aTemplate, + AssociationListKey.SELECTED_WEAPON_PROF_BONUS); if (profKeys != null) { addAutoProfsToList(profKeys, abilities); @@ -16912,8 +16921,9 @@ } } - List<String> profKeys = getAssocList(aDomain, - AssociationListKey.SELECTED_WEAPON_PROF_BONUS); + List<String> profKeys = + getAssocList(aDomain, + AssociationListKey.SELECTED_WEAPON_PROF_BONUS); if (profKeys != null) { addAutoProfsToList(profKeys, abilities); @@ -17148,10 +17158,10 @@ { for (PCTemplate lt : rlt.getSafeListFor(ListKey.LEVEL_TEMPLATES)) { - List<String> featList = getAssocList(lt, - AssociationListKey.TEMPLATE_FEAT); + List<String> featList = + getAssocList(lt, AssociationListKey.TEMPLATE_FEAT); if (featList == null && addNew - && lt.get(IntegerKey.LEVEL) <= level) + && lt.get(IntegerKey.LEVEL) <= level) { featList = getLevelFeat(lt); } @@ -17163,8 +17173,8 @@ } for (PCTemplate lt : pct.getSafeListFor(ListKey.LEVEL_TEMPLATES)) { - List<String> featList = getAssocList(lt, - AssociationListKey.TEMPLATE_FEAT); + List<String> featList = + getAssocList(lt, AssociationListKey.TEMPLATE_FEAT); if (featList == null && addNew && lt.get(IntegerKey.LEVEL) <= level) { featList = getLevelFeat(lt); @@ -17177,11 +17187,11 @@ for (PCTemplate lt : pct.getSafeListFor(ListKey.HD_TEMPLATES)) { - List<String> featList = getAssocList(lt, - AssociationListKey.TEMPLATE_FEAT); + List<String> featList = + getAssocList(lt, AssociationListKey.TEMPLATE_FEAT); if (featList == null && addNew - && lt.get(IntegerKey.HD_MAX) <= hitdice - && lt.get(IntegerKey.HD_MIN) >= hitdice) + && lt.get(IntegerKey.HD_MAX) <= hitdice + && lt.get(IntegerKey.HD_MIN) >= hitdice) { featList = getLevelFeat(lt); } @@ -17216,7 +17226,8 @@ return list; } - private <T> Collection<? extends T> actOn(PCTemplate pct, PersistentTransitionChoice<T> ptc) + private <T> Collection<? extends T> actOn(PCTemplate pct, + PersistentTransitionChoice<T> ptc) { Collection<? extends T> result = ptc.driveChoice(this); ptc.act(result, pct, this); @@ -17370,8 +17381,8 @@ public boolean containsAssociated(CDOMObject obj, FixedStringList o) { - List<FixedStringList> list = assocSupt.getAssocList(obj, - AssociationListKey.CHOICES); + List<FixedStringList> list = + assocSupt.getAssocList(obj, AssociationListKey.CHOICES); if (list != null) { for (FixedStringList fsl : list) @@ -17722,7 +17733,8 @@ hml = SpellLevel.getMasterLevelInfo(this, sp); cache.addToMapFor(MapKey.SPELL_MASTER_INFO, sp, hml); } - HashMapToList<CDOMList<Spell>, Integer> newhml = new HashMapToList<CDOMList<Spell>, Integer>(); + HashMapToList<CDOMList<Spell>, Integer> newhml = + new HashMapToList<CDOMList<Spell>, Integer>(); newhml.addAllLists(hml); return newhml; } @@ -17736,7 +17748,8 @@ hml = SpellLevel.getPCBasedLevelInfo(this, sp); cache.addToMapFor(MapKey.SPELL_PC_INFO, sp, hml); } - HashMapToList<CDOMList<Spell>, Integer> newhml = new HashMapToList<CDOMList<Spell>, Integer>(); + HashMapToList<CDOMList<Spell>, Integer> newhml = + new HashMapToList<CDOMList<Spell>, Integer>(); newhml.addAllLists(hml); return newhml; } @@ -17804,7 +17817,7 @@ } // Add in the spells granted by objects SpellLevel.addBonusKnowSpellsToList(this, spellSource, csList); - + final ArrayList<CharacterSpell> aList = new ArrayList<CharacterSpell>(); if (csList == null || csList.size() == 0) { @@ -17815,7 +17828,8 @@ { if ((aSpell == null) || cs.getSpell().equals(aSpell)) { - final SpellInfo si = cs.getSpellInfoFor(this, book, level, -1, null); + final SpellInfo si = + cs.getSpellInfoFor(this, book, level, -1, null); if (si != null) { @@ -17836,8 +17850,9 @@ * @param level * @return list of CharacterSpells from the character spell list */ - public final List<CharacterSpell> getCharacterSpellsNoBonus(PObject spellSource, - final Spell aSpell, final String book, final int level) + public final List<CharacterSpell> getCharacterSpellsNoBonus( + PObject spellSource, final Spell aSpell, final String book, + final int level) { List<CharacterSpell> csList = getAssocList(spellSource, AssociationListKey.CHARACTER_SPELLS); @@ -17845,7 +17860,7 @@ { csList = new ArrayList<CharacterSpell>(); } - + final ArrayList<CharacterSpell> aList = new ArrayList<CharacterSpell>(); if (csList == null || csList.size() == 0) { @@ -17856,7 +17871,8 @@ { if ((aSpell == null) || cs.getSpell().equals(aSpell)) { - final SpellInfo si = cs.getSpellInfoFor(this, book, level, -1, null); + final SpellInfo si = + cs.getSpellInfoFor(this, book, level, -1, null); if (si != null) { @@ -17868,7 +17884,6 @@ return aList; } - /** * Returns DC for a spell and SpellInfo. * @param sp the spell @@ -17889,7 +17904,8 @@ * @param inLevel * @return DC */ - public int getDC(final Spell sp, final SpellInfo si, PCClass aClass, final int inLevel) + public int getDC(final Spell sp, final SpellInfo si, PCClass aClass, + final int inLevel) { CharacterSpell cs; PObject ow = null; @@ -17916,7 +17932,8 @@ * TODO Need to evaluate how duplicative this logic is and what * is really necessary */ - if(fixedDC != null && "INNATE".equalsIgnoreCase(si.getBook())) { + if (fixedDC != null && "INNATE".equalsIgnoreCase(si.getBook())) + { return getVariableValue(fixedDC, "").intValue(); } @@ -17930,7 +17947,7 @@ if (si.getFeatList() != null) { - for ( Ability metaFeat : si.getFeatList() ) + for (Ability metaFeat : si.getFeatList()) { spellLevel -= metaFeat.getSafe(IntegerKey.ADD_SPELL_LEVEL); metaDC += metaFeat.bonusTo("DC", "FEATBONUS", this, this); @@ -17946,7 +17963,8 @@ { bonDomain = "DOMAIN." + ow.getKeyName(); - final CharacterDomain aCD = getCharacterDomainForDomain(ow.getKeyName()); + final CharacterDomain aCD = + getCharacterDomainForDomain(ow.getKeyName()); if ((aCD != null) && aCD.isFromPCClass()) { @@ -17978,7 +17996,10 @@ setSpellLevelTemp(spellLevel); // must be done after spellLevel is set above - int dc = getVariableValue(Globals.getGameModeBaseSpellDC(), classKey).intValue() + metaDC; + int dc = + getVariableValue(Globals.getGameModeBaseSpellDC(), classKey) + .intValue() + + metaDC; dc += (int) getTotalBonusTo("DC", "ALLSPELLS"); if (spellIndex == -2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-08-31 03:04:52
|
Revision: 10361 http://pcgen.svn.sourceforge.net/pcgen/?rev=10361&view=rev Author: thpr Date: 2009-08-31 03:04:46 +0000 (Mon, 31 Aug 2009) Log Message: ----------- fix SVN 10356 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-31 03:04:21 UTC (rev 10360) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-31 03:04:46 UTC (rev 10361) @@ -106,6 +106,7 @@ import pcgen.cdom.facet.StatFacet; import pcgen.cdom.facet.SubRaceFacet; import pcgen.cdom.facet.TemplateFacet; +import pcgen.cdom.facet.ClassFacet.ClassInfo; import pcgen.cdom.helper.ClassSource; import pcgen.cdom.helper.FollowerLimit; import pcgen.cdom.helper.ProfProvider; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2014-02-17 16:19:41
|
Revision: 23272 http://sourceforge.net/p/pcgen/code/23272 Author: thpr Date: 2014-02-17 16:19:36 +0000 (Mon, 17 Feb 2014) Log Message: ----------- Minor access change to support Formula Parser Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2014-02-17 16:17:00 UTC (rev 23271) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2014-02-17 16:19:36 UTC (rev 23272) @@ -6064,7 +6064,7 @@ * * @return PC's AC bonus from equipment */ - private int modToACFromEquipment() + public int modToACFromEquipment() { int bonus = 0; for (Equipment eq : getEquippedEquipmentSet()) @@ -6082,7 +6082,7 @@ * * @return PC's ACCHECK bonus from equipment */ - private int modToACCHECKFromEquipment() + public int modToACCHECKFromEquipment() { Load load = getHouseRuledLoadType(); int bonus = 0; @@ -6108,7 +6108,7 @@ * * @return PC's SpellFailure bonus from equipment */ - private int modToSpellFailureFromEquipment() + public int modToSpellFailureFromEquipment() { int bonus = 0; for (Equipment eq : getEquippedEquipmentSet()) @@ -6125,7 +6125,7 @@ * * @return MAXDEX bonus */ - private int modToMaxDexFromEquipment() + public int modToMaxDexFromEquipment() { final int statBonus = (int) getStatBonusTo("MISC", "MAXDEX"); final Load load = getHouseRuledLoadType(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2009-03-22 06:36:30
|
Revision: 9749 http://pcgen.svn.sourceforge.net/pcgen/?rev=9749&view=rev Author: jdempsey Date: 2009-03-22 06:36:26 +0000 (Sun, 22 Mar 2009) Log Message: ----------- Fix defect: Concurrent Exception - Merge from 5.16.x branch Issue#: 2701162 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-22 06:34:02 UTC (rev 9748) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-03-22 06:36:26 UTC (rev 9749) @@ -16560,7 +16560,7 @@ rebuildAggregateAbilityList(); abilities = theAbilities.get(aCategory, Ability.Nature.AUTOMATIC); } - return abilities; + return Collections.unmodifiableList(abilities); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-17 01:10:29
|
Revision: 10111 http://pcgen.svn.sourceforge.net/pcgen/?rev=10111&view=rev Author: thpr Date: 2009-07-17 01:10:21 +0000 (Fri, 17 Jul 2009) Log Message: ----------- allow alignment to be null (necessary in game modes that do not use alignment) Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-07-15 12:14:57 UTC (rev 10110) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-07-17 01:10:21 UTC (rev 10111) @@ -3931,14 +3931,17 @@ } } - final String aString = checkForVariableInList(alignment, - variableString, isMax, found, value); + if (alignment != null) + { + final String aString = checkForVariableInList(alignment, + variableString, isMax, found, value); - if (aString.length() > 0) - { - value = getMinMaxFirstValue(found, isMax, value, Float - .parseFloat(aString)); - found = true; + if (aString.length() > 0) + { + value = getMinMaxFirstValue(found, isMax, value, Float + .parseFloat(aString)); + found = true; + } } if (!found) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-18 15:42:45
|
Revision: 10139 http://pcgen.svn.sourceforge.net/pcgen/?rev=10139&view=rev Author: thpr Date: 2009-07-18 15:42:42 +0000 (Sat, 18 Jul 2009) Log Message: ----------- useless code removal Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-07-18 03:24:29 UTC (rev 10138) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-07-18 15:42:42 UTC (rev 10139) @@ -16785,15 +16785,12 @@ // Add in the spells granted by objects SpellLevel.addBonusKnowSpellsToList(this, po, cspells); - if (cspells != null) + for (CharacterSpell cs : cspells) { - for (CharacterSpell cs : cspells) + Spell sp = cs.getSpell(); + if (spell.equals(sp) && (cs.getOwner().equals(po))) { - Spell sp = cs.getSpell(); - if (spell.equals(sp) && (cs.getOwner().equals(po))) - { - return cs; - } + return cs; } } return null; @@ -16821,7 +16818,7 @@ SpellLevel.addBonusKnowSpellsToList(this, spellSource, csList); final ArrayList<CharacterSpell> aList = new ArrayList<CharacterSpell>(); - if (csList == null || csList.size() == 0) + if (csList.size() == 0) { return aList; } @@ -16864,7 +16861,7 @@ } final ArrayList<CharacterSpell> aList = new ArrayList<CharacterSpell>(); - if (csList == null || csList.size() == 0) + if (csList.size() == 0) { return aList; } @@ -16917,7 +16914,6 @@ String spellType = ""; String classKey = ""; int metaDC = 0; - PCStat spellStat = null; if (si != null) { @@ -16984,7 +16980,6 @@ bonClass = "CLASS." + aClass.getKeyName(); classKey = "CLASS:" + aClass.getKeyName(); spellType = aClass.getSpellType(); - spellStat = aClass.baseSpellStat(); useStatFromSpell = aClass.getSafe(ObjectKey.USE_SPELL_SPELL_STAT); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-19 17:33:30
|
Revision: 10171 http://pcgen.svn.sourceforge.net/pcgen/?rev=10171&view=rev Author: thpr Date: 2009-07-19 17:33:28 +0000 (Sun, 19 Jul 2009) Log Message: ----------- fix hit-or-miss test passage for CleElf Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-07-19 17:32:02 UTC (rev 10170) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-07-19 17:33:28 UTC (rev 10171) @@ -194,7 +194,8 @@ private BigDecimal gold = new BigDecimal(0); private Deity deity = null; - private final Set<Domain> domains = new HashSet<Domain>(); + private final Set<Domain> domains = new TreeSet<Domain>( + CDOMObjectUtilities.CDOM_SORTER); private ClassSource defaultDomainSource = null; // List of Classes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2009-08-08 05:54:16
|
Revision: 10220 http://pcgen.svn.sourceforge.net/pcgen/?rev=10220&view=rev Author: jdempsey Date: 2009-08-08 05:54:07 +0000 (Sat, 08 Aug 2009) Log Message: ----------- Fix bug: Using KIT in a race seems to cause unexplained freeze Issue#: 2831013 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-08 01:53:40 UTC (rev 10219) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-08 05:54:07 UTC (rev 10220) @@ -12836,8 +12836,11 @@ } aClone.tempBonusItemList.addAll(tempBonusItemList); aClone.bonusManager = bonusManager.buildDeepClone(aClone); + aClone.race = race; aClone.selectedFavoredClass = selectedFavoredClass; - if (kitList != null) + aClone.stats.clear(); + aClone.stats.addAll(stats); + if (kitList != null) { aClone.kitList = new ArrayList<Kit>(); aClone.kitList.addAll(kitList); @@ -12900,6 +12903,7 @@ aClone.useTempMods = useTempMods; aClone.setFeats(feats); aClone.age = age; + aClone.alignment = alignment; aClone.costPool = costPool; aClone.currentEquipSetNumber = currentEquipSetNumber; aClone.earnedXP = earnedXP; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-08-30 15:29:06
|
Revision: 10351 http://pcgen.svn.sourceforge.net/pcgen/?rev=10351&view=rev Author: thpr Date: 2009-08-30 15:28:57 +0000 (Sun, 30 Aug 2009) Log Message: ----------- Convert Language Facet of PCGen to part-CDOM implementation - ID: 2829556 Step 1 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-30 15:24:21 UTC (rev 10350) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-30 15:28:57 UTC (rev 10351) @@ -259,8 +259,6 @@ // .CLEAR-TEMPLATES from clearing the OLDER template languages. private final List<Language> templateAutoLanguages = new ArrayList<Language>(); - private final SortedSet<Language> templateLanguages = - new TreeSet<Language>(); private final SortedSet<Language> languages = new TreeSet<Language>(); private Map<StringKey, String> stringChar = new HashMap<StringKey, String>(); @@ -7351,7 +7349,6 @@ { templateAutoLanguages.addAll(ref.getContainedObjects()); } - addStartingLanguages(inTemplate, templateLanguages); getAutoLanguages(); addNaturalWeapons(inTemplate.getListFor(ListKey.NATURAL_WEAPON)); @@ -9701,16 +9698,6 @@ // of multiple // templates. - Collection<CDOMReference<Language>> langCollection = - inTmpl.getListMods(Language.STARTING_LIST); - if (langCollection != null) - { - for (CDOMReference<Language> ref : langCollection) - { - templateLanguages.removeAll(ref.getContainedObjects()); - } - } - removeNaturalWeapons(inTmpl); List<LevelCommandFactory> lcfList = inTmpl.getSafeListFor(ListKey.ADD_LEVEL); @@ -12614,7 +12601,6 @@ aClone.kitList.addAll(kitList); } aClone.templateAutoLanguages.addAll(templateAutoLanguages); - aClone.templateLanguages.addAll(templateLanguages); aClone.setBio(new String(getBio())); aClone.setBirthday(new String(getBirthday())); aClone.setBirthplace(new String(getBirthplace())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-08-31 03:04:28
|
Revision: 10360 http://pcgen.svn.sourceforge.net/pcgen/?rev=10360&view=rev Author: thpr Date: 2009-08-31 03:04:21 +0000 (Mon, 31 Aug 2009) Log Message: ----------- fix SVN 10356 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-31 03:01:10 UTC (rev 10359) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-08-31 03:04:21 UTC (rev 10360) @@ -5657,9 +5657,7 @@ } // Get existing classes - final List<PCClass> existingClasses = - new ArrayList<PCClass>(getClassSet()); - classFacet.removeAllClasses(id); + ClassInfo ci = classFacet.removeAllClasses(id); // // Remove all saved monster level information @@ -5699,12 +5697,11 @@ // If user has chosen a class before choosing a race, // we need to tweak the number of skill points and feats // - if (!isImporting() && existingClasses.size() != 0) + if (!isImporting() && ci != null && !ci.isEmpty()) { int totalLevels = this.getTotalLevels(); - // final Integer zero = Integer.valueOf(0); - for (PCClass pcClass : existingClasses) + for (PCClass pcClass : ci.getClassSet()) { // // Don't add monster classes back in. This will possibly @@ -5714,9 +5711,9 @@ if (!pcClass.isMonster()) { classFacet.addClass(id, pcClass); + final int cLevels = ci.getLevel(pcClass); + classFacet.setLevel(id, pcClass, cLevels); - final int cLevels = getLevel(pcClass); - setAssoc(pcClass, AssociationKey.SKILL_POOL, 0); int cMod = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-09-02 00:25:12
|
Revision: 10380 http://pcgen.svn.sourceforge.net/pcgen/?rev=10380&view=rev Author: thpr Date: 2009-09-02 00:22:19 +0000 (Wed, 02 Sep 2009) Log Message: ----------- eliminate duplicate method Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-02 00:18:04 UTC (rev 10379) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-02 00:22:19 UTC (rev 10380) @@ -1615,7 +1615,7 @@ double startAdjust = rangeLevel == 0 ? 0 : startLevel / rangeLevel; pool += - Math.floor((this.getTotalCharacterLevel() >= startLevel) ? 1.0d + Math.floor((this.totalNonMonsterLevels() >= startLevel) ? 1.0d + pcpool - startAdjust + 0.0001 : pcpool + 0.0001); pool += Math.floor(mpool + 0.0001); pool += Math.floor(bonus + 0.0001); @@ -4614,7 +4614,7 @@ if (check != null) { - totalClassLevels = getTotalCharacterLevel(); + totalClassLevels = totalNonMonsterLevels(); if (totalClassLevels > SettingsHandler.getGame().getChecksMaxLvl()) { isEpic = true; @@ -7498,7 +7498,7 @@ } // Check for Epic - final int totalClassLevels = getTotalCharacterLevel(); + final int totalClassLevels = totalNonMonsterLevels(); Map<String, String> totalLvlMap = null; final Map<String, String> classLvlMap; boolean isEpic = false; @@ -10466,27 +10466,6 @@ return s; } - /** - * get the total number of character levels a character has. A character - * level is any class level that is not a monster level - * - * @return total character level - */ - private int getTotalCharacterLevel() - { - int total = 0; - - for (PCClass pcClass : getClassSet()) - { - if (!pcClass.isMonster()) - { - total += getLevel(pcClass); - } - } - - return total; - } - private HashMap<String, String> getTotalLevelHashMap() { final HashMap<String, String> lvlMap = new HashMap<String, String>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-09-04 22:03:11
|
Revision: 10398 http://pcgen.svn.sourceforge.net/pcgen/?rev=10398&view=rev Author: thpr Date: 2009-09-04 22:03:01 +0000 (Fri, 04 Sep 2009) Log Message: ----------- convert realAbilities to isolate lists and guarantee known add/remove behavior Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-04 21:57:03 UTC (rev 10397) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-04 22:03:01 UTC (rev 10398) @@ -378,8 +378,8 @@ * These are abilities that are added directly to the character rather than * being added to a class, template etc that the character possesses. */ - private Map<Category<Ability>, List<Ability>> realAbilities = - new HashMap<Category<Ability>, List<Ability>>(); + private HashMapToList<Category<Ability>, Ability> realAbilities = + new HashMapToList<Category<Ability>, Ability>(); /** * List of all directly assigned virtual nature abilities split by category. @@ -12984,13 +12984,7 @@ return false; } anAbility.setAbilityNature(Nature.NORMAL); - List<Ability> abilities = realAbilities.get(aCategory); - if (abilities == null) - { - abilities = new ArrayList<Ability>(); - realAbilities.put(aCategory, abilities); - } - abilities.add(anAbility); + realAbilities.addToListFor(aCategory, anAbility); return true; } @@ -13309,12 +13303,7 @@ public boolean removeRealAbility(final AbilityCategory aCategory, final Ability anAbility) { - final List<Ability> abilities = realAbilities.get(aCategory); - if (abilities == null) - { - return false; - } - return abilities.remove(anAbility); + return realAbilities.removeFromListFor(aCategory, anAbility); } public void adjustFeats(final double arg) @@ -13501,7 +13490,7 @@ { double iCount = 0; - List<Ability> abilities = realAbilities.get(AbilityCategory.FEAT); + List<Ability> abilities = realAbilities.getListFor(AbilityCategory.FEAT); if (abilities == null) { return 0; @@ -14156,10 +14145,13 @@ if (nature != Nature.ANY) { List<Ability> abilities = new ArrayList<Ability>(); - if (nature == Nature.NORMAL - && realAbilities.get(cat) != null) + if (nature == Nature.NORMAL) { - abilities.addAll(realAbilities.get(cat)); + List<Ability> abilityList = realAbilities.getListFor(cat); + if (abilityList != null) + { + abilities.addAll(abilityList); + } } else if (nature == Nature.VIRTUAL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-09-05 20:40:28
|
Revision: 10409 http://pcgen.svn.sourceforge.net/pcgen/?rev=10409&view=rev Author: thpr Date: 2009-09-05 20:40:03 +0000 (Sat, 05 Sep 2009) Log Message: ----------- initialize height + weight Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-05 20:33:45 UTC (rev 10408) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-05 20:40:03 UTC (rev 10409) @@ -434,6 +434,8 @@ checkFacet.addAll(id, Globals.getContext().ref .getOrderSortedCDOMObjects(PCCheck.class)); genderFacet.setGender(id, Gender.values()[0]); + heightFacet.setHeight(id, 0); + weightFacet.setWeight(id, 0); setRace(Globals.s_EMPTYRACE); setName(Constants.EMPTY_STRING); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-09-26 22:12:57
|
Revision: 10614 http://pcgen.svn.sourceforge.net/pcgen/?rev=10614&view=rev Author: thpr Date: 2009-09-26 22:12:41 +0000 (Sat, 26 Sep 2009) Log Message: ----------- FindBugs cleanup Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-26 21:58:22 UTC (rev 10613) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-09-26 22:12:41 UTC (rev 10614) @@ -4562,69 +4562,64 @@ Map<String, String> totalLvlMap = null; final Map<String, String> classLvlMap; - if (check != null) + totalClassLevels = totalNonMonsterLevels(); + if (totalClassLevels > SettingsHandler.getGame().getChecksMaxLvl()) { - totalClassLevels = totalNonMonsterLevels(); - if (totalClassLevels > SettingsHandler.getGame().getChecksMaxLvl()) + isEpic = true; + Integer epicCheck = epicCheckMap.get(check); + if (epicCheck == null) { - isEpic = true; - Integer epicCheck = epicCheckMap.get(check); - if (epicCheck == null) - { - totalLvlMap = getTotalLevelHashMap(); - classLvlMap = - getCharacterLevelHashMap(SettingsHandler.getGame() - .getChecksMaxLvl()); - getVariableProcessor().pauseCache(); - setClassLevelsBrazenlyTo(classLvlMap); // insure class-levels - // total is below some - // value (e.g. 20) - } - else - { - //Logging.errorPrint("getBaseCheck(): '" + cacheLookup + "' = epic='" + epicCheck + "'"); //$NON-NLS-1$ - return epicCheck; - } + totalLvlMap = getTotalLevelHashMap(); + classLvlMap = getCharacterLevelHashMap(SettingsHandler + .getGame().getChecksMaxLvl()); + getVariableProcessor().pauseCache(); + setClassLevelsBrazenlyTo(classLvlMap); // insure class-levels + // total is below some + // value (e.g. 20) } + else + { + // Logging.errorPrint("getBaseCheck(): '" + cacheLookup + "' = + // epic='" + epicCheck + "'"); //$NON-NLS-1$ + return epicCheck; + } + } - final String checkName = check.getKeyName(); - bonus = getTotalBonusTo("CHECKS", "BASE." + checkName); + final String checkName = check.getKeyName(); + bonus = getTotalBonusTo("CHECKS", "BASE." + checkName); - // - // now we see if this PC is a Familiar/Mount - final PlayerCharacter nPC = getMasterPC(); + // + // now we see if this PC is a Familiar/Mount + final PlayerCharacter nPC = getMasterPC(); - if ((nPC != null) && (getCopyMasterCheck().length() > 0)) - { - int masterBonus = nPC.getBaseCheck(check); + if ((nPC != null) && (getCopyMasterCheck().length() > 0)) + { + int masterBonus = nPC.getBaseCheck(check); - final String copyMasterCheck = - replaceMasterString(getCopyMasterCheck(), masterBonus); - masterBonus = - getVariableValue(copyMasterCheck, - Constants.EMPTY_STRING).intValue(); + final String copyMasterCheck = replaceMasterString( + getCopyMasterCheck(), masterBonus); + masterBonus = getVariableValue(copyMasterCheck, + Constants.EMPTY_STRING).intValue(); - // use masters save if better - bonus = Math.max(bonus, masterBonus); - } + // use masters save if better + bonus = Math.max(bonus, masterBonus); + } - if (isEpic) - { - epicCheckMap.put(check, (int) bonus); - } + if (isEpic) + { + epicCheckMap.put(check, (int) bonus); + } - if (totalLvlMap != null) - { - setClassLevelsBrazenlyTo(totalLvlMap); - getVariableProcessor().restartCache(); - } + if (totalLvlMap != null) + { + setClassLevelsBrazenlyTo(totalLvlMap); + getVariableProcessor().restartCache(); } return (int) bonus; } /** - * Returns the total check value for the check specified for the - * character. + * Returns the total check value for the check specified for the character. * * <p> * This total includes all check bonuses the character has. @@ -5385,7 +5380,7 @@ */ public Double getMovement(final int moveIdx) { - if ((getMovements() != null) && (moveIdx < movements.length)) + if ((movements != null) && (moveIdx < movements.length)) { return movements[moveIdx]; } @@ -8420,7 +8415,6 @@ // In order for the BONUS's to work, the PC we want // to get the hit points for must be the "current" one. // - final PlayerCharacter curPC = this; int masterHP = nPC.hitPoints(); final String copyMasterHP = @@ -9687,7 +9681,7 @@ */ Double getMovementMult(final int moveIdx) { - if ((getMovements() != null) && (moveIdx < movementMult.length)) + if ((movements != null) && (moveIdx < movementMult.length)) { return movementMult[moveIdx]; } @@ -10096,16 +10090,6 @@ } /** - * an array of movement speeds - * - * @return array of Integer movement speeds - */ - public Double[] getMovements() - { - return movements; - } - - /** * sets up the movement arrays creates them if they do not exist * * @param moveType @@ -10713,7 +10697,6 @@ { final StringTokenizer aTok = new StringTokenizer(aString, Constants.PIPE); - String outputString = Constants.PIPE; while (aTok.hasMoreTokens()) { @@ -10739,13 +10722,7 @@ Logging.errorPrint(ple.getMessage(), ple); } } - else - { - outputString += (bString + Constants.PIPE); - } } - - aString = outputString.substring(1); // TODO: value never used } /** @@ -11847,7 +11824,7 @@ calcActiveBonuses(); } - private class CasterLevelSpellBonus + private static class CasterLevelSpellBonus { private int bonus; private String type; @@ -12107,44 +12084,44 @@ } for (String book : spellBooks) { - aClone.addSpellBook(new String(book)); + aClone.addSpellBook(book); } aClone.tempBonusItemList.addAll(tempBonusItemList); aClone.bonusManager = bonusManager.buildDeepClone(aClone); aClone.selectedFavoredClass = selectedFavoredClass; - aClone.setBio(new String(getBio())); - aClone.setBirthday(new String(getBirthday())); - aClone.setBirthplace(new String(getBirthplace())); - aClone.setCatchPhrase(new String(getCatchPhrase())); - aClone.setCurrentEquipSetName(new String(getCurrentEquipSetName())); - aClone.setDescription(new String(getDescription())); - aClone.setDescriptionLst(new String(getDescriptionLst())); - aClone.setEyeColor(new String(getEyeColor())); - aClone.setFileName(new String(getFileName())); + aClone.setBio(getBio()); + aClone.setBirthday(getBirthday()); + aClone.setBirthplace(getBirthplace()); + aClone.setCatchPhrase(getCatchPhrase()); + aClone.setCurrentEquipSetName(getCurrentEquipSetName()); + aClone.setDescription(getDescription()); + aClone.setDescriptionLst(getDescriptionLst()); + aClone.setEyeColor(getEyeColor()); + aClone.setFileName(getFileName()); aClone.setGender(getGenderObject()); - aClone.setHairColor(new String(getHairColor())); - aClone.setHairStyle(new String(getHairStyle())); - aClone.setHanded(new String(getHanded())); - aClone.setInterests(new String(getInterests())); - aClone.setLocation(new String(getLocation())); - aClone.setName(new String(getName())); - aClone.setPhobias(new String(getPhobias())); - aClone.setPlayersName(new String(getPlayersName())); - aClone.setPortraitPath(new String(getPortraitPath())); + aClone.setHairColor(getHairColor()); + aClone.setHairStyle(getHairStyle()); + aClone.setHanded(getHanded()); + aClone.setInterests(getInterests()); + aClone.setLocation(getLocation()); + aClone.setName(getName()); + aClone.setPhobias(getPhobias()); + aClone.setPlayersName(getPlayersName()); + aClone.setPortraitPath(getPortraitPath()); if (getRegion() != null) { - aClone.setRegion(new String(getRegion())); + aClone.setRegion(getRegion()); } - aClone.setResidence(new String(getResidence())); - aClone.setSkinColor(new String(getSkinColor())); - aClone.setSpeechTendency(new String(getSpeechTendency())); + aClone.setResidence(getResidence()); + aClone.setSkinColor(getSkinColor()); + aClone.setSpeechTendency(getSpeechTendency()); if (getSubRegion() != null) { - aClone.setSubRegion(new String(getSubRegion())); + aClone.setSubRegion(getSubRegion()); } - aClone.tabName = new String(tabName); - aClone.setTrait1(new String(getTrait1())); - aClone.setTrait2(new String(getTrait2())); + aClone.tabName = tabName; + aClone.setTrait1(getTrait1()); + aClone.setTrait2(getTrait2()); if (theWeaponProfs != null) { aClone.theWeaponProfs = new TreeSet<WeaponProf>(); @@ -12153,8 +12130,8 @@ aClone.autoKnownSpells = autoKnownSpells; aClone.autoLoadCompanion = autoLoadCompanion; aClone.autoSortGear = autoSortGear; - aClone.outputSheetHTML = new String(outputSheetHTML); - aClone.outputSheetPDF = new String(outputSheetPDF); + aClone.outputSheetHTML = outputSheetHTML; + aClone.outputSheetPDF = outputSheetPDF; aClone.ageSetKitSelections = new boolean[10]; System.arraycopy(ageSetKitSelections, 0, aClone.ageSetKitSelections, 0, @@ -12876,9 +12853,6 @@ public HashMap<Nature, Set<Ability>> getAbilitiesSet() { - - final Set<Category<Ability>> abCats = abilityFacet.getCategories(id); - HashMap<Nature, Set<Ability>> st = new HashMap<Nature, Set<Ability>>(); @@ -15674,7 +15648,7 @@ abilityFacet.add(id, cat, nature, abil); } - private class AbilityMonitor implements DataFacetChangeListener<Ability> + private static class AbilityMonitor implements DataFacetChangeListener<Ability> { boolean changed = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-10-30 21:34:01
|
Revision: 10847 http://pcgen.svn.sourceforge.net/pcgen/?rev=10847&view=rev Author: thpr Date: 2009-10-30 21:33:53 +0000 (Fri, 30 Oct 2009) Log Message: ----------- SR tag not working on a class level lines Issue#: 2887224 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-10-30 21:32:39 UTC (rev 10846) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-10-30 21:33:53 UTC (rev 10847) @@ -7711,6 +7711,17 @@ SR = Math.max(SR, pcClass.getSafe(ObjectKey.SR).getReduction() .resolve(this, pcClass.getQualifiedKey()).intValue()); + int lvl = getLevel(pcClass); + for (int i = 0; i <= lvl; i++) + { + PCClassLevel pcl = getActiveClassLevel(pcClass, i); + if (pcl != null) + { + SR = + Math.max(SR, pcl.getSafe(ObjectKey.SR).getReduction() + .resolve(this, pcl.getQualifiedKey()).intValue()); + } + } } for (Ability aFeat : getFullAbilitySet()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-10-31 02:14:53
|
Revision: 10856 http://pcgen.svn.sourceforge.net/pcgen/?rev=10856&view=rev Author: thpr Date: 2009-10-31 02:14:45 +0000 (Sat, 31 Oct 2009) Log Message: ----------- SPELLS tag not working in Class Issue#: 2880818 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-10-31 02:07:37 UTC (rev 10855) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-10-31 02:14:45 UTC (rev 10856) @@ -5839,6 +5839,15 @@ for (PCClass pcClass : getClassSet()) { addSpells(pcClass); + int lvl = getLevel(pcClass); + for (int i = 0; i <= lvl; i++) + { + PCClassLevel pcl = getActiveClassLevel(pcClass, i); + if (pcl != null) + { + addSpells(pcl); + } + } } for (Ability ability : getFullAbilitySet()) @@ -10278,7 +10287,7 @@ return lvlMap; } - private void addSpells(final PObject obj) + private void addSpells(final CDOMObject obj) { Race race = getRace(); if (race == null || obj == null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2009-11-01 02:49:56
|
Revision: 10880 http://pcgen.svn.sourceforge.net/pcgen/?rev=10880&view=rev Author: jdempsey Date: 2009-11-01 02:49:48 +0000 (Sun, 01 Nov 2009) Log Message: ----------- Fix bug: Removing spell from prepared spells removes it from spells Issue#: 2882602 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-11-01 02:49:21 UTC (rev 10879) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-11-01 02:49:48 UTC (rev 10880) @@ -8002,7 +8002,10 @@ // Remove the spell form the character's class instance if it // is no longer present in any book - removeAssoc(aClass, AssociationListKey.CHARACTER_SPELLS, acs); + if (acs.getInfoList().isEmpty()) + { + removeAssoc(aClass, AssociationListKey.CHARACTER_SPELLS, acs); + } return ""; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jde...@us...> - 2009-11-03 08:09:47
|
Revision: 10900 http://pcgen.svn.sourceforge.net/pcgen/?rev=10900&view=rev Author: jdempsey Date: 2009-11-03 08:09:38 +0000 (Tue, 03 Nov 2009) Log Message: ----------- Fix bug: [5.17.0] NPE when adding ability Issue#: 2890573 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-11-03 05:49:15 UTC (rev 10899) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2009-11-03 08:09:38 UTC (rev 10900) @@ -15642,11 +15642,14 @@ public boolean hasUserVirtualAbility(AbilityCategory cat, Ability abilityInfo) { List<Ability> list = virtualAbilities.getListFor(cat); - for (Ability ability : list) + if (list != null) { - if (AbilityUtilities.areSameAbility(ability, abilityInfo)) + for (Ability ability : list) { - return true; + if (AbilityUtilities.areSameAbility(ability, abilityInfo)) + { + return true; + } } } return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2010-05-21 22:03:25
|
Revision: 11921 http://pcgen.svn.sourceforge.net/pcgen/?rev=11921&view=rev Author: thpr Date: 2010-05-21 22:03:19 +0000 (Fri, 21 May 2010) Log Message: ----------- cleanup Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2010-05-21 21:55:41 UTC (rev 11920) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2010-05-21 22:03:19 UTC (rev 11921) @@ -67,7 +67,6 @@ import pcgen.cdom.base.Constants; import pcgen.cdom.base.PersistentTransitionChoice; import pcgen.cdom.base.PrereqObject; -import pcgen.cdom.base.SelectableSet; import pcgen.cdom.base.TransitionChoice; import pcgen.cdom.content.HitDie; import pcgen.cdom.content.LevelCommandFactory; @@ -8509,63 +8508,8 @@ * Calculates the number of languages that the character is qualified * for. * - * @param includeSpeakLanguage Should languages granted by the speak language skill be include * @return The number of languages allowed */ - public int languageNum(final boolean includeSpeakLanguage) - { - - int i = Math.max(0, (int) getStatBonusTo("LANG", "BONUS")); - final Race pcRace = getRace(); - - if (includeSpeakLanguage) - { - for (Skill skill : getSkillSet()) - { - if (skill.getSafe(StringKey.CHOICE_STRING).indexOf("Language") >= 0) - { - i += SkillRankControl.getTotalRank(this, skill).intValue(); - } - } - } - - if (pcRace != null) - { - i += ((int) getTotalBonusTo("LANGUAGES", "NUMBER")); - } - - // - // Check all for ADD:LANGUAGE - // - for (CDOMObject cdo : getCDOMObjectList()) - { - List<PersistentTransitionChoice<?>> adds = - cdo.getListFor(ListKey.ADD); - if (adds != null) - { - for (PersistentTransitionChoice<?> ptc : adds) - { - SelectableSet<?> ch = ptc.getChoices(); - if (LANGUAGE_CLASS.equals(ch.getChoiceClass())) - { - i += ptc.getCount().resolve(this, null).intValue(); - //i += this.getAssocCount(ptc, AssociationListKey.ADD); - } - } - } - } - - i += freeLangs; - - return i; - } - - /** - * Calculates the number of languages that the character is qualified - * for. - * - * @return The number of languages allowed - */ public int getBonusLanguageCount() { int i = Math.max(0, (int) getStatBonusTo("LANG", "BONUS")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |