feat: shell range defs

This commit is contained in:
tresabhi committed 2024-11-09 12:55:39 -06:00
1 parent 1cf6a9e76a
commit f2f7d8aa3d
3 files changed
+22

No files matched your search

@@ -170,6 +170,7 @@ message ShellDefinition {
optional float normalization = 10;
optional float ricochet = 11;
optional float explosion_radius = 12;
required uint32 range = 13;
}
enum ShellType {
@@ -499,6 +499,7 @@ export interface ShellDefinition {
normalization?: number | undefined;
ricochet?: number | undefined;
explosion_radius?: number | undefined;
range: number;
}
export interface ShellPenetration {
@@ -3232,6 +3233,7 @@ function createBaseShellDefinition(): ShellDefinition {
normalization: undefined,
ricochet: undefined,
explosion_radius: undefined,
range: 0,
};
}
@@ -3273,6 +3275,9 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
if (message.explosion_radius !== undefined && message.explosion_radius !== undefined) {
writer.uint32(101).float(message.explosion_radius);
}
if (message.range !== 0) {
writer.uint32(104).uint32(message.range);
}
return writer;
},
@@ -3379,6 +3384,14 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
message.explosion_radius = reader.float();
continue;
}
case 13: {
if (tag !== 104) {
break;
}
message.range = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -3402,6 +3415,7 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
normalization: isSet(object.normalization) ? globalThis.Number(object.normalization) : undefined,
ricochet: isSet(object.ricochet) ? globalThis.Number(object.ricochet) : undefined,
explosion_radius: isSet(object.explosion_radius) ? globalThis.Number(object.explosion_radius) : undefined,
range: globalThis.Number(assertSet("ShellDefinition.range", object.range)),
};
},
@@ -3443,6 +3457,9 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
if (message.explosion_radius !== undefined && message.explosion_radius !== undefined) {
obj.explosion_radius = message.explosion_radius;
}
if (message.range !== 0) {
obj.range = Math.round(message.range);
}
return obj;
},
@@ -3465,6 +3482,7 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
message.normalization = object.normalization ?? undefined;
message.ricochet = object.ricochet ?? undefined;
message.explosion_radius = object.explosion_radius ?? undefined;
message.range = object.range ?? 0;
return message;
},
};
@@ -323,6 +323,7 @@ interface GunDefinitionsList {
[key: string]: {
speed: number;
piercingPower: string;
maxDistance: number;
};
};
};
@@ -1276,6 +1277,7 @@ export async function definitions() {
near: penetrationRaw[0],
far: penetrationRaw[1],
},
range: gunShellEntry.maxDistance,
});
});
});
@@ -1648,6 +1650,7 @@ export async function definitions() {
};
});
return;
await commitAssets('definitions', [
{
content: encodePBBuffer(GameDefinitions, gameDefinitions),