Skip to content

Commit

Permalink
Implemented the new Combos and Anima boxes. Also started laying the f…
Browse files Browse the repository at this point in the history
…oundations for the Sorcery/Thaumaturgy section, currently commented out.
  • Loading branch information
ericastor committed Jul 29, 2011
1 parent faae733 commit fa28efc
Show file tree
Hide file tree
Showing 54 changed files with 685 additions and 479 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public Abyssal2ndAnimaEncoderFactory(IResources resources, BaseFont basefont, Ba
super(resources, basefont, symbolBaseFont);
}

@Override
protected int getAnimaPowerCount() {
return 2;
}

@Override
protected IPdfTableEncoder getAnimaTableEncoder() {
return new AnimaTableEncoder(getResources(), getBaseFont(), getFontSize(), new AnimaTableStealthProvider(getResources()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public IPdfContentBoxEncoder getGreatCurseEncoder() {

@Override
public IPdfContentBoxEncoder getAnimaEncoder() {
return new Abyssal2ndAnimaEncoderFactory(getResources(), getBaseFont(), getSymbolBaseFont()).createAnimaEncoder();
return new Abyssal2ndAnimaEncoderFactory(getResources(), getBaseFont(), getBaseFont()).createAnimaEncoder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ public AbyssalAnimaEncoderFactory(IResources resources, BaseFont basefont, BaseF
super(resources, basefont, symbolBaseFont);
}

@Override
protected int getAnimaPowerCount() {
return 4;
}

@Override
protected IPdfTableEncoder getAnimaTableEncoder() {
return new AnimaTableEncoder(getResources(), getBaseFont(), getFontSize(), new AbyssalAnimaTableStealthProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public IPdfContentBoxEncoder getGreatCurseEncoder() {

@Override
public IPdfContentBoxEncoder getAnimaEncoder() {
return new AbyssalAnimaEncoderFactory(getResources(), getBaseFont(), getSymbolBaseFont()).createAnimaEncoder();
return new AbyssalAnimaEncoderFactory(getResources(), getBaseFont(), getBaseFont()).createAnimaEncoder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ public DbAnimaEncoderFactory(IResources resources, BaseFont basefont, BaseFont s
super(resources, basefont, symbolBaseFont);
}

@Override
protected int getAnimaPowerCount() {
return 4;
}

@Override
protected IPdfTableEncoder getAnimaTableEncoder() {
return new AnimaTableEncoder(getResources(), getBaseFont(), getFontSize(), new DbAnimaTableRangeProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public IPdfContentBoxEncoder getGreatCurseEncoder() {

@Override
public IPdfContentBoxEncoder getAnimaEncoder() {
return new DbAnimaEncoderFactory(getResources(), getBaseFont(), getSymbolBaseFont()).createAnimaEncoder();
return new DbAnimaEncoderFactory(getResources(), getBaseFont(), getBaseFont()).createAnimaEncoder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public IPdfContentBoxEncoder getGreatCurseEncoder() {

@Override
public IPdfContentBoxEncoder getAnimaEncoder() {
return new DbAnimaEncoderFactory(getResources(), getBaseFont(), getSymbolBaseFont()).createAnimaEncoder();
return new DbAnimaEncoderFactory(getResources(), getBaseFont(), getBaseFont()).createAnimaEncoder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface ICharmTemplate {

public IUniqueRequiredCharmType getUniqueRequiredCharmType();

public boolean knowsCharms(IExaltedRuleSet rules);
public boolean canLearnCharms(IExaltedRuleSet rules);

public boolean isAllowedAlienCharms(ICasteType caste);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@

public interface ISpellMagicTemplate {

public CircleType[] getSorceryCircles();

public CircleType[] getNecromancyCircles();

public CircleType[] getSorceryCircles();
public boolean canLearnSorcery();

public boolean canLearnNecromancy();

public boolean canLearnSpellMagic();

public boolean knowsNecromancy();
public boolean knowsSorcery(ICharm[] knownCharms);

public boolean knowsSorcery();
public boolean knowsNecromancy(ICharm[] knownCharms);

public boolean knowsSpellMagic();
public boolean knowsSpellMagic(ICharm[] knownCharms);

public boolean canLearnSpell(ISpell spell, ICharm[] knownCharms);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public IMartialArtsRules getMartialArtsRules() {
return martialArtsRules;
}

public boolean knowsCharms(IExaltedRuleSet rules) {
public boolean canLearnCharms(IExaltedRuleSet rules) {
return charmSet.getCharms(rules).length > 0 || charmSet.getMartialArtsCharms(rules).length > 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,94 @@ public class SpellMagicTemplate implements ISpellMagicTemplate {
private final CircleType[] necromancyCircles;
private final ICharacterTemplate template;

public SpellMagicTemplate(CircleType[] sorceryCircles, CircleType[] necromancyCircles,
ICharacterTemplate template) {
public SpellMagicTemplate(CircleType[] sorceryCircles,
CircleType[] necromancyCircles,
ICharacterTemplate template) {
this.sorceryCircles = sorceryCircles;
this.necromancyCircles = necromancyCircles;
this.template = template;
}

public boolean knowsSorcery() {
public CircleType[] getSorceryCircles() {
return sorceryCircles;
}

public CircleType[] getNecromancyCircles() {
return necromancyCircles;
}

public boolean canLearnSorcery() {
return getSorceryCircles() != null && getSorceryCircles().length != 0;
}

public boolean knowsNecromancy() {
public boolean canLearnNecromancy() {
return getNecromancyCircles() != null && getNecromancyCircles().length != 0;
}

public CircleType[] getSorceryCircles() {
return sorceryCircles;
public boolean canLearnSpellMagic() {
return canLearnSorcery() || canLearnNecromancy();
}

public CircleType[] getNecromancyCircles() {
return necromancyCircles;
protected boolean knowsCharm(String charm, ICharm[] knownCharms) {
for (ICharm knownCharm : knownCharms)
if (charm.equals(knownCharm.getId()))
return true;
return false;
}

public boolean knowsSpellMagic() {
return knowsNecromancy() || knowsSorcery();

public boolean knowsSorcery(ICharm[] knownCharms) {
for (CircleType circle : sorceryCircles) {
if (knowsCharm(getInitiation(circle), knownCharms)) {
return true;
}
}
return false;
}

public boolean knowsNecromancy(ICharm[] knownCharms) {
for (CircleType circle : necromancyCircles) {
if (knowsCharm(getInitiation(circle), knownCharms)) {
return true;
}
}
return false;
}

public boolean knowsSpellMagic(ICharm[] knownCharms) {
return knowsSorcery(knownCharms) || knowsNecromancy(knownCharms);
}

@Override
public boolean canLearnSpell(ISpell spell, ICharm[] knownCharms)
{
final String[] circleCharmName = new String[1];
spell.getCircleType().accept(new ICircleTypeVisitor() {
public void visitTerrestrial(CircleType type) {
circleCharmName[0] = template.getTemplateType().getCharacterType().getId() + ".TerrestrialCircleSorcery"; //$NON-NLS-1$
}

public void visitCelestial(CircleType type) {
circleCharmName[0] = template.getTemplateType().getCharacterType().getId() + ".CelestialCircleSorcery"; //$NON-NLS-1$
}

public void visitSolar(CircleType type) {
circleCharmName[0] = template.getTemplateType().getCharacterType().getId() + ".SolarCircleSorcery"; //$NON-NLS-1$
}

public void visitShadowland(CircleType type) {
circleCharmName[0] = template.getTemplateType().getCharacterType().getId() + ".ShadowlandsCircleNecromancy"; //$NON-NLS-1$
}

public void visitLabyrinth(CircleType type) {
circleCharmName[0] = template.getTemplateType().getCharacterType().getId() + ".LabyrinthCircleNecromancy"; //$NON-NLS-1$
}

public void visitVoid(CircleType type) {
circleCharmName[0] = template.getTemplateType().getCharacterType().getId() + ".VoidCircleNecromancy"; //$NON-NLS-1$
}
});
for (ICharm charm : knownCharms)
if (charm.getId().equals(circleCharmName[0]))
return true;
return false;
public boolean canLearnSpell(ISpell spell, ICharm[] knownCharms) {
return knowsCharm(getInitiation(spell.getCircleType()), knownCharms);
}

public String getInitiation(CircleType type) {
final String[] initiation = new String[1];
type.accept(new ICircleTypeVisitor() {
public void visitTerrestrial(CircleType type) {
initiation[0] = template.getTemplateType().getCharacterType().getId() + ".TerrestrialCircleSorcery"; //$NON-NLS-1$
}

public void visitCelestial(CircleType type) {
initiation[0] = template.getTemplateType().getCharacterType().getId() + ".CelestialCircleSorcery"; //$NON-NLS-1$
}

public void visitSolar(CircleType type) {
initiation[0] = template.getTemplateType().getCharacterType().getId() + ".SolarCircleSorcery"; //$NON-NLS-1$
}

public void visitShadowland(CircleType type) {
initiation[0] = template.getTemplateType().getCharacterType().getId() + ".ShadowlandsCircleNecromancy"; //$NON-NLS-1$
}

public void visitLabyrinth(CircleType type) {
initiation[0] = template.getTemplateType().getCharacterType().getId() + ".LabyrinthCircleNecromancy"; //$NON-NLS-1$
}

public void visitVoid(CircleType type) {
initiation[0] = template.getTemplateType().getCharacterType().getId() + ".VoidCircleNecromancy"; //$NON-NLS-1$
}
});
return initiation[0];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ public InfernalAnimaEncoderFactory(IResources resources, BaseFont basefont, Base
protected IPdfTableEncoder getAnimaTableEncoder() {
return new AnimaTableEncoder(getResources(), getBaseFont(), getFontSize());
}

@Override
protected int getAnimaPowerCount() {
return 3;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public IPdfContentBoxEncoder getGreatCurseEncoder() {

@Override
public IPdfContentBoxEncoder getAnimaEncoder() {
return new InfernalAnimaEncoderFactory(getResources(), getBaseFont(), getSymbolBaseFont()).createAnimaEncoder();
return new InfernalAnimaEncoderFactory(getResources(), getBaseFont(), getBaseFont()).createAnimaEncoder();
}

public IPdfVariableContentBoxEncoder[] getAdditionalFirstPageEncoders()
Expand Down
Loading

0 comments on commit fa28efc

Please sign in to comment.