feat(traps): activation VFX/SFX, explosion effect, and help section
Wire mimic/pit/arrow/laser media on activate, poison/explosion via effects, and document the scene editor and traps in Instructions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -52,7 +52,8 @@ export function minDistSqEffectToPoint(inst: EffectInstance, p: { x: number; y:
|
||||
case 'scorch':
|
||||
case 'ice':
|
||||
case 'shadow':
|
||||
case 'poisonCloud': {
|
||||
case 'poisonCloud':
|
||||
case 'explosion': {
|
||||
const dx = inst.at.x - p.x;
|
||||
const dy = inst.at.y - p.y;
|
||||
return dx * dx + dy * dy;
|
||||
@@ -67,7 +68,8 @@ function eraseHitThresholdSq(inst: EffectInstance, toolRadiusN: number): number
|
||||
inst.type === 'scorch' ||
|
||||
inst.type === 'ice' ||
|
||||
inst.type === 'shadow' ||
|
||||
inst.type === 'poisonCloud'
|
||||
inst.type === 'poisonCloud' ||
|
||||
inst.type === 'explosion'
|
||||
) {
|
||||
const r = toolRadiusN + inst.radiusN;
|
||||
return r * r;
|
||||
|
||||
@@ -7,6 +7,7 @@ export type EffectToolType =
|
||||
| 'lightning'
|
||||
| 'sunbeam'
|
||||
| 'poisonCloud'
|
||||
| 'explosion'
|
||||
| 'freeze'
|
||||
| 'exploreBrush'
|
||||
| 'eraser';
|
||||
@@ -20,6 +21,7 @@ export type EffectInstanceType =
|
||||
| 'lightning'
|
||||
| 'sunbeam'
|
||||
| 'poisonCloud'
|
||||
| 'explosion'
|
||||
| 'freeze'
|
||||
| 'scorch'
|
||||
| 'ice'
|
||||
@@ -104,6 +106,15 @@ export type PoisonCloudInstance = EffectInstanceBase & {
|
||||
lifetimeMs: number;
|
||||
};
|
||||
|
||||
/** «Взрыв» — one-shot webm в точке удара (тот же ассет, что у ловушки). */
|
||||
export type ExplosionInstance = EffectInstanceBase & {
|
||||
type: 'explosion';
|
||||
at: { x: number; y: number };
|
||||
radiusN: number;
|
||||
intensity: number;
|
||||
lifetimeMs: number;
|
||||
};
|
||||
|
||||
export type FreezeInstance = EffectInstanceBase & {
|
||||
type: 'freeze';
|
||||
at: { x: number; y: number };
|
||||
@@ -148,6 +159,7 @@ export type EffectInstance =
|
||||
| LightningInstance
|
||||
| SunbeamInstance
|
||||
| PoisonCloudInstance
|
||||
| ExplosionInstance
|
||||
| FreezeInstance
|
||||
| ScorchInstance
|
||||
| IceInstance
|
||||
|
||||
Reference in New Issue
Block a user