Search in sources :

Example 1 with MacroRef

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

the class EditorManager method create.

private static <E extends MapActor> MacroObj create(ObjType type) {
    MacroRef ref = new MacroRef(MacroGame.game);
    ref.setPlayer(MacroGame.game.getPlayerFaction().getOwner());
    ref.setPlayer(MacroGame.game.getFactions().get(0).getOwner());
    if (type.getOBJ_TYPE_ENUM() == MACRO_OBJ_TYPES.PLACE)
        return new Place(MacroGame.game, type, ref);
    if (type.getOBJ_TYPE_ENUM() == DC_TYPE.PARTY)
        try {
            MacroParty party = new MacroParty(type, MacroGame.game, ref);
            party.getParty().initMembers();
            return party;
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    return null;
}
Also used : MacroParty(eidolons.game.module.adventure.entity.MacroParty) MacroRef(eidolons.game.module.adventure.MacroRef) Place(eidolons.game.module.adventure.map.Place)

Example 2 with MacroRef

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

the class MacroAction method activate.

@Override
public boolean activate() {
    MacroRef ref = new MacroRef(MacroManager.getSelectedPartyMember());
    ref.setParty(MacroManager.getActiveParty());
    return activatedOn(ref);
}
Also used : MacroRef(eidolons.game.module.adventure.MacroRef)

Example 3 with MacroRef

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

the class MacroActionManager method getAction.

private static MacroAction getAction(String actionName, Obj obj) {
    MacroAction action = actionMap.get(actionName);
    if (action != null) {
        return action;
    }
    MacroRef ref = new MacroRef(obj);
    // objType.initType(); aut0
    // TODO  DataManager.getType(actionName, MACRO_OBJ_TYPES.MAP_ACTIONS);
    ObjType objType = null;
    if (objType == null)
        objType = getBaseType();
    action = new MacroAction(objType, ref);
    actionMap.put(actionName, action);
    return action;
}
Also used : ObjType(main.entity.type.ObjType) MacroRef(eidolons.game.module.adventure.MacroRef)

Example 4 with MacroRef

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

the class MacroActionManager method generateMacroActions.

public static void generateMacroActions() {
    // different entities
    for (MACRO_MODES m : MACRO_MODES.values()) {
        MacroAction action = new MacroAction(getBaseType(), new MacroRef(), m);
        actionMap.put((m.toString()), action);
    }
    for (MACRO_PARTY_ACTIONS m : MACRO_PARTY_ACTIONS.values()) {
        MacroAction action = new MacroAction(getBaseType(), new MacroRef(), m);
        actionMap.put((m.toString()), action);
    }
// can this work for real setting with many parties active?
}
Also used : MacroRef(eidolons.game.module.adventure.MacroRef)

Example 5 with MacroRef

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

the class TownInitializer method initShops.

public static void initShops(Town town) {
    MacroRef ref = MacroGame.getGame().getRef().getCopy();
    int i = 0;
    int max = town.getLevel();
    if (max == 0) {
        max = default_shop_limit;
    }
    int min = town.getLevel() / 2;
    if (min == 0) {
        min = default_shop_min;
    }
    for (String shopTypeName : StringMaster.open(town.getProperty(MACRO_PROPS.SHOPS))) {
        i++;
        if (i > max) {
            break;
        }
        ObjType type = new ObjType(DataManager.getType(shopTypeName, MACRO_OBJ_TYPES.SHOP));
        type.initType();
        if (type == null) {
            type = getGenericShopType(shopTypeName);
        }
        addShop(town, ref, type);
    }
    if (i < min) {
        // generate by preferred type/level/mod
        Map<SHOP_TYPE, Integer> typeMap = new RandomWizard<SHOP_TYPE>().constructWeightMap(town.getProperty(MACRO_PROPS.SHOP_TYPE), SHOP_TYPE.class, MACRO_OBJ_TYPES.SHOP);
        Map<SHOP_MODIFIER, Integer> modMap = new RandomWizard<SHOP_MODIFIER>().constructWeightMap(town.getProperty(MACRO_PROPS.SHOP_MODIFIER), SHOP_MODIFIER.class, MACRO_OBJ_TYPES.SHOP);
        while (true) {
            SHOP_TYPE shopType = new RandomWizard<SHOP_TYPE>().getObjectByWeight(typeMap);
            SHOP_MODIFIER shopMode = new RandomWizard<SHOP_MODIFIER>().getObjectByWeight(modMap);
            ObjType type = getGenericShopType(shopType.toString());
            type.setProperty(MACRO_PROPS.SHOP_MODIFIER, shopMode.toString());
            addShop(town, ref, type);
        }
    }
}
Also used : SHOP_MODIFIER(main.content.CONTENT_CONSTS2.SHOP_MODIFIER) ObjType(main.entity.type.ObjType) SHOP_TYPE(main.content.CONTENT_CONSTS2.SHOP_TYPE) MacroRef(eidolons.game.module.adventure.MacroRef)

Aggregations

MacroRef (eidolons.game.module.adventure.MacroRef)5 ObjType (main.entity.type.ObjType)2 MacroParty (eidolons.game.module.adventure.entity.MacroParty)1 Place (eidolons.game.module.adventure.map.Place)1 SHOP_MODIFIER (main.content.CONTENT_CONSTS2.SHOP_MODIFIER)1 SHOP_TYPE (main.content.CONTENT_CONSTS2.SHOP_TYPE)1