(StringBuilder buffer)
| 2056 | * completely changed due to new Spell API |
| 2057 | */ |
| 2058 | private void appendSpellLines(StringBuilder buffer) |
| 2059 | { |
| 2060 | |
| 2061 | for (PCClass pcClass : charDisplay.getClassSet()) |
| 2062 | { |
| 2063 | Collection<? extends CharacterSpell> sp = charDisplay.getCharacterSpells(pcClass); |
| 2064 | List<CharacterSpell> classSpells = new ArrayList<>(sp); |
| 2065 | // Add in the spells granted by objects |
| 2066 | thePC.addBonusKnownSpellsToList(pcClass, classSpells); |
| 2067 | Collections.sort(classSpells); |
| 2068 | |
| 2069 | for (CharacterSpell cSpell : classSpells) |
| 2070 | { |
| 2071 | for (SpellInfo spellInfo : cSpell.getInfoList()) |
| 2072 | { |
| 2073 | CDOMObject owner = cSpell.getOwner(); |
| 2074 | List<? extends CDOMList<Spell>> lists = charDisplay.getSpellLists(owner); |
| 2075 | |
| 2076 | if (SpellLevel.getFirstLevelForKey(cSpell.getSpell(), lists, thePC) < 0) |
| 2077 | { |
| 2078 | Logging.errorPrint( |
| 2079 | "Ignoring unqualified spell " + cSpell.getSpell() + " in list for class " + pcClass + "."); |
| 2080 | continue; |
| 2081 | } |
| 2082 | if (spellInfo.getBook().equals(Globals.getDefaultSpellBook()) |
| 2083 | && thePC.getSpellSupport(pcClass).isAutoKnownSpell(cSpell.getSpell(), |
| 2084 | SpellLevel.getFirstLevelForKey(cSpell.getSpell(), lists, thePC), false, thePC) |
| 2085 | && thePC.getAutoSpells()) |
| 2086 | { |
| 2087 | continue; |
| 2088 | } |
| 2089 | |
| 2090 | buffer.append(IOConstants.TAG_SPELLNAME).append(':'); |
| 2091 | buffer.append(EntityEncoder.encode(cSpell.getSpell().getKeyName())); |
| 2092 | buffer.append('|'); |
| 2093 | buffer.append(IOConstants.TAG_TIMES).append(':'); |
| 2094 | buffer.append(spellInfo.getTimes()); |
| 2095 | buffer.append('|'); |
| 2096 | buffer.append(IOConstants.TAG_CLASS).append(':'); |
| 2097 | buffer.append(EntityEncoder.encode(pcClass.getKeyName())); |
| 2098 | buffer.append('|'); |
| 2099 | buffer.append(IOConstants.TAG_SPELL_BOOK).append(':'); |
| 2100 | buffer.append(EntityEncoder.encode(spellInfo.getBook())); |
| 2101 | buffer.append('|'); |
| 2102 | buffer.append(IOConstants.TAG_SPELLLEVEL).append(':'); |
| 2103 | buffer.append(spellInfo.getActualLevel()); |
| 2104 | if (spellInfo.getNumPages() > 0) |
| 2105 | { |
| 2106 | buffer.append('|'); |
| 2107 | buffer.append(IOConstants.TAG_SPELLNUMPAGES).append(':'); |
| 2108 | buffer.append(spellInfo.getNumPages()); |
| 2109 | } |
| 2110 | |
| 2111 | final List<Ability> metaFeats = spellInfo.getFeatList(); |
| 2112 | |
| 2113 | if ((metaFeats != null) && (!metaFeats.isEmpty())) |
| 2114 | { |
| 2115 | buffer.append('|'); |
no test coverage detected