use of main.entity.Ref in project Eidolons by IDemiurge.
the class HT_Node method getReqs.
public List<String> getReqs() {
if (reqs == null) {
Ref ref = getRef();
DC_Game.game.getRequirementsManager().getRequirements(getType(), 0).check(ref, true);
setReqs(DC_Game.game.getRequirementsManager().getRequirements(getType(), 0).getReasons());
}
return reqs;
}
use of main.entity.Ref 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.Ref in project Eidolons by IDemiurge.
the class FloatingTextMaster method createAndShowParamModText.
public void createAndShowParamModText(Object o) {
Pair<PARAMETER, Ref> pair = (Pair<PARAMETER, Ref>) o;
Entity active = pair.getValue().getObj(KEYS.ACTIVE);
int amount = 0;
if (pair.getValue().getAmount() != null)
amount = pair.getValue().getAmount();
else {
return;
}
FloatingText text = getFloatingText(active, TEXT_CASES.PARAM_MOD, new ImmutablePair<>(pair.getKey(), amount));
Obj obj = active.getRef().getTargetObj();
if (obj == null)
obj = active.getRef().getSourceObj();
if (obj != null) {
BaseView view = DungeonScreen.getInstance().getGridPanel().getViewMap().get(obj);
if (view != null) {
Vector2 v = view.localToStageCoordinates(new Vector2(view.getX(), view.getY()));
text.setPosition(v.x, v.y);
}
}
GuiEventManager.trigger(GuiEventType.ADD_FLOATING_TEXT, text);
}
use of main.entity.Ref in project Eidolons by IDemiurge.
the class LockMaster method tryUnlock.
public boolean tryUnlock(Entity lockedObj, Unit lockPicker, Formula formula) {
boolean result = TrapMaster.checkTrapOnLock(lockedObj);
if (!result) {
return false;
}
Ref ref = new Ref(lockPicker);
ref.setTarget(lockedObj.getId());
// preCheck lockpick
if (formula != null) {
// TODO
} else {
result = RollMaster.roll(GenericEnums.ROLL_TYPES.UNLOCK, ref);
}
// roll
lockedObj.getIntParam(PARAMS.LOCK_LEVEL);
// DC_SoundMaster.playStandardSound(STD_SOUNDS.UNLOCK_SUCCESS);
return result;
}
use of main.entity.Ref in project Eidolons by IDemiurge.
the class GameManager method effectApplies.
public boolean effectApplies(EffectImpl effect) {
Ref ref = effect.getRef();
ref.setEffect(effect);
return (!getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.EFFECT_IS_BEING_APPLIED, ref)));
}
Aggregations