Search in sources :

Example 1 with StackingRule

use of eidolons.game.battlecraft.rules.action.StackingRule in project Eidolons by IDemiurge.

the class Positioner method adjustCoordinate.

public static Coordinates adjustCoordinate(Entity entity, Coordinates c, FACING_DIRECTION facing, Predicate<Coordinates> filterPredicate) {
    if (c == null) {
        return null;
    }
    Loop loop = new Loop(50);
    Coordinates coordinate = new Coordinates(c.x, c.y);
    while (loop.continues()) {
        // TODO remove from adj. list to limit
        // iterations to 8!
        DIRECTION direction = ArenaPositioner.getRandomSpawnAdjustDirection();
        coordinate = c.getAdjacentCoordinate(direction);
        if (coordinate != null) {
            if (filterPredicate != null)
                if (!filterPredicate.test(coordinate))
                    continue;
            if (!DC_Game.game.isSimulation()) {
                if (DC_Game.game.getBattleFieldManager().canMoveOnto(entity, coordinate)) {
                    break;
                }
            }
            if (new StackingRule(DC_Game.game).canBeMovedOnto(entity, coordinate)) {
                break;
            }
        }
    }
    // second layer in case first one is fully
    loop = new Loop(50);
    // blocked
    while (!loop.continues() && !DC_Game.game.getBattleFieldManager().canMoveOnto(entity, c) || // (DC_Game.game.getBattleField().getGrid().isCoordinateObstructed(coordinate)
    coordinate == null) {
        Coordinates adjacentCoordinate = c.getAdjacentCoordinate(ArenaPositioner.getRandomSpawnAdjustDirection());
        coordinate = adjustCoordinate(adjacentCoordinate, facing);
    }
    if (coordinate.isInvalid()) {
        return null;
    }
    return coordinate;
}
Also used : Loop(main.system.auxiliary.Loop) Coordinates(main.game.bf.Coordinates) DIRECTION(main.game.bf.Coordinates.DIRECTION) FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) StackingRule(eidolons.game.battlecraft.rules.action.StackingRule)

Example 2 with StackingRule

use of eidolons.game.battlecraft.rules.action.StackingRule in project Eidolons by IDemiurge.

the class DC_Rules method init.

private void init() {
    RuleMaster.init();
    WaitRule.reset();
    illuminationRule = new IlluminationRule(game);
    unconsciousRule = new UnconsciousRule(game);
    watchRule = new WatchRule();
    engagedRule = new EngagedRule(getGame());
    stackingRule = new StackingRule(getGame());
    ensnareRule = new EnsnaredRule(getGame());
    stealthRule = new StealthRule(getGame());
    stackingRule = new StackingRule(getGame());
    actionRules.add(unconsciousRule);
    actionRules.add(watchRule);
    actionRules.add(stealthRule);
    actionRules.add(ensnareRule);
    actionRules.add(stackingRule);
    actionRules.add(engagedRule);
    // actionRules.add(waterRule= new WaterRule(getGame()));
    cleaveRule = new CleaveRule(getGame());
    focusRule = new FocusRule(getGame());
    moraleRule = new MoraleRule(getGame());
    roundRules.add(focusRule);
    roundRules.add(moraleRule);
    // roundRules.add( upkeepRule = new UpkeepRule(getGame()) );
    // roundRules.add( scoutingRule = new ScoutingRule(getGame()));
    roundRules.add(unconsciousRule);
    moraleKillingRule = new MoraleKillingRule(getGame());
    bleedingRule = new BleedingDamageRule(game);
    poisonRule = new PoisonRule(game);
    diseaseRule = new DiseaseRule(game);
    blazeRule = new BlazeRule(game);
    lavaRule = new LavaRule(game);
    suffocationRule = new SuffocationRule(game);
    damageRules.add(bleedingRule);
    damageRules.add(suffocationRule);
    damageRules.add(poisonRule);
    damageRules.add(diseaseRule);
    damageRules.add(blazeRule);
    damageRules.add(lavaRule);
    counterRules.addAll(damageRules);
    freezeRule = new FreezeRule(game);
    moistRule = new MoistRule(game);
    rageRule = new RageRule(game);
    corrosionRule = new CorrosionRule(game);
    blightRule = new BlightRule(game);
    greaseRule = new GreaseRule(game);
    clayRule = new ClayRule(game);
    encaseRule = new EncaseRule(game);
    // despairRule = new DespairRule(game);
    // lustRule = new LustRule(game);
    // hatredRule = new HatredRule(game);
    counterRules.add(rageRule);
    counterRules.add(blightRule);
    counterRules.add(corrosionRule);
    counterRules.add(clayRule);
    counterRules.add(moistRule);
    counterRules.add(freezeRule);
    counterRules.add(ensnareRule);
    counterRules.add(encaseRule);
    counterRules.add(greaseRule);
    timeRule = new TimeRule(getGame());
    moraleBuffRule = new MoraleBuffRule(getGame());
    this.buffRules.add(moraleBuffRule);
    staminaRule = new StaminaBuffRule(getGame());
    this.buffRules.add(staminaRule);
    weightRule = new WeightBuffRule(getGame());
    this.buffRules.add(weightRule);
    focusBuffRule = new FocusBuffRule(getGame());
    this.buffRules.add(focusBuffRule);
    woundsRule = new WoundsBuffRule(getGame());
    this.buffRules.add(woundsRule);
    getTriggerRules().add(trampleRule = new TrampleRule(getGame()));
    getTriggerRules().add(durabilityRule = new DurabilityRule(getGame()));
    getTriggerRules().add(bleedingTriggerRule = new BleedingRule(game));
    getTriggerRules().add(ashAnnihilationRule = new AshAnnihilationRule(game));
    CounterMasterAdvanced.defineInteractions();
// this.rules.add(rule);
// rule = new TreasonRule(getGame());
// this.rules.add(rule);
// rule = new PanicRule(getGame());
// this.rules.add(rule);
// rule = new ClaimRule(getGame());
// this.rules.add(rule);
}
Also used : BleedingRule(eidolons.game.battlecraft.rules.combat.mechanics.BleedingRule) CleaveRule(eidolons.game.battlecraft.rules.combat.misc.CleaveRule) StealthRule(eidolons.game.battlecraft.logic.battlefield.vision.StealthRule) StackingRule(eidolons.game.battlecraft.rules.action.StackingRule) IlluminationRule(eidolons.game.battlecraft.rules.mechanics.IlluminationRule) AshAnnihilationRule(eidolons.game.battlecraft.rules.mechanics.AshAnnihilationRule) DurabilityRule(eidolons.game.battlecraft.rules.mechanics.DurabilityRule) EngagedRule(eidolons.game.battlecraft.rules.action.EngagedRule) MoraleKillingRule(eidolons.game.battlecraft.rules.combat.mechanics.MoraleKillingRule) TrampleRule(eidolons.game.battlecraft.rules.combat.misc.TrampleRule) WatchRule(eidolons.game.battlecraft.rules.action.WatchRule)

Aggregations

StackingRule (eidolons.game.battlecraft.rules.action.StackingRule)2 StealthRule (eidolons.game.battlecraft.logic.battlefield.vision.StealthRule)1 EngagedRule (eidolons.game.battlecraft.rules.action.EngagedRule)1 WatchRule (eidolons.game.battlecraft.rules.action.WatchRule)1 BleedingRule (eidolons.game.battlecraft.rules.combat.mechanics.BleedingRule)1 MoraleKillingRule (eidolons.game.battlecraft.rules.combat.mechanics.MoraleKillingRule)1 CleaveRule (eidolons.game.battlecraft.rules.combat.misc.CleaveRule)1 TrampleRule (eidolons.game.battlecraft.rules.combat.misc.TrampleRule)1 AshAnnihilationRule (eidolons.game.battlecraft.rules.mechanics.AshAnnihilationRule)1 DurabilityRule (eidolons.game.battlecraft.rules.mechanics.DurabilityRule)1 IlluminationRule (eidolons.game.battlecraft.rules.mechanics.IlluminationRule)1 Coordinates (main.game.bf.Coordinates)1 DIRECTION (main.game.bf.Coordinates.DIRECTION)1 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)1 Loop (main.system.auxiliary.Loop)1