-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp_replace.js
More file actions
114 lines (97 loc) · 5.76 KB
/
Copy pathtmp_replace.js
File metadata and controls
114 lines (97 loc) · 5.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
const fs = require('fs');
const path = require('path');
const filePath = path.resolve('c:/claudetest/legacy-code-mmo/apps/web/src/App.tsx');
let content = fs.readFileSync(filePath, 'utf8');
const lines = content.split('\n');
const newStoreLevel = `const StoreLevel = () => {
return (
<group>
{/* 10x8 Floor */}
{Array.from({ length: 8 }).map((_, z) => (
Array.from({ length: 10 }).map((_, x) => (
<PrefabModel key={\`sf-floor-\${x}-\${z}\`} src="/models/floorFull.glb" position={[-4.5 + x, 0, 3.5 - z]} />
))
))}
{/* Back Wall (Fridges) */}
{Array.from({ length: 10 }).map((_, x) => (
<group key={\`sf-fridge-grp-\${x}\`} position={[-4.5 + x, 0, -4]}>
<PrefabModel src="/models/wall.glb" position={[0, 0, 0]} />
{x > 0 && x < 9 ? (
<group>
<PrefabModel src="/models/store_fridge.glb" position={[0, 0, 0.5]} />
{/* Populate Fridge */}
<PrefabModel src="/models/soda-bottle.glb" position={[-0.2, 0.5, 0.5]} scale={[0.8, 0.8, 0.8]} />
<PrefabModel src="/models/wine-red.glb" position={[0.2, 0.5, 0.5]} scale={[0.8, 0.8, 0.8]} />
<PrefabModel src="/models/soda-can.glb" position={[0, 1.2, 0.5]} scale={[0.8, 0.8, 0.8]} />
</group>
) : null}
</group>
))}
{/* Left Wall */}
{Array.from({ length: 8 }).map((_, z) => (
<PrefabModel key={\`sf-wall-l-\${z}\`} src="/models/wall.glb" position={[-5, 0, 3.5 - z]} rotation={[0, Math.PI / 2, 0]} />
))}
{/* Right Wall */}
{Array.from({ length: 8 }).map((_, z) => (
<PrefabModel key={\`sf-wall-r-\${z}\`} src="/models/wall.glb" position={[5, 0, 3.5 - z]} rotation={[0, -Math.PI / 2, 0]} />
))}
{/* Front Wall with Entry Door (Glass) */}
{Array.from({ length: 10 }).map((_, x) => (
x === 4 || x === 5 ? (
<mesh key={\`sf-glass-\${x}\`} position={[-4.5 + x, 1.29, 4]}>
<boxGeometry args={[1, 2.58, 0.1]} />
<meshStandardMaterial color="#a5f3fc" transparent opacity={0.3} roughness={0.1} metalness={0.8} />
</mesh>
) : (
<PrefabModel key={\`sf-wall-f-\${x}\`} src="/models/wall.glb" position={[-4.5 + x, 0, 4]} rotation={[0, Math.PI, 0]} />
)
))}
{/* Checkout Counters */}
<PrefabModel src="/models/store_counter.glb" position={[-2, 0, 2]} />
<PrefabModel src="/models/store_counter.glb" position={[-1, 0, 2]} />
<PrefabModel src="/models/deskCorner.glb" position={[0, 0, 2]} rotation={[0, Math.PI / 2, 0]} />
<PrefabModel src="/models/store_counter.glb" position={[0, 0, 3]} rotation={[0, Math.PI / 2, 0]} />
{/* Counter Clutter */}
<PrefabModel src="/models/computerScreen.glb" position={[-1.5, 0.7, 2]} rotation={[0, 0, 0]} />
<PrefabModel src="/models/lollypop.glb" position={[-0.5, 0.7, 2]} />
<PrefabModel src="/models/bag-flat.glb" position={[0, 0.7, 2]} />
{/* Center Aisles */}
{Array.from({ length: 4 }).map((_, z) => (
<group key={\`sf-aisle-\${z}\`}>
<PrefabModel src="/models/store_shelf.glb" position={[-2, 0, -2 + z]} />
<PrefabModel src="/models/store_shelf.glb" position={[2, 0, -2 + z]} rotation={[0, Math.PI, 0]} />
</group>
))}
{/* Moody Lighting */}
<ambientLight intensity={0.2} color="#ffffff" />
<directionalLight position={[10, 20, 10]} intensity={0.2} color="#fffcf2" castShadow shadow-mapSize={[2048, 2048]} />
{/* Fridge Neon (Cyan) */}
<pointLight position={[0, 3, -3]} color="#00ffff" intensity={1.5} distance={8} />
<pointLight position={[-3, 3, -3]} color="#00ffff" intensity={1.5} distance={8} />
<pointLight position={[3, 3, -3]} color="#00ffff" intensity={1.5} distance={8} />
{/* Checkout Neon (Amber) */}
<pointLight position={[-1, 3, 2]} color="#ffb000" intensity={1.5} distance={6} />
{/* Portal to Backrooms (Back Left) */}
<mesh position={[-3, 1.25, -4.5]}>
<boxGeometry args={[1.5, 2.5, 0.2]} />
<meshStandardMaterial color="#000000" transparent opacity={0.8} />
</mesh>
<pointLight position={[-3, 2, -4]} color="#ff0000" intensity={1} distance={2} /> {/* Subtle red aura */}
</group>
);
};`;
// Replace Player scale
newContent = content.replace('<group ref={groupRef} position={position} scale={[0.8, 0.8, 0.8]}>', '<group ref={groupRef} position={position} scale={[1.2, 1.2, 1.2]}>');
// Replace Customer scale
newContent = newContent.replace('scale={[0.8, 0.8, 0.8]}\n onClick={(e) => {', 'scale={[1.2, 1.2, 1.2]}\n onClick={(e) => {');
const startIndex = newContent.indexOf('const StoreLevel = () => {');
const endIndex = newContent.indexOf('const BackroomsLevel = () => {');
if (startIndex !== -1 && endIndex !== -1) {
const beforePart = newContent.substring(0, startIndex);
const afterPart = newContent.substring(endIndex);
const finalContent = beforePart + newStoreLevel + '\n\n' + afterPart;
fs.writeFileSync(filePath, finalContent, 'utf8');
console.log('Successfully replaced StoreLevel and updated character scale.');
} else {
console.error('Failed to find StoreLevel boundaries.');
}