import { BaseZoneScene } from './BaseZoneScene.js?v=20260427c';
import { ZONE_DEFINITIONS } from '../systems/session.js?v=20260427c';
export class Zone3Scene extends BaseZoneScene {
constructor() {
super('Zone3Scene', ZONE_DEFINITIONS[2]);
}
buildHorizontalLevel() {
super.buildHorizontalLevel();
for (let x = 520; x < this.levelWidth - 360; x += 620) {
this.addShopItem(x, this.scale.height - 185, 'Shield', 45);
this.addShopItem(x + 190, this.scale.height - 245, 'Double Jump', 65);
}
}
addShopItem(x, y, label, price) {
const card = this.add.rectangle(x, y, 150, 74, 0xffffff, 0.96).setStrokeStyle(2, 0xff3d00, 0.8);
this.add.text(x, y - 12, `${label}\n${price}+ cookies`, {
fontFamily: 'system-ui',
fontSize: '12px',
color: '#111',
fontStyle: '700',
align: 'center',
}).setOrigin(0.5);
this.physics.add.existing(card, true);
this.time.delayedCall(50, () => {
if (!this.player) return;
this.physics.add.overlap(this.player.sprite, card, () => {
if (card.used) return;
card.used = true;
this.marketplacePurchase(label, price);
card.setFillStyle(0xdddddd, 0.6);
});
});
}
spawnZoneThreats(time) {
if (!this.nextAdAt) this.nextAdAt = time + 1200;
if (time < this.nextAdAt) return;
const fewerAds = this.session.adblock.detected === true;
this.nextAdAt = time + (fewerAds ? 2500 : 1050);
const place = this.session.geo.city && this.session.geo.city !== 'Unknown' ? this.session.geo.city : this.session.device.timezone || 'your area';
const label = this.session.consent.marketing
? Phaser.Utils.Array.GetRandom([`HOT DEALS\n${place}`, `${this.session.device.os || 'DEVICE'} SALE`, 'ONLY 03:14 LEFT'])
: 'GENERIC AD';
this.spawnAd(label, 0xff004d);
}
zonePrompts() {
return [
{
at: 10,
key: 'Share location',
title: 'Share your location?',
copy: 'Optimize local offers, smoother routes, and suspiciously relevant billboards.',
accept: 'Share',
decline: 'No thanks',
onAccept: () => {
this.session.flags.sharedLocation = true;
this.session.currencies.cookies += 40;
this.algorithm.say(`Great. ${this.session.geo.city || 'Your area'} is full of opportunities.`);
},
},
];
}
}