Search in sources :

Example 51 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class FilterMaster method filter.

public static List<? extends Entity> filter(List<? extends Entity> list, Condition condition, boolean out) {
    if (list == null) {
        return list;
    }
    Collection<Entity> removeList = new ArrayList<>();
    for (Entity e : list) {
        if (e == null) {
            continue;
        }
        Ref REF = e.getRef().getCopy();
        REF.setID(KEYS.MATCH.name(), e.getId());
        boolean check = !condition.preCheck(REF);
        if (out) {
            check = !check;
        }
        if (check) {
            removeList.add(e);
        }
    }
    list.removeAll(removeList);
    return list;
}
Also used : Entity(main.entity.Entity) Ref(main.entity.Ref) ArrayList(java.util.ArrayList)

Example 52 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class Property method getFullString.

public String getFullString() {
    if (autovar) {
        return FunctionManager.evaluateFunction(ref, FUNCTIONS.AUTOVAR, string);
    }
    if (obj_string == null) {
        if (fullString == null) {
            return ref.getValue(value_string);
        }
        return fullString;
    }
    entity = ref.getObj(obj_string);
    if (entity == null) {
        entity = ref.getType(obj_string);
    }
    if (entity == null) {
        if (obj_string.equalsIgnoreCase("EVENT")) {
            Ref REF = ref.getEvent().getRef();
            if (!value_string.contains(StringMaster.FORMULA_REF_SEPARATOR) && REF.getValue(value_string) != null) {
                return REF.getValue(value_string);
            } else {
                return new Property(StringMaster.wrapInCurlyBraces(value_string)).getStr(REF);
            }
        }
        return ref.getValue(value_string);
    }
    String str = (strict) ? entity.getProperty(ContentManager.getPROP(value_string), base) : entity.getProperty(ContentManager.getPROP(value_string), base);
    return str;
}
Also used : Ref(main.entity.Ref)

Example 53 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class Communicator method getRef.

@Deprecated
protected Ref getRef(String string) {
    // new Ref(string);
    Ref ref = null;
    ref.setGame(game);
    return ref;
}
Also used : Ref(main.entity.Ref)

Example 54 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class DivinationMaster method applyKnownSpellDivinationEffect.

private static void applyKnownSpellDivinationEffect(DC_SpellObj spell) {
    if (hero.checkPassive(UnitEnums.STANDARD_PASSIVES.DRUIDIC_VISIONS)) {
        Ref ref = Ref.getSelfTargetingRefCopy(hero);
        ref.setID(KEYS.SPELL, spell.getId());
        new ModifyValueEffect(PARAMS.C_ESSENCE, MOD.MODIFY_BY_CONST, DC_Formulas.DRUIDIC_VISIONS_ESSENCE).apply(ref);
        return;
    }
    if (hero.checkPassive(UnitEnums.STANDARD_PASSIVES.HOLY_PRAYER)) {
        Ref ref = Ref.getSelfTargetingRefCopy(hero);
        ref.setID(KEYS.SPELL, spell.getId());
        new ModifyValueEffect(PARAMS.C_MORALE, MOD.MODIFY_BY_CONST, DC_Formulas.HOLY_PRAYER_MORALE).apply(ref);
    // ++ REMOVE COOLDOWN FROM SPELL?
    }
    Ref ref = Ref.getSelfTargetingRefCopy(spell);
    AddBuffEffect buffEffect = new AddBuffEffect(BUFF_FAVORED, new Effects(new ModifyValueEffect(PARAMS.ESS_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.FOC_REQ, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.FOC_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.STA_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.SPELLPOWER_MOD, MOD.MODIFY_BY_PERCENT, "25")));
    buffEffect.apply(ref);
    buffEffect.getBuff().setDuration((// TODO
    hero.getIntParam(PARAMS.CHARISMA) + // GRACE!
    hero.getIntParam(PARAMS.DIVINATION_MASTERY)) / 5);
    buffEffect.getBuff().setProperty(G_PROPS.STD_BOOLS, "" + GenericEnums.STD_BOOLS.STACKING, true);
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Ref(main.entity.Ref) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 55 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class HC_SequenceMaster method chooseNewMember.

public void chooseNewMember(Party party) {
    Unit leader = party.getLeader();
    Conditions filterConditions = new Conditions() {

        @Override
        public boolean check(Ref ref) {
            return super.check(leader.getRef());
        }
    };
    OrConditions orConditions = new OrConditions();
    // StringContainersComparison principlesCondition = new
    // StringContainersComparison(
    // "{SOURCE_" + G_PROPS.PRINCIPLES + "}", "{MATCH_"
    // + G_PROPS.PRINCIPLES + "}");
    // orConditions.add(principlesCondition);
    // PartyManager
    // Conditions principlesConditions =
    // PartyManager.getPrincipleConditions(party);
    // orConditions.add(principlesConditions);
    // now gradual! TODO
    // StringComparison deityCondition = new StringComparison("{SOURCE_"
    // + G_PROPS.DEITY + "}", "{MATCH_" + G_PROPS.DEITY + "}", true);
    // 
    // orConditions.add(new Conditions(new NotCondition(new PropCondition(
    // G_PROPS.DEITY, "" + STD_DEITY_TYPE_NAMES.Faithless, true)),
    // deityCondition));
    // filterConditions.add(orConditions);
    NotCondition noDuplicatesCondition = new NotCondition(new StringContainersComparison(true, StringMaster.getValueRef(KEYS.PARTY, PROPS.MEMBERS), StringMaster.getValueRef(KEYS.MATCH, G_PROPS.NAME), false));
    filterConditions.add(noDuplicatesCondition);
    if (CharacterCreator.isArcadeMode()) {
        NumericCondition lvlCondition = new NumericCondition(false, StringMaster.getValueRef(KEYS.PARTY, PARAMS.LEVEL) + "+1", StringMaster.getValueRef(KEYS.MATCH, PARAMS.HERO_LEVEL));
        filterConditions.add(lvlCondition);
    }
    // filterConditions.setRef();
    launchEntitySelection(DC_TYPE.CHARS, MainManager.getPresetGroup(), filterConditions, leader, InfoMaster.CHOOSE_MEMBER);
    selection = SELECTION_TYPES.NEW_MEMBER_SELECTION;
}
Also used : Ref(main.entity.Ref) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

Ref (main.entity.Ref)155 Unit (eidolons.entity.obj.unit.Unit)28 ObjType (main.entity.type.ObjType)23 Event (main.game.logic.event.Event)16 ArrayList (java.util.ArrayList)15 Obj (main.entity.obj.Obj)15 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)13 Coordinates (main.game.bf.Coordinates)13 Conditions (main.elements.conditions.Conditions)12 Formula (main.system.math.Formula)11 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)10 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)9 PARAMETER (main.content.values.parameters.PARAMETER)9 DC_SpellObj (eidolons.entity.active.DC_SpellObj)8 Effects (main.ability.effects.Effects)8 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)7 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)7 Effect (main.ability.effects.Effect)7 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)5 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)5