use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class HT_MapBuilder method addAltBaseLinks.
private void addAltBaseLinks() {
for (HT_Node c : map.getNodeMap().values()) {
String prop = c.getType().getProperty(PROPS.ALT_BASE_LINKS);
if (prop.isEmpty()) {
continue;
}
for (String s : StringMaster.open(prop)) {
String typeName = VariableManager.removeVarPart(s);
String vars = VariableManager.getVar(s);
LINK_VARIANT variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, vars.split("=")[0]);
ObjType targetType = DataManager.getType(typeName, getTYPE());
Point point = map.getPointForType(c.getType());
// getPoint(variant, parent, type, parentX, i, sublingCount)
// point = getNodePointFromLink(point2.x, targetType, 0, 0,
// c.getType(), variant);
/*
* use the variant.getOffset()
*
* what point is base?
*
* c.
*
*/
int offsetX = StringMaster.getInteger(vars.split("=")[1].split(",")[0]);
int offsetY = StringMaster.getInteger(vars.split("=")[1].split(",")[1]);
point = new PointX(point.x + offsetX, point.y + offsetY);
StaticTreeLink link = new StaticTreeLink(variant, point, targetType, c.getType());
// link.setAlt(true); // what will it do?
map.getAltLinks().put(link, targetType);
}
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class AnimationConstructor method preconstructAllForAV.
public static void preconstructAllForAV() {
for (ObjType type : DataManager.getTypes(DC_TYPE.SPELLS)) {
DC_SpellObj active = new DC_SpellObj(type, Player.NEUTRAL, DC_Game.game, new Ref());
AnimData data = null;
try {
int i = 0;
for (ANIM_PART part : ANIM_PART.values()) {
data = new AnimationConstructor().getStandardData(active, part, i);
for (ANIM_VALUES val : ANIM_VALUES.values()) {
String identifier;
switch(val) {
case PARTICLE_EFFECTS:
identifier = "SFX";
break;
case SPRITES:
identifier = "SPRITE";
break;
default:
continue;
}
String value = data.getValue(val);
if (StringMaster.isEmpty(value))
continue;
value = value.replace(PathFinder.getImagePath().toLowerCase(), "");
i++;
PROPERTY prop = ContentManager.findPROP("anim" + "_" + identifier + "_" + part);
if (prop == null)
continue;
type.setProperty(prop, value);
}
}
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class ActionGenerator method generateOffhandActions.
public static void generateOffhandActions(ACTION_TYPE action_type) {
for (ObjType type : DataManager.getTypesGroup(DC_TYPE.ACTIONS, "" + action_type)) {
if (StringMaster.contains(type.getProperty(G_PROPS.ACTION_TAGS), ActionEnums.ACTION_TAGS.MAIN_HAND + "")) {
ActionType offHandType = new ActionType(type);
offHandType.addProperty(G_PROPS.ACTION_TAGS, StringMaster.getWellFormattedString(ActionEnums.ACTION_TAGS.OFF_HAND + ""));
offHandType.removeProperty(G_PROPS.ACTION_TAGS, StringMaster.getWellFormattedString(ActionEnums.ACTION_TAGS.MAIN_HAND + ""));
//
offHandType.setName(getOffhandActionName(type.getName()));
offHandType.addProperty(G_PROPS.ACTION_TAGS, getOffhandActionName(type.getName()));
DataManager.addType(offHandType);
}
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class InventoryTransactionManager method updateType.
public static void updateType(Unit hero) {
hero.setType(new ObjType(hero.getType()));
ObjType type = hero.getType();
// TODO init type?
hero.getGame().initType(type);
for (PROPERTY prop : INV_PROPS) {
type.copyValue(prop, hero);
// String property = hero.getProperty(prop);for (String item :
// StringMaster.openContainer(property)) {
// if (hero.getGame().getObjectById(StringMaster.getInteger(item))
// != null) {
// String string = hero.getGame()
// .getObjectById(StringMaster.getInteger(item))
// .getId().toString();
// // .getName();
// if (prop.isContainer())
// type.addProperty(prop, string);
// else
// type.setProperty(prop, string);
// }
// }
// type.setProperty(prop, property);
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class UnitLibrary method initPool.
private static void initPool(LEARN_CASE lc) {
LibraryManager.initSpellbook(unit);
spellPool = new XLinkedMap<>();
for (String substring : StringMaster.open(unit.getProperty(getSourceProp(lc)))) {
ObjType type = DataManager.getType(VariableManager.removeVarPart(substring), DC_TYPE.SPELLS);
if (checkCanLearnSpell(type, lc)) {
Integer weight = StringMaster.getWeight(substring);
if (weight <= 0) {
weight = 1;
}
spellPool.put(type, weight);
}
}
}
Aggregations