Fix hp showed wrong for Crab Tank/brellas

This commit is contained in:
Kalle
2022-10-22 12:08:20 +03:00
parent 63a80c8ecd
commit 89c388e1c3
3 changed files with 14 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import type {
SpecialWeaponParams,
SubWeaponParams,
} from "./types";
import { hpDivided } from "./utils";
import weaponParams from "./weapon-params.json";
const PLACEHOLDER_HP = 1000;
@@ -35,11 +36,15 @@ export const objectHitPoints = (abilityPoints: AbilityPoints): HitPoints => {
return {
BulletUmbrellaCanopyNormal: PLACEHOLDER_HP, // ?? needs defaults
BulletUmbrellaCanopyWide: weaponParams.mainWeapons[6010].CanopyHP,
BulletUmbrellaCanopyCompact: weaponParams.mainWeapons[6020].CanopyHP,
BulletUmbrellaCanopyWide: hpDivided(
weaponParams.mainWeapons[6010].CanopyHP
),
BulletUmbrellaCanopyCompact: hpDivided(
weaponParams.mainWeapons[6020].CanopyHP
),
Wsb_Shield,
Bomb_TorpedoBullet: PLACEHOLDER_HP, // ??
Chariot: weaponParams.specialWeapons[CRAB_TANK_ID].ArmorHP,
Chariot: hpDivided(weaponParams.specialWeapons[CRAB_TANK_ID].ArmorHP),
Gachihoko_Barrier: PLACEHOLDER_HP, // ??
GreatBarrier_Barrier,
GreatBarrier_WeakPoint,

View File

@@ -17,6 +17,7 @@ import {
abilityPointsToEffects,
apFromMap,
hasEffect,
hpDivided,
weaponParams,
} from "./utils";
import { assertUnreachable } from "~/utils/types";
@@ -789,7 +790,7 @@ export function subStats(
case "NO_CHANGE":
return roundToTwoDecimalPlaces(effect);
case "HP":
return roundToTwoDecimalPlaces(effect / 10);
return roundToTwoDecimalPlaces(hpDivided(effect));
case "TIME":
return framesToSeconds(effect);
default:
@@ -1170,8 +1171,8 @@ export function specialDeviceHp(
});
return {
baseValue: Math.round(baseEffect / 10),
value: Math.round(effect / 10),
baseValue: Math.round(hpDivided(baseEffect)),
value: Math.round(hpDivided(effect)),
modifiedBy: SPECIAL_DEVICE_HP_KEY,
};
}

View File

@@ -165,3 +165,5 @@ export function validatedWeaponIdFromSearchParams(
return weaponCategories[0].weaponIds[0];
}
export const hpDivided = (hp: number) => hp / 10;