|
Znaczniki: Usunięcie całej zawartości strony Ręczne wycofanie zmian |
Linia 1: |
Linia 1: |
| function calculateWeaponSpeed(baseSpeed, dexterity, swingSpeedIncrease) {
| |
| // Maksymalna redukcja czasu ataku na podstawie dexterity
| |
| let swingDelay = Math.max(1.25, (baseSpeed * (100 - Math.min(60, dexterity / 10))) / 100);
| |
|
| |
|
| // Uwzględnienie modyfikatora Swing Speed Increase (SSI)
| |
| let ssiModifier = Math.min(swingSpeedIncrease, 60); // Maksymalnie 60% SSI
| |
| swingDelay *= (1 - (ssiModifier / 100));
| |
|
| |
| return swingDelay.toFixed(2) + " sekundy";
| |
| }
| |
|
| |
| // Przykładowe użycie:
| |
| let baseWeaponSpeed = 2.5; // Podstawowa prędkość broni (w sekundach)
| |
| let dexterity = 100; // Dexterity gracza
| |
| let swingSpeedIncrease = 30; // Bonus SSI z przedmiotów
| |
|
| |
| console.log("Czas między atakami:", calculateWeaponSpeed(baseWeaponSpeed, dexterity, swingSpeedIncrease));
| |