Search in sources :

Example 81 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class DC_GameManager method resetValues.

// a single-method spell, Warp Time: take another turn...
public void resetValues(Player owner) {
    for (Obj obj : getGame().getBfObjects()) {
        BattleFieldObject unit = null;
        if (obj instanceof BattleFieldObject) {
            unit = (BattleFieldObject) obj;
            if (owner == null || unit.getOwner() == owner) {
                unit.newRound();
            }
        }
        unit.regen();
    }
}
Also used : BattleFieldObject(eidolons.entity.obj.BattleFieldObject) DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) MicroObj(main.entity.obj.MicroObj) ActiveObj(main.entity.obj.ActiveObj) BuffObj(main.entity.obj.BuffObj) Obj(main.entity.obj.Obj) PassiveAbilityObj(main.ability.PassiveAbilityObj)

Example 82 with Obj

use of main.entity.obj.Obj 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);
}
Also used : DC_Obj(eidolons.entity.obj.DC_Obj) DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj)

Example 83 with Obj

use of main.entity.obj.Obj 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);
}
Also used : DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) Unit(eidolons.entity.obj.unit.Unit)

Example 84 with Obj

use of main.entity.obj.Obj 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;
}
Also used : DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) PARAMETER(main.content.values.parameters.PARAMETER)

Example 85 with Obj

use of main.entity.obj.Obj 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;
}
Also used : DC_Obj(eidolons.entity.obj.DC_Obj) DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj)

Aggregations

Obj (main.entity.obj.Obj)127 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)34 DC_Obj (eidolons.entity.obj.DC_Obj)30 Coordinates (main.game.bf.Coordinates)27 Unit (eidolons.entity.obj.unit.Unit)24 ArrayList (java.util.ArrayList)19 Ref (main.entity.Ref)15 DC_SpellObj (eidolons.entity.active.DC_SpellObj)14 BuffObj (main.entity.obj.BuffObj)13 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)12 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)11 ActiveObj (main.entity.obj.ActiveObj)10 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)9 PassiveAbilityObj (main.ability.PassiveAbilityObj)9 ObjType (main.entity.type.ObjType)8 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)7 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)7 PARAMETER (main.content.values.parameters.PARAMETER)7 Conditions (main.elements.conditions.Conditions)6 MicroObj (main.entity.obj.MicroObj)6