use of main.ability.Abilities in project Eidolons by IDemiurge.
the class DialogueSyntax method getAbilities.
public static Abilities getAbilities(String text) {
if (!text.contains(PARAM_MOD))
return null;
String parsedPart = text.substring(text.indexOf(PARAM_MOD), text.indexOf(PARAM_MOD_CLOSE));
// specify KEY
Targeting t = new FixedTargeting();
Effects paramModEffects = getParamModEffects(parsedPart);
if (!paramModEffects.getEffects().isEmpty()) {
return new Abilities(new ActiveAbility(t, paramModEffects));
}
return new Abilities(new ActiveAbility(t, new AbilityEffect(parsedPart)));
}
use of main.ability.Abilities in project Eidolons by IDemiurge.
the class ObjectiveMaster method initObjectiveTrigger.
public static void initObjectiveTrigger(OBJECTIVE_TYPE type, String data, Location mission) {
Dungeon dungeon = mission.getBossLevel();
objectiveData = data;
STANDARD_EVENT_TYPE eventType = null;
Conditions conditions = new Conditions();
Abilities abilities = new Abilities();
abilities.add(new ActiveAbility(new FixedTargeting(), new EndGameEffect(true)));
Ref ref = new Ref();
Integer id = null;
String name;
switch(type) {
case BOSS:
eventType = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_KILLED;
Coordinates c = DC_ObjInitializer.getCoordinatesFromObjString(objectiveData);
// new Coordinates(s);
name = DC_ObjInitializer.getNameFromObjString(objectiveData);
// conditions.add(new ObjComparison(KEY, KEYS.TARGET.toString()));
break;
case CAPTURE_HOLD:
// "As long as
break;
case SURVIVE_TIME:
break;
case ESCAPE:
// eventType = STANDARD_EVENT_TYPE.UNIT_GONE_THRU_ENTRANCE;
break;
case ITEM:
break;
}
// some objectives will be initialized on a condition, e.g. capture-hold
addTrigger(eventType, conditions, abilities);
}
use of main.ability.Abilities in project Eidolons by IDemiurge.
the class ObjectiveMaster method addTrigger.
private static void addTrigger(EVENT_TEMPLATE ET, String eventData, SCRIPT_CONDITION_TEMPLATE CT, String conditionData, ACTION_TEMPLATE AT, String actionData) {
STANDARD_EVENT_TYPE eventType = null;
Conditions conditions = null;
Abilities abilities = null;
addTrigger(eventType, conditions, abilities);
}
use of main.ability.Abilities in project Eidolons by IDemiurge.
the class DualAttackMaster method createDual.
private static DC_UnitAction createDual(DC_UnitAction main, DC_UnitAction offhand) {
Costs costs = getDualCosts(main, offhand);
// cooldown!
ActiveAbility activateAttacks = new ActiveAbility(main.getTargeting(), new Effects(new ActivateEffect(main.getName(), true), new ActivateEffect(offhand.getName(), true)));
Ability setCooldown = new ActiveAbility(new AutoTargeting(new PropCondition(G_PROPS.ACTION_TAGS, "Dual", false)), new ModifyValueEffect(PARAMS.C_COOLDOWN, MOD.SET, getCooldown(main.getOwnerObj())));
Abilities abilities = new Abilities();
abilities.add(activateAttacks);
abilities.add(setCooldown);
ObjType newType = new ObjType("Dual: " + main.getName() + " and " + offhand.getName(), DataManager.getType("Dual Attack", DC_TYPE.ACTIONS));
for (Cost cost : costs.getCosts()) {
PARAMETER p = cost.getCostParam();
if (p == null)
continue;
newType.setParam(p, cost.getPayment().getAmountFormula().toString());
}
DC_UnitAction dual = new DC_UnitAction(newType, main.getOwner(), main.getGame(), new Ref(main.getOwnerObj()));
dual.setAbilities(abilities);
dual.setCosts(costs);
dual.setTargeting(main.getTargeting());
dual.getTargeter().setTargetingInitialized(true);
dual.setConstructed(true);
return dual;
}
use of main.ability.Abilities in project Eidolons by IDemiurge.
the class SpeechBuilder method processText.
protected String processText(String text, Speech speech) {
try {
Condition reqs = DialogueSyntax.getConditions(text);
speech.setConditions(reqs);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
try {
Abilities abils = DialogueSyntax.getAbilities(text);
speech.setAbilities(abils);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
try {
String script = DialogueSyntax.getScript(text);
speech.setScript(script);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
return DialogueSyntax.getRawText(text);
}
Aggregations