mirror of
https://github.com/solcloud/Counter-Strike.git
synced 2025-02-24 11:52:23 +01:00
Tuning
This commit is contained in:
parent
82fa6ebf3b
commit
8c09e48001
@ -138,7 +138,7 @@ final class Action
|
||||
public static function getWeaponPrimarySpeedMultiplier(string $itemId): float
|
||||
{
|
||||
if (!isset(self::$cacheFloat["getWeaponPrimarySpeedMultiplier-{$itemId}"])) {
|
||||
self::$cacheFloat["getWeaponPrimarySpeedMultiplier-{$itemId}"] = self::$data["weaponPrimarySpeedMultiplier-{$itemId}"] ?? 0.6;
|
||||
self::$cacheFloat["getWeaponPrimarySpeedMultiplier-{$itemId}"] = (self::$data["weaponPrimarySpeedMultiplier-{$itemId}"] ?? 60) / 100;
|
||||
}
|
||||
return self::$cacheFloat["getWeaponPrimarySpeedMultiplier-{$itemId}"];
|
||||
}
|
||||
@ -146,7 +146,7 @@ final class Action
|
||||
public static function getWeaponSecondarySpeedMultiplier(string $itemId): float
|
||||
{
|
||||
if (!isset(self::$cacheFloat["getWeaponSecondarySpeedMultiplier-{$itemId}"])) {
|
||||
self::$cacheFloat["getWeaponSecondarySpeedMultiplier-{$itemId}"] = self::$data["weaponSecondarySpeedMultiplier-{$itemId}"] ?? 0.8;
|
||||
self::$cacheFloat["getWeaponSecondarySpeedMultiplier-{$itemId}"] = (self::$data["weaponSecondarySpeedMultiplier-{$itemId}"] ?? 80) / 100;
|
||||
}
|
||||
return self::$cacheFloat["getWeaponSecondarySpeedMultiplier-{$itemId}"];
|
||||
}
|
||||
|
@ -43,9 +43,6 @@ final class AttackEvent
|
||||
foreach ($hits as $hit) {
|
||||
$bullet->lowerDamage($hit->getHitAntiForce());
|
||||
$result->addHit($hit);
|
||||
if (!$bullet->isActive()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace cs\Event;
|
||||
|
||||
use Closure;
|
||||
use cs\Core\Util;
|
||||
|
||||
class TimeoutEvent extends Event
|
||||
{
|
||||
@ -13,7 +12,7 @@ class TimeoutEvent extends Event
|
||||
public function __construct(Closure $callback, protected int $timeoutMs)
|
||||
{
|
||||
$this->callback = $callback;
|
||||
$this->tickCountTimeout = Util::millisecondsToFrames($this->timeoutMs);
|
||||
$this->tickCountTimeout = $this->timeMsToTick($this->timeoutMs);
|
||||
}
|
||||
|
||||
final public function process(int $tick): void
|
||||
|
@ -19,7 +19,7 @@ abstract class AmmoBasedWeapon extends BaseWeapon implements Reloadable, AttackE
|
||||
protected bool $reloading = false;
|
||||
protected bool $isWeaponPrimary;
|
||||
private ?ReloadEvent $eventReload = null;
|
||||
private int $lastAttackTick = -9999;
|
||||
private int $lastAttackTick = 0;
|
||||
private int $fireRateTicks;
|
||||
|
||||
public function __construct(bool $instantlyEquip = false)
|
||||
@ -41,7 +41,7 @@ abstract class AmmoBasedWeapon extends BaseWeapon implements Reloadable, AttackE
|
||||
return false;
|
||||
}
|
||||
|
||||
return ($this->lastAttackTick + $this->fireRateTicks <= $tickId);
|
||||
return ($this->lastAttackTick === 0 || $this->lastAttackTick + $this->fireRateTicks <= $tickId);
|
||||
}
|
||||
|
||||
public final function attack(AttackEvent $event): ?AttackResult
|
||||
|
Loading…
x
Reference in New Issue
Block a user