-
Автор темы
- #1
Еще один слив строчек кода для ваших пасточек на plusminus для 236 dev
эти чстроки так же есть в моей пасточке ketamine.pw
эти чстроки так же есть в моей пасточке ketamine.pw
Калькуляция:
float CalculateBulletRadius(float distToTarget, float num10, float num11, float boundsPadding) {
float num12 = boundsPadding + num10 * num11;
return num12;
}
Сама функция Bullet Teleport:
//сама функа
void ProjectileUpdate_hk(Projectile* self) {
auto* TargetPlayer = reinterpret_cast<BasePlayer*>(vars::stor::closestPlayer);
if (vars::combat::bullet_tp
&& self->isAuthoritative()
//&& GetAsyncKeyState(vars::keys::bullet_tp_key)
&& self->isAlive()
&& TargetPlayer != NULL)
{
BasePlayer* targetPlayer = reinterpret_cast<BasePlayer*>(TargetPlayer);
if (auto transform = targetPlayer->transform_(head)) {
auto targetPos = transform->position();
auto projPos = self->transform()->position();
auto distToTarget = targetPos.distance(projPos);
HitTest* hitTest = reinterpret_cast<HitTest*>(self->hitTest());
bool flag18 = !(self->projectileID());
if (!flag18)
{
bool flag22 = self->integrity() <= 0.f;
if (!flag22)
{
float num = Mathf1::Clamp(self->traveledTime(), 0.f, 8.f);
float num2 = 1.f + 0.5f;
float projectile_clientframes = 2.f;
float projectile_serverframes = 2.f;
float num3 = Mathx1::Decrement(self->launchTime());
float num4 = Mathf1::Clamp(Mathx1::Increment(Time::realtimeSinceStartup()) - num3, 0.f, 8.f);
float num5 = num;
float num7 = Mathf1::Min(num4, num5);
float num8 = projectile_clientframes / 60.f;
float num9 = projectile_serverframes * Mathx1::Max(Time::deltaTime(), Time::smoothDeltaTime(), Time::fixedDeltaTime());
float desyncTime = (Time::realtimeSinceStartup() - LocalPlayer::Entity()->lastSentTickTime()) - 0.03125 * 3;
float num10 = (desyncTime + num7 + num8 + num9) * num2;
float num11 = targetPlayer->MaxVelocity() + targetPlayer->GetParentVelocity().Magnitude();
float num12 = targetPlayer->BoundsPadding() + num10 * num11;
float num13 = distToTarget;
bool flag64 = num13 > num12;
float bulletRadius = CalculateBulletRadius(distToTarget, num10, num11, targetPlayer->BoundsPadding());
if (vars::visuals::show_radius_bullettp) {
DDraw::Capsule(TargetPlayer->transform_(head)->position(), Quaternion(), bulletRadius, 2 * (bulletRadius), Color(1.f, 1.f, 1.f, 1.f), 0.01f, false);
}
//DDraw::Sphere(TargetPlayer->get_bone_pos(head), bulletRadius, Color(1, 1, 1, 1), 0.01f, false);
if (distToTarget <= bulletRadius)
{
if (GamePhysics::LineOfSight__(TargetPlayer->get_bone_pos(spine2), self->currentPosition(), 10551296, 0.f) &&
GamePhysics::LineOfSight__(TargetPlayer->get_bone_pos(head), self->currentPosition(), 10551296, 0.f))
{
auto newPos = MoveTowards(self->transform()->position(), targetPos, 1.0f);
Ray r(self->transform()->position(), newPos - self->currentPosition());
hitTest->AttackRay() = r;
hitTest->HitTransform() = transform;
hitTest->HitEntity() = targetPlayer;
hitTest->HitPoint() = transform->InverseTransformPoint(newPos);
hitTest->HitNormal() = transform->InverseTransformDirection(self->transform()->position());
hitTest->DidHit() = true;
hitTest->HitDistance() = distToTarget;
hitTest->MaxDistance() = 999.f;
self->DoHit(hitTest, newPos, hitTest->HitNormalWorld());
//Color sphereColor(vars::colors::colsphere.x, vars::colors::colsphere.y, vars::colors::colsphere.z, 1.f);
//DDraw::Capsule(self->currentPosition(), Quaternion(), 0.5f, 2 * 0.5f, sphereColor, 5.f, false);
}
}
}
}
}
}
return Original_Update_(self);
}
Хук:
hk_((void*)METHOD("Assembly-CSharp::Projectile::Update(): Void"), (void**)&Original_Update_, ProjectileUpdate_hk); [/ICODE]
Последнее редактирование: