|
|
@@ -3,8 +3,10 @@ package org.leumasjaffe.charsheet.model.features.impl;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import org.leumasjaffe.charsheet.model.DDCharacterClass;
|
|
|
import org.leumasjaffe.charsheet.model.features.DDFeaturePredicate;
|
|
|
import org.leumasjaffe.charsheet.model.features.DDProperty;
|
|
|
+import org.leumasjaffe.charsheet.model.magic.DDSpell;
|
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
|
@@ -21,17 +23,11 @@ public class PerSpellLevel implements DDProperty {
|
|
|
}
|
|
|
|
|
|
@Override @SuppressWarnings("unchecked")
|
|
|
- public Object value() {
|
|
|
- return this.value; // TODO consume spell level information
|
|
|
- }
|
|
|
-
|
|
|
- @Override @SuppressWarnings("unchecked")
|
|
|
- public void accumulate(Map<String, Object> props) {
|
|
|
+ public void accumulate(Map<String, Object> props, Object... data) {
|
|
|
+ final int level = DDSpell.class.cast(data[1]).getClassLevel(DDCharacterClass.class.cast(data[0]).getName());
|
|
|
// TODO: use groups
|
|
|
// TODO: allow multiple things
|
|
|
- // TODO: consume spell level information
|
|
|
props.putIfAbsent("effect", new HashMap<>());
|
|
|
- ((Map<String, Integer>) props.get("effect")).compute("value",
|
|
|
- (k, old) -> old == null ? value : value + (Integer) old);
|
|
|
+ ((Map<String, Object>) props.get("effect")).put("value", value * level);
|
|
|
}
|
|
|
}
|