mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
start of scripts
This commit is contained in:
1 parent
b4175dc60d
commit
bf132a7387
3 files changed
+19
-4
No files matched your search
@@ -26,8 +26,16 @@ export const characteristics = {
|
||||
|
||||
damage: {
|
||||
type: CharacteristicType.Number,
|
||||
compute({ shell }) {
|
||||
return shell.armor_damage;
|
||||
compute({ shell, environment, equalizer, script }) {
|
||||
let coefficient = 1;
|
||||
|
||||
if (environment.equalize) coefficient *= equalizer.damage;
|
||||
|
||||
script("", (script) => {
|
||||
coefficient *= script.something;
|
||||
});
|
||||
|
||||
return coefficient * shell.armor_damage;
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { CaseType } from "@blitzkit/core";
|
||||
import type { GunDefinition } from "@blitzkit/protos";
|
||||
import type { CharacteristicsGroup } from "../types/characteristics";
|
||||
|
||||
export const characteristicsGroups: CharacteristicsGroup[] = [
|
||||
@@ -67,8 +69,10 @@ export const characteristicsGroups: CharacteristicsGroup[] = [
|
||||
order: [
|
||||
{
|
||||
name: "gun_type",
|
||||
render({ output }) {
|
||||
return GunType[output as GunType];
|
||||
render({ output, strings }) {
|
||||
return strings.common.gun_types[
|
||||
output as CaseType<GunDefinition["gun_type"]>
|
||||
];
|
||||
},
|
||||
},
|
||||
{ name: "dpm", decimals: 0, units: "hp", localize: true },
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Strings } from "@blitzkit/i18n";
|
||||
import type {
|
||||
EngineDefinition,
|
||||
Equalizer,
|
||||
GunDefinition,
|
||||
ShellDefinition,
|
||||
TankDefinition,
|
||||
@@ -29,6 +30,8 @@ export interface CharacteristicContext {
|
||||
state: TankState;
|
||||
environment: TankEnvironment;
|
||||
|
||||
equalizer: Equalizer;
|
||||
|
||||
tank: TankDefinition;
|
||||
engine: EngineDefinition;
|
||||
track: TrackDefinition;
|
||||
|
||||
Reference in new issue
Block a user