use of main.content.DC_TYPE in project Eidolons by IDemiurge.
the class ContainerTextElement method getRef.
@Override
protected Ref getRef() {
if (entity == null) {
return null;
}
int id = entity.getId();
Ref ref;
// if (entity.getGame().isSimulation())
// ref = CharacterCreator.getHeroPanel().getHero().getRef();
// else TODO
ref = entity.getRef();
if (entity.getOBJ_TYPE_ENUM() instanceof DC_TYPE) {
switch((DC_TYPE) entity.getOBJ_TYPE_ENUM()) {
case UNITS:
case CHARS:
ref = entity.getRef();
break;
case ACTIONS:
ref.setID(KEYS.ACTIVE, id);
break;
case ARMOR:
ref.setID(KEYS.ARMOR, id);
break;
case ITEMS:
ref.setID(KEYS.ITEM, id);
break;
case SPELLS:
ref.setID(KEYS.SPELL, id);
ref.setID(KEYS.ACTIVE, id);
break;
case WEAPONS:
ref.setID(KEYS.WEAPON, id);
break;
}
}
ref.setID(KEYS.INFO, id);
ref.setInfoEntity(entity);
if (CharacterCreator.getHero() != null) {
if (Game.game.isSimulation()) {
if (entity instanceof ObjType) {
entity = HeroCreator.getObjForType(CharacterCreator.getHero(), (ObjType) entity);
}
}
ref.setSource(CharacterCreator.getHero().getId());
// if (item!=null )
// ref.setSource(item.getRef().getSource());
CharacterCreator.getHero().getRef().setInfoEntity(entity);
}
return ref;
}
use of main.content.DC_TYPE in project Eidolons by IDemiurge.
the class XML_Converter method getTypeListFromXML.
public static List<ObjType> getTypeListFromXML(String xml, boolean layerDown) {
if (layerDown) {
xml = layerDown(xml);
}
Document doc = getDoc(xml);
List<ObjType> list = new ArrayList<>();
List<Node> typeGroupsList = null;
for (Node n : getNodeList(doc)) {
if (n.getNodeName().equalsIgnoreCase(TYPES_NODE)) {
typeGroupsList = getNodeList(n);
}
}
if (typeGroupsList == null) {
return new ArrayList<>();
}
for (Node groupNode : typeGroupsList) {
DC_TYPE obj_type = DC_TYPE.getType(groupNode.getNodeName());
for (Node typeNode : getNodeList(groupNode)) {
ObjType type = DataManager.getType(typeNode.getNodeName(), obj_type);
if (// TODO find?
type != null) {
list.add(type);
}
// TODO each type node could have some spec data for workspace?
}
}
return list;
}
use of main.content.DC_TYPE in project Eidolons by IDemiurge.
the class ContentGenerator method initHeight.
// public static void generateBfObjParams(ObjType t) {
// BF_OBJECT_TYPE type = new EnumMaster<BF_OBJECT_TYPE>().retrieveEnumConst(
// BF_OBJECT_TYPE.class, t.getProperty(G_PROPS.BF_OBJECT_TYPE));
// BF_OBJECT_GROUP group = new
// EnumMaster<BF_OBJECT_GROUP>().retrieveEnumConst(
// BF_OBJECT_GROUP.class, t.getProperty(G_PROPS.BF_OBJECT_GROUP));
// BF_OBJECT_SIZE size = new EnumMaster<BF_OBJECT_SIZE>().retrieveEnumConst(
// BF_OBJECT_SIZE.class, t.getProperty(PROPS.BF_OBJECT_SIZE));
// BF_OBJ_MATERIAL material = new
// EnumMaster<BF_OBJ_MATERIAL>().retrieveEnumConst(
// BF_OBJ_MATERIAL.class, t.getProperty(PROPS.BF_OBJ_MATERIAL));
// OBJECT_ARMOR_TYPE armorType = new
// EnumMaster<OBJECT_ARMOR_TYPE>().retrieveEnumConst(
// OBJECT_ARMOR_TYPE.class, t.getProperty(PROPS.OBJECT_ARMOR_TYPE));
//
// if (armorType == null) {
// switch (type) {
//
// }
// }
//
// // TODO
//
// // stone/wood/metal/ ...
// int i = 0;
// List<String> list = getParamsFor(armorType);
// for (PARAMS portrait : params) {
// t.setParam(portrait, list.getOrCreate(i));
// i++;
// }
// list = getResistancesForArmorType(armorType);
// for (PARAMETER portrait : ValuePages.RESISTANCES) {
// t.setParam(portrait, list.getOrCreate(i));
// i++;
// }
//
// }
// TODO use mods from size? or multiply later...
// private static String getParams(OBJECT_ARMOR_TYPE armorType, PARAMS portrait) {
// switch (armorType) {
// case AETHER:
// return getAETHERParam(portrait);
// case BONE:
// return getBONEParam(portrait);
// case CRYSTAL:
// return getCRYSTALParam(portrait);
// case ETHEREAL:
// return getETHEREALParam(portrait);
// case FLESH:
// return getFLESHParam(portrait);
// case METAL:
// return getMETALParam(portrait);
// case STONE:
// return getSTONEParam(portrait);
// case WOOD:
// return getWOODParam(portrait);
//
// }
//
// return null;
// }
//
// private static List<String> getResistancesForArmorType(OBJECT_ARMOR_TYPE
// armorType) {
// List<String> list = new ArrayList<>();
// for (PARAMETER portrait : ValuePages.RESISTANCES) {
// switch ((PARAMS) portrait) {
// case PIERCING_RESISTANCE:
// list.add(getPIERCING_RESISTANCE(armorType));
// list.add(getOrCreate(armorType));
// break;
// case BLUDGEONING_RESISTANCE:
// list.add(getBLUDGEONING_RESISTANCE(armorType));
// break;
// case SLASHING_RESISTANCE:
// list.add(getSLASHING_RESISTANCE(armorType));
// break;
// case POISON_RESISTANCE:
// list.add(getPOISON_RESISTANCE(armorType));
// break;
// case FIRE_RESISTANCE:
// list.add(getFIRE_RESISTANCE(armorType));
// break;
// case COLD_RESISTANCE:
// list.add(getCOLD_RESISTANCE(armorType));
// break;
// case ACID_RESISTANCE:
// list.add(getACID_RESISTANCE(armorType));
// break;
// case LIGHTNING_RESISTANCE:
// list.add(getLIGHTNING_RESISTANCE(armorType));
// break;
// case SONIC_RESISTANCE:
// list.add(getSONIC_RESISTANCE(armorType));
// break;
// case LIGHT_RESISTANCE:
// list.add(getLIGHT_RESISTANCE(armorType));
// break;
// case CHAOS_RESISTANCE:
// list.add(getCHAOS_RESISTANCE(armorType));
// break;
// case ARCANE_RESISTANCE:
// list.add(getARCANE_RESISTANCE(armorType));
// break;
// case HOLY_RESISTANCE:
// list.add(getHOLY_RESISTANCE(armorType));
// break;
// case SHADOW_RESISTANCE:
// list.add(getSHADOW_RESISTANCE(armorType));
// break;
// case PSIONIC_RESISTANCE:
// list.add(getPSIONIC_RESISTANCE(armorType));
// break;
// case DEATH_RESISTANCE:
// list.add(getDEATH_RESISTANCE(armorType));
// break;
// }
// }
//
// return list;
// }
//
// private static List<String> getParamsFor(OBJECT_ARMOR_TYPE armorType) {
// List<String> list = new ArrayList<>();
// for (PARAMS portrait : params) {
// list.add(getParams(armorType, portrait));
// }
//
// return list;
// }
public static void initHeight(ObjType t) {
DC_TYPE TYPE = (DC_TYPE) t.getOBJ_TYPE_ENUM();
if (t.getIntParam(PARAMS.HEIGHT) != 0) {
return;
}
int height = 0;
switch(TYPE) {
case BF_OBJ:
BF_OBJECT_TYPE type = new EnumMaster<BF_OBJECT_TYPE>().retrieveEnumConst(BF_OBJECT_TYPE.class, t.getProperty(G_PROPS.BF_OBJECT_TYPE));
BF_OBJECT_GROUP group = new EnumMaster<BF_OBJECT_GROUP>().retrieveEnumConst(BF_OBJECT_GROUP.class, t.getProperty(G_PROPS.BF_OBJECT_GROUP));
if (type != null) {
switch(type) {
}
}
if (group != null) {
switch(group) {
case ROCKS:
height = 100;
break;
case TREES:
height = 1000;
break;
default:
break;
}
}
break;
case UNITS:
List<CLASSIFICATIONS> c = new EnumMaster<CLASSIFICATIONS>().getEnumList(CLASSIFICATIONS.class, t.getProperty(G_PROPS.CLASSIFICATIONS));
if (c.contains(UnitEnums.CLASSIFICATIONS.GIANT)) {
height = 600;
} else if (c.contains(UnitEnums.CLASSIFICATIONS.HUMANOID)) {
height = 180;
} else if (c.contains(UnitEnums.CLASSIFICATIONS.TALL)) {
height = 225;
} else if (c.contains(UnitEnums.CLASSIFICATIONS.SHORT)) {
height = 125;
}
case CHARS:
RACE race = new EnumMaster<RACE>().retrieveEnumConst(RACE.class, t.getProperty(G_PROPS.RACE));
BACKGROUND bg = new EnumMaster<BACKGROUND>().retrieveEnumConst(BACKGROUND.class, t.getProperty(G_PROPS.BACKGROUND));
GENDER g = new EnumMaster<GENDER>().retrieveEnumConst(GENDER.class, t.getProperty(G_PROPS.GENDER));
if (race != null) {
switch(race) {
case DEMON:
height = 200;
break;
case DWARF:
height = 130;
break;
case ELF:
height = 190;
break;
case GOBLINOID:
height = 160;
break;
case HUMAN:
height = 180;
if (bg == HeroEnums.BACKGROUND.MAN_OF_WOLF_REALM) {
height += 10;
}
if (bg == HeroEnums.BACKGROUND.MAN_OF_EAGLE_REALM) {
height += 15;
}
break;
case VAMPIRE:
height = 180;
break;
default:
break;
}
}
if (g == HeroEnums.GENDER.FEMALE) {
height -= height / 5;
}
break;
}
t.setParam(PARAMS.HEIGHT, height);
// per race?
// per obj type
}
use of main.content.DC_TYPE in project Eidolons by IDemiurge.
the class DC_RequirementsManager method getRequirements.
@Override
public Requirements getRequirements(Entity type, int mode) {
Map<Entity, Requirements> map = getReqMap(mode);
if (map != null) {
if (// TODO
map.get(type) != null) {
return map.get(type);
}
}
Requirements req = null;
OBJ_TYPE TYPE = type.getOBJ_TYPE_ENUM();
if (TYPE instanceof DC_TYPE) {
switch((DC_TYPE) TYPE) {
case ARMOR:
req = generateItemRequirements(type, mode);
break;
case ITEMS:
req = generateItemRequirements(type, mode);
break;
case CLASSES:
req = generateClassRequirements(type, mode);
break;
case SKILLS:
req = generateSkillRequirements(type, mode);
break;
case SPELLS:
req = generateSpellRequirements(type, mode);
break;
case WEAPONS:
req = generateItemRequirements(type, mode);
break;
case UNITS:
break;
case ACTIONS:
break;
default:
break;
}
}
if (req == null) {
return null;
}
String additionalRequirements = type.getProperty(PROPS.REQUIREMENTS);
if (!StringMaster.isEmpty(additionalRequirements)) {
try {
req.addAll(toRequirements(additionalRequirements));
} catch (Exception e) {
LogMaster.log(1, type + "'s req failed! - " + additionalRequirements);
// main.system.ExceptionMaster.printStackTrace(e);
}
}
if (type.isUpgrade() && TYPE != null) {
Requirement baseTypeRequirement = getBaseTypeRequirement(type, TYPE);
if (baseTypeRequirement != null) {
req.add(baseTypeRequirement);
}
}
if (map != null) {
map.put(type, req);
}
return req;
}
use of main.content.DC_TYPE in project Eidolons by IDemiurge.
the class ValuePageManager method initMaps.
private static void initMaps(Map<OBJ_TYPE, Map<String, List<VALUE>>> pageMaps, VALUE[][][] pageArray, String[] PAGE_NAMES, boolean alt) {
for (DC_TYPE TYPE : DC_TYPE.values()) {
int i = TYPE.getCode();
if (pageArray.length <= i) {
break;
}
VALUE[][] pages = pageArray[i];
if (pages == null) {
continue;
}
List<String> pageNames = StringMaster.openContainer(PAGE_NAMES[i]);
List<List<VALUE>> pageList = new ArrayMaster<VALUE>().get2dList(pages);
Map<String, List<VALUE>> map = new MapMaster<String, List<VALUE>>().constructMap(pageNames, pageList);
if (!alt) {
map.put(DC_HEADER, Arrays.asList(ValuePages.GENERIC_DC_HEADER));
map.put(AV_HEADER, Arrays.asList(ValuePages.GENERIC_AV_HEADER));
map.put(AV_TRAILING_PAGE, Arrays.asList(ValuePages.AV_TRAILING_PAGE));
map.put(DC_TRAILING_PAGE, Arrays.asList(ValuePages.DC_TRAILING_PAGE));
}
pageMaps.put(TYPE, map);
}
}
Aggregations