@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)); }
private float encodeTraitGroup( SheetGraphics graphics, FavorableTraitContent content, IIdentifiedTraitTypeGroup group, Position position, float width) { float height = 0; float groupLabelWidth = IVoidStateFormatConstants.LINE_HEIGHT + IVoidStateFormatConstants.TEXT_PADDING; float traitX = position.x + groupLabelWidth; ITraitType[] traitTypes = group.getAllGroupTypes(); float groupLabelX = position.x + 4; float markerX = groupLabelX + IVoidStateFormatConstants.TEXT_PADDING; for (int index = 0; index < traitTypes.length; index++) { ITraitType traitType = traitTypes[index]; float yPosition = position.y - (index + 1) * traitEncoder.getTraitHeight(); if (content.getMarkedTraitTypes().contains(traitType)) { encodeMarker(graphics, new Position(markerX, yPosition + 1)); } IGenericTraitCollection traitCollection = content.getTraitCollection(); IFavorableGenericTrait trait = traitCollection.getFavorableTrait(traitType); String label = content.getTraitLabel(traitType); if (content.shouldShowExcellencies()) { boolean[] excellencyLearned = content.hasExcellenciesLearned(traitType); height += encodeFavorableTrait( graphics, content, label, trait, excellencyLearned, new Position(traitX, yPosition), width - groupLabelWidth); } else { height += encodeFavorableTrait( graphics, content, label, trait, new Position(traitX, yPosition), width - groupLabelWidth); } } Position groupLabelPosition = new Position(groupLabelX, position.y - height / 2f); addGroupLabel(graphics, content, group, groupLabelPosition); return height; }
@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(); }
@Override public boolean isFavoredOrCasteTrait(ITraitType type) { return collection.isFavoredOrCasteTrait(type); }