Search in sources :

Example 41 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class ChannelingRule method activateChanneing.

public static boolean activateChanneing(DC_SpellObj spell) {
    // ActiveAbility spell_ability = ActivesConstructor
    // .mergeActiveList(spell, TARGETING_MODE.SINGLE);
    spell.getOwnerObj().getHandler().initChannelingSpellData(spell);
    boolean result = true;
    ModeEffect modeEffect = new ModeEffect(STD_MODES.CHANNELING);
    // String string = STD_MODES.CHANNELING.toString();
    // if (spell instanceof DC_UnitAction) {
    // if (spell.checkProperty(G_PROPS.CUSTOM_PROPS)) {
    // modeEffect.getModPropEffect().setValue(
    // spell.getProperty(G_PROPS.CUSTOM_PROPS));
    // }
    // }
    Ref REF = spell.getRef().getCopy();
    REF.setTarget(spell.getOwnerObj().getId());
    // modeEffect.getAddBuffEffect().setEffect(effect)
    // Condition conditions = new Conditions(new RefCondition(
    // KEYS.EVENT_SOURCE, KEYS.SOURCE), new StringComparison(
    // "{SOURCE_MODE}", string, true));
    // CastSpellEffect castEffect = new CastSpellEffect(spell);
    // castEffect.setForceTargeting(true);
    // AddTriggerEffect triggerEffect = new AddTriggerEffect(
    // STANDARD_EVENT_TYPE.UNIT_TURN_STARTED, conditions,
    // new ActiveAbility(null, new Effects(
    // new RemoveBuffEffect(string), castEffect)));
    modeEffect.setReinit(false);
    // modeEffect.getAddBuffEffect().addEffect(triggerEffect);
    modeEffect.getAddBuffEffect().setDuration(2);
    result &= modeEffect.apply(REF);
    return result;
}
Also used : Ref(main.entity.Ref) ModeEffect(eidolons.ability.effects.oneshot.mechanic.ModeEffect)

Example 42 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class EnsnaredRule method unitBecomesActive.

@Override
public boolean unitBecomesActive(Unit unit) {
    if (getNumberOfCounters(unit) <= 0) {
        return true;
    }
    Ref ref = new Ref(unit);
    ref.setTarget(unit.getId());
    if (!RollMaster.roll(GenericEnums.ROLL_TYPES.BODY_STRENGTH, "-", getNumberOfCounters(unit) + "*1.5", ref, " and breaks free!", "Entanglement")) {
        unit.setCounter(getCounterName(), 0);
        unit.modifyParameter(PARAMS.C_N_OF_ACTIONS, -1);
        return false;
    }
    if (RollMaster.roll(GenericEnums.ROLL_TYPES.QUICK_WIT, "-", getNumberOfCounters(unit) + "/2.5", ref, "@, unable to figure out how to cut free...", "Entanglement")) {
        unit.modifyParameter(PARAMS.C_N_OF_ACTIONS, -1);
        return false;
    }
    if (checkCutAway(false)) {
        return false;
    }
    if (checkCutAway(true)) {
        return false;
    }
    return false;
}
Also used : Ref(main.entity.Ref)

Example 43 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class Crawler method launchFastDc.

private static void launchFastDc() {
    DC_Engine.jarInit();
    FontMaster.init();
    GuiManager.init();
    String dungeon = new FileChooser(PathFinder.getDungeonLevelFolder()).launch("", "");
    FAST_DC.DEFAULT_DUNGEON = (dungeon);
    Ref ref = new Ref();
    Condition conditions = new Conditions();
    FAST_DC.PLAYER_PARTY = ListChooser.chooseType(DC_TYPE.CHARS, ref, conditions);
    FAST_DC.main(new String[] { String.valueOf(PresetLauncher.OPTION_NEW) });
}
Also used : Condition(main.elements.conditions.Condition) Ref(main.entity.Ref) FileChooser(main.swing.generic.components.editors.FileChooser) Conditions(main.elements.conditions.Conditions)

Example 44 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class Crawler method main.

public static void main(String[] args) {
    FAST_DC.FAST_MODE = false;
    ExplorationMaster.setTestMode(true);
    DC_Engine.jarInit();
    FontMaster.init();
    GuiManager.init();
    int index = DialogMaster.optionChoice(launch_options, "Choose the type of Eidolons game you want to launch...");
    List<String> parts = null;
    if (index == 0) {
        String data = FileManager.readFile(launchDataPath);
        parts = StringMaster.openContainer(data);
        index = 1;
    }
    if (index == 2) {
    // random  = true;
    // parts = Collections.nCopies(2, "");
    } else if (index == 3) {
        FAST_DC.main(new String[] { "" + (Arrays.asList(PresetLauncher.LAUNCH_OPTIONS)).indexOf(StringMaster.getWellFormattedString(LAUNCH.EXPLORATION.toString())) });
        return;
    } else if (index == 4) {
        FAST_DC.main(new String[] { "" + (Arrays.asList(PresetLauncher.LAUNCH_OPTIONS)).indexOf(StringMaster.getWellFormattedString(LAUNCH.EXPLORATION_TEST.toString())) });
        return;
    }
    DemoLauncher.main(null);
    DC_Engine.mainMenuInit();
    String dungeon = parts == null ? "crawl" + new FileChooser(PathFinder.getDungeonLevelFolder() + "crawl").launch("", "") : parts.get(0);
    launchData += dungeon;
    dungeon = StringMaster.removePreviousPathSegments(dungeon, PathFinder.getDungeonLevelFolder());
    ScreenData data = new ScreenData(ScreenType.BATTLE, dungeon);
    GameLauncher launcher = new GameLauncher(GAME_SUBCLASS.TEST);
    Ref ref = new Ref();
    Condition conditions = new Conditions();
    launcher.PLAYER_PARTY = parts == null ? ListChooser.chooseType(DC_TYPE.CHARS, ref, conditions) : parts.get(1);
    launchData += StringMaster.SEPARATOR + launcher.PLAYER_PARTY;
    launcher.setDungeon(dungeon);
    launcher.PARTY_CODE = CODE.PRESET;
    launcher.ENEMY_CODE = CODE.NONE;
    GuiEventManager.trigger(GuiEventType.SWITCH_SCREEN, data);
    DC_Engine.gameStartInit();
    DC_Game game = launcher.initDC_Game();
    game.start(true);
    if (!StringMaster.isEmpty(launchData)) {
        FileManager.write(launchData, launchDataPath);
    }
}
Also used : Condition(main.elements.conditions.Condition) Ref(main.entity.Ref) FileChooser(main.swing.generic.components.editors.FileChooser) GameLauncher(eidolons.game.core.launch.GameLauncher) DC_Game(eidolons.game.core.game.DC_Game) Conditions(main.elements.conditions.Conditions) ScreenData(eidolons.libgdx.screens.ScreenData)

Example 45 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class LE_ObjMaster method getObject.

public static Unit getObject(ObjType type, Coordinates c) {
    Unit obj = null;
    if (type.checkProperty(G_PROPS.BF_OBJECT_GROUP, BfObjEnums.BF_OBJECT_GROUP.ENTRANCE.toString())) {
    // obj = new Entrance(c.x, c.y, type, LevelEditor.getCurrentLevel().getDungeon(), null);
    } else {
        obj = getObjCache().get(type);
        if (obj == null) {
            obj = new Unit(type, c.x, c.y, DC_Player.NEUTRAL, LevelEditor.getSimulation(), new Ref());
        }
    }
    getObjCache().put(type, obj);
    return obj;
}
Also used : Ref(main.entity.Ref) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

Ref (main.entity.Ref)155 Unit (eidolons.entity.obj.unit.Unit)28 ObjType (main.entity.type.ObjType)23 Event (main.game.logic.event.Event)16 ArrayList (java.util.ArrayList)15 Obj (main.entity.obj.Obj)15 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)13 Coordinates (main.game.bf.Coordinates)13 Conditions (main.elements.conditions.Conditions)12 Formula (main.system.math.Formula)11 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)10 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)9 PARAMETER (main.content.values.parameters.PARAMETER)9 DC_SpellObj (eidolons.entity.active.DC_SpellObj)8 Effects (main.ability.effects.Effects)8 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)7 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)7 Effect (main.ability.effects.Effect)7 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)5 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)5