use of main.ability.AbilityType in project Eidolons by IDemiurge.
the class CloneMaster method getTypeCopy.
public static ObjType getTypeCopy(ObjType type, String newName, Game game, String group) {
// Ref ref = type.getRef();
// type.setGame(null);
// type.setRef(null);
ObjType newType = null;
if (type instanceof AbilityType)
newType = new AbilityType((AbilityType) type);
else
newType = new ObjType(type);
// (ObjType) CloneMaster.deepCopy(type);
newType.cloned();
return newType;
}
use of main.ability.AbilityType in project Eidolons by IDemiurge.
the class VariableManager method getVarType.
public static AbilityType getVarType(String abilTypeName) {
String vars = getVarPart(abilTypeName);
abilTypeName = abilTypeName.replace(vars, "");
AbilityType type = (AbilityType) DataManager.getType(abilTypeName, DC_TYPE.ABILS);
if (type == null) {
return null;
}
if (vars == "") {
return type;
}
AbilityType newType = new AbilityType(type);
type.initType();
setAbilityVariables(newType, vars);
// type.setVariables(varList);
return newType;
}
use of main.ability.AbilityType in project Eidolons by IDemiurge.
the class TypeInitializer method getNewType.
public ObjType getNewType(OBJ_TYPE obj_type) {
DC_TYPE OBJ_TYPE;
ObjType type = new ObjType();
if (obj_type instanceof DC_TYPE) {
OBJ_TYPE = (DC_TYPE) obj_type;
switch(OBJ_TYPE) {
case DIALOGUE:
type = new DialogueType();
setXmlTreeValue(true);
break;
case ABILS:
type = new AbilityType();
setXmlTreeValue(true);
break;
case BUFFS:
type = new BuffType();
break;
case ACTIONS:
type = new ActionType();
break;
case SPELLS:
type = new SpellType();
break;
case UNITS:
type = new UnitType();
// type.addProp(CLASSIFICATION, UNIT);
break;
case CHARS:
type = new UnitType();
// type.addProp(CLASSIFICATION, CHAR);
break;
default:
break;
}
}
type.setProperty(G_PROPS.TYPE, obj_type.getName());
type.setOBJ_TYPE_ENUM(obj_type);
return type;
}
use of main.ability.AbilityType in project Eidolons by IDemiurge.
the class DungeonObjMaster method createAction.
public DC_UnitAction createAction(T sub, Unit unit, String typeName, DungeonObj obj) {
// TODO CACHE
DC_UnitAction action = unit.getGame().getActionManager().getOrCreateAction(typeName, unit);
action.setTargeting(new SelectiveTargeting(new Conditions(new DistanceCondition("1", true), new FacingCondition(FACING_SINGLE.IN_FRONT))));
action.setConstructed(true);
action.getTargeter().setTargetingInitialized(true);
action.setTargetingCachingOff(true);
action.setActionTypeGroup(ACTION_TYPE_GROUPS.STANDARD);
action.setAbilities(null);
List<ActiveObj> actives = new ArrayList<>();
actives.add(new ActiveAbilityObj((AbilityType) DataManager.getType("Dummy Ability", DC_TYPE.ABILS), unit.getRef(), unit.getOwner(), unit.getGame()) {
@Override
public boolean activatedOn(Ref ref) {
return actionActivated(sub, unit, obj);
}
});
action.setActives(actives);
action.setActionTypeGroup(ACTION_TYPE_GROUPS.DUNGEON);
return action;
}
Aggregations