@Override protected final void addMovementCells( SheetGraphics graphics, PdfPTable table, HealthLevelType level, int painTolerance, IGenericTraitCollection collection) { int woundPenalty = getPenalty(level, painTolerance); int dex = collection.getTrait(AttributeType.Dexterity).getCurrentValue(); int str = collection.getTrait(AttributeType.Strength).getCurrentValue(); int athletics = collection.getTrait(AbilityType.Athletics).getCurrentValue(); // minimum move is 1, minimum dash is 2, minimum jump h/v, swim, & climb is unknown int move = Math.max(dex + woundPenalty + mobilityPenalty, 1); int dash = Math.max(dex + woundPenalty + mobilityPenalty + 6, 2); int verticalJump = str + athletics + woundPenalty + mobilityPenalty; int horizontalJump = verticalJump * 2; table.addCell(createMovementCell(graphics, move, 1)); addSpaceCells(graphics, table, 1); table.addCell(createMovementCell(graphics, dash, 2)); addSpaceCells(graphics, table, 1); table.addCell(createMovementCell(graphics, horizontalJump, 0)); table.addCell(createMovementCell(graphics, verticalJump, 0)); }
@Override public IGenericTrait getTrait(final ITraitType type) { IGenericTrait attribute; IBeastformAttribute beastformattribute = beastmanCollection.getDeadlyBeastmanAttribute(type); if (beastformattribute == null) { attribute = collection.getTrait(type); } else { attribute = beastformattribute.getTrait(); } final int[] value = new int[1]; value[0] = attribute.getCurrentValue(); for (IQualitySelection<?> selection : model.getSelectedQualities()) { ((IMutation) selection.getQuality()) .accept( new MutationVisitorAdapter() { @Override public void visitAttributeEnhancingMutation(AttributeEnhancingMutation mutation) { if (mutation.getAttributeType() == type) { value[0] += mutation.getBonus(); } } }); } return new ValuedTraitType(type, value[0]); }
private int getBackgroundValue(IGenericTraitCollection traitCollection) { IGenericTrait background = traitCollection.getTrait(template); if (background == null) { return 0; } return background.getCurrentValue(); }