@adatechnology/game-test-room 0.25.0 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +115 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.global.js
CHANGED
|
@@ -6702,7 +6702,7 @@ var GameTestRoom = (() => {
|
|
|
6702
6702
|
};
|
|
6703
6703
|
var resolveStrings = (locale) => locales[locale ?? "en"] ?? locales.en;
|
|
6704
6704
|
|
|
6705
|
-
// ../game-audio/dist/chunk-
|
|
6705
|
+
// ../game-audio/dist/chunk-BXUGSOPY.js
|
|
6706
6706
|
var DISTANCE_CURVES = {
|
|
6707
6707
|
/** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
|
|
6708
6708
|
game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
|
|
@@ -9007,7 +9007,22 @@ var GameTestRoom = (() => {
|
|
|
9007
9007
|
["smg_45_auto", 2, "sfx_pistol"],
|
|
9008
9008
|
["weapon_draw", 2],
|
|
9009
9009
|
["suppressor_attach", 3],
|
|
9010
|
-
["suppressor_detach", 3]
|
|
9010
|
+
["suppressor_detach", 3],
|
|
9011
|
+
["minigun_loop", 3],
|
|
9012
|
+
["smg_5_7x28", 3],
|
|
9013
|
+
["mg_belt_adjust", 3],
|
|
9014
|
+
["mg_belt_box_attach", 3],
|
|
9015
|
+
["mg_cover_open", 3],
|
|
9016
|
+
["mg_cover_close", 3],
|
|
9017
|
+
["weapon_holster", 3],
|
|
9018
|
+
["scope_zoom", 3]
|
|
9019
|
+
]),
|
|
9020
|
+
...entries("impactos", [
|
|
9021
|
+
["knife_hit_wall", 3],
|
|
9022
|
+
["helmet_hit", 3],
|
|
9023
|
+
["vest_hit", 3],
|
|
9024
|
+
["headshot", 3],
|
|
9025
|
+
["blood_squirt", 3]
|
|
9011
9026
|
]),
|
|
9012
9027
|
...entries("explosoes-fogo", [
|
|
9013
9028
|
["explosion_grenade", 1, "boom"],
|
|
@@ -9025,7 +9040,13 @@ var GameTestRoom = (() => {
|
|
|
9025
9040
|
["grenade_bounce", 1],
|
|
9026
9041
|
["c4_plant", 2],
|
|
9027
9042
|
["c4_beep", 2],
|
|
9028
|
-
["c4_disarm", 2]
|
|
9043
|
+
["c4_disarm", 2],
|
|
9044
|
+
["c4_disarming_loop", 3],
|
|
9045
|
+
["c4_remote_detonate", 3],
|
|
9046
|
+
["smoke_grenade_hiss", 3],
|
|
9047
|
+
["grenade_pin_pull", 3],
|
|
9048
|
+
["electric_shock", 3],
|
|
9049
|
+
["electric_spark", 3]
|
|
9029
9050
|
]),
|
|
9030
9051
|
...entries("personagem", [
|
|
9031
9052
|
["footstep_concrete_walk", 1, "sfx_step"],
|
|
@@ -9053,7 +9074,13 @@ var GameTestRoom = (() => {
|
|
|
9053
9074
|
["zombie_attack", 1],
|
|
9054
9075
|
["zombie_pain", 1],
|
|
9055
9076
|
["zombie_claw_hit", 1, "sfx_flesh"],
|
|
9056
|
-
["zombie_claw_miss", 2]
|
|
9077
|
+
["zombie_claw_miss", 2],
|
|
9078
|
+
["swing_whoosh", 3],
|
|
9079
|
+
["heartbeat_critical", 3],
|
|
9080
|
+
["fall_water", 3],
|
|
9081
|
+
["fall_damage", 3],
|
|
9082
|
+
["fall_scream", 3],
|
|
9083
|
+
["footstep_glass_walk", 3]
|
|
9057
9084
|
]),
|
|
9058
9085
|
...entries("veiculos", [
|
|
9059
9086
|
["engine_loop_car", 1],
|
|
@@ -9063,7 +9090,12 @@ var GameTestRoom = (() => {
|
|
|
9063
9090
|
["car_door_open", 1, "latch"],
|
|
9064
9091
|
["car_door_close", 1, "shut_metal"],
|
|
9065
9092
|
["horn_car", 2, "horn"],
|
|
9066
|
-
["tire_skid_asphalt", 2]
|
|
9093
|
+
["tire_skid_asphalt", 2],
|
|
9094
|
+
["jet_flyby", 3],
|
|
9095
|
+
["helicopter_turbine", 3],
|
|
9096
|
+
["tire_burnout", 3],
|
|
9097
|
+
["handbrake_turn", 3],
|
|
9098
|
+
["siren_police", 3]
|
|
9067
9099
|
]),
|
|
9068
9100
|
...entries("itens-portas", [
|
|
9069
9101
|
["item_pickup_metal", 1],
|
|
@@ -9074,7 +9106,27 @@ var GameTestRoom = (() => {
|
|
|
9074
9106
|
["door_creak", 1, "creak_wood"],
|
|
9075
9107
|
["door_locked_rattle", 1, "rattle"],
|
|
9076
9108
|
["drawer_open", 2, "slide"],
|
|
9077
|
-
["fridge_close", 2, "shut_metal"]
|
|
9109
|
+
["fridge_close", 2, "shut_metal"],
|
|
9110
|
+
["inventory_open", 3],
|
|
9111
|
+
["inventory_close", 3],
|
|
9112
|
+
["inventory_select", 3],
|
|
9113
|
+
["inventory_place", 3],
|
|
9114
|
+
["pickup_chime", 3],
|
|
9115
|
+
["item_pickup_coins", 3],
|
|
9116
|
+
["bandage_use", 3],
|
|
9117
|
+
["bandage_refuse", 3],
|
|
9118
|
+
["flashlight_toggle", 3],
|
|
9119
|
+
["gear_draw", 3],
|
|
9120
|
+
["gear_holster", 3],
|
|
9121
|
+
["button_press", 3],
|
|
9122
|
+
["lock_desk_open", 3],
|
|
9123
|
+
["elevator_move_loop", 3],
|
|
9124
|
+
["elevator_stop", 3],
|
|
9125
|
+
["door_sliding", 3],
|
|
9126
|
+
["door_kick", 3],
|
|
9127
|
+
["door_wood_break", 3],
|
|
9128
|
+
["gate_iron_open", 3],
|
|
9129
|
+
["gate_iron_close", 3]
|
|
9078
9130
|
]),
|
|
9079
9131
|
...entries("ambiente", [
|
|
9080
9132
|
["rain_loop", 2],
|
|
@@ -9082,7 +9134,16 @@ var GameTestRoom = (() => {
|
|
|
9082
9134
|
["thunder_near", 2],
|
|
9083
9135
|
["thunder_far", 2],
|
|
9084
9136
|
["water_splash", 2],
|
|
9085
|
-
["helicopter_loop", 3]
|
|
9137
|
+
["helicopter_loop", 3],
|
|
9138
|
+
["bird_flush", 3],
|
|
9139
|
+
["dog_growl", 3],
|
|
9140
|
+
["dog_whimper", 3],
|
|
9141
|
+
["dog_howl", 3],
|
|
9142
|
+
["zombie_dog_bark", 3],
|
|
9143
|
+
["zombie_dog_howl_far", 3],
|
|
9144
|
+
["insect_squash", 3],
|
|
9145
|
+
["insect_crawl", 3],
|
|
9146
|
+
["fan_loop", 3]
|
|
9086
9147
|
])
|
|
9087
9148
|
];
|
|
9088
9149
|
var SFX_MATERIALS = [
|
|
@@ -18551,7 +18612,44 @@ var GameTestRoom = (() => {
|
|
|
18551
18612
|
renderer.compile(scene2, camera2);
|
|
18552
18613
|
renderer.render(scene2, camera2);
|
|
18553
18614
|
}
|
|
18615
|
+
function drawOnly(scene2, root) {
|
|
18616
|
+
const hidden = [];
|
|
18617
|
+
const visit = (object) => {
|
|
18618
|
+
if (object === root || !object.visible) return;
|
|
18619
|
+
const drawable = object;
|
|
18620
|
+
if (drawable.isMesh === true || drawable.isPoints === true || drawable.isLine === true || drawable.isSprite === true) {
|
|
18621
|
+
if (!holdsLight(object) && !holdsObject(object, root)) {
|
|
18622
|
+
object.visible = false;
|
|
18623
|
+
hidden.push(object);
|
|
18624
|
+
return;
|
|
18625
|
+
}
|
|
18626
|
+
}
|
|
18627
|
+
for (const child of object.children) visit(child);
|
|
18628
|
+
};
|
|
18629
|
+
for (const child of scene2.children) visit(child);
|
|
18630
|
+
return () => hidden.forEach((object) => object.visible = true);
|
|
18631
|
+
}
|
|
18632
|
+
function holdsLight(object) {
|
|
18633
|
+
let found = false;
|
|
18634
|
+
object.traverse((each) => {
|
|
18635
|
+
if (each.isLight === true) found = true;
|
|
18636
|
+
});
|
|
18637
|
+
return found;
|
|
18638
|
+
}
|
|
18639
|
+
function holdsObject(object, target) {
|
|
18640
|
+
for (let at3 = target; at3 !== null; at3 = at3.parent) if (at3 === object) return true;
|
|
18641
|
+
return false;
|
|
18642
|
+
}
|
|
18554
18643
|
function playEffect(renderer, scene2, camera2, effect, target) {
|
|
18644
|
+
const root = effect.root?.();
|
|
18645
|
+
const restore = root === null || root === void 0 ? () => void 0 : drawOnly(scene2, root);
|
|
18646
|
+
try {
|
|
18647
|
+
playFrames(renderer, scene2, camera2, effect, target);
|
|
18648
|
+
} finally {
|
|
18649
|
+
restore();
|
|
18650
|
+
}
|
|
18651
|
+
}
|
|
18652
|
+
function playFrames(renderer, scene2, camera2, effect, target) {
|
|
18555
18653
|
effect.play();
|
|
18556
18654
|
try {
|
|
18557
18655
|
for (let frame2 = 0; frame2 < (effect.frames ?? DEFAULT_EFFECT_FRAMES); frame2++) {
|
|
@@ -19058,7 +19156,7 @@ var GameTestRoom = (() => {
|
|
|
19058
19156
|
return sources;
|
|
19059
19157
|
}
|
|
19060
19158
|
|
|
19061
|
-
// ../game-vfx-three/dist/chunk-
|
|
19159
|
+
// ../game-vfx-three/dist/chunk-2MZDWTHX.js
|
|
19062
19160
|
var GLOW_VERTEX = `attribute vec4 aP;attribute vec4 aC;varying vec2 vU;varying vec4 vC;
|
|
19063
19161
|
void main(){vec3 R=vec3(viewMatrix[0][0],viewMatrix[1][0],viewMatrix[2][0]);vec3 Up=vec3(viewMatrix[0][1],viewMatrix[1][1],viewMatrix[2][1]);
|
|
19064
19162
|
vec3 wp=aP.xyz+(R*position.x+Up*position.y)*aP.w;vU=position.xy;vC=aC;gl_Position=projectionMatrix*viewMatrix*vec4(wp,1.);}`;
|
|
@@ -20438,6 +20536,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
|
|
|
20438
20536
|
drawCalls = Number(lastDrawn.puffs > 0) + Number(lastDrawn.sparks > 0) + Number(lastDrawn.glows > 0) + Number(chunks.rocks.count > 0) + Number(chunks.plates.count > 0) + Number(sprites.additive.geometry.drawRange.count > 0) + Number(sprites.normal.geometry.drawRange.count > 0) + lastDrawn.shocks * 2 + marks.count() + workshopCalls;
|
|
20439
20537
|
}
|
|
20440
20538
|
return {
|
|
20539
|
+
root,
|
|
20441
20540
|
world,
|
|
20442
20541
|
play(request) {
|
|
20443
20542
|
followCamera();
|
|
@@ -56035,6 +56134,7 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
|
|
|
56035
56134
|
return true;
|
|
56036
56135
|
};
|
|
56037
56136
|
const extraScenarios = [...options.scenarios ?? []];
|
|
56137
|
+
let moduleHeld = false;
|
|
56038
56138
|
const moduleCheck = (ok, text, data, itemId) => {
|
|
56039
56139
|
log.add({ channel: "check", type: ok ? "pass" : "fail", text: `${ok ? "\u2713" : "\u2717"} ${text}`, itemId, data: { ok, ...data } });
|
|
56040
56140
|
};
|
|
@@ -56159,7 +56259,11 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
|
|
|
56159
56259
|
loading,
|
|
56160
56260
|
addView: (view) => moduleViews.add(view),
|
|
56161
56261
|
setViewCamera: (view) => moduleViews.setMain(view ?? null),
|
|
56162
|
-
holdPlayer: (held) =>
|
|
56262
|
+
holdPlayer: (held) => {
|
|
56263
|
+
moduleHeld = held;
|
|
56264
|
+
player.setWalkHeld(held);
|
|
56265
|
+
},
|
|
56266
|
+
playerHeld: () => moduleHeld,
|
|
56163
56267
|
...options.blastShove ? { blastShove: options.blastShove } : {},
|
|
56164
56268
|
blastReach: (point, target, ignore) => world.blastReach(point, target, ignore ? { ignore } : {}),
|
|
56165
56269
|
tool: () => ({
|
|
@@ -56295,6 +56399,8 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
|
|
|
56295
56399
|
let handle = null;
|
|
56296
56400
|
return {
|
|
56297
56401
|
id: `vfx:${id}`,
|
|
56402
|
+
// the room was drawn in every fog state just before: each frame of a blast draws the effects alone
|
|
56403
|
+
root: () => vfx.root,
|
|
56298
56404
|
play() {
|
|
56299
56405
|
handle = vfx.play({ effect: id, point: [0, 0.1, -4], direction: [0, 1, 0], normal: [0, 1, 0] });
|
|
56300
56406
|
},
|