diff --git a/litiengine/src/main/java/de/gurkenlabs/litiengine/abilities/AbilityAttributes.java b/litiengine/src/main/java/de/gurkenlabs/litiengine/abilities/AbilityAttributes.java index a4bb0df97..9fd4dbed3 100644 --- a/litiengine/src/main/java/de/gurkenlabs/litiengine/abilities/AbilityAttributes.java +++ b/litiengine/src/main/java/de/gurkenlabs/litiengine/abilities/AbilityAttributes.java @@ -95,4 +95,18 @@ public Attribute range() { public Attribute value() { return this.value; } + + /** + * Copies the values from another `AbilityAttributes` instance to this instance. + * + * @param otherAttributes the `AbilityAttributes` instance from which to copy values + */ + public void copyValues(AbilityAttributes otherAttributes) { + cooldown().setBaseValue(otherAttributes.cooldown().getBase()); + duration().setBaseValue(otherAttributes.duration().getBase()); + impact().setBaseValue(otherAttributes.impact().getBase()); + impactAngle().setBaseValue(otherAttributes.impactAngle().getBase()); + range().setBaseValue(otherAttributes.range().getBase()); + value().setBaseValue(otherAttributes.value().getBase()); + } } diff --git a/litiengine/src/main/java/de/gurkenlabs/litiengine/entities/Creature.java b/litiengine/src/main/java/de/gurkenlabs/litiengine/entities/Creature.java index 99b18edb5..8e5f0b838 100644 --- a/litiengine/src/main/java/de/gurkenlabs/litiengine/entities/Creature.java +++ b/litiengine/src/main/java/de/gurkenlabs/litiengine/entities/Creature.java @@ -70,9 +70,7 @@ public Creature(String spritesheetName) { if (spritesheetName != null) { this.setSpritesheetName(spritesheetName); } else { - this.setSpritesheetName( - Game.random() - .choose(EntityAnimationController.getDefaultSpritePrefixes(getClass()))); + this.setSpritesheetName(Game.random().choose(EntityAnimationController.getDefaultSpritePrefixes(getClass()))); } }