Search in sources :

Example 1 with Tavern

use of eidolons.game.module.adventure.town.Tavern in project Eidolons by IDemiurge.

the class HC_Controls method handleClick.

public void handleClick(String command, final boolean alt) {
    if (processing) {
        DC_SoundMaster.playStandardSound(STD_SOUNDS.CLICK_BLOCKED);
        return;
    }
    processing = true;
    try {
        switch(command) {
            case MAP:
                break;
            case TAVERNS:
                Tavern tavern = MacroManager.getActiveParty().getTown().selectTavern();
                if (tavern != null) {
                    tavern.openView();
                }
                break;
            case ADD:
                DC_SoundMaster.playStandardSound(STD_SOUNDS.MOVE);
                if (PartyHelper.checkPartySize() || Launcher.DEV_MODE) {
                    Launcher.getMainManager().getSequenceMaster().chooseNewMember(PartyHelper.getParty());
                } else {
                    DialogMaster.error("Maximum party size reached!");
                }
                break;
            case REMOVE:
                // ...
                PartyHelper.remove(hero);
                break;
            case FIGHT:
            case FIGHT_2:
            case FIGHT_3:
            case FIGHT_ARCADE:
                new Thread(() -> fight(), " thread").start();
                // }
                break;
            case EXPORT_HERO:
                {
                    DC_SoundMaster.playStandardSound(STD_SOUNDS.DONE);
                    new Thread(new Runnable() {

                        public void run() {
                            CharacterCreator.saveAs(CharacterCreator.getSelectedHeroType(), !alt);
                            // CharacterCreator.savePreset(hero.getType());
                            DC_SoundMaster.playStandardSound(STD_SOUNDS.OK);
                        }
                    }).start();
                    break;
                }
            case EXPORT_PARTY:
                {
                    new Thread(new Runnable() {

                        public void run() {
                            PartyHelper.savePartyAs(false);
                        }
                    }).start();
                    break;
                }
            case NEW_BRANCH:
                {
                    new Thread(new Runnable() {

                        public void run() {
                            PartyHelper.savePartyAs(true);
                        }
                    }).start();
                    break;
                }
            case NEW_HERO:
                {
                    newHero = CharacterCreator.getNewHero();
                    Launcher.setView(null, VIEWS.CHOICE);
                    final HeroChoiceSequence sequence = new HeroChoiceSequence(newHero);
                    sequence.setManager(this);
                    new Thread(new Runnable() {

                        public void run() {
                            sequence.start();
                        }
                    }).start();
                    break;
                }
            case SAVE:
                DC_SoundMaster.playStandardSound(STD_SOUNDS.DONE);
                if (CharacterCreator.isPartyMode()) {
                    PartyHelper.saveParty();
                } else {
                    CharacterCreator.save(CharacterCreator.getSelectedHeroType());
                }
                DC_SoundMaster.playStandardSound(STD_SOUNDS.OK);
                break;
            case BACK:
                DC_SoundMaster.playStandardSound(STD_SOUNDS.ACTION_CANCELLED);
                CharacterCreator.getHeroManager().stepBack(hero);
                CharacterCreator.refreshGUI();
                break;
            case LEVEL_UP:
                // always ready?
                if (!CharacterCreator.isLevelUpEnabled(hero)) {
                    DC_SoundMaster.playStandardSound(STD_SOUNDS.CLICK_ERROR);
                    break;
                }
                HeroLevelManager.levelUp(hero);
                DC_SoundMaster.playStandardSound(STD_SOUNDS.LEVEL_UP);
                break;
        }
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    } finally {
        processing = false;
    // CharacterCreator.refreshGUI();
    }
}
Also used : HeroChoiceSequence(eidolons.client.cc.gui.neo.choice.HeroChoiceSequence) Tavern(eidolons.game.module.adventure.town.Tavern)

Example 2 with Tavern

use of eidolons.game.module.adventure.town.Tavern in project Eidolons by IDemiurge.

the class RestMasterOld method applyMacroMode.

public static void applyMacroMode(MacroParty party) {
    mod = 100;
    one_mod = 100;
    vig_mod = 100;
    // TODO from area! or place...
    hp_mod = 100;
    if (party.getTown() != null) {
        Town town = party.getTown();
        for (Tavern t : town.getTaverns()) {
            // t.getProperty(MACRO_PROPS.ROOM_TYPE);
            if (t.getIntParam(MACRO_PARAMS.RENT_DURATION) > 0) {
                // apply mods from Room
                mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
                one_mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
                vig_mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
                hp_mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
            }
        }
    }
    for (Unit hero : party.getMembers()) {
        RestMasterOld.applyMacroMode(hero);
    }
}
Also used : Town(eidolons.game.module.adventure.town.Town) Unit(eidolons.entity.obj.unit.Unit) Tavern(eidolons.game.module.adventure.town.Tavern)

Aggregations

Tavern (eidolons.game.module.adventure.town.Tavern)2 HeroChoiceSequence (eidolons.client.cc.gui.neo.choice.HeroChoiceSequence)1 Unit (eidolons.entity.obj.unit.Unit)1 Town (eidolons.game.module.adventure.town.Town)1