@Test public void testApplyCharacterWorldObject() { final WorldObject obj = mock(WorldObject.class); final Character caster = mock(Character.class); try { hpEffect1.apply(caster, obj); fail("Applying an effect for characters to a world object didn't fail."); } catch (final InvalidTargetException e) { } }
@Override public void apply(Character caster, Character target) { int points = minPoints + randomGenerator.nextInt(deltaPoints); points += (int) Math.round(points * EFFECT_MULTIPLIER * caster.getLevel()); target.addToHitPoints(points); }
HitPointsEffect implements Effect { @Override public void apply(Character caster, Character target) { int points = minPoints + randomGenerator.nextInt(deltaPoints); points += (int) Math.round(points * EFFECT_MULTIPLIER * caster.getLevel()); target.addToHitPoints(points); } }
HitPointsEffect implements Effect { @Override public void apply(Character caster, Character target) { int points = minPoints + randomGenerator.nextInt(deltaPoints); points += (int) Math.round(points * EFFECT_MULTIPLIER * caster.getLevel()); target.addToHitPoints(points); } HitPointsEffect(int minPoints, int maxPoints); }
HitPointsEffect implements Effect { @Override public void apply(Character caster, Character target) { int points = minPoints + randomGenerator.nextInt(deltaPoints); points += (int) Math.round(points * EFFECT_MULTIPLIER * caster.getLevel()); target.addToHitPoints(points); } HitPointsEffect(int minPoints, int maxPoints); @Override void apply(Character caster, Character target); @Override boolean appliesTo(Character caster, Character target); @Override boolean appliesTo(Character caster, WorldObject worldobject); @Override void apply(Character caster, WorldObject target); }
HitPointsEffect implements Effect { @Override public void apply(Character caster, Character target) { int points = minPoints + randomGenerator.nextInt(deltaPoints); points += (int) Math.round(points * EFFECT_MULTIPLIER * caster.getLevel()); target.addToHitPoints(points); } HitPointsEffect(int minPoints, int maxPoints); @Override void apply(Character caster, Character target); @Override boolean appliesTo(Character caster, Character target); @Override boolean appliesTo(Character caster, WorldObject worldobject); @Override void apply(Character caster, WorldObject target);  }