use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class DebugMaster method executeHiddenDebugFunction.
public Object executeHiddenDebugFunction(HIDDEN_DEBUG_FUNCTIONS func) {
executedFunctions.push(func.toString());
Unit infoObj;
try {
infoObj = (Unit) getObj();
} catch (Exception e) {
infoObj = game.getManager().getActiveObj();
}
switch(func) {
case WRITE_GROUP:
Entity entity = DC_Game.game.getValueHelper().getEntity();
if (entity == null) {
break;
}
XML_Writer.writeXML_ForTypeGroup(entity.getOBJ_TYPE_ENUM(), entity.getGroupingKey());
case WRITE:
if (!(DC_Game.game.getValueHelper().getEntity() instanceof ObjType)) {
break;
}
XML_Writer.writeXML_ForTypeGroup(DC_Game.game.getValueHelper().getEntity().getOBJ_TYPE_ENUM());
break;
case WRITE_TYPE:
if (!(DC_Game.game.getValueHelper().getEntity() instanceof ObjType)) {
break;
}
XML_Writer.writeXML_ForType((ObjType) DC_Game.game.getValueHelper().getEntity());
break;
case TOGGLE_AV_MODE:
CoreEngine.setArcaneVault(!CoreEngine.isArcaneVault());
CoreEngine.setArcaneVaultMode(true);
break;
case RECONSTRUCT:
{
for (ActiveObj obj : infoObj.getPassives()) {
obj.setConstructed(false);
}
for (ActiveObj obj : infoObj.getActives()) {
obj.setConstructed(false);
}
break;
}
case RELOAD_TYPES:
{
XML_Reader.readTypes(false, true);
game.initObjTypes();
break;
}
case RESTART_GAME:
// TODO executeDebugFunction(KILL_ALL_UNITS);
// DC_ObjInitializer.processUnitDataString(game.getPlayer(true),
// game.getPlayerParty(), game);
game.getManager().unitActionCompleted(null, false);
break;
case BF_RESURRECT_ALL:
break;
case DISPLAY_EVENT_LOG:
break;
case DISPLAY_REF:
display(game.getManager().getInfoObj().getName() + "'s REF:", game.getManager().getInfoObj().getRef() + "");
break;
case DISPLAY_TRIGGERS:
// display("Triggers: ", game.getState().getAttachedTriggers());
displayList("Triggers: ", game.getState().getTriggers(), 1);
break;
case DISPLAY_STATE:
display("State: ", game.getState());
break;
case DISPLAY_EFFECTS:
displayList("Effects ", game.getState().getEffects(), 1);
break;
case DISPLAY_OBJECTS:
for (OBJ_TYPE sub : game.getState().getGame().getState().getObjMaps().keySet()) {
displayList(sub + ": ", game.getState().getGame().getState().getObjMaps().get(sub).keySet(), 1);
}
case DISPLAY_UNITS:
displayList("Units ", game.getState().getGame().getUnits(), 1);
break;
case DISPLAY_UNIT_INFO:
display("INFO OBJ: ", getUnitInfo(game.getManager().getInfoObj()));
break;
case HERO_ADD_ALL_SPELLS:
for (ObjType type : DataManager.getTypes(DC_TYPE.SPELLS)) {
Unit hero = (Unit) game.getManager().getInfoObj();
if (LibraryManager.checkHeroHasSpell(hero, type)) {
continue;
}
LibraryManager.addVerbatimSpell(hero, type);
DC_SpellObj spell = new DC_SpellObj(type, hero.getOriginalOwner(), hero.getGame(), hero.getRef());
hero.getSpells().add(spell);
}
break;
default:
break;
}
return null;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class TextMaster method extractTypeText.
private static void extractTypeText() {
DC_Engine.fullInit();
int i = 0;
for (OBJ_TYPE k : extractedTypes) {
List<String> value = null;
if (extractedTypeGroups.length > i) {
value = StringMaster.openContainer(extractedTypeGroups[i]);
}
extractedTypesMap.put(k, value);
i++;
}
for (PROPERTY prop : extract_props) {
for (OBJ_TYPE t : extractedTypesMap.keySet()) {
List<String> list = extractedTypesMap.get(t);
if (list == null) {
extractTypeText(t, null, prop);
} else {
for (String c : list) {
extractTypeText(t, c, prop);
}
}
}
}
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class TreeViewBuilder method getEmptyType.
private ObjType getEmptyType(String TYPE, String newName) {
ObjType type = new ObjType(newName);
OBJ_TYPE t = DC_TYPE.getType(TYPE);
if (ArcaneVault.isMacroMode()) {
t = MACRO_OBJ_TYPES.getType(TYPE);
}
// type.setObjType(t);
Simulation.getGame().initType(type);
return type;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class FilterMaster method newFilter.
public static void newFilter() {
Conditions conditions = new Conditions();
OBJ_TYPE TYPE = ArcaneVault.getSelectedOBJ_TYPE();
CONDITION_TEMPLATES[] templates = CONDITION_TEMPLATES.values();
while (true) {
// CHOOSE TYPE? OR USE SELECTED TAB!
int i = DialogMaster.optionChoice(templates, "choose filter template");
if (i == -1) {
break;
}
CONDITION_TEMPLATES template = CONDITION_TEMPLATES.values()[i];
String value = DialogMaster.inputText("Enter filter's value name");
if (StringMaster.isEmpty(value)) {
break;
}
VALUE val = ContentManager.findValue(value);
value = DialogMaster.inputText("Enter filtering value");
if (StringMaster.isEmpty(value)) {
break;
}
conditions.add(new ConditionMaster().getConditionFromTemplate(template, StringMaster.getValueRef(KEYS.MATCH, val), value));
}
if (conditions.isEmpty()) {
return;
}
if (TYPE == null) {
}
// Document node = XML_Converter.getDoc(XML_Converter.openXml("conditions")
// + XML_Converter.closeXml("conditions"));
// String conditionString = XML_Converter.getStringFromXML(node);
TypeFilter filter = new TypeFilter(conditions, TYPE);
// save!
filters.add(filter);
ArcaneVault.getMainBuilder().getTabBuilder().addFilter(filter);
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class TypeFinder method findTypes.
public static List<ObjType> findTypes(String typeName, OBJ_TYPE... TYPES) {
lastSearch = typeName;
List<ObjType> list = new ArrayList<>();
for (OBJ_TYPE TYPE : TYPES) {
List<ObjType> foundTypes = DataManager.findTypes(typeName, false, TYPE);
list.addAll(foundTypes);
}
return list;
}
Aggregations