|
|
@@ -0,0 +1,34 @@
|
|
|
+package org.leumasjaffe.charsheet.model.skill;
|
|
|
+
|
|
|
+import lombok.AccessLevel;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.Setter;
|
|
|
+import lombok.experimental.FieldDefaults;
|
|
|
+
|
|
|
+@AllArgsConstructor
|
|
|
+@Data
|
|
|
+@FieldDefaults(level=AccessLevel.PRIVATE)
|
|
|
+public class DDSkill {
|
|
|
+ final String name;
|
|
|
+ final boolean requiresTraining;
|
|
|
+ String ability;
|
|
|
+
|
|
|
+ boolean isClassSkill = false;
|
|
|
+ @Setter(value=AccessLevel.PRIVATE) float ranks = 0.0f; // realistically, int + .0/.5
|
|
|
+ // This would be 2x ranks if cross-class, 1x if class.
|
|
|
+ // Unless you gain it as a class skill later, in which case it might be in-between
|
|
|
+ @Setter(value=AccessLevel.PRIVATE) int pointsSpent = 0;
|
|
|
+
|
|
|
+ public DDSkill(DDSkillPrototype proto) {
|
|
|
+ this.name = proto.getName();
|
|
|
+ this.requiresTraining = proto.isRequiresTraining();
|
|
|
+ this.ability = proto.getAbility();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void allocatePoints(int points) {
|
|
|
+ pointsSpent += points;
|
|
|
+ if ( isClassSkill ) { ranks += points; }
|
|
|
+ else { ranks += ( points / 2.0 ); }
|
|
|
+ }
|
|
|
+}
|