Commit 08824359 authored by hilaire1's avatar hilaire1
Browse files

new ability for the mentaly instead of the standard attack

parent 3b2fbf01
......@@ -72,7 +72,7 @@ CHATROSE
0
#abilityList
4
TEST_ATTACK_ABILITY
MENTALI_ATTACK
TEST_FIREBOLT
NULL_ABILITY
TEST_LP_FIREBOLT
......
......@@ -8,5 +8,6 @@ public enum AbilityKey {
TEST_ATTACK_ABILITY,
TEST_LP_FIREBOLT,
TEST_FIREBOLT,
MENTALI_ATTACK,
TEST_SUICIDE;
}
......@@ -40,6 +40,22 @@ public class AbilityRoster {
);
abilityFactory.registerAbilityGenerator(AbilityKey.TEST_ATTACK_ABILITY, abilityGenerator);
abilityGenerator =
() -> new Ability(
2000,
AbilityIconKeys.MENTALI_ATTACK,
Action.ATTACK,
new ArrayList<>(Arrays.asList(new EffectDescriptor(EffectKey.MENTALI_ATTACK_DAMAGE, new int[]{10000,32})))
);
abilityFactory.registerAbilityGenerator(AbilityKey.MENTALI_ATTACK, abilityGenerator);
abilityGenerator =
() -> new Ability(
2000,
......@@ -48,6 +64,7 @@ public class AbilityRoster {
new ArrayList<>(Arrays.asList(new EffectDescriptor(EffectKey.TEST_FIREBOLT, new int[]{5,10})))
);
abilityFactory.registerAbilityGenerator(AbilityKey.TEST_FIREBOLT, abilityGenerator);
abilityGenerator =
() -> new Ability(
2000,
......
package core.abilities.effects;
import core.zone.Translation;
/**
* Created by dupriez on 22/12/15.
*
......@@ -28,6 +30,23 @@ public final class EffectGeneratorRoster {
};
effectFactory.registerEffectGenerator(EffectKey.TEST_ATTACK_EFFECT, effectGenerator);
effectGenerator =
(casterCharacterID, parameters) -> {
int amountOfDamage = parameters.getNthParameter(0);
int range = parameters.getNthParameter(1);
return eb.affectZone((character -> (character.getHitbox().clone().translate(Translation.construct(character.getDirection(),range)) ) ),
eb.filter( CommonCharacterIDListFilter.allExceptOne(casterCharacterID),
eb.reduceHP(amountOfDamage)));
};
effectFactory.registerEffectGenerator(EffectKey.MENTALI_ATTACK_DAMAGE, effectGenerator);
effectGenerator =
(casterCharacterID, parameters) -> {
return eb.suicide();
......
......@@ -14,7 +14,8 @@ public enum EffectKey {
TEST_SUICIDE(1),
TRAP_TRIGGER(0),
TRIGGER_DEGAT(0),
TRIGGER_DEGAT_LP(0);
TRIGGER_DEGAT_LP(0),
MENTALI_ATTACK_DAMAGE(2);
private EffectKey(int parameterNb) {
this.parameterNb = parameterNb;
......
......@@ -11,6 +11,7 @@ public enum AbilityIconKeys {
VIAL_RED_1,
FIRE_BOLT_1,
FROST_BOLT_1,
MENTALI_ATTACK,
EXPLOSION_1,
NULL_ABILITY,
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment