mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +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: {
|
damage: {
|
||||||
type: CharacteristicType.Number,
|
type: CharacteristicType.Number,
|
||||||
compute({ shell }) {
|
compute({ shell, environment, equalizer, script }) {
|
||||||
return shell.armor_damage;
|
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";
|
import type { CharacteristicsGroup } from "../types/characteristics";
|
||||||
|
|
||||||
export const characteristicsGroups: CharacteristicsGroup[] = [
|
export const characteristicsGroups: CharacteristicsGroup[] = [
|
||||||
@@ -67,8 +69,10 @@ export const characteristicsGroups: CharacteristicsGroup[] = [
|
|||||||
order: [
|
order: [
|
||||||
{
|
{
|
||||||
name: "gun_type",
|
name: "gun_type",
|
||||||
render({ output }) {
|
render({ output, strings }) {
|
||||||
return GunType[output as GunType];
|
return strings.common.gun_types[
|
||||||
|
output as CaseType<GunDefinition["gun_type"]>
|
||||||
|
];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ name: "dpm", decimals: 0, units: "hp", localize: true },
|
{ name: "dpm", decimals: 0, units: "hp", localize: true },
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { Strings } from "@blitzkit/i18n";
|
import type { Strings } from "@blitzkit/i18n";
|
||||||
import type {
|
import type {
|
||||||
EngineDefinition,
|
EngineDefinition,
|
||||||
|
Equalizer,
|
||||||
GunDefinition,
|
GunDefinition,
|
||||||
ShellDefinition,
|
ShellDefinition,
|
||||||
TankDefinition,
|
TankDefinition,
|
||||||
@@ -29,6 +30,8 @@ export interface CharacteristicContext {
|
|||||||
state: TankState;
|
state: TankState;
|
||||||
environment: TankEnvironment;
|
environment: TankEnvironment;
|
||||||
|
|
||||||
|
equalizer: Equalizer;
|
||||||
|
|
||||||
tank: TankDefinition;
|
tank: TankDefinition;
|
||||||
engine: EngineDefinition;
|
engine: EngineDefinition;
|
||||||
track: TrackDefinition;
|
track: TrackDefinition;
|
||||||
|
|||||||
Reference in new issue
Block a user