Search in sources :

Example 1 with LightEmittingEffect

use of eidolons.ability.effects.common.LightEmittingEffect in project Eidolons by IDemiurge.

the class IlluminationRule method getLightEmissionEffect.

public LightEmittingEffect getLightEmissionEffect(DC_Obj source) {
    LightEmittingEffect effect = effectCache.get(source);
    if (effect == null) {
        int value = getLightEmission(source);
        if (value <= 0) {
            return null;
        }
        Boolean circular = true;
        if (source instanceof Unit)
            circular = false;
        else if (source.checkBool(GenericEnums.STD_BOOLS.SPECTRUM_LIGHT)) {
            circular = false;
        } else if (EntityCheckMaster.isOverlaying(source)) {
            BattleFieldObject dc_Obj = (BattleFieldObject) source;
            if (dc_Obj.getDirection() != null) {
                circular = false;
            }
        }
        effect = new LightEmittingEffect(("" + value), circular);
        effect.setRef(new Ref(source));
        effectCache.put(source, effect);
    } else
        effect.getEffects().setFormula(new Formula("" + getLightEmission(source)));
    return effect;
}
Also used : Formula(main.system.math.Formula) Ref(main.entity.Ref) BattleFieldObject(eidolons.entity.obj.BattleFieldObject) Unit(eidolons.entity.obj.unit.Unit) LightEmittingEffect(eidolons.ability.effects.common.LightEmittingEffect)

Example 2 with LightEmittingEffect

use of eidolons.ability.effects.common.LightEmittingEffect in project Eidolons by IDemiurge.

the class SpellIlluminationRule method spellResolves.

public void spellResolves(DC_ActiveObj spell) {
    Unit caster = spell.getOwnerObj();
    Boolean circular = true;
    // distance reductionBoolean circular = true;
    if (spell.checkBool(GenericEnums.STD_BOOLS.SPECTRUM_LIGHT)) {
        circular = false;
    }
    int value = spell.getIntParam(PARAMS.SPELL_DIFFICULTY);
    LightEmittingEffect effect = new LightEmittingEffect(("" + value), circular);
    effect.apply(new Ref(caster));
    caster.getGame().getManager().reset();
    WaitMaster.WAIT(delay);
    caster.getGame().getVisionMaster().refresh();
    caster.getGame().getBattleField().getGrid().refresh();
// reduce for distance
}
Also used : Ref(main.entity.Ref) Unit(eidolons.entity.obj.unit.Unit) LightEmittingEffect(eidolons.ability.effects.common.LightEmittingEffect)

Aggregations

LightEmittingEffect (eidolons.ability.effects.common.LightEmittingEffect)2 Unit (eidolons.entity.obj.unit.Unit)2 Ref (main.entity.Ref)2 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 Formula (main.system.math.Formula)1