mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-27 04:44:43 -05:00
63 lines
1.9 KiB
TypeScript
63 lines
1.9 KiB
TypeScript
import invariant from "tiny-invariant";
|
|
import { BIG_BUBBLER_ID, CRAB_TANK_ID, SPLASH_WALL_ID } from "../in-game-lists";
|
|
import { specialDeviceHp, specialFieldHp, subStats } from "./stats";
|
|
import type {
|
|
AbilityPoints,
|
|
HitPoints,
|
|
SpecialWeaponParams,
|
|
SubWeaponParams,
|
|
} from "./types";
|
|
import { hpDivided } from "./utils";
|
|
import weaponParams from "./weapon-params.json";
|
|
|
|
const WAVE_BREAKER_HP = 400;
|
|
const SPRINKER_HP = 100;
|
|
const RAINMAKER_HP = 1000;
|
|
const SPLAT_BRELLA_SHIELD_HP = 500;
|
|
const BOOYAH_BOMB_ARMOR_HP = 470;
|
|
const BEAKON_HP = 120;
|
|
const TORPEDO_HP = 20;
|
|
|
|
export const objectHitPoints = (abilityPoints: AbilityPoints): HitPoints => {
|
|
const Wsb_Shield = subStats({
|
|
abilityPoints,
|
|
subWeaponParams: weaponParams.subWeapons[SPLASH_WALL_ID] as SubWeaponParams,
|
|
}).subHp?.value;
|
|
const GreatBarrier_Barrier = specialFieldHp({
|
|
abilityPoints,
|
|
specialWeaponParams: weaponParams.specialWeapons[
|
|
BIG_BUBBLER_ID
|
|
] as SpecialWeaponParams,
|
|
})?.value;
|
|
const GreatBarrier_WeakPoint = specialDeviceHp({
|
|
abilityPoints,
|
|
specialWeaponParams: weaponParams.specialWeapons[
|
|
BIG_BUBBLER_ID
|
|
] as SpecialWeaponParams,
|
|
})?.value;
|
|
|
|
invariant(Wsb_Shield);
|
|
invariant(GreatBarrier_Barrier);
|
|
invariant(GreatBarrier_WeakPoint);
|
|
|
|
return {
|
|
BulletUmbrellaCanopyNormal: SPLAT_BRELLA_SHIELD_HP,
|
|
BulletUmbrellaCanopyWide: hpDivided(
|
|
weaponParams.mainWeapons[6010].CanopyHP
|
|
),
|
|
BulletUmbrellaCanopyCompact: hpDivided(
|
|
weaponParams.mainWeapons[6020].CanopyHP
|
|
),
|
|
Wsb_Shield,
|
|
Bomb_TorpedoBullet: TORPEDO_HP,
|
|
Chariot: hpDivided(weaponParams.specialWeapons[CRAB_TANK_ID].ArmorHP),
|
|
Gachihoko_Barrier: RAINMAKER_HP,
|
|
GreatBarrier_Barrier,
|
|
GreatBarrier_WeakPoint,
|
|
NiceBall_Armor: BOOYAH_BOMB_ARMOR_HP, // ??
|
|
ShockSonar: WAVE_BREAKER_HP,
|
|
Wsb_Flag: BEAKON_HP,
|
|
Wsb_Sprinkler: SPRINKER_HP,
|
|
};
|
|
};
|