Search in sources :

Example 1 with ROLL_TYPES

use of main.content.enums.GenericEnums.ROLL_TYPES in project Eidolons by IDemiurge.

the class RollMaster method generateRollsFromString.

public static Rolls generateRollsFromString(String rollString) {
    boolean or = false;
    if (rollString.contains(StringMaster.AND_SEPARATOR)) {
        or = true;
    }
    Rolls rolls = new Rolls(or);
    String separator = StringMaster.AND_SEPARATOR;
    if (!or) {
        separator = StringMaster.AND;
    }
    for (String s : StringMaster.open(rollString, separator)) {
        String varPart = VariableManager.getVarPart(s);
        if (StringMaster.isEmpty(varPart)) {
            rolls.add(new Roll(new EnumMaster<ROLL_TYPES>().retrieveEnumConst(ROLL_TYPES.class, s), null, null));
            continue;
        }
        s = s.replace(varPart, "");
        varPart = StringMaster.cropParenthesises(varPart);
        String success = StringMaster.openContainer(varPart, StringMaster.VAR_SEPARATOR).get(0);
        String fail = StringMaster.openContainer(varPart, StringMaster.VAR_SEPARATOR).get(1);
        ROLL_TYPES type = new EnumMaster<ROLL_TYPES>().retrieveEnumConst(ROLL_TYPES.class, s);
        rolls.add(new Roll(type, success, fail));
    }
    return rolls;
}
Also used : ROLL_TYPES(main.content.enums.GenericEnums.ROLL_TYPES)

Example 2 with ROLL_TYPES

use of main.content.enums.GenericEnums.ROLL_TYPES in project Eidolons by IDemiurge.

the class ActivesConstructor method wrapInSaveRollEffect.

public static void wrapInSaveRollEffect(Effects effects, String saveRoll) {
    // TODO
    ArrayList<ROLL_TYPES> rolls = new ArrayList<>();
    ArrayList<String> vars = new ArrayList<>();
    for (String roll : StringMaster.open(saveRoll, StringMaster.AND_SEPARATOR)) {
        String varArgs = VariableManager.getVarPart(roll);
        roll = roll.replace(varArgs, "");
        rolls.add(new EnumMaster<ROLL_TYPES>().retrieveEnumConst(ROLL_TYPES.class, roll));
        vars.add(varArgs);
    }
    int i = 0;
    for (Effect e : effects) {
        for (ROLL_TYPES roll : rolls) {
            String args = StringMaster.cropParenthesises(vars.get(i));
            e = wrapInRoll(e, roll, args);
            i++;
        }
    }
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) ArrayList(java.util.ArrayList) ROLL_TYPES(main.content.enums.GenericEnums.ROLL_TYPES) DC_Effect(eidolons.ability.effects.DC_Effect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) RayEffect(eidolons.ability.effects.containers.customtarget.RayEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect)

Example 3 with ROLL_TYPES

use of main.content.enums.GenericEnums.ROLL_TYPES in project Eidolons by IDemiurge.

the class RollMaster method rollForceKnockdown.

/*
     * apply *Push* effect always if sufficient force
     * apply *Knockdown* instead plus damage for force if roll (?) failed
      TODO reflex? defense vs force? forceResistance - strength, armor,
         shield,
         rollLogged(roll_type, success, fail, ref, logString, rollSource)
         resist if reflex win
         draw if strength win
     */
public static Boolean rollForceKnockdown(Unit target, DC_ActiveObj attack, int force) {
    ROLL_TYPES roll_type = GenericEnums.ROLL_TYPES.FORCE;
    String success = "3*" + getStdFormula(GenericEnums.ROLL_TYPES.BODY_STRENGTH, true);
    String fail = "" + force / ForceRule.ROLL_FACTOR;
    // Ref ref = Ref.getSelfTargetingRefCopy(target);
    // ref.setSource(attack.getRef().getSource());
    Boolean result = new Roll(GenericEnums.ROLL_TYPES.FORCE, success, fail, 25).roll(attack.getRef());
    if (result == null) {
    }
    return result;
}
Also used : ROLL_TYPES(main.content.enums.GenericEnums.ROLL_TYPES)

Aggregations

ROLL_TYPES (main.content.enums.GenericEnums.ROLL_TYPES)3 DC_Effect (eidolons.ability.effects.DC_Effect)1 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 RayEffect (eidolons.ability.effects.containers.customtarget.RayEffect)1 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)1 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)1 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1 EnumMaster (main.system.auxiliary.EnumMaster)1