public void setTargetEntity(Entity entity) { target = new DynamicLocation(entity); }
public void setTargetLocation(Location location) { target = new DynamicLocation(location); }
public Effect start(String effectClass, ConfigurationSection parameters, Location origin, Player targetPlayer){ return start(effectClass, parameters, new DynamicLocation(origin, null), new DynamicLocation(null, null), (ConfigurationSection)null, targetPlayer); }
@Override public void start(Entity originEntity, Entity targetEntity) { startEffects(new DynamicLocation(originEntity), new DynamicLocation(targetEntity)); }
@Override public void start(Location origin, Entity originEntity, Location target, Entity targetEntity) { startEffects(new DynamicLocation(origin, originEntity), new DynamicLocation(target, targetEntity)); }
public void start(Location origin, Entity originEntity, Collection<Entity> targets) { if (targets == null || targets.size() == 0) return; DynamicLocation source = new DynamicLocation(origin, originEntity); for (Entity targetEntity : targets) { if (targetEntity == null) continue; // This is not really going to work out well for any Effect type but Single! // TODO : Perhaps re-visit? DynamicLocation target = new DynamicLocation(targetEntity); startEffects(source, target); } }
@Override public void start(Location origin, Location target) { startEffects(new DynamicLocation(origin), new DynamicLocation(target)); }
/** * Start an Effect from a Configuration map of parameters. * * @param effectClass The name of the Effect class to instantiate. If unqualified, defaults to the de.slikey.effectlib.effect namespace. * @param parameters A Configuration-driven map of key/value parameters. Each of these will be applied directly to the corresponding field in the Effect instance. * @param origin The origin Location * @param target The target Location, only used in some Effects (like LineEffect) * @param originEntity The origin Entity, the effect will attach to the Entity's Location * @param targetEntity The target Entity, only used in some Effects * @param parameterMap A map of parameter values to replace. These must start with the "$" character, values in the parameters map that contain a $key will be replaced with the value in this parameterMap. * @return */ @Deprecated public Effect start(String effectClass, ConfigurationSection parameters, Location origin, Location target, Entity originEntity, Entity targetEntity, Map<String, String> parameterMap) { return start(effectClass, parameters, new DynamicLocation(origin, originEntity), new DynamicLocation(target, targetEntity), parameterMap); }
public void setEntity(Entity entity) { setDynamicOrigin(new DynamicLocation(entity)); }
public void setLocation(Location location) { setDynamicOrigin(new DynamicLocation(location)); }
@Override public void run(String playerID) throws QuestRuntimeException { Player p = PlayerConverter.getPlayer(playerID); Location location = (loc == null) ? p.getLocation() : loc.getLocation(playerID); Entity originEntity = (loc == null) ? p : null; Player targetPlayer = pr1vate ? p : null; EffectLibIntegrator.getEffectManager().start(effectClass, parameters, new DynamicLocation(location, null), new DynamicLocation(null, null), (Map<String, String>) null, targetPlayer); }
protected void startProjectileEffects(CastContext context, String effectKey) { Collection<EffectPlayer> projectileEffects = context.getEffects(effectKey); for (EffectPlayer apiEffectPlayer : projectileEffects) { if (effectLocation == null) { effectLocation = new DynamicLocation(actionContext.getTargetLocation()); effectLocation.setDirection(velocity); } if (activeProjectileEffects == null) { activeProjectileEffects = new ArrayList<>(); } // Hrm- this is ugly, but I don't want the API to depend on EffectLib. if (apiEffectPlayer instanceof com.elmakers.mine.bukkit.effect.EffectPlayer) { com.elmakers.mine.bukkit.effect.EffectPlayer effectPlayer = (com.elmakers.mine.bukkit.effect.EffectPlayer)apiEffectPlayer; effectPlayer.setEffectPlayList(activeProjectileEffects); if (projectileEffectsUseTarget) { Entity sourceEntity = actionContext.getEntity(); DynamicLocation sourceLocation = sourceEntity == null ? new DynamicLocation(actionContext.getLocation()) : new DynamicLocation(sourceEntity); effectPlayer.startEffects(sourceLocation, effectLocation); } else { effectPlayer.startEffects(effectLocation, null); } } } } }
@Override public void iterate() { Location origin = getOrigin(); if (origin == null) return; float currentRadius = scale(radius * scale); // Randomization double startRadians = Math.random() * Math.PI * 2; for (int i = 0; i < size; i++) { double radians = (double)i / size * Math.PI * 2 + startRadians; Vector direction = new Vector(Math.cos(radians) * currentRadius, 0, Math.sin(radians) * currentRadius); Location source = origin; Location target = getTarget(); if (playAtOrigin) { source = source.clone(); source.add(direction); } if (target != null && playAtTarget) { target = target.clone(); target.add(direction); } playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity())); } } }
public void iterateSteps(Location originalOrigin, Location originalTarget) { for (int i = 0; i < steps; i++) { Location source = originalOrigin; Location target = originalTarget; if (playAtOrigin) { source = source.clone(); source.add(positionTransform.get(source, totalSteps)); } if (target != null && playAtTarget) { target = target.clone(); target.add(positionTransform.get(target, totalSteps)); } playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity())); totalSteps++; if (maxStep > 0 && totalSteps >= maxStep) { totalSteps = 0; } } }
effect.name, effect.settings, new DynamicLocation(loc, null), new DynamicLocation(null, null), null, player);
public void setTarget(Location location) { if (target == null) { target = new DynamicLocation(location); } else { Location targetLocation = target.getLocation(); targetLocation.setX(location.getX()); targetLocation.setY(location.getY()); targetLocation.setZ(location.getZ()); } }
public void setOrigin(Location location) { if (origin == null) { origin = new DynamicLocation(location); } else { Location originLocation = origin.getLocation(); originLocation.setX(location.getX()); originLocation.setY(location.getY()); originLocation.setZ(location.getZ()); } }
@Override public void iterate() { if (positionTransform == null) { playEffect(); return; } Location origin = getOrigin(); Location target = getTarget(); if (origin == null) return; if (steps > 0) { iterateSteps(origin, target); return; } Location source = origin; double t = (double)playTime / 1000; if (playAtOrigin) { source = source.clone(); source.add(positionTransform.get(source, t)); } if (target != null && playAtTarget) { target = target.clone(); target.add(positionTransform.get(target, t)); } long now = System.currentTimeMillis(); playTime += (now - lastIteration); lastIteration = now; playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity())); } }
@Override public void iterate() { Location origin = getOrigin(); Location target = getTarget(); if (origin == null) return; Vector delta = direction.clone(); Location source = origin.clone(); if (playAtOrigin) { source.add(delta.multiply(scale(size) + 1)); } if (target != null && playAtTarget) { target = target.clone(); target.add(delta.multiply(-scale(size) + 1)); } playEffect(new DynamicLocation(source, getOriginEntity()), new DynamicLocation(target, getTargetEntity())); }