@adatechnology/game-test-room 0.19.1 → 0.20.0
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.d.ts +15 -0
- package/dist/index.global.js +603 -113
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +41 -1
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -2954,7 +2954,7 @@ function createRoomDoors(options) {
|
|
|
2954
2954
|
// src/room.ts
|
|
2955
2955
|
import { releaseObject3D as releaseObject3D2 } from "@adatechnology/game-shapes-three";
|
|
2956
2956
|
import { createTerrain, createTerrainImpl, DEFAULT_PROFILE } from "@adatechnology/game-terrain";
|
|
2957
|
-
import { createTerrainRenderer } from "@adatechnology/game-terrain-three";
|
|
2957
|
+
import { createTerrainRenderer, terrainProfileName } from "@adatechnology/game-terrain-three";
|
|
2958
2958
|
|
|
2959
2959
|
// src/avatar.ts
|
|
2960
2960
|
var DEFAULT_STRIKE_CLIPS = { hand: "punch_right", fists: "punch_right", shove: "shove_two_hands", kick: "front_kick" };
|
|
@@ -3325,6 +3325,8 @@ var en = {
|
|
|
3325
3325
|
"ins.damage": "Marks",
|
|
3326
3326
|
"ins.damage_counts": "{dents}, {holes}, {cracks}",
|
|
3327
3327
|
"ins.mass": "Mass",
|
|
3328
|
+
"ins.dug": "Dug",
|
|
3329
|
+
"ins.dig_limit": "Ground left to dig",
|
|
3328
3330
|
"ins.load": "Load",
|
|
3329
3331
|
"ins.stress": "Stress",
|
|
3330
3332
|
"ins.joints": "Joints",
|
|
@@ -3673,6 +3675,8 @@ var ptBR = {
|
|
|
3673
3675
|
"ins.damage": "Marcas",
|
|
3674
3676
|
"ins.damage_counts": "{dents}, {holes}, {cracks}",
|
|
3675
3677
|
"ins.mass": "Massa",
|
|
3678
|
+
"ins.dug": "Escavado",
|
|
3679
|
+
"ins.dig_limit": "Ch\xE3o at\xE9 o limite",
|
|
3676
3680
|
"ins.load": "Carga",
|
|
3677
3681
|
"ins.stress": "Tens\xE3o",
|
|
3678
3682
|
"ins.joints": "Juntas",
|
|
@@ -4560,6 +4564,15 @@ function createUi(o) {
|
|
|
4560
4564
|
insp.appendChild(mk3("div", void 0, t("ui.aim_at_something")));
|
|
4561
4565
|
return;
|
|
4562
4566
|
}
|
|
4567
|
+
if (i.ground) {
|
|
4568
|
+
const g = i.ground;
|
|
4569
|
+
insp.appendChild(mk3("div", "t", `${i.object} \u203A ${g.surface}`));
|
|
4570
|
+
insp.appendChild(row(t("ins.material"), g.material));
|
|
4571
|
+
insp.appendChild(row(t("ins.dug"), `${num(g.dug * 100, 0)} cm`));
|
|
4572
|
+
insp.appendChild(row(t("ins.dig_limit"), `${num(g.remaining, 2)} m`));
|
|
4573
|
+
if (g.scorch > 0.01) insp.appendChild(row(t("ins.char"), `${num(g.scorch * 100, 0)} %`));
|
|
4574
|
+
return;
|
|
4575
|
+
}
|
|
4563
4576
|
if (i.thumbnail) insp.appendChild(thumb(i.thumbnail, i.thumbnailCredit));
|
|
4564
4577
|
insp.appendChild(mk3("div", "t", `${i.object} \u203A ${i.part}`));
|
|
4565
4578
|
insp.appendChild(row(t("ins.material"), i.material));
|
|
@@ -6918,9 +6931,36 @@ function createTestRoom(options) {
|
|
|
6918
6931
|
if (!leaf) return void 0;
|
|
6919
6932
|
return t(leaf.locked ? "hud.door_hint_locked" : leaf.open ? "hud.door_hint_close" : "hud.door_hint_open");
|
|
6920
6933
|
};
|
|
6934
|
+
const groundInspect = (r) => {
|
|
6935
|
+
const onFloor = terrain.raycast(aimO, aimD, r.distance + 3);
|
|
6936
|
+
const [x, , z] = onFloor?.point ?? r.point;
|
|
6937
|
+
const column = terrain.columnAt(x, z);
|
|
6938
|
+
const materialName = S.text[`material.${column.material}`] ?? dStrings.materialNames[column.material] ?? column.material;
|
|
6939
|
+
return {
|
|
6940
|
+
object: t("ground.name"),
|
|
6941
|
+
objectId: GROUND_ID,
|
|
6942
|
+
part: column.profile,
|
|
6943
|
+
material: materialName,
|
|
6944
|
+
status: "",
|
|
6945
|
+
hp: 0,
|
|
6946
|
+
maxHp: 0,
|
|
6947
|
+
temperature: 0,
|
|
6948
|
+
burning: false,
|
|
6949
|
+
char: column.scorch,
|
|
6950
|
+
melt: 0,
|
|
6951
|
+
dents: 0,
|
|
6952
|
+
holes: 0,
|
|
6953
|
+
cracks: 0,
|
|
6954
|
+
mass: 0,
|
|
6955
|
+
joints: [],
|
|
6956
|
+
distance: onFloor?.distance ?? r.distance,
|
|
6957
|
+
ground: { surface: terrainProfileName(column.profile, locale), material: materialName, dug: column.depth, remaining: column.remaining, scorch: column.scorch }
|
|
6958
|
+
};
|
|
6959
|
+
};
|
|
6921
6960
|
const inspectInfo = () => {
|
|
6922
6961
|
const r = inspectTarget();
|
|
6923
6962
|
if (!r) return null;
|
|
6963
|
+
if (r.object === GROUND_ID) return groundInspect(r);
|
|
6924
6964
|
const st = world.state(r.object);
|
|
6925
6965
|
const p = world.part(r.object, r.part);
|
|
6926
6966
|
if (!st || !p) return null;
|