use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class UnitAI method initActionPriorities.
private void initActionPriorities() {
actionPriorityBonuses = RandomWizard.constructWeightMap(unit.getProperty(PROPS.ACTION_PRIORITY_BONUSES), C_OBJ_TYPE.ACTIVE);
actionPriorityMods = RandomWizard.constructWeightMap(unit.getProperty(PROPS.ACTION_PRIORITY_MODS), C_OBJ_TYPE.ACTIVE);
for (ObjType spell : DataManager.toTypeList(unit.getProperty(PROPS.VERBATIM_SPELLS), DC_TYPE.SPELLS)) {
Integer mastery = unit.getIntParam(ContentManager.getSpellMasteryForSpell(spell));
// WHY VERBATIM? MAYBE FROM *TYPE*, YES...
int mod = DEFAULT_VERBATIM_MOD + mastery;
}
// default additions?
/*
* verbatim spell list per mastery
*/
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class UnitInitializer method initNaturalWeapon.
public void initNaturalWeapon(boolean offhand) {
if (offhand) {
if (StringMaster.isEmpty(getProperty(PROPS.OFFHAND_NATURAL_WEAPON))) {
return;
}
}
PROPS prop = (offhand) ? PROPS.OFFHAND_NATURAL_WEAPON : PROPS.NATURAL_WEAPON;
// if (game.isSimulation())
// return;
ObjType weaponType = DataManager.getType(getProperty(prop), DC_TYPE.WEAPONS);
if (weaponType == null) {
return;
}
DC_WeaponObj weapon = new DC_WeaponObj(weaponType, getEntity().getOwner(), getGame(), getRef(), !offhand);
getEntity().setNaturalWeapon(offhand, weapon);
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class UnitInitializer method initFeatContainer.
// TODO reqs: save() ; modify() ; resetSkillRanks() for (s s : skills)
public void initFeatContainer(PROPERTY PROP, DC_TYPE TYPE, DequeImpl<DC_FeatObj> list) {
// TODO make it dynamic and clean!
List<String> feats = StringMaster.openContainer(getProperty(PROP));
for (String feat : feats) {
DC_FeatObj featObj = null;
int rank = 0;
// or special separator!
if (StringMaster.isInteger(StringMaster.cropParenthesises(VariableManager.getVarPart(feat)))) {
rank = StringMaster.getInteger(StringMaster.cropParenthesises(VariableManager.getVarPart(feat)));
feat = VariableManager.removeVarPart(feat);
}
ObjType featType = DataManager.getType(feat, TYPE);
if (game.isSimulation()) {
featObj = (DC_FeatObj) getGame().getSimulationObj(getEntity(), featType, PROP);
}
if (featObj == null) {
try {
featObj = new DC_FeatObj(featType, getEntity().getOriginalOwner(), getGame(), getRef());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
continue;
}
if (game.isSimulation()) {
getGame().addSimulationObj(getEntity(), featType, featObj, PROP);
}
}
if (rank != 0) {
featObj.setParam(PARAMS.RANK, rank);
}
list.add(featObj);
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class DC_QuickItemObj method construct.
@Override
public void construct() {
if (active == null) {
if (wrapped) {
generateWrappedActive();
return;
}
}
if (!constructed) {
ref.setID(KEYS.ACTIVE, getId());
} else {
if (getActive() == null) {
generateWrappedActive();
} else {
// TODO for parsing?
ref.setID(KEYS.ACTIVE, getActive().getId());
}
}
super.construct();
if (!StringMaster.isEmpty(getProperty(PROPS.ITEM_SPELL))) {
}
if (// ?
actives == null) {
return;
}
if (actives.isEmpty()) {
return;
}
ObjType type = initActiveType();
setActive(new DC_QuickItemAction(type, getOriginalOwner(), getGame(), ref));
getActive().setActives(getActives());
getActive().setConstructed(true);
getActive().setItem(this);
}
use of main.entity.type.ObjType 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;
}
Aggregations