use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HqShop method initItems.
private void initItems() {
items = new ArrayList<>();
if (isPreset()) {
items = DataManager.toTypeList(StringMaster.openContainer(getProperty(PROPS.SHOP_ITEMS)), C_OBJ_TYPE.ITEMS);
return;
}
List<ObjType> templates = DataManager.toTypeList(StringMaster.openContainer(getProperty(PROPS.SHOP_ITEM_TEMPLATES)), C_OBJ_TYPE.ITEMS);
items = getItemsFromTemplates(templates);
if (getShopType() == null)
return;
// addStandardItems(); then randomize
PROPERTY prop = getShopType().getFilterProp();
int i = 0;
String[] item_groups = getShopType().getItem_groups();
for (String group : item_groups) {
List<ObjType> pool;
if (prop == null) {
pool = DataManager.toTypeList(DataManager.getTypesSubGroupNames(C_OBJ_TYPE.ITEMS, group), C_OBJ_TYPE.ITEMS);
} else {
pool = ItemGenerator.getBaseTypes(C_OBJ_TYPE.ITEMS);
FilterMaster.filter(pool, new PropCondition(prop, group));
}
pool = constructPool(pool);
pool.addAll(getSpecialItems(group));
i++;
if (!isRandomized()) {
for (ObjType item : pool) {
buyItem(item, 0);
}
// buyAll();
continue;
}
//
goldToSpend = (100 - spareGold - i * 5) / item_groups.length;
// some params from Shop ObjType?
Loop.startLoop(ShopMaster.getMaxItemsPerGroup(this));
while (!Loop.loopEnded() && !pool.isEmpty()) {
int randomListIndex = RandomWizard.getRandomListIndex(pool);
ObjType t = pool.get(randomListIndex);
if (t == null) {
continue;
}
if (!buyItem(t)) {
// second loop based on cheapest items?
break;
}
}
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class SkirmishMaster method chooseSkirmish.
public static void chooseSkirmish() {
// generated mission types?
// DataManager.getTypesSubGroup(MACRO_OBJ_TYPES.MISSIONS, SKIRMISH);
// this will be on EDT, so choosing can be same thread, but waiting for
// result on another
ChoiceMaster.chooseTypeNewThread(MACRO_OBJ_TYPES.MISSION, DataManager.getTypesGroup(MACRO_OBJ_TYPES.MISSION, "Skirmish"), "Choose Skirmish to Fight in", null, null);
new Thread(new Runnable() {
public void run() {
ObjType type = (ObjType) WaitMaster.waitForInput(WAIT_OPERATIONS.SELECTION);
if (type != null) {
File file = FileManager.getFile(type.getProperty(MACRO_PROPS.ROOT_LEVEL));
if (!file.isFile()) {
return;
}
// Dungeon dungeon = DungeonBuilder.buildDungeon(FileManager.readFile(file));
// initSkirmish(type, dungeon);
// Launcher.resetView(VIEWS.MENU);
} else {
Launcher.getMainManager().exitToMainMenu();
}
}
}, " thread").start();
// String name = ListChooser.chooseType(MACRO_OBJ_TYPES.MISSIONS,
// "Skirmish");
// if (type == null)
// Launcher.getMainManager().exitToMainMenu();
// else
// // ObjType type = DataManager.getType(name,
// MACRO_OBJ_TYPES.MISSIONS);
// {
// skirmish = new Skirmish(type,
// type.getProperty(MACRO_PROPS.LEVEL_PATH));
// Launcher.resetView(VIEWS.MENU);
// }
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class ContentGenerator method adjustParties.
public static void adjustParties() {
for (ObjType type : DataManager.getTypes(DC_TYPE.PARTY)) {
ObjType leader = DataManager.getType(type.getProperty(PROPS.LEADER), DC_TYPE.CHARS);
if (leader == null) {
List<String> members = StringMaster.openContainer(type.getProperty(PROPS.MEMBERS));
if (members.isEmpty()) {
continue;
}
leader = DataManager.getType(members.get(0), DC_TYPE.CHARS);
if (leader == null) {
continue;
}
type.setProperty(PROPS.LEADER, leader.getName());
}
type.setImage(leader.getImagePath());
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class PlaceholderGenerator method generate.
public static void generate() {
/*
unit subgroups
*/
for (UNIT_GROUP group : UnitEnums.UNIT_GROUP.values()) {
for (String sub : StringMaster.openContainer(group.getSubgroups(), ",")) {
for (PLACEHOLDER_AI_TYPE aiType : PLACEHOLDER_AI_TYPE.values()) {
ObjType type = generate(group, sub, aiType.name());
type.setProperty(PROPS.AI_TYPE, aiType.name());
}
for (PLACEHOLDER_POWER power : PLACEHOLDER_POWER.values()) {
generate(group, sub, power.name());
}
}
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HT_View method adjustLink.
public void adjustLink(Boolean vertical_horizontal_manual, HT_Node node) {
ObjType type = node.getType();
LINK_VARIANT variant = null;
if (tree.getMap().getLinkForChildType(type) != null) {
variant = tree.getMap().getLinkForChildType(type).getVariant();
}
if (variant == null || vertical_horizontal_manual == null) {
variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
} else {
variant = HT_MapBuilder.getShiftedLinkVariant(variant, vertical_horizontal_manual);
}
if (variant == null) {
LogMaster.log(1, type + "'s LINK_VARIANT null !!! ");
return;
}
type.setProperty(PROPS.LINK_VARIANT, variant.toString());
if (!CoreEngine.isArcaneVault()) {
XML_Writer.writeXML_ForType(type, isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES);
}
LogMaster.log(1, type + "'s LINK_VARIANT set for " + variant);
rebuildAndSetTree();
}
Aggregations