use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.
the class ConcealmentRule method getMissChance.
// DEPENDING ON VISIBILITY_LEVEL?
public static int getMissChance(DC_ActiveObj action) {
DC_Obj source = action.getOwnerObj();
Obj target = action.getRef().getTargetObj();
Obj cell = source.getGame().getCellByCoordinate(source.getCoordinates());
// if (source.checkPassive(STANDARD_PASSIVES.DARKVISION))
// return false;
// if (source.checkPassive(STANDARD_PASSIVES.LIGHTVISION))
// return false;
int chance = target.getIntParam(PARAMS.CONCEALMENT) - source.getIntParam(PARAMS.DETECTION) - // - target.getIntParam(PARAMS.NOISE) / 2
source.getIntParam(PARAMS.ACCURACY) - source.getIntParam(PARAMS.ILLUMINATION) + // vision...
cell.getIntParam(PARAMS.CONCEALMENT);
if (chance < 0) {
chance = 0;
}
chance -= source.getIntParam(PARAMS.ILLUMINATION);
if (chance < 0) {
chance += 500;
if (chance < 0)
return -(chance) / 2;
else
return 0;
}
return (chance);
}
use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.
the class ConcealmentRule method checkMissed.
/*
* add buff with a passive dodge ability addPassive effect?
* trigger/continuous effect to be removed...
*
* or maybe I could hard-code it somewhere almost like resistance?
*
* Only for *ranged touch* actions, which could be a STD spell/action
* passive or tag or classif.
*/
public static boolean checkMissed(DC_ActiveObj action) {
Unit source = action.getOwnerObj();
Obj target = action.getRef().getTargetObj();
if (source == null || target == null) {
return false;
}
if (source.getVisionMode() == VisionEnums.VISION_MODE.INFRARED_VISION) {
}
int chance = getMissChance(action);
if (chance <= 0) {
return false;
}
return RandomWizard.chance(chance);
}
use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.
the class ResistanceRule method getResistance.
public static int getResistance(Ref ref) {
DC_ActiveObj spell = (DC_ActiveObj) ref.getObj(KEYS.SPELL);
if (spell == null) {
return 0;
}
Obj target = ref.getTargetObj();
Obj source = ref.getSourceObj();
DAMAGE_TYPE type = spell.getEnergyType();
int specResist = 0;
PARAMETER typeResistance = DC_ContentManager.getDamageTypeResistance(type);
if (typeResistance != null) {
specResist = target.getIntParam(typeResistance);
}
int resistance = specResist;
// int resistance = target.getIntParam(PARAMS.RESISTANCE);
// resistance = MathMaster.addFactor(resistance, specResist);
resistance -= source.getIntParam(PARAMS.RESISTANCE_PENETRATION);
int mod = spell.getIntParam(PARAMS.RESISTANCE_MOD);
resistance = MathMaster.applyMod(resistance, mod);
return resistance;
}
use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.
the class EvasionRule method getMissChance.
public static int getMissChance(DC_ActiveObj action) {
DC_Obj source = action.getOwnerObj();
Obj target = action.getRef().getTargetObj();
int chance = target.getIntParam(PARAMS.EVASION) - source.getIntParam(PARAMS.ACCURACY);
return chance;
}
use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.
the class EvasionRule method checkMissed.
public static boolean checkMissed(DC_ActiveObj action) {
DC_Obj source = action.getOwnerObj();
Obj target = action.getRef().getTargetObj();
if (source == null || target == null) {
return false;
}
if (source.checkPassive(UnitEnums.STANDARD_PASSIVES.TRUE_STRIKE)) {
return false;
}
int chance = getMissChance(action);
if (chance <= 0) {
return false;
}
return RandomWizard.chance(chance);
}
Aggregations