Начинающий
- Статус
- Оффлайн
- Регистрация
- 20 Июл 2025
- Сообщения
- 98
- Реакции
- 0
всем прив, вот написал ВРОДЕ хорошую ротку на ст а вроде и флагает. кто сможет обьяснить почему флагает? (в код немношка вмешивался кодекс)
заранее спс за ответ!
забыл добавить что ротка писалась на анархию ст а не на дуели
rotation:
if (this.spookyTime.isSelected()) {
long currentTime = System.currentTimeMillis();
Vec3d humanPoint = this.generateHumanLikePoint();
Rotation targetRotation = RotationUtil.fromVec3d(humanPoint.subtract(eyes));
float targetYaw = targetRotation.getYaw();
float targetPitch = targetRotation.getPitch();
float yawDelta = MathHelper.wrapDegrees(targetYaw - this.lastYaw);
float pitchDelta = targetPitch - this.lastPitch;
if (this.spookyRandom.nextFloat() < 0.25F) {
yawDelta *= 0.7F + this.spookyRandom.nextFloat() * 0.2F;
pitchDelta *= 0.8F + this.spookyRandom.nextFloat() * 0.15F;
}
float reactionSpeed = 0.08F;
float distanceToTarget = (float) Math.sqrt(yawDelta * yawDelta + pitchDelta * pitchDelta);
if (distanceToTarget < 5.0F) {
reactionSpeed = 0.15F + this.spookyRandom.nextFloat() * 0.1F;
} else if (distanceToTarget > 20.0F) {
reactionSpeed = 0.05F + this.spookyRandom.nextFloat() * 0.08F;
}
if (this.spookyRandom.nextFloat() < 0.15F) {
reactionSpeed += this.spookyRandom.nextFloat() * 0.1F;
}
float humanYaw = this.lastYaw + yawDelta * reactionSpeed;
float humanPitch = this.lastPitch + pitchDelta * reactionSpeed;
float tremorIntensity = 0.02F + this.spookyRandom.nextFloat() * 0.08F;
humanYaw += (this.spookyRandom.nextFloat() - 0.5F) * tremorIntensity;
humanPitch += (this.spookyRandom.nextFloat() - 0.5F) * tremorIntensity * 0.6F;
if (this.spookyRandom.nextFloat() < 0.08F) {
humanYaw += (this.spookyRandom.nextFloat() - 0.5F) * 3.0F;
humanPitch += (this.spookyRandom.nextFloat() - 0.5F) * 2.0F;
}
if (this.spookyRandom.nextFloat() < 0.12F) {
float correctionYaw = (this.spookyRandom.nextFloat() - 0.5F) * 1.5F;
float correctionPitch = (this.spookyRandom.nextFloat() - 0.5F) * 1.0F;
humanYaw += correctionYaw;
humanPitch += correctionPitch;
}
long sessionTime = currentTime - (this.lastJitterTime == 0 ? currentTime : this.lastJitterTime);
if (sessionTime > 20000) { // После 20 секунд
float fatigueMultiplier = 1.0F + (sessionTime / 60000.0F) * 0.6F;
humanYaw += (this.spookyRandom.nextFloat() - 0.5F) * 0.3F * fatigueMultiplier;
humanPitch += (this.spookyRandom.nextFloat() - 0.5F) * 0.2F * fatigueMultiplier;
}
if (this.spookyRandom.nextFloat() < 0.06F) {
humanYaw = this.lastYaw + (humanYaw - this.lastYaw) * 0.1F;
humanPitch = this.lastPitch + (humanPitch - this.lastPitch) * 0.1F;
}
float maxHumanYawSpeed = 15.0F + this.spookyRandom.nextFloat() * 8.0F;
float maxHumanPitchSpeed = 12.0F + this.spookyRandom.nextFloat() * 6.0F;
float actualYawDelta = humanYaw - this.lastYaw;
float actualPitchDelta = humanPitch - this.lastPitch;
if (Math.abs(actualYawDelta) > maxHumanYawSpeed) {
humanYaw = this.lastYaw + Math.signum(actualYawDelta) * maxHumanYawSpeed;
}
if (Math.abs(actualPitchDelta) > maxHumanPitchSpeed) {
humanPitch = this.lastPitch + Math.signum(actualPitchDelta) * maxHumanPitchSpeed;
}
humanYaw += (this.spookyRandom.nextFloat() - 0.5F) * 0.05F;
humanPitch += (this.spookyRandom.nextFloat() - 0.5F) * 0.03F;
humanPitch = MathHelper.clamp(humanPitch, -90.0F, 90.0F);
Rotation humanRotation = new Rotation(humanYaw, humanPitch);
RotationComponent.update(humanRotation, 360.0F, 360.0F, 360.0F, 360.0F, 0, 1, false);
this.lastYaw = humanRotation.getYaw();
this.lastPitch = humanRotation.getPitch();
}
}
}
заранее спс за ответ!
забыл добавить что ротка писалась на анархию ст а не на дуели