Comments.

Hint at per-velocity friction factor. Could be used to add short term 
velocity that does not decrease. However it can't replace extra-buffer
due to special invalidation conditions.
This commit is contained in:
asofold 2013-07-17 23:22:38 +02:00
parent 13add02392
commit b49df04120
4 changed files with 11 additions and 5 deletions

View File

@ -231,7 +231,8 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
final double hDist = TrigUtil.distance(loc.getX(), loc.getZ(), mData.fromX, mData.fromZ) ;
if (hDist >= 0.23 && mData.sfHorizontalBuffer > 0.5 && MovingListener.shouldCheckSurvivalFly(player, mData, MovingConfig.getConfig(player))){
// Allow extra consumption with buffer.
mData.sfHBufExtra = 7;
// TODO: Add to normal buffer or add velocity entry.
// mData.sfHBufExtra = 7;
if (cc.debug && BuildParameters.debugLevel > 0){
System.out.println(player.getName() + " attacks, hDist to last from: " + hDist + " | targetdist=" + TrigUtil.distance(loc.getX(), loc.getZ(), targetLoc.getX(), targetLoc.getZ()) + " | sprinting=" + player.isSprinting() + " | food=" + player.getFoodLevel() +" | hbuf=" + mData.sfHorizontalBuffer);
}

View File

@ -503,11 +503,12 @@ public class MovingData extends ACheckData {
*/
public void velocityTick(){
// Decrease counts for active.
// TODO: Actual friction. Could pass as an argument (special value for not to be used).
// TODO: Consider removing already invalidated here.
for (final Velocity vel : hVelActive){
vel.valCount --;
vel.sum += vel.value;
vel.value *= 0.93; // TODO: Actual friction.
vel.value *= 0.93; // vel.frictionFactor;
// (Altered entries should be kept, since they get used right away.)
}
// Decrease counts for queued.

View File

@ -10,17 +10,22 @@ import fr.neatmonster.nocheatplus.utilities.TickTask;
*/
public class Velocity {
// private static final double defaultFrictionFactor = 0.93;
/** Tick at which velocity got added. */
public final int tick;
/** The amount of velocity, decreasing with use. */
public double value;
// /** Factor for decrease of value */
// public double frictionFactor = defaultFrictionFactor;
/** "Some sum" for general purpose.
* <li> For vertical entries this is used to alter the allowed y-distance to the set-back point. </li>
*/
public double sum;
///////////////////////////
// Activation conditions.
///////////////////////////

View File

@ -175,8 +175,7 @@ public class DebugUtil {
if (BuildParameters.debugLevel > 0){
try{
// TODO: Check backwards compatibility (1.4.2). Remove try-catch
builder.append("\n(walkspeed=" + player.getWalkSpeed() + " flyspeed=" + player.getFlySpeed() + ")");
builder.append("\n(walkspeed=" + player.getWalkSpeed() + " flyspeed=" + player.getFlySpeed() + ")");
} catch (Throwable t){}
if (player.isSprinting()){
builder.append("(sprinting)");