Release Healer Man 0.1.43
This commit is contained in:
1 parent
c7e8163790
commit
ccc01396cd
86 files changed
+2951
-198
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { useEffect } from "react";
|
||||
import { RigidBody } from "@react-three/rapier";
|
||||
import type { DungeonDefinition } from "../game/dungeonTypes";
|
||||
import { DUNGEON_PHYSICAL_COLLISION_GROUPS, DUNGEON_WALL_COLLISION_GROUPS } from "./dungeonLineOfSight";
|
||||
|
||||
export function BossTestingRoom({ definition, onReady }: { readonly definition: DungeonDefinition; readonly onReady?: () => void }) {
|
||||
const { min, max } = definition.bounds;
|
||||
const x = (min[0] + max[0]) / 2;
|
||||
const z = (min[2] + max[2]) / 2;
|
||||
const y = definition.bosses[0].position[1];
|
||||
const width = max[0] - min[0];
|
||||
const depth = max[2] - min[2];
|
||||
useEffect(() => {
|
||||
onReady?.();
|
||||
}, [onReady]);
|
||||
return <group name="boss-testing-room">
|
||||
<RigidBody type="fixed" colliders="cuboid" collisionGroups={DUNGEON_PHYSICAL_COLLISION_GROUPS} position={[x, y - 0.5, z]}>
|
||||
<mesh receiveShadow><boxGeometry args={[width, 1, depth]} /><meshStandardMaterial color="#535c68" roughness={0.9} /></mesh>
|
||||
</RigidBody>
|
||||
{([
|
||||
[min[0] - 0.5, y + 4, z, 1, 8, depth + 2], [max[0] + 0.5, y + 4, z, 1, 8, depth + 2],
|
||||
[x, y + 4, min[2] - 0.5, width, 8, 1], [x, y + 4, max[2] + 0.5, width, 8, 1],
|
||||
] as const).map(([px, py, pz, w, h, d], index) =>
|
||||
<RigidBody key={index} type="fixed" colliders="cuboid" collisionGroups={DUNGEON_WALL_COLLISION_GROUPS} position={[px, py, pz]}>
|
||||
<mesh receiveShadow><boxGeometry args={[w, h, d]} /><meshStandardMaterial color="#293441" roughness={0.95} /></mesh>
|
||||
</RigidBody>
|
||||
)}
|
||||
<gridHelper args={[Math.max(width, depth), Math.ceil(Math.max(width, depth) / 5), "#8794a5", "#626d7b"]} position={[x, y + 0.015, z]} />
|
||||
</group>;
|
||||
}
|
||||
@@ -5,10 +5,12 @@ import { activeManastormStageAssetPackage } from "../game/manastormStageLoader";
|
||||
import { useGameStore } from "../game/store";
|
||||
import { ProductionDungeon } from "./ProductionDungeon";
|
||||
import { PrototypeDungeon } from "./PrototypeDungeon";
|
||||
import { BossTestingRoom } from "./BossTestingRoom";
|
||||
|
||||
export function DungeonEnvironment({ onReady }: { readonly onReady?: () => void }) {
|
||||
const activeDungeonId = useGameStore((state) => state.activeDungeonId);
|
||||
const gameMode = useGameStore((state) => state.gameMode);
|
||||
const bossTest = useGameStore((state) => state.bossTest);
|
||||
const sessionRevision = useGameStore((state) => state.sessionRevision);
|
||||
const definition = requireDungeonDefinition(activeDungeonId);
|
||||
const manastormPackage = gameMode === "manastorm"
|
||||
@@ -31,6 +33,7 @@ export function DungeonEnvironment({ onReady }: { readonly onReady?: () => void
|
||||
&& assets.collision.length > 0;
|
||||
|
||||
useEffect(() => {
|
||||
if (bossTest) return;
|
||||
if (hasProductionAssets) return;
|
||||
const missing = [
|
||||
...definition.assets.visual.filter((_, index) => !assets.visual[index]).map((asset) => asset.fileName),
|
||||
@@ -38,8 +41,9 @@ export function DungeonEnvironment({ onReady }: { readonly onReady?: () => void
|
||||
];
|
||||
useGameStore.getState().setAssetStatus("proxy", `Waiting for ${missing.join(" and ") || "generated dungeon assets"}.`);
|
||||
onReady?.();
|
||||
}, [assets.collision, assets.visual, definition, hasProductionAssets, onReady]);
|
||||
}, [assets.collision, assets.visual, bossTest, definition, hasProductionAssets, onReady]);
|
||||
|
||||
if (bossTest) return <BossTestingRoom definition={definition} onReady={onReady} />;
|
||||
if (!hasProductionAssets) return <PrototypeDungeon definition={definition} />;
|
||||
return (
|
||||
<Suspense fallback={null}>
|
||||
|
||||
Reference in new issue
Block a user