mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Make it possible to escape a vortex
This commit is contained in:
parent
1d9f3b3ae3
commit
6b7193e0f4
1 changed files with 5 additions and 1 deletions
|
@ -37,7 +37,7 @@ public class SpellVortex extends SpellShield {
|
||||||
|
|
||||||
applyForce(pos, target, -force, 0);
|
applyForce(pos, target, -force, 0);
|
||||||
|
|
||||||
float maxVel = source.getAffinity() != SpellAffinity.BAD ? 1.6f : 1;
|
float maxVel = source.getAffinity() == SpellAffinity.BAD ? 1 : 1.6f;
|
||||||
|
|
||||||
if (target.motionX > maxVel) target.motionX = maxVel;
|
if (target.motionX > maxVel) target.motionX = maxVel;
|
||||||
if (target.motionX < -maxVel) target.motionX = -maxVel;
|
if (target.motionX < -maxVel) target.motionX = -maxVel;
|
||||||
|
@ -45,5 +45,9 @@ public class SpellVortex extends SpellShield {
|
||||||
if (target.motionY < -maxVel) target.motionY = -maxVel;
|
if (target.motionY < -maxVel) target.motionY = -maxVel;
|
||||||
if (target.motionZ > maxVel) target.motionZ = maxVel;
|
if (target.motionZ > maxVel) target.motionZ = maxVel;
|
||||||
if (target.motionZ < -maxVel) target.motionZ = -maxVel;
|
if (target.motionZ < -maxVel) target.motionZ = -maxVel;
|
||||||
|
|
||||||
|
if (distance < 0.5) {
|
||||||
|
target.motionZ += maxVel * 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue