zenno/doc/frbm: update with charts &c.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Umamusume race mechanics adapted from KuromiAK's doc:
|
||||
// https://docs.google.com/document/d/15VzW9W2tXBBTibBRbZ8IVpW6HaMX8H0RP03kq6Az7Xg/edit?usp=sharing
|
||||
|
||||
import { binomPMF } from "./prob";
|
||||
|
||||
/**
|
||||
* Fundamental stats of umas.
|
||||
*/
|
||||
@@ -246,6 +248,17 @@ export function spotStruggleDuration(gutsStat: number, frontAptitude: AptitudeLe
|
||||
return Math.sqrt(700 * gutsStat) * 0.012 * strategyProficiencyMod[frontAptitude];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the speed modifier for running uphill.
|
||||
* Contrary to the race mechanics document, this is expressed as a negative number.
|
||||
* @param powerStat Final power stat
|
||||
* @param slopePer Slope percentage, generally one of 0.5, 1.0, 1.5, or 2.0
|
||||
* @returns Speed modifier for running uphill, a negative value
|
||||
*/
|
||||
export function uphillMod(powerStat: number, slopePer: number): number {
|
||||
return slopePer * -200/powerStat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the forward speed boost given when moving lanewise while a skill
|
||||
* that grants a lane change speed boost is active.
|
||||
@@ -256,6 +269,18 @@ export function moveLaneModifier(powerStat: number): number {
|
||||
return Math.sqrt(0.0002 * powerStat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the probability of n of N skills activating.
|
||||
* @param baseWit Base wit stat
|
||||
* @param N Number of skills available, default 1
|
||||
* @param n Number of skills activating, default 1
|
||||
* @returns Probability of exactly n skills out of N passing wit checks
|
||||
*/
|
||||
export function skillWitCheck(baseWit: number, N?: number, n?: number): number {
|
||||
const p = Math.max(0.2, 1 - 90/baseWit);
|
||||
return binomPMF(p, N ?? 1, n ?? 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate a skill's actual duration scaled to race length.
|
||||
* @param baseDur Skill's listed duration in s
|
||||
@@ -292,3 +317,12 @@ export function speedGain(speedBonus: number, dur: number, accel: number | null,
|
||||
// speedBonus*(dur-accelTime) + speedBonus*accelTime/2 + speedBonus*decelTime/2
|
||||
return speedBonus * (dur + 0.5 * (decelTime - accelTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the chance to enter downhill accel mode each second while running downhill.
|
||||
* @param witStat Final wit stat, including style aptitude modifier
|
||||
* @returns Probability each eligible tick to enter downhill accel mode
|
||||
*/
|
||||
export function downhillAccelEnterChance(witStat: number): number {
|
||||
return witStat * 0.0004;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user