@muvtacode/cli 0.1.8 → 0.1.10
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/agent/loop.js +10 -1
- package/dist/agent/loop.js.map +1 -1
- package/dist/agent/prompt.js +101 -0
- package/dist/agent/prompt.js.map +1 -1
- package/dist/cli.js +102 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/index.js +28 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/i18n/en.js +4 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/pt.js +4 -0
- package/dist/i18n/pt.js.map +1 -1
- package/dist/remote/claudeSessions.js +82 -0
- package/dist/remote/claudeSessions.js.map +1 -0
- package/dist/remote/host.js +530 -0
- package/dist/remote/host.js.map +1 -0
- package/dist/remote/passagem.js +545 -0
- package/dist/remote/passagem.js.map +1 -0
- package/dist/repl.js +94 -22
- package/dist/repl.js.map +1 -1
- package/dist/state/templates.js +43 -10
- package/dist/state/templates.js.map +1 -1
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/AssaultRifle_1.mtl +42 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/AssaultRifle_1.obj +1472 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Grip.mtl +12 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Grip.obj +890 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/LICENCA.txt +25 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Pistol_1.mtl +52 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Pistol_1.obj +1444 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Pistol_4.mtl +32 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Pistol_4.obj +1789 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Revolver_1.mtl +32 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Revolver_1.obj +1273 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Scope_1.mtl +32 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Scope_1.obj +485 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Shotgun_1.mtl +42 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Shotgun_1.obj +1589 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Silencer_1.mtl +12 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/Silencer_1.obj +309 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/SniperRifle_1.mtl +52 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/SniperRifle_1.obj +1681 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/SubmachineGun_1.mtl +42 -0
- package/dist/templates/game/adapt-assets-3d-01/files/public/models/armas/SubmachineGun_1.obj +1275 -0
- package/dist/templates/game/adapt-assets-3d-01/files/src/assets/modelos.ts +270 -0
- package/dist/templates/game/adapt-assets-3d-01/meta.json +30 -0
- package/dist/templates/game/adapt-audio-01/files/src/audio/audio.ts +309 -0
- package/dist/templates/game/adapt-audio-01/meta.json +47 -0
- package/dist/templates/game/adapt-camera-rig-01/files/src/camera/rig.ts +364 -0
- package/dist/templates/game/adapt-camera-rig-01/meta.json +53 -0
- package/dist/templates/game/adapt-controle-teclado-01/files/src/controles/teclado.ts +175 -0
- package/dist/templates/game/adapt-controle-teclado-01/meta.json +36 -0
- package/dist/templates/game/adapt-controle-toque-01/files/src/controles/toque.ts +407 -0
- package/dist/templates/game/adapt-controle-toque-01/meta.json +43 -0
- package/dist/templates/game/adapt-dia-noite-01/files/src/world/dianoite.ts +378 -0
- package/dist/templates/game/adapt-dia-noite-01/meta.json +50 -0
- package/dist/templates/game/adapt-hud-01/files/src/hud/hud.ts +859 -0
- package/dist/templates/game/adapt-hud-01/meta.json +69 -0
- package/dist/templates/game/adapt-menu-01/files/src/ui/menu.ts +427 -0
- package/dist/templates/game/adapt-menu-01/meta.json +41 -0
- package/dist/templates/game/adapt-particulas-01/files/src/vfx/particulas.ts +280 -0
- package/dist/templates/game/adapt-particulas-01/meta.json +50 -0
- package/dist/templates/game/adapt-perf-mobile-01/files/src/engine/performance.ts +220 -0
- package/dist/templates/game/adapt-perf-mobile-01/meta.json +49 -0
- package/dist/templates/game/adapt-primeira-pessoa-01/files/src/camera/primeirapessoa.ts +595 -0
- package/dist/templates/game/adapt-primeira-pessoa-01/meta.json +63 -0
- package/dist/templates/game/adapt-save-01/files/src/save/save.ts +188 -0
- package/dist/templates/game/adapt-save-01/meta.json +34 -0
- package/dist/templates/game/carro-2d-01/files/src/models/carro2d.ts +253 -0
- package/dist/templates/game/carro-2d-01/meta.json +38 -0
- package/dist/templates/game/carro-3d-01/files/src/models/carro3d.ts +266 -0
- package/dist/templates/game/carro-3d-01/meta.json +13 -0
- package/dist/templates/game/estruturas-3d-01/files/src/world/estruturas.ts +490 -0
- package/dist/templates/game/estruturas-3d-01/meta.json +13 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/arena.ts +324 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/armas.ts +398 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/cena.ts +801 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/coletaveis.ts +129 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/fisica.ts +257 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/inimigos.ts +608 -0
- package/dist/templates/game/fps-3d-01/files/src/fps/jogador.ts +224 -0
- package/dist/templates/game/fps-3d-01/files/src/main.ts +21 -0
- package/dist/templates/game/fps-3d-01/meta.json +48 -0
- package/dist/templates/game/game-design-tokens-01/files/src/design/tokens.ts +274 -0
- package/dist/templates/game/game-design-tokens-01/meta.json +13 -0
- package/dist/templates/game/game-engine-base-01/files/index.html +37 -0
- package/dist/templates/game/game-engine-base-01/files/package.json +19 -0
- package/dist/templates/game/game-engine-base-01/files/src/engine/device.ts +57 -0
- package/dist/templates/game/game-engine-base-01/files/src/engine/engine.ts +221 -0
- package/dist/templates/game/game-engine-base-01/files/src/engine/index.ts +68 -0
- package/dist/templates/game/game-engine-base-01/files/src/engine/input.ts +578 -0
- package/dist/templates/game/game-engine-base-01/files/src/engine/layout.ts +192 -0
- package/dist/templates/game/game-engine-base-01/files/tsconfig.json +14 -0
- package/dist/templates/game/game-engine-base-01/files/vite.config.ts +10 -0
- package/dist/templates/game/game-engine-base-01/meta.json +70 -0
- package/dist/templates/game/mundo-25d-01/files/src/world/mundo25d.ts +252 -0
- package/dist/templates/game/mundo-25d-01/meta.json +39 -0
- package/dist/templates/game/mundo-2d-01/files/src/world/mundo2d.ts +273 -0
- package/dist/templates/game/mundo-2d-01/meta.json +38 -0
- package/dist/templates/game/mundo-3d-01/files/src/world/mundo3d.ts +3130 -0
- package/dist/templates/game/mundo-3d-01/meta.json +132 -0
- package/dist/templates/game/npc-3d-01/files/src/ai/npc3d.ts +658 -0
- package/dist/templates/game/npc-3d-01/meta.json +13 -0
- package/dist/templates/game/personagem-2d-01/files/src/models/personagem2d.ts +341 -0
- package/dist/templates/game/personagem-2d-01/meta.json +41 -0
- package/dist/templates/game/personagem-3d-01/files/src/models/personagem3d.ts +614 -0
- package/dist/templates/game/personagem-3d-01/meta.json +67 -0
- package/package.json +2 -1
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Inimigos: drones de combate.
|
|
3
|
+
//
|
|
4
|
+
// Drone e não humanoide de propósito: voa (não precisa de navegação no chão
|
|
5
|
+
// nem de animação de andar), lê bem de longe (corpo + anel luminoso + olho) e
|
|
6
|
+
// o PONTO FRACO é óbvio — o olho vale dano crítico. Para trocar por soldados,
|
|
7
|
+
// use npc-3d-01 + personagem-3d-01 e mantenha o contrato de `Enxame`.
|
|
8
|
+
//
|
|
9
|
+
// O que separa isto de um alvo que voa até você:
|
|
10
|
+
// • PERCEPÇÃO: só vê com linha de visada livre (pilar e caixa escondem), e
|
|
11
|
+
// LEMBRA onde te viu por último — perde o contato, vai até lá procurar.
|
|
12
|
+
// • COMBATE: mantém distância preferida, ORBITA de lado (alvo parado é
|
|
13
|
+
// injusto e chato), desvia de obstáculo pela frente e se afasta dos outros.
|
|
14
|
+
// • TIRO JUSTO: o olho acende ANTES do disparo (carga) e o projétil é visível
|
|
15
|
+
// e desviável. Tiro instantâneo de inimigo vira dano que o jogador não
|
|
16
|
+
// entende de onde veio.
|
|
17
|
+
// • Percepção escalonada (~5 vezes/s, cada drone num momento) para caber no
|
|
18
|
+
// celular com vários drones.
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
import * as THREE from 'three';
|
|
22
|
+
import { getPalette } from '../design/tokens';
|
|
23
|
+
import { raioCaixa, raioEsfera, linhaLivre, empurrarEsfera } from './fisica';
|
|
24
|
+
|
|
25
|
+
export type TipoDrone = 'batedor' | 'pesado';
|
|
26
|
+
|
|
27
|
+
export interface DefDrone {
|
|
28
|
+
vida: number;
|
|
29
|
+
/** Raio do corpo (m): é também o tamanho visual e a esfera de acerto. */
|
|
30
|
+
raio: number;
|
|
31
|
+
velocidade: number;
|
|
32
|
+
aceleracao: number;
|
|
33
|
+
/** Distância que tenta manter do jogador em combate. */
|
|
34
|
+
distanciaPreferida: number;
|
|
35
|
+
alcanceVisao: number;
|
|
36
|
+
alcanceTiro: number;
|
|
37
|
+
/** Intervalo médio entre tiros (s), sorteado ±25%. */
|
|
38
|
+
intervaloTiro: number;
|
|
39
|
+
/** Aviso visível antes do tiro (s): o olho acende. */
|
|
40
|
+
tempoCarga: number;
|
|
41
|
+
dano: number;
|
|
42
|
+
velocidadeProjetil: number;
|
|
43
|
+
/** Erro de mira (rad). */
|
|
44
|
+
imprecisao: number;
|
|
45
|
+
pontos: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const TIPOS: Record<TipoDrone, DefDrone> = {
|
|
49
|
+
batedor: {
|
|
50
|
+
vida: 60, raio: 0.42, velocidade: 6.5, aceleracao: 14, distanciaPreferida: 9,
|
|
51
|
+
alcanceVisao: 38, alcanceTiro: 30, intervaloTiro: 2.0, tempoCarga: 0.55,
|
|
52
|
+
dano: 7, velocidadeProjetil: 22, imprecisao: 0.07, pontos: 100
|
|
53
|
+
},
|
|
54
|
+
pesado: {
|
|
55
|
+
vida: 190, raio: 0.68, velocidade: 3.4, aceleracao: 7, distanciaPreferida: 14,
|
|
56
|
+
alcanceVisao: 42, alcanceTiro: 36, intervaloTiro: 2.6, tempoCarga: 0.85,
|
|
57
|
+
dano: 16, velocidadeProjetil: 17, imprecisao: 0.05, pontos: 250
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const tuning = {
|
|
62
|
+
/** Percepções por segundo de cada drone (escalonadas entre eles). */
|
|
63
|
+
percepcoesPorSegundo: 5,
|
|
64
|
+
/** Segundos sem ver o jogador até desistir e ir procurar. */
|
|
65
|
+
memoria: 3.5,
|
|
66
|
+
/** Tempo de reação ao avistar (s) antes do primeiro tiro. */
|
|
67
|
+
reacao: 0.6,
|
|
68
|
+
alturaMinima: 1.1,
|
|
69
|
+
alturaMaxima: 3.8,
|
|
70
|
+
/** Distância em que um drone empurra o outro. */
|
|
71
|
+
separacao: 2.4,
|
|
72
|
+
tempoMorte: 1.4,
|
|
73
|
+
/** Empurrão do tiro (m/s por ponto de dano). */
|
|
74
|
+
empurraoPorDano: 0.04,
|
|
75
|
+
maxProjeteis: 48,
|
|
76
|
+
/** Tolerância do acerto no jogador além do raio dele (m). */
|
|
77
|
+
folgaAcerto: 0.12,
|
|
78
|
+
/**
|
|
79
|
+
* Erro extra de mira por metro de distância (rad/m). Sem isto, quem fica
|
|
80
|
+
* parado longe leva quase todo tiro — e longe é onde o jogador ainda está
|
|
81
|
+
* procurando o drone na tela.
|
|
82
|
+
*/
|
|
83
|
+
imprecisaoPorMetro: 0.0025
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type Estado = 'patrulha' | 'combate' | 'procura' | 'morrendo' | 'inativo';
|
|
87
|
+
|
|
88
|
+
/** Pontos testados ao longo do trecho que o projétil anda num passo. */
|
|
89
|
+
const AMOSTRAS = [0, 0.5, 1] as const;
|
|
90
|
+
|
|
91
|
+
export interface Drone {
|
|
92
|
+
readonly tipo: TipoDrone;
|
|
93
|
+
readonly def: DefDrone;
|
|
94
|
+
readonly grupo: THREE.Group;
|
|
95
|
+
/** Mesma referência de grupo.position. */
|
|
96
|
+
readonly pos: THREE.Vector3;
|
|
97
|
+
readonly vel: THREE.Vector3;
|
|
98
|
+
/** Para onde o "olho" aponta (unitário). */
|
|
99
|
+
readonly frente: THREE.Vector3;
|
|
100
|
+
vida: number;
|
|
101
|
+
estado: Estado;
|
|
102
|
+
/** Vivo = participa do combate (morrendo não conta). */
|
|
103
|
+
readonly vivo: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface DroneInterno extends Drone {
|
|
107
|
+
corpo: THREE.Mesh;
|
|
108
|
+
anel: THREE.Mesh;
|
|
109
|
+
olho: THREE.Mesh;
|
|
110
|
+
matCorpo: THREE.Material;
|
|
111
|
+
ve: boolean;
|
|
112
|
+
semVer: number;
|
|
113
|
+
ultimoVisto: THREE.Vector3;
|
|
114
|
+
pensar: number;
|
|
115
|
+
espera: number;
|
|
116
|
+
carga: number;
|
|
117
|
+
lado: number;
|
|
118
|
+
trocaLado: number;
|
|
119
|
+
alvoPatrulha: THREE.Vector3;
|
|
120
|
+
fase: number;
|
|
121
|
+
flash: number;
|
|
122
|
+
morteT: number;
|
|
123
|
+
giro: THREE.Vector3;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface Projetil {
|
|
127
|
+
malha: THREE.Mesh;
|
|
128
|
+
pos: THREE.Vector3;
|
|
129
|
+
vel: THREE.Vector3;
|
|
130
|
+
origem: THREE.Vector3;
|
|
131
|
+
vida: number;
|
|
132
|
+
dano: number;
|
|
133
|
+
ativo: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** O que o jogo precisa saber do jogador para os drones agirem. */
|
|
137
|
+
export interface AlvoDrones {
|
|
138
|
+
cabeca: THREE.Vector3;
|
|
139
|
+
pes: THREE.Vector3;
|
|
140
|
+
vel: THREE.Vector3;
|
|
141
|
+
raio: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Ganchos para som, partícula, HUD e pontuação — o enxame não toca em nada disso. */
|
|
145
|
+
export interface EventosEnxame {
|
|
146
|
+
aoCarregar?(d: Drone): void;
|
|
147
|
+
aoAtirar?(d: Drone, origem: THREE.Vector3): void;
|
|
148
|
+
aoAcertarJogador(dano: number, origem: THREE.Vector3): void;
|
|
149
|
+
aoImpacto?(ponto: THREE.Vector3, normal: THREE.Vector3): void;
|
|
150
|
+
aoMorrer?(d: Drone): void;
|
|
151
|
+
aoExplodir?(ponto: THREE.Vector3, d: Drone): void;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface AcertoDrone {
|
|
155
|
+
drone: Drone;
|
|
156
|
+
distancia: number;
|
|
157
|
+
/** Acertou o olho: dano crítico. */
|
|
158
|
+
critico: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface Enxame {
|
|
162
|
+
/** Adicione na cena. */
|
|
163
|
+
raiz: THREE.Group;
|
|
164
|
+
readonly drones: readonly Drone[];
|
|
165
|
+
/** Quantos estão vivos (morrendo não conta). */
|
|
166
|
+
vivos(): number;
|
|
167
|
+
criar(tipo: TipoDrone, pos: THREE.Vector3): Drone;
|
|
168
|
+
atualizar(passo: number, alvo: AlvoDrones, caixas: readonly THREE.Box3[], limite: number, ev: EventosEnxame): void;
|
|
169
|
+
/** Raio de tiro contra os drones: o mais próximo até `max`. */
|
|
170
|
+
raioContra(o: THREE.Vector3, d: THREE.Vector3, max: number): AcertoDrone | null;
|
|
171
|
+
/** Aplica dano. Devolve true se matou agora. */
|
|
172
|
+
ferir(drone: Drone, dano: number, direcao: THREE.Vector3, ev: EventosEnxame): boolean;
|
|
173
|
+
/** Recolore pela paleta ativa (troca de tema no menu). */
|
|
174
|
+
aplicarPaleta(): void;
|
|
175
|
+
limpar(): void;
|
|
176
|
+
dispose(): void;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function criarEnxame(): Enxame {
|
|
180
|
+
const raiz = new THREE.Group();
|
|
181
|
+
raiz.name = 'drones';
|
|
182
|
+
const drones: DroneInterno[] = [];
|
|
183
|
+
|
|
184
|
+
// ---- geometrias e materiais COMPARTILHADOS (modelados com raio 1)
|
|
185
|
+
const geoCorpo = new THREE.IcosahedronGeometry(1, 1);
|
|
186
|
+
const geoAnel = new THREE.TorusGeometry(1.25, 0.07, 6, 32);
|
|
187
|
+
const geoOlho = new THREE.SphereGeometry(0.3, 14, 10);
|
|
188
|
+
const geoAleta = new THREE.BoxGeometry(0.12, 0.45, 0.85);
|
|
189
|
+
const geoAntena = new THREE.CylinderGeometry(0.04, 0.04, 0.5, 6);
|
|
190
|
+
const geoProj = new THREE.SphereGeometry(1, 8, 6);
|
|
191
|
+
|
|
192
|
+
const matCorpoBatedor = new THREE.MeshStandardMaterial({ roughness: 0.35, metalness: 0.55, flatShading: true });
|
|
193
|
+
const matCorpoPesado = new THREE.MeshStandardMaterial({ roughness: 0.45, metalness: 0.45, flatShading: true });
|
|
194
|
+
const matAnelBatedor = new THREE.MeshBasicMaterial();
|
|
195
|
+
const matAnelPesado = new THREE.MeshBasicMaterial();
|
|
196
|
+
const matOlho = new THREE.MeshBasicMaterial();
|
|
197
|
+
const matOlhoCarga = new THREE.MeshBasicMaterial();
|
|
198
|
+
const matFlash = new THREE.MeshBasicMaterial({ color: '#ffffff' });
|
|
199
|
+
const matProj = new THREE.MeshBasicMaterial({ transparent: true, blending: THREE.AdditiveBlending, depthWrite: false });
|
|
200
|
+
|
|
201
|
+
const aplicarPaleta = (): void => {
|
|
202
|
+
const p = getPalette();
|
|
203
|
+
matCorpoBatedor.color.set(p.superficie).lerp(new THREE.Color(p.contorno), 0.55);
|
|
204
|
+
matCorpoPesado.color.set(p.secundaria).lerp(new THREE.Color(p.superficie), 0.55);
|
|
205
|
+
matAnelBatedor.color.set(p.primaria);
|
|
206
|
+
matAnelPesado.color.set(p.acento);
|
|
207
|
+
matOlho.color.set(p.perigo);
|
|
208
|
+
matOlhoCarga.color.set(p.aviso);
|
|
209
|
+
matProj.color.set(p.perigo);
|
|
210
|
+
};
|
|
211
|
+
aplicarPaleta();
|
|
212
|
+
|
|
213
|
+
// ---- projéteis (pool)
|
|
214
|
+
const projeteis: Projetil[] = Array.from({ length: tuning.maxProjeteis }, () => {
|
|
215
|
+
const malha = new THREE.Mesh(geoProj, matProj);
|
|
216
|
+
malha.visible = false;
|
|
217
|
+
malha.scale.set(0.09, 0.09, 0.32); // esticado ao longo da velocidade
|
|
218
|
+
raiz.add(malha);
|
|
219
|
+
return { malha, pos: malha.position, vel: new THREE.Vector3(), origem: new THREE.Vector3(), vida: 0, dano: 0, ativo: false };
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const construir = (tipo: TipoDrone): DroneInterno => {
|
|
223
|
+
const def = TIPOS[tipo];
|
|
224
|
+
const grupo = new THREE.Group();
|
|
225
|
+
grupo.name = `drone-${tipo}`;
|
|
226
|
+
const matCorpo = tipo === 'pesado' ? matCorpoPesado : matCorpoBatedor;
|
|
227
|
+
const corpo = new THREE.Mesh(geoCorpo, matCorpo);
|
|
228
|
+
corpo.castShadow = true;
|
|
229
|
+
const anel = new THREE.Mesh(geoAnel, tipo === 'pesado' ? matAnelPesado : matAnelBatedor);
|
|
230
|
+
anel.rotation.x = Math.PI / 2;
|
|
231
|
+
const olho = new THREE.Mesh(geoOlho, matOlho);
|
|
232
|
+
// Object3D.lookAt aponta o +Z para o alvo: o olho fica na frente (+Z).
|
|
233
|
+
olho.position.set(0, 0.05, 0.86);
|
|
234
|
+
const aletaE = new THREE.Mesh(geoAleta, matCorpo);
|
|
235
|
+
aletaE.position.set(-1.02, 0, -0.1);
|
|
236
|
+
aletaE.rotation.z = 0.25;
|
|
237
|
+
const aletaD = aletaE.clone();
|
|
238
|
+
aletaD.position.x = 1.02;
|
|
239
|
+
aletaD.rotation.z = -0.25;
|
|
240
|
+
const antena = new THREE.Mesh(geoAntena, matCorpo);
|
|
241
|
+
antena.position.set(0, 1.1, -0.2);
|
|
242
|
+
grupo.add(corpo, anel, olho, aletaE, aletaD, antena);
|
|
243
|
+
grupo.scale.setScalar(def.raio);
|
|
244
|
+
raiz.add(grupo);
|
|
245
|
+
|
|
246
|
+
const d: DroneInterno = {
|
|
247
|
+
tipo, def, grupo,
|
|
248
|
+
pos: grupo.position,
|
|
249
|
+
vel: new THREE.Vector3(),
|
|
250
|
+
frente: new THREE.Vector3(0, 0, 1),
|
|
251
|
+
vida: def.vida,
|
|
252
|
+
estado: 'inativo',
|
|
253
|
+
get vivo() { return this.estado === 'patrulha' || this.estado === 'combate' || this.estado === 'procura'; },
|
|
254
|
+
corpo, anel, olho, matCorpo,
|
|
255
|
+
ve: false, semVer: 0, ultimoVisto: new THREE.Vector3(),
|
|
256
|
+
pensar: 0, espera: 0, carga: 0, lado: 1, trocaLado: 0,
|
|
257
|
+
alvoPatrulha: new THREE.Vector3(), fase: 0, flash: 0, morteT: 0,
|
|
258
|
+
giro: new THREE.Vector3()
|
|
259
|
+
};
|
|
260
|
+
return d;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const criar = (tipo: TipoDrone, pos: THREE.Vector3): Drone => {
|
|
264
|
+
// Reaproveita um drone inativo do mesmo tipo: nada de alocar no meio da partida.
|
|
265
|
+
let d = drones.find((x) => x.estado === 'inativo' && x.tipo === tipo);
|
|
266
|
+
if (!d) { d = construir(tipo); drones.push(d); }
|
|
267
|
+
d.pos.copy(pos);
|
|
268
|
+
d.vel.set(0, 0, 0);
|
|
269
|
+
d.vida = d.def.vida;
|
|
270
|
+
d.estado = 'patrulha';
|
|
271
|
+
d.ve = false;
|
|
272
|
+
d.semVer = 0;
|
|
273
|
+
// Escalona a percepção: cada drone pensa num quadro diferente.
|
|
274
|
+
d.pensar = Math.random() / tuning.percepcoesPorSegundo;
|
|
275
|
+
d.espera = tuning.reacao + Math.random() * 0.6;
|
|
276
|
+
d.carga = 0;
|
|
277
|
+
d.lado = Math.random() < 0.5 ? -1 : 1;
|
|
278
|
+
d.trocaLado = 2 + Math.random() * 2;
|
|
279
|
+
d.fase = Math.random() * Math.PI * 2;
|
|
280
|
+
d.flash = 0;
|
|
281
|
+
d.alvoPatrulha.copy(pos);
|
|
282
|
+
d.grupo.visible = true;
|
|
283
|
+
d.grupo.rotation.set(0, 0, 0);
|
|
284
|
+
d.corpo.material = d.matCorpo;
|
|
285
|
+
d.olho.material = matOlho;
|
|
286
|
+
return d;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// ------------------------------------------------------------ auxiliares
|
|
290
|
+
const _para = new THREE.Vector3();
|
|
291
|
+
const _desejada = new THREE.Vector3();
|
|
292
|
+
const _lado = new THREE.Vector3();
|
|
293
|
+
const _sonda = new THREE.Vector3();
|
|
294
|
+
const _normal = new THREE.Vector3();
|
|
295
|
+
const _olho = new THREE.Vector3();
|
|
296
|
+
const _alvo = new THREE.Vector3();
|
|
297
|
+
const _mira = new THREE.Vector3();
|
|
298
|
+
const _tmp = new THREE.Vector3();
|
|
299
|
+
|
|
300
|
+
const posicaoDoOlho = (d: DroneInterno, saida: THREE.Vector3) =>
|
|
301
|
+
saida.copy(d.frente).multiplyScalar(d.def.raio * 0.86).add(d.pos);
|
|
302
|
+
|
|
303
|
+
const atirar = (d: DroneInterno, alvo: AlvoDrones, ev: EventosEnxame): void => {
|
|
304
|
+
const pr = projeteis.find((x) => !x.ativo);
|
|
305
|
+
if (!pr) return;
|
|
306
|
+
posicaoDoOlho(d, _olho);
|
|
307
|
+
// Mira com antecipação PARCIAL: acertaria sempre quem anda em linha reta
|
|
308
|
+
// com 100%, e nunca acertaria ninguém com 0%.
|
|
309
|
+
const dist = _olho.distanceTo(alvo.cabeca);
|
|
310
|
+
const t = dist / d.def.velocidadeProjetil;
|
|
311
|
+
_alvo.copy(alvo.cabeca).addScaledVector(alvo.vel, t * 0.55);
|
|
312
|
+
_alvo.y -= 0.25; // mira no peito, não no olho
|
|
313
|
+
_mira.subVectors(_alvo, _olho).normalize();
|
|
314
|
+
const erro = d.def.imprecisao + dist * tuning.imprecisaoPorMetro;
|
|
315
|
+
_mira.x += (Math.random() - 0.5) * 2 * erro;
|
|
316
|
+
_mira.y += (Math.random() - 0.5) * 2 * erro;
|
|
317
|
+
_mira.z += (Math.random() - 0.5) * 2 * erro;
|
|
318
|
+
_mira.normalize();
|
|
319
|
+
pr.ativo = true;
|
|
320
|
+
pr.vida = 3;
|
|
321
|
+
pr.dano = d.def.dano;
|
|
322
|
+
pr.pos.copy(_olho);
|
|
323
|
+
pr.origem.copy(_olho);
|
|
324
|
+
pr.vel.copy(_mira).multiplyScalar(d.def.velocidadeProjetil);
|
|
325
|
+
pr.malha.visible = true;
|
|
326
|
+
pr.malha.lookAt(_tmp.copy(pr.pos).add(pr.vel));
|
|
327
|
+
ev.aoAtirar?.(d, _olho);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/** Distância de um ponto ao eixo do jogador (cilindro vertical pés→cabeça). */
|
|
331
|
+
const distanciaAoJogador = (p: THREE.Vector3, alvo: AlvoDrones): number => {
|
|
332
|
+
const y0 = alvo.pes.y + 0.3;
|
|
333
|
+
const y1 = alvo.cabeca.y;
|
|
334
|
+
const y = Math.max(y0, Math.min(y1, p.y));
|
|
335
|
+
return Math.hypot(p.x - alvo.pes.x, p.y - y, p.z - alvo.pes.z);
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// --------------------------------------------------------------- update
|
|
339
|
+
const atualizar = (
|
|
340
|
+
passo: number, alvo: AlvoDrones, caixas: readonly THREE.Box3[], limite: number, ev: EventosEnxame
|
|
341
|
+
): void => {
|
|
342
|
+
for (const d of drones) {
|
|
343
|
+
if (d.estado === 'inativo') continue;
|
|
344
|
+
|
|
345
|
+
// ---- morrendo: cai girando e explode no chão
|
|
346
|
+
if (d.estado === 'morrendo') {
|
|
347
|
+
d.morteT -= passo;
|
|
348
|
+
d.vel.y -= 14 * passo;
|
|
349
|
+
d.pos.addScaledVector(d.vel, passo);
|
|
350
|
+
d.grupo.rotation.x += d.giro.x * passo;
|
|
351
|
+
d.grupo.rotation.z += d.giro.z * passo;
|
|
352
|
+
if (d.pos.y <= d.def.raio * 0.6 || d.morteT <= 0) {
|
|
353
|
+
d.estado = 'inativo';
|
|
354
|
+
d.grupo.visible = false;
|
|
355
|
+
ev.aoExplodir?.(d.pos, d);
|
|
356
|
+
}
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const def = d.def;
|
|
361
|
+
d.fase += passo;
|
|
362
|
+
if (d.flash > 0) {
|
|
363
|
+
d.flash -= passo;
|
|
364
|
+
d.corpo.material = d.flash > 0 ? matFlash : d.matCorpo;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ---- percepção escalonada
|
|
368
|
+
d.pensar -= passo;
|
|
369
|
+
if (d.pensar <= 0) {
|
|
370
|
+
d.pensar += 1 / tuning.percepcoesPorSegundo;
|
|
371
|
+
const dist = d.pos.distanceTo(alvo.cabeca);
|
|
372
|
+
d.ve = dist <= def.alcanceVisao && linhaLivre(d.pos, alvo.cabeca, caixas);
|
|
373
|
+
if (d.ve) {
|
|
374
|
+
d.ultimoVisto.copy(alvo.cabeca);
|
|
375
|
+
d.semVer = 0;
|
|
376
|
+
if (d.estado !== 'combate') {
|
|
377
|
+
d.estado = 'combate';
|
|
378
|
+
d.espera = Math.max(d.espera, tuning.reacao * (0.7 + Math.random() * 0.6));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (!d.ve) d.semVer += passo;
|
|
383
|
+
if (d.estado === 'combate' && d.semVer > tuning.memoria) d.estado = 'procura';
|
|
384
|
+
if (d.estado === 'procura' && d.pos.distanceTo(d.ultimoVisto) < 2.2) {
|
|
385
|
+
d.estado = 'patrulha';
|
|
386
|
+
d.alvoPatrulha.copy(d.pos);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// ---- para onde quer ir
|
|
390
|
+
let alturaAlvo = 2.2;
|
|
391
|
+
_desejada.set(0, 0, 0);
|
|
392
|
+
if (d.estado === 'combate') {
|
|
393
|
+
_para.subVectors(alvo.cabeca, d.pos);
|
|
394
|
+
_para.y = 0;
|
|
395
|
+
const distXZ = Math.max(0.001, _para.length());
|
|
396
|
+
_para.divideScalar(distXZ);
|
|
397
|
+
// Aproxima ou recua até a distância preferida, e orbita de lado.
|
|
398
|
+
const radial = distXZ > def.distanciaPreferida + 2 ? 1 : distXZ < def.distanciaPreferida - 2 ? -1 : 0;
|
|
399
|
+
_lado.set(-_para.z, 0, _para.x).multiplyScalar(d.lado);
|
|
400
|
+
_desejada.addScaledVector(_para, radial).addScaledVector(_lado, 0.85);
|
|
401
|
+
d.trocaLado -= passo;
|
|
402
|
+
if (d.trocaLado <= 0) { d.lado = -d.lado; d.trocaLado = 2 + Math.random() * 2.5; }
|
|
403
|
+
alturaAlvo = alvo.cabeca.y + 0.6 + Math.sin(d.fase * 1.3) * 0.6;
|
|
404
|
+
} else {
|
|
405
|
+
const destino = d.estado === 'procura' ? d.ultimoVisto : d.alvoPatrulha;
|
|
406
|
+
if (d.estado === 'patrulha' && d.pos.distanceTo(d.alvoPatrulha) < 2) {
|
|
407
|
+
d.alvoPatrulha.set(
|
|
408
|
+
(Math.random() * 2 - 1) * limite * 0.8,
|
|
409
|
+
1.8 + Math.random() * 1.2,
|
|
410
|
+
(Math.random() * 2 - 1) * limite * 0.8
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
_desejada.subVectors(destino, d.pos);
|
|
414
|
+
_desejada.y = 0;
|
|
415
|
+
alturaAlvo = destino.y;
|
|
416
|
+
}
|
|
417
|
+
if (_desejada.lengthSq() > 1e-6) _desejada.normalize();
|
|
418
|
+
_desejada.multiplyScalar(d.estado === 'patrulha' ? def.velocidade * 0.5 : def.velocidade);
|
|
419
|
+
|
|
420
|
+
// ---- separação: drones não se empilham
|
|
421
|
+
for (const o of drones) {
|
|
422
|
+
if (o === d || !o.vivo) continue;
|
|
423
|
+
_tmp.subVectors(d.pos, o.pos);
|
|
424
|
+
const dist2 = _tmp.lengthSq();
|
|
425
|
+
if (dist2 > tuning.separacao * tuning.separacao || dist2 < 1e-6) continue;
|
|
426
|
+
_desejada.addScaledVector(_tmp, (def.velocidade * 0.8) / dist2);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// ---- desvio: sonda à frente; parede no caminho empurra pela normal
|
|
430
|
+
const velH = Math.hypot(d.vel.x, d.vel.z);
|
|
431
|
+
if (velH > 0.3) {
|
|
432
|
+
_sonda.set(d.vel.x / velH, 0, d.vel.z / velH);
|
|
433
|
+
for (const c of caixas) {
|
|
434
|
+
const t = raioCaixa(d.pos, _sonda, c, 1.6 + def.raio, _normal);
|
|
435
|
+
if (t !== null) {
|
|
436
|
+
_desejada.addScaledVector(_normal, def.velocidade * 1.2);
|
|
437
|
+
if (d.estado === 'combate') d.lado = -d.lado; // orbitar para o outro lado
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Vertical separada: sobe/desce até a altura-alvo.
|
|
444
|
+
alturaAlvo = THREE.MathUtils.clamp(alturaAlvo, tuning.alturaMinima, tuning.alturaMaxima);
|
|
445
|
+
_desejada.y = THREE.MathUtils.clamp((alturaAlvo - d.pos.y) * 2, -2.5, 2.5);
|
|
446
|
+
|
|
447
|
+
// ---- aceleração limitada (anda dirigindo, não teletransportando)
|
|
448
|
+
_tmp.subVectors(_desejada, d.vel);
|
|
449
|
+
const dif = _tmp.length();
|
|
450
|
+
const acel = def.aceleracao * passo;
|
|
451
|
+
if (dif > acel) _tmp.multiplyScalar(acel / dif);
|
|
452
|
+
d.vel.add(_tmp);
|
|
453
|
+
d.pos.addScaledVector(d.vel, passo);
|
|
454
|
+
if (empurrarEsfera(d.pos, def.raio, caixas)) d.vel.multiplyScalar(0.85);
|
|
455
|
+
d.pos.x = THREE.MathUtils.clamp(d.pos.x, -limite + def.raio, limite - def.raio);
|
|
456
|
+
d.pos.z = THREE.MathUtils.clamp(d.pos.z, -limite + def.raio, limite - def.raio);
|
|
457
|
+
d.pos.y = THREE.MathUtils.clamp(d.pos.y, tuning.alturaMinima, tuning.alturaMaxima);
|
|
458
|
+
|
|
459
|
+
// ---- olhar: no jogador em combate; senão, para onde voa
|
|
460
|
+
if (d.estado === 'combate' && d.ve) _alvo.subVectors(alvo.cabeca, d.pos);
|
|
461
|
+
else _alvo.set(d.vel.x, 0, d.vel.z);
|
|
462
|
+
if (_alvo.lengthSq() > 1e-4) {
|
|
463
|
+
_alvo.normalize();
|
|
464
|
+
d.frente.lerp(_alvo, 1 - Math.exp(-passo * 7)).normalize();
|
|
465
|
+
}
|
|
466
|
+
d.grupo.lookAt(_tmp.copy(d.pos).add(d.frente));
|
|
467
|
+
d.anel.rotation.z += passo * (2.5 + velH * 0.6);
|
|
468
|
+
|
|
469
|
+
// ---- tiro: carga visível, depois o disparo
|
|
470
|
+
const podeAtirar = d.estado === 'combate' && d.ve && d.pos.distanceTo(alvo.cabeca) <= def.alcanceTiro;
|
|
471
|
+
if (d.carga > 0) {
|
|
472
|
+
if (!podeAtirar) {
|
|
473
|
+
// Perdeu a visada no meio da carga: não atira às cegas.
|
|
474
|
+
d.carga = 0;
|
|
475
|
+
d.espera = 0.4;
|
|
476
|
+
d.olho.material = matOlho;
|
|
477
|
+
d.olho.scale.setScalar(1);
|
|
478
|
+
} else {
|
|
479
|
+
d.carga -= passo;
|
|
480
|
+
const k = 1 - d.carga / def.tempoCarga;
|
|
481
|
+
d.olho.scale.setScalar(1 + k * 0.6);
|
|
482
|
+
if (d.carga <= 0) {
|
|
483
|
+
d.olho.material = matOlho;
|
|
484
|
+
d.olho.scale.setScalar(1);
|
|
485
|
+
atirar(d, alvo, ev);
|
|
486
|
+
d.espera = def.intervaloTiro * (0.75 + Math.random() * 0.5);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
} else if (podeAtirar) {
|
|
490
|
+
d.espera -= passo;
|
|
491
|
+
if (d.espera <= 0) {
|
|
492
|
+
d.carga = def.tempoCarga;
|
|
493
|
+
d.olho.material = matOlhoCarga;
|
|
494
|
+
ev.aoCarregar?.(d);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// ---- projéteis
|
|
500
|
+
for (const pr of projeteis) {
|
|
501
|
+
if (!pr.ativo) continue;
|
|
502
|
+
pr.vida -= passo;
|
|
503
|
+
const passoLen = pr.vel.length() * passo;
|
|
504
|
+
_sonda.copy(pr.vel).normalize();
|
|
505
|
+
let parou = pr.vida <= 0;
|
|
506
|
+
|
|
507
|
+
// Jogador primeiro: três amostras ao longo do trecho deste passo.
|
|
508
|
+
if (!parou) {
|
|
509
|
+
for (const k of AMOSTRAS) {
|
|
510
|
+
_tmp.copy(pr.pos).addScaledVector(_sonda, passoLen * k);
|
|
511
|
+
if (distanciaAoJogador(_tmp, alvo) <= alvo.raio + tuning.folgaAcerto) {
|
|
512
|
+
ev.aoAcertarJogador(pr.dano, pr.origem);
|
|
513
|
+
parou = true;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
// Cenário: o primeiro obstáculo no trecho.
|
|
519
|
+
if (!parou) {
|
|
520
|
+
let melhor = passoLen;
|
|
521
|
+
let bateu = false;
|
|
522
|
+
for (const c of caixas) {
|
|
523
|
+
const t = raioCaixa(pr.pos, _sonda, c, melhor, _lado);
|
|
524
|
+
if (t !== null && t < melhor) { melhor = t; bateu = true; _normal.copy(_lado); }
|
|
525
|
+
}
|
|
526
|
+
if (!bateu && pr.pos.y + _sonda.y * passoLen <= 0) {
|
|
527
|
+
melhor = _sonda.y < 0 ? -pr.pos.y / _sonda.y : 0;
|
|
528
|
+
_normal.set(0, 1, 0);
|
|
529
|
+
bateu = true;
|
|
530
|
+
}
|
|
531
|
+
if (bateu) {
|
|
532
|
+
_tmp.copy(pr.pos).addScaledVector(_sonda, melhor);
|
|
533
|
+
ev.aoImpacto?.(_tmp, _normal);
|
|
534
|
+
parou = true;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (parou) {
|
|
538
|
+
pr.ativo = false;
|
|
539
|
+
pr.malha.visible = false;
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
pr.pos.addScaledVector(pr.vel, passo);
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
// ------------------------------------------------------------- acerto
|
|
547
|
+
const _c = new THREE.Vector3();
|
|
548
|
+
const raioContra = (o: THREE.Vector3, dir: THREE.Vector3, max: number): AcertoDrone | null => {
|
|
549
|
+
let melhor: AcertoDrone | null = null;
|
|
550
|
+
let limiteDist = max;
|
|
551
|
+
for (const d of drones) {
|
|
552
|
+
if (!d.vivo) continue;
|
|
553
|
+
// Olho primeiro: se o raio passa pelo olho, é crítico mesmo que também
|
|
554
|
+
// atravesse o corpo logo atrás.
|
|
555
|
+
posicaoDoOlho(d, _c);
|
|
556
|
+
const tOlho = raioEsfera(o, dir, _c, d.def.raio * 0.36, limiteDist);
|
|
557
|
+
const tCorpo = raioEsfera(o, dir, d.pos, d.def.raio, limiteDist);
|
|
558
|
+
const t = tOlho ?? tCorpo;
|
|
559
|
+
if (t === null) continue;
|
|
560
|
+
limiteDist = t;
|
|
561
|
+
melhor = { drone: d, distancia: t, critico: tOlho !== null };
|
|
562
|
+
}
|
|
563
|
+
return melhor;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
const ferir = (drone: Drone, dano: number, direcao: THREE.Vector3, ev: EventosEnxame): boolean => {
|
|
567
|
+
const d = drone as DroneInterno;
|
|
568
|
+
if (!d.vivo) return false;
|
|
569
|
+
d.vida -= dano;
|
|
570
|
+
d.flash = 0.07;
|
|
571
|
+
d.corpo.material = matFlash;
|
|
572
|
+
d.vel.addScaledVector(direcao, dano * tuning.empurraoPorDano);
|
|
573
|
+
// Levou tiro sem ver o atirador: vira para procurar de onde veio.
|
|
574
|
+
if (d.estado !== 'combate') {
|
|
575
|
+
d.estado = 'procura';
|
|
576
|
+
d.ultimoVisto.copy(d.pos).addScaledVector(direcao, -8);
|
|
577
|
+
}
|
|
578
|
+
if (d.vida > 0) return false;
|
|
579
|
+
d.estado = 'morrendo';
|
|
580
|
+
d.morteT = tuning.tempoMorte;
|
|
581
|
+
d.vel.y = 2.5;
|
|
582
|
+
d.giro.set((Math.random() - 0.5) * 8, 0, (Math.random() - 0.5) * 8);
|
|
583
|
+
d.olho.material = matOlho;
|
|
584
|
+
d.olho.scale.setScalar(1);
|
|
585
|
+
ev.aoMorrer?.(d);
|
|
586
|
+
return true;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
return {
|
|
590
|
+
raiz,
|
|
591
|
+
get drones() { return drones; },
|
|
592
|
+
vivos: () => drones.reduce((n, d) => n + (d.vivo ? 1 : 0), 0),
|
|
593
|
+
criar,
|
|
594
|
+
atualizar,
|
|
595
|
+
raioContra,
|
|
596
|
+
ferir,
|
|
597
|
+
aplicarPaleta,
|
|
598
|
+
limpar() {
|
|
599
|
+
for (const d of drones) { d.estado = 'inativo'; d.grupo.visible = false; }
|
|
600
|
+
for (const pr of projeteis) { pr.ativo = false; pr.malha.visible = false; }
|
|
601
|
+
},
|
|
602
|
+
dispose() {
|
|
603
|
+
[geoCorpo, geoAnel, geoOlho, geoAleta, geoAntena, geoProj].forEach((g) => g.dispose());
|
|
604
|
+
[matCorpoBatedor, matCorpoPesado, matAnelBatedor, matAnelPesado, matOlho, matOlhoCarga, matFlash, matProj]
|
|
605
|
+
.forEach((m) => m.dispose());
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
}
|