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;
}
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;
}
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;
}
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);
}
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;
}
Aggregations