mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Casters can now control the range of the shield spell by sneaking
This commit is contained in:
parent
5a9686b108
commit
2db782422b
1 changed files with 4 additions and 2 deletions
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.EquinePredicates;
|
import com.minelittlepony.unicopia.EquinePredicates;
|
||||||
|
import com.minelittlepony.unicopia.entity.SpellcastEntity;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||||
import com.minelittlepony.unicopia.magic.Affinity;
|
import com.minelittlepony.unicopia.magic.Affinity;
|
||||||
import com.minelittlepony.unicopia.magic.AttachableSpell;
|
import com.minelittlepony.unicopia.magic.AttachableSpell;
|
||||||
|
@ -41,7 +42,7 @@ public class ShieldSpell extends AbstractRangedAreaSpell implements AttachableSp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(Caster<?> source) {
|
public void render(Caster<?> source) {
|
||||||
float radius = 4 + (source.getCurrentLevel() * 2);
|
float radius = (float)getDrawDropOffRange(source);
|
||||||
|
|
||||||
source.spawnParticles(new Sphere(true, radius), (int)(radius * 6), pos -> {
|
source.spawnParticles(new Sphere(true, radius), (int)(radius * 6), pos -> {
|
||||||
source.addParticle(new MagicParticleEffect(getTint()), pos, Vec3d.ZERO);
|
source.addParticle(new MagicParticleEffect(getTint()), pos, Vec3d.ZERO);
|
||||||
|
@ -75,7 +76,8 @@ public class ShieldSpell extends AbstractRangedAreaSpell implements AttachableSp
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDrawDropOffRange(Caster<?> source) {
|
public double getDrawDropOffRange(Caster<?> source) {
|
||||||
return 4 + (source.getCurrentLevel() * 2);
|
float multiplier = (source.getOwner() instanceof SpellcastEntity || source.getOwner().isSneaking() ? 1 : 2);
|
||||||
|
return (4 + (source.getCurrentLevel() * 2)) / multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue