mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
blitz scripts
This commit is contained in:
1 parent
1733180f2c
commit
402b6d5113
8 files changed
+90
-302
No files matched your search
@@ -1,9 +1,11 @@
|
|||||||
{
|
{
|
||||||
"words": [
|
"words": [
|
||||||
|
"Debuff",
|
||||||
"gamemodes",
|
"gamemodes",
|
||||||
"Passability",
|
"Passability",
|
||||||
"Recoverkit",
|
"Recoverkit",
|
||||||
"Repairkit",
|
"Repairkit",
|
||||||
|
"Respawns",
|
||||||
"Tankopedia"
|
"Tankopedia"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
SkillDefinitions,
|
SkillDefinitions,
|
||||||
TankDefinitions,
|
TankDefinitions,
|
||||||
} from "@blitzkit/core";
|
} from "@blitzkit/core";
|
||||||
|
import { BlitzScripts } from "../../types/blitzScripts";
|
||||||
|
|
||||||
export abstract class BlitzKitAPI {
|
export abstract class BlitzKitAPI {
|
||||||
abstract skills(): Promise<SkillDefinitions>;
|
abstract skills(): Promise<SkillDefinitions>;
|
||||||
@@ -22,6 +23,7 @@ export abstract class BlitzKitAPI {
|
|||||||
abstract tanks(): Promise<TankDefinitions>;
|
abstract tanks(): Promise<TankDefinitions>;
|
||||||
abstract game(): Promise<GameDefinitions>;
|
abstract game(): Promise<GameDefinitions>;
|
||||||
abstract gallery(): Promise<Gallery>;
|
abstract gallery(): Promise<Gallery>;
|
||||||
|
abstract scripts(): Promise<BlitzScripts>;
|
||||||
|
|
||||||
async tank(id: number) {
|
async tank(id: number) {
|
||||||
const tanks = await this.tanks();
|
const tanks = await this.tanks();
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
type BlitzEffectScript = RSN & {
|
||||||
|
"#text": string;
|
||||||
|
attribute?: string;
|
||||||
|
|
||||||
|
cooldown?: number;
|
||||||
|
duration?: number;
|
||||||
|
startCooldown?: number;
|
||||||
|
|
||||||
|
automatic?: boolean;
|
||||||
|
keepSpoted?: boolean;
|
||||||
|
breakTracks?: boolean;
|
||||||
|
disableTracksCollisionDamage?: boolean;
|
||||||
|
simpleMode?: boolean;
|
||||||
|
|
||||||
|
shotEffect?: string;
|
||||||
|
contusionChances?: string;
|
||||||
|
modules?: string;
|
||||||
|
damageFactors?: string;
|
||||||
|
|
||||||
|
extrasMustBeStopped?: string;
|
||||||
|
targetExtrasMustBeStopped?: string;
|
||||||
|
conflictExtras?: string;
|
||||||
|
effectExtraName?: string;
|
||||||
|
clientEffectVariant?: string;
|
||||||
|
|
||||||
|
piercingFactors?: RSN;
|
||||||
|
visionRadiusPercentageBonus?: RSN;
|
||||||
|
bonus?: RSN;
|
||||||
|
enginePowerPercentageBonus?: RSN;
|
||||||
|
bonusPercentage?: RSN;
|
||||||
|
attributes?: RSN;
|
||||||
|
respawnBoost?: RSN;
|
||||||
|
maxHealthFactor?: RSN;
|
||||||
|
|
||||||
|
bonusValues?: BonusValues;
|
||||||
|
modulesHealthFactors?: ModuleConstants;
|
||||||
|
chancesToHit?: ChangesToHit;
|
||||||
|
respawns?: Respawns;
|
||||||
|
slowDebuff?: SlowDebuff;
|
||||||
|
};
|
||||||
|
|
||||||
|
type RSN = Record<string, number>;
|
||||||
|
|
||||||
|
type BonusValues = RSN & {
|
||||||
|
chancesToHit?: ModuleConstants;
|
||||||
|
modulesMaxHpFactors?: ModuleConstants;
|
||||||
|
modulesMaxRegenHpFactors?: ModuleConstants;
|
||||||
|
item?: RSN[];
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ModuleConstants {
|
||||||
|
modules: Record<string, number | number[]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ModulesMaxHPFactorsModules {
|
||||||
|
ammoBayHealth: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ChangesToHit {
|
||||||
|
crew: number;
|
||||||
|
modules: RSN;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Respawns {
|
||||||
|
respawn: RSN;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SlowDebuff {
|
||||||
|
item: SlowDebuffItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SlowDebuffItem {
|
||||||
|
duration: number;
|
||||||
|
enginePowerFactor: RSN;
|
||||||
|
speedLimitsFactor: RSN;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export interface BlitzScripts {
|
||||||
|
consumables: Record<number, BlitzEffectScript>;
|
||||||
|
provisions: Record<number, BlitzEffectScript>;
|
||||||
|
equipment: Record<number, BlitzEffectScript>;
|
||||||
|
}
|
||||||
@@ -1,257 +0,0 @@
|
|||||||
interface ProvisionConsumableScript {
|
|
||||||
attribute?: string;
|
|
||||||
bonusValues?: BonusValuesClass | string;
|
|
||||||
"#text": string;
|
|
||||||
piercingFactors?: PiercingFactors;
|
|
||||||
modulesHealthFactors?: ModulesHealthFactorsClass | string;
|
|
||||||
rammingAbsorptionPercent?: number | string;
|
|
||||||
chancesToHit?: ChancesToHitChancesToHit | string;
|
|
||||||
largeCaliberHighExplosiveDamageFactor?: number;
|
|
||||||
largeCaliberHighExplosivePiercingFactor?: number;
|
|
||||||
maxHpBonusPercent?: number;
|
|
||||||
modules?: string;
|
|
||||||
visionRadiusPercentageBonus?: Bonus;
|
|
||||||
activateWhenStillSec?: number;
|
|
||||||
activateBonusFactor?: number;
|
|
||||||
bonus?: Bonus;
|
|
||||||
bonusPercentage?: BonusPercentage;
|
|
||||||
enginePowerPercentageBonus?: Bonus;
|
|
||||||
weight?: number;
|
|
||||||
automatic?: boolean;
|
|
||||||
cooldown?: number;
|
|
||||||
duration?: number;
|
|
||||||
enginePowerIncrease?: number;
|
|
||||||
rotationSpeedFactor?: number;
|
|
||||||
fwdSpeedLimitBias?: number;
|
|
||||||
bkwdSpeedLimitBias?: number;
|
|
||||||
shotDispersionAngleFactor?: number;
|
|
||||||
aimingTimeFactor?: number;
|
|
||||||
clipReloadTimeFactor?: number;
|
|
||||||
gunReloadTimeFactor?: number;
|
|
||||||
shieldCoef?: number;
|
|
||||||
minDamageFactor?: number;
|
|
||||||
maxDamageFactor?: number;
|
|
||||||
shotEffect?: string;
|
|
||||||
deactivateStates?: number;
|
|
||||||
activateStates?: number;
|
|
||||||
contusionChances?: string;
|
|
||||||
abortVelocity?: number;
|
|
||||||
distance?: number;
|
|
||||||
activationDamageFactor?: number;
|
|
||||||
damageFactor?: number;
|
|
||||||
startCooldown?: number;
|
|
||||||
keepSpoted?: boolean;
|
|
||||||
conflictExtras?: string;
|
|
||||||
effectExtraName?: string;
|
|
||||||
clientEffectVariant?: string;
|
|
||||||
range?: number;
|
|
||||||
healthFactor?: number;
|
|
||||||
burstForce?: number;
|
|
||||||
damageFactors?: string;
|
|
||||||
flyTime?: number;
|
|
||||||
distanceOffset?: number;
|
|
||||||
timeSeconds?: number;
|
|
||||||
extrasMustBeStopped?: string;
|
|
||||||
breakTracks?: boolean;
|
|
||||||
minAngleDegrees?: number;
|
|
||||||
maxAngleDegrees?: number;
|
|
||||||
attributes?: { [key: string]: number };
|
|
||||||
acceleration?: number;
|
|
||||||
burstRange?: number;
|
|
||||||
burstDamagePercent?: number;
|
|
||||||
projectileSpeed?: number;
|
|
||||||
healWaveDelay?: number;
|
|
||||||
healWavesCount?: number;
|
|
||||||
healFactorPercent?: number;
|
|
||||||
selfHealReducePercent?: number;
|
|
||||||
shieldDuration?: number;
|
|
||||||
targetExtrasMustBeStopped?: string;
|
|
||||||
maxHealthSelfDamageFactor?: number;
|
|
||||||
maxHealthDamageFactor?: number;
|
|
||||||
disableTracksCollisionDamage?: boolean;
|
|
||||||
maxHealthDamagePercent?: number;
|
|
||||||
poisonTicks?: number;
|
|
||||||
poisonTickDelay?: number;
|
|
||||||
effectDuration?: number;
|
|
||||||
radius?: number;
|
|
||||||
attractorMass?: number;
|
|
||||||
hpStockPercent?: number;
|
|
||||||
invisibilityInMovingFactor?: number;
|
|
||||||
maxBonusSources?: number;
|
|
||||||
sixthSenseDelay?: number;
|
|
||||||
stopObservingDelayFactor?: number;
|
|
||||||
revengeDamagePercentage?: number;
|
|
||||||
timeForComeBack?: number;
|
|
||||||
simpleMode?: boolean;
|
|
||||||
respawns?: Respawns;
|
|
||||||
curseStrength?: number;
|
|
||||||
curseReduction?: number;
|
|
||||||
curseHeal?: number;
|
|
||||||
explodeDamagePercent?: number;
|
|
||||||
damageReductionPercent?: number;
|
|
||||||
respawnBoost?: RespawnBoost;
|
|
||||||
slowDebuff?: SlowDebuff;
|
|
||||||
maxHealthFactor?: Bonus;
|
|
||||||
minRammingDamageMaxHealthRatio?: number;
|
|
||||||
minRammingDamageCooldown?: number;
|
|
||||||
optDeviceRammingDamageOverride?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Bonus {
|
|
||||||
lightTank: number;
|
|
||||||
mediumTank: number;
|
|
||||||
heavyTank: number;
|
|
||||||
"AT-SPG": number;
|
|
||||||
SPG?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BonusPercentage {
|
|
||||||
rotationSpeedFactor?: number;
|
|
||||||
firmGroundPassabilityIncrease?: number;
|
|
||||||
softGroundPassabilityIncrease?: number;
|
|
||||||
mediumGroundPassabilityIncrease?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BonusValuesClass {
|
|
||||||
percent?: number;
|
|
||||||
value?: number;
|
|
||||||
projectileSpeedFactor?: number;
|
|
||||||
piercingPenaltyFactor500m?: number;
|
|
||||||
circularVisionRadiusIncrease?: number;
|
|
||||||
upperPitchLimitIncrease?: number;
|
|
||||||
lowerPitchLimitIncrease?: number;
|
|
||||||
enginePowerIncrease?: number;
|
|
||||||
gunReloadSpeedIncrease?: number;
|
|
||||||
damageReductionPercent?: number;
|
|
||||||
rammingDamageFactor?: number;
|
|
||||||
sacrificeLoss?: number;
|
|
||||||
damagePercentBonus?: number;
|
|
||||||
enginePowerFactor?: number;
|
|
||||||
maxVelocityFactor?: number;
|
|
||||||
terrainResistanceFactor?: number;
|
|
||||||
chassisHealthFactor?: number;
|
|
||||||
rotationSpeedFactor?: number;
|
|
||||||
damageReflectionPercent?: number;
|
|
||||||
enginePowerAbilityFactor?: number;
|
|
||||||
speedLimitAbilityBonus?: number;
|
|
||||||
crewLevelIncrease?: number;
|
|
||||||
factor?: number;
|
|
||||||
turretRotationSpeedIncrease?: number;
|
|
||||||
crewChanceToHitFactor?: number;
|
|
||||||
repairSpeedIncrease?: number;
|
|
||||||
fireProtectionIncrease?: number;
|
|
||||||
explosivesHealthIncrease?: number;
|
|
||||||
fwdSpeedLimitBias?: number;
|
|
||||||
bkwdSpeedLimitBias?: number;
|
|
||||||
lifestealFactor?: number;
|
|
||||||
lifestealRandomFactor?: number;
|
|
||||||
killHealFactor?: number;
|
|
||||||
healFactor?: number;
|
|
||||||
healRandomFactor?: number;
|
|
||||||
dealingRammingDamageFactor?: number;
|
|
||||||
gunReloadingBonus?: number;
|
|
||||||
gunAimingTimeBonus?: number;
|
|
||||||
visionRadiusBonus?: number;
|
|
||||||
shotDispersionAngleFactor?: number;
|
|
||||||
aimingTimeFactor?: number;
|
|
||||||
timeBetweenShots?: number;
|
|
||||||
increasedDamageChance?: number;
|
|
||||||
increaseDamageFactor?: number;
|
|
||||||
gunReloadFactor?: number;
|
|
||||||
commonDamageFactor?: number;
|
|
||||||
speedLimitsFactor?: number;
|
|
||||||
maxHealthPercentBonus?: number;
|
|
||||||
maxStaticsDamagePercent?: number;
|
|
||||||
chancesToHit?: BonusValuesChancesToHit;
|
|
||||||
modulesMaxHpFactors?: ModulesMaxHPFactors;
|
|
||||||
modulesMaxRegenHpFactors?: ModulesMaxHPFactors;
|
|
||||||
item?: BonusValuesItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BonusValuesChancesToHit {
|
|
||||||
modules: PurpleModules;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PurpleModules {
|
|
||||||
engineHealth: number;
|
|
||||||
fuelTankHealth: number;
|
|
||||||
turretRotatorHealth: number;
|
|
||||||
surveyingDeviceHealth: number[];
|
|
||||||
ammoBayHealth: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BonusValuesItem {
|
|
||||||
commonDamageFactor: number;
|
|
||||||
reloadSpeedFactor: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModulesMaxHPFactors {
|
|
||||||
modules: ModulesMaxHPFactorsModules;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModulesMaxHPFactorsModules {
|
|
||||||
ammoBayHealth: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ChancesToHitChancesToHit {
|
|
||||||
crew: number;
|
|
||||||
modules: FluffyModules;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FluffyModules {
|
|
||||||
engineHealth: number;
|
|
||||||
ammoBayHealth: number;
|
|
||||||
commanderHealth: number;
|
|
||||||
driverHealth: number;
|
|
||||||
gunner1Health: number;
|
|
||||||
gunner2Health: number;
|
|
||||||
loader1Health: number;
|
|
||||||
loader2Health: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModulesHealthFactorsClass {
|
|
||||||
modules: ModulesHealthFactorsModules;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModulesHealthFactorsModules {
|
|
||||||
leftTrackHealth: number;
|
|
||||||
rightTrackHealth: number;
|
|
||||||
fuelTankHealth: number;
|
|
||||||
ammoBayHealth: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PiercingFactors {
|
|
||||||
ARMOR_PIERCING: number;
|
|
||||||
HOLLOW_CHARGE: number;
|
|
||||||
HIGH_EXPLOSIVE: number;
|
|
||||||
ARMOR_PIERCING_HE: number;
|
|
||||||
ARMOR_PIERCING_CR: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RespawnBoost {
|
|
||||||
duration: number;
|
|
||||||
enginePowerFactor: number;
|
|
||||||
speedLimitAbilityBonus: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Respawns {
|
|
||||||
respawn: Respawn[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Respawn {
|
|
||||||
respawnIndex: number;
|
|
||||||
bonusDamage: number;
|
|
||||||
bonusReloadSpeed: number;
|
|
||||||
bonusMaxSpeed: number;
|
|
||||||
bonusEnginePower: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SlowDebuff {
|
|
||||||
item: SlowDebuffItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SlowDebuffItem {
|
|
||||||
duration: number;
|
|
||||||
enginePowerFactor: Bonus;
|
|
||||||
speedLimitsFactor: Bonus;
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package blitzkit;
|
|
||||||
|
|
||||||
import "tank_definitions.proto";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wargaming's script system for provisions, consumables, and equipment is
|
|
||||||
* genuinely the most repulsive and inconsistent XML schema I have ever seen.
|
|
||||||
* Here are my notes on how I normalize the data into BlitzKit. I can totally
|
|
||||||
* see why they want to move to Unreal Engine. This is unhealthy.
|
|
||||||
*/
|
|
||||||
message Script {
|
|
||||||
/**
|
|
||||||
* If #text is "StaticFactorDevice", type will be script.attribute, otherwise
|
|
||||||
* type will assume the value of #text. Same for "StaticAdditiveDevice".
|
|
||||||
*/
|
|
||||||
string type = 1;
|
|
||||||
|
|
||||||
optional bool automatic = 2;
|
|
||||||
optional float cooldown = 3;
|
|
||||||
optional float duration = 4;
|
|
||||||
bool keep_spotted = 5;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bonus values enjoys Record<string, number> entries from
|
|
||||||
* script.bonusValues.
|
|
||||||
*
|
|
||||||
* I also augment Record<string, number | ""> values from the root of the
|
|
||||||
* script object. That is, if an entry on the root script object isn't
|
|
||||||
* "attribute", "bonusValues", "#text", etc., it goes in here. Empty strings
|
|
||||||
* values get omitted.
|
|
||||||
*
|
|
||||||
* Values from script.visionRadiusPercentageBonus from type CoatedOptics will
|
|
||||||
* also be merged into here to be consistent with CamouflageNet. God fucking
|
|
||||||
* damn it Wargaming.
|
|
||||||
*
|
|
||||||
* Same goes for all these:
|
|
||||||
* - enginePowerPercentageBonus
|
|
||||||
* - visionRadiusPercentageBonus
|
|
||||||
*/
|
|
||||||
map<string, float> values = 2;
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
import { ProvisionDefinitions } from "@blitzkit/core";
|
import { ProvisionDefinitions } from "@blitzkit/core";
|
||||||
import { api } from "../../../blitzkit/api";
|
import { api } from "../../../blitzkit/api";
|
||||||
|
import { vfs } from "../../../core/blitzkit/vfs";
|
||||||
|
|
||||||
export { getStaticPaths } from "../_index";
|
export { getStaticPaths } from "../_index";
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const definitions = await api.provisions();
|
const definitions = await api.provisions();
|
||||||
|
|
||||||
return Response.json(definitions);
|
return Response.json(await vfs.yaml("Data/Strings/en.yaml"));
|
||||||
|
|
||||||
const bytes = ProvisionDefinitions.encode(definitions).finish();
|
const bytes = ProvisionDefinitions.encode(definitions).finish();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import type { ConsumablesCommon } from "@blitzkit/core";
|
import type { ConsumablesCommon } from "@blitzkit/core";
|
||||||
import type { APIContext, GetStaticPathsItem } from "astro";
|
import type { APIContext, GetStaticPathsItem } from "astro";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
|
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
|
||||||
import { extractPackedIcon } from "../../../../core/blitz/extractPackedIcon";
|
import { extractPackedIcon } from "../../../../core/blitz/extractPackedIcon";
|
||||||
import { parsePackedSpriteRect } from "../../../../core/blitz/parsePackedSpriteRect";
|
import { parsePackedSpriteRect } from "../../../../core/blitz/parsePackedSpriteRect";
|
||||||
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
|
|
||||||
import { vfs } from "../../../../core/blitzkit/vfs";
|
import { vfs } from "../../../../core/blitzkit/vfs";
|
||||||
import { getStaticPaths as _getStaticPaths } from "../../_index";
|
import { getStaticPaths as _getStaticPaths } from "../../_index";
|
||||||
|
|
||||||
@@ -47,6 +47,8 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(consumable);
|
||||||
|
|
||||||
if (!styleSheet) {
|
if (!styleSheet) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`No style sheet found for consumable ${consumable.icon}; skipping...`,
|
`No style sheet found for consumable ${consumable.icon}; skipping...`,
|
||||||
|
|||||||
Reference in new issue
Block a user