Ensure resetting hacc only happens with head obstructed.

This commit is contained in:
asofold 2016-11-02 09:35:19 +01:00
parent 518f2f08da
commit bea35e610a

View File

@ -1541,8 +1541,8 @@ public class SurvivalFly extends Check {
// Allow hop for special cases. // Allow hop for special cases.
if (!allowHop && (thisMove.from.onGround || thisMove.touchedGroundWorkaround)) { if (!allowHop && (thisMove.from.onGround || thisMove.touchedGroundWorkaround)) {
// TODO: Better reset delay in this case ? // TODO: Better reset delay in this case ?
if (data.bunnyhopDelay <= 6 || yDistance >= 0.0 && thisMove.headObstructed) { // || to.isHeadObstructed()) { if (data.bunnyhopDelay <= 6) {
// TODO: headObstructed: check always and set a flag in data + consider regain buffer? // TODO: Confine further ?
tags.add("ediblebunny"); tags.add("ediblebunny");
allowHop = true; allowHop = true;
} }
@ -1551,17 +1551,18 @@ public class SurvivalFly extends Check {
&& lastMove.hDistance > lastMove.hAllowedDistanceBase && lastMove.hDistance < 1.34 * lastMove.hAllowedDistanceBase && lastMove.hDistance > lastMove.hAllowedDistanceBase && lastMove.hDistance < 1.34 * lastMove.hAllowedDistanceBase
&& thisMove.hDistance > lastMove.hDistance * 1.24 && thisMove.hDistance > lastMove.hDistance * 1.24
&& thisMove.hDistance < lastMove.hDistance * 1.34 && thisMove.hDistance < lastMove.hDistance * 1.34
|| yDistance >= 0.0 && thisMove.headObstructed // || to.isHeadObstructed()
) { ) {
// TODO: headObstructed: check always and set a flag in data + consider regain buffer?
tags.add("headbangbunny"); tags.add("headbangbunny");
allowHop = true; allowHop = true;
} // TODO: Magic.
// ONLY WITH ALL ABOVE BEING ABOUT HEAD OBSTRUCTED: if (data.combinedMediumHValue / (double) data.combinedMediumHCount < 1.5) {
// TODO: Magic. // TODO: Reset to 1 and min(allowed, actual) rather.
if (allowHop && data.combinedMediumHValue / (double) data.combinedMediumHCount < 1.5) { data.combinedMediumHCount = 0;
// TODO: Reset to 1 and min(allowed, actual) rather. data.combinedMediumHValue = 0.0;
data.combinedMediumHCount = 0; tags.add("bunny_no_hacc");
data.combinedMediumHValue = 0.0; }
tags.add("bunny_no_hacc");
} }
} }