Search in sources :

Example 1 with INJURY

use of main.content.CONTENT_CONSTS2.INJURY in project Eidolons by IDemiurge.

the class InjuryEffect method applyThis.

@Override
public boolean applyThis() {
    int mod = 100 - getTarget().getIntParam(PARAMS.INJURY_RESISTANCE);
    if (mod <= 0) {
        return true;
    }
    INJURY injury;
    if (template != null) {
        injury = template;
    } else {
        injury = getRandomInjury();
    }
    // preCheck applicable
    getTarget().addProperty(PROPS.INJURIES, StringMaster.getWellFormattedString(injury.toString()));
    Effects effects = EffectFinder.initParamModEffects(injury.getModString(), ref);
    // TODO ++ PROPS
    if (mod != 100) {
        effects.appendFormulaByMod(mod);
    }
    effects.apply(ref);
    return true;
}
Also used : INJURY(main.content.CONTENT_CONSTS2.INJURY) Effects(main.ability.effects.Effects)

Example 2 with INJURY

use of main.content.CONTENT_CONSTS2.INJURY in project Eidolons by IDemiurge.

the class InjuryRule method applyOldWounds.

public static void applyOldWounds(Unit hero) {
    Effects effects = new Effects();
    for (String substring : StringMaster.open(hero.getProperty(PROPS.INJURIES))) {
        INJURY template = new EnumMaster<INJURY>().retrieveEnumConst(INJURY.class, substring);
        effects.add(new InjuryEffect(template, true));
    }
    effects.apply(Ref.getSelfTargetingRefCopy(hero));
}
Also used : INJURY(main.content.CONTENT_CONSTS2.INJURY) InjuryEffect(eidolons.ability.effects.oneshot.rule.InjuryEffect) Effects(main.ability.effects.Effects)

Aggregations

Effects (main.ability.effects.Effects)2 INJURY (main.content.CONTENT_CONSTS2.INJURY)2 InjuryEffect (eidolons.ability.effects.oneshot.rule.InjuryEffect)1