use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UpkeepRule method addUpkeep.
public static void addUpkeep(Obj payObj) {
Obj spell = payObj.getRef().getObj(KEYS.ACTIVE);
if (spell == null) {
return;
}
Obj abil = payObj.getRef().getObj(KEYS.ABILITY);
if (abil != null) {
if (abil instanceof PassiveAbilityObj) {
return;
}
}
String property = spell.getProperty(PROPS.UPKEEP_FAIL_ACTION);
if (new EnumMaster<UPKEEP_FAIL_ACTION>().retrieveEnumConst(UPKEEP_FAIL_ACTION.class, property) == null) {
property = UPKEEP_FAIL_ACTION.DEATH + "";
}
payObj.setProperty(PROPS.UPKEEP_FAIL_ACTION, property);
for (PARAMETER p : ValuePages.UPKEEP_PARAMETERS) {
Integer param = spell.getIntParam(p);
if (param > 0) {
payObj.getType().setParam(p, param);
}
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UpkeepRule method subtractUpkeep.
public void subtractUpkeep(Unit unit, Obj payObj) {
for (PARAMETER p : ValuePages.UPKEEP_PARAMETERS) {
PARAMETER payParam = DC_ContentManager.getPayParamFromUpkeep(p);
int amount = new Formula(payObj.getParam(p)).getAppendedByModifier(StringMaster.getValueRef(KEYS.SOURCE, PARAMS.UPKEEP_MOD)).getInt(unit.getRef());
if (amount <= 0) {
return;
}
unit.modifyParameter(payParam, -amount);
unit.getGame().getLogManager().log(payObj.getName() + "'s " + ContentManager.getBaseParameterFromCurrent(p).getName() + " upkeep paid: " + amount);
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class IntegrityRule method getIntegrityMod.
public static int getIntegrityMod(Entity hero, PRINCIPLES principle) {
PARAMETER alignment_param = DC_ContentManager.getAlignmentForPrinciple(principle);
PARAMETER identity_param = DC_ContentManager.getIdentityParamForPrinciple(principle);
Integer degree = hero.getIntParam(identity_param);
Integer amount = hero.getIntParam(alignment_param);
int product = getIntegrityProduct(degree, amount);
return product;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class IntegrityRule method applyMods.
public static void applyMods(Entity hero, Entity from, boolean alignment_identity) {
if (from == null) {
return;
}
PARAMETER[] array = alignment_identity ? ValuePages.PRINCIPLE_ALIGNMENTS : ValuePages.PRINCIPLE_IDENTITIES;
for (PARAMETER param : array) {
Integer amount = from.getIntParam(param);
// min/max?
hero.modifyParameter(param, amount);
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class IntegrityRule method getValues.
public static Integer[] getValues(PRINCIPLES principle, Entity item, Entity hero) {
PARAMETER alignment_param = DC_ContentManager.getAlignmentForPrinciple(principle);
PARAMETER identity_param = DC_ContentManager.getIdentityParamForPrinciple(principle);
Integer alignment = hero.getIntParam(alignment_param);
Integer identity = hero.getIntParam(identity_param);
if (item != null) {
alignment = item.getIntParam(alignment_param);
identity = item.getIntParam(identity_param);
}
return new Integer[] { identity, alignment, getIntegrityProduct(hero.getIntParam(identity_param), alignment) };
}
Aggregations