Files
Alien_Sniper/temp/programming/packer-driver/targets/preview/chunks/f8/f8f691aa4e9ee54c9f93800a6a699c64dce1eca4.js
T
2026-07-14 11:44:07 +08:00

464 lines
19 KiB
JavaScript

System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6"], function (_export, _context) {
"use strict";
var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Button, instantiate, Label, Node, Prefab, randomRange, Tween, tween, Vec3, LocalSaveMgr, AudioMgr, PanelBase, AssetController, GameController, SdkMgr, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _class3, _crd, ccclass, property, WinPanel;
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
function _reportPossibleCrUseOfLocalSaveMgr(extras) {
_reporterNs.report("LocalSaveMgr", "../framework/data/LocalSaveMgr", _context.meta, extras);
}
function _reportPossibleCrUseOfAudioMgr(extras) {
_reporterNs.report("AudioMgr", "../framework/audio/AudioMgr", _context.meta, extras);
}
function _reportPossibleCrUseOfPanelBase(extras) {
_reporterNs.report("PanelBase", "../framework/ui/PanelBase", _context.meta, extras);
}
function _reportPossibleCrUseOfAssetController(extras) {
_reporterNs.report("AssetController", "../AssetController", _context.meta, extras);
}
function _reportPossibleCrUseOfGameController(extras) {
_reporterNs.report("GameController", "../GameController", _context.meta, extras);
}
function _reportPossibleCrUseOfBattleResult(extras) {
_reporterNs.report("BattleResult", "../BattleLevel", _context.meta, extras);
}
function _reportPossibleCrUseOfSdkMgr(extras) {
_reporterNs.report("SdkMgr", "../framework/sdk/SdkMgr", _context.meta, extras);
}
return {
setters: [function (_unresolved_) {
_reporterNs = _unresolved_;
}, function (_cc) {
_cclegacy = _cc.cclegacy;
__checkObsolete__ = _cc.__checkObsolete__;
__checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
_decorator = _cc._decorator;
Button = _cc.Button;
instantiate = _cc.instantiate;
Label = _cc.Label;
Node = _cc.Node;
Prefab = _cc.Prefab;
randomRange = _cc.randomRange;
Tween = _cc.Tween;
tween = _cc.tween;
Vec3 = _cc.Vec3;
}, function (_unresolved_2) {
LocalSaveMgr = _unresolved_2.LocalSaveMgr;
}, function (_unresolved_3) {
AudioMgr = _unresolved_3.AudioMgr;
}, function (_unresolved_4) {
PanelBase = _unresolved_4.PanelBase;
}, function (_unresolved_5) {
AssetController = _unresolved_5.AssetController;
}, function (_unresolved_6) {
GameController = _unresolved_6.GameController;
}, function (_unresolved_7) {
SdkMgr = _unresolved_7.SdkMgr;
}],
execute: function () {
_crd = true;
_cclegacy._RF.push({}, "614eaqzNRhDUbkVLRNfRlH0", "WinPanel", undefined);
__checkObsolete__(['_decorator', 'Button', 'Component', 'instantiate', 'Label', 'math', 'Node', 'Prefab', 'randomRange', 'Sprite', 'Tween', 'tween', 'Vec3']);
({
ccclass,
property
} = _decorator);
_export("WinPanel", WinPanel = (_dec = ccclass('WinPanel'), _dec2 = property(Node), _dec3 = property(Button), _dec4 = property(Button), _dec5 = property(Label), _dec6 = property(Label), _dec7 = property(Prefab), _dec8 = property(Label), _dec9 = property(Label), _dec10 = property(Label), _dec11 = property(Label), _dec12 = property(Node), _dec13 = property(Label), _dec14 = property(Label), _dec(_class = (_class2 = (_class3 = class WinPanel extends (_crd && PanelBase === void 0 ? (_reportPossibleCrUseOfPanelBase({
error: Error()
}), PanelBase) : PanelBase) {
constructor() {
super(...arguments);
_initializerDefineProperty(this, "pointer", _descriptor, this);
// 指针节点
_initializerDefineProperty(this, "amplitude", _descriptor2, this);
// 运动幅度
_initializerDefineProperty(this, "speed", _descriptor3, this);
// 运动速度
_initializerDefineProperty(this, "rewardBtn", _descriptor4, this);
_initializerDefineProperty(this, "continueBtn", _descriptor5, this);
_initializerDefineProperty(this, "remainTimer", _descriptor6, this);
_initializerDefineProperty(this, "killEnemyCount", _descriptor7, this);
_initializerDefineProperty(this, "flyMoneyPrefab", _descriptor8, this);
_initializerDefineProperty(this, "coinCount", _descriptor9, this);
_initializerDefineProperty(this, "rewardCoin", _descriptor10, this);
_initializerDefineProperty(this, "rewardTimerCoin", _descriptor11, this);
_initializerDefineProperty(this, "rewardKillCoin", _descriptor12, this);
_initializerDefineProperty(this, "flyMoneyContent", _descriptor13, this);
_initializerDefineProperty(this, "coinLabel", _descriptor14, this);
_initializerDefineProperty(this, "continueCoinLabel", _descriptor15, this);
this.time = 0;
this.runingPoint = false;
this.rewardDouble = 1;
this.curResult = void 0;
this.winTween1 = null;
this.winTween2 = null;
this.winTween3 = null;
this.pointPos = void 0;
}
onLoad() {
WinPanel.instance = this;
this.rewardBtn.node.on(Button.EventType.CLICK, this.onClickRewardBtn, this);
this.continueBtn.node.on(Button.EventType.CLICK, this.onClickContinueBtn, this);
}
onClickRewardBtn() {
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
error: Error()
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
error: Error()
}), AssetController) : AssetController).instance.click);
if (Math.abs(this.pointPos) < 50) {
this.rewardDouble = 5;
} else if (Math.abs(this.pointPos) < 150) {
this.rewardDouble = 4;
} else if (Math.abs(this.pointPos) < 250) {
this.rewardDouble = 3;
} else if (Math.abs(this.pointPos) < 350) {
this.rewardDouble = 2;
} else if (Math.abs(this.pointPos) < 450) {
this.rewardDouble = 1;
}
this.runingPoint = false;
(_crd && SdkMgr === void 0 ? (_reportPossibleCrUseOfSdkMgr({
error: Error()
}), SdkMgr) : SdkMgr).instance.playerRewardAds(() => {
var addPoint = Math.ceil(this.curResult.coinCount * this.rewardDouble);
var fromeMoney = (_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
error: Error()
}), LocalSaveMgr) : LocalSaveMgr).instance.playerData.coin;
(_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
error: Error()
}), LocalSaveMgr) : LocalSaveMgr).instance.addCoin(addPoint);
var endMoney = (_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
error: Error()
}), LocalSaveMgr) : LocalSaveMgr).instance.playerData.coin;
this.flyMoney(fromeMoney, endMoney);
});
}
onClickContinueBtn() {
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
error: Error()
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
error: Error()
}), AssetController) : AssetController).instance.click);
(_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
error: Error()
}), GameController) : GameController).getInstance().backMain();
(_crd && SdkMgr === void 0 ? (_reportPossibleCrUseOfSdkMgr({
error: Error()
}), SdkMgr) : SdkMgr).instance.showInterstitial();
}
backMain() {
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
error: Error()
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
error: Error()
}), AssetController) : AssetController).instance.click);
(_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
error: Error()
}), GameController) : GameController).getInstance().backMain();
}
start() {
this.time = 0;
}
refresh() {
var result = (_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
error: Error()
}), GameController) : GameController).getInstance().curLevel.levelResult;
this.curResult = result;
(_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
error: Error()
}), LocalSaveMgr) : LocalSaveMgr).instance.addCoin(result.coinCount);
this.killEnemyCount.string = result.enemyCount.toString();
this.remainTimer.string = result.timer.toString();
this.coinLabel.string = (_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
error: Error()
}), LocalSaveMgr) : LocalSaveMgr).instance.playerData.coin.toString();
this.coinCount.string = "0";
var startValue = 0;
var endValue = result.coinCount;
var duration = 1; // 1秒
var startValue2 = 0;
var endValue2 = result.timerCoin;
var startValue3 = 0;
var endValue3 = result.enemyCoin;
this.continueCoinLabel.string = result.coinCount.toString();
this.winTween1 = new Tween({
value: startValue
}).to(duration, {
value: endValue
}, {
onUpdate: (target, ratio) => {
// 在每一帧更新时调用
var currentValue = Math.floor(target.value);
this.coinCount.string = currentValue.toString();
}
}).start();
this.winTween2 = new Tween({
value: startValue2
}).to(duration, {
value: endValue2
}, {
onUpdate: (target, ratio) => {
// 在每一帧更新时调用
var currentValue = Math.floor(target.value);
this.rewardTimerCoin.string = currentValue.toString();
}
}).start();
this.winTween3 = new Tween({
value: startValue3
}).to(duration, {
value: endValue3
}, {
onUpdate: (target, ratio) => {
// 在每一帧更新时调用
var currentValue = Math.floor(target.value);
this.rewardKillCoin.string = currentValue.toString();
}
}).start();
this.runPoint();
}
flyMoney(fromMoney, endMoney) {
var _this = this;
this.rewardBtn.interactable = false;
this.continueBtn.interactable = false;
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
error: Error()
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
error: Error()
}), AssetController) : AssetController).instance.getCoin);
var _loop = function _loop() {
var item = instantiate(_this.flyMoneyPrefab);
item.setParent(_this.flyMoneyContent);
item.setPosition(_this.rewardBtn.node.getPosition());
var delay = index * 0.1;
tween(item).by(0.3, {
position: new Vec3(randomRange(-150, 150), randomRange(-150, 150), 0)
}).delay(delay).to(0.6, {
worldPosition: _this.coinLabel.node.getWorldPosition()
}).call(() => {
item.destroy();
}).start();
};
for (var index = 0; index < 10; index++) {
_loop();
}
new Tween({
value: fromMoney
}).delay(0.9).to(1, {
value: endMoney
}, {
onUpdate: (target, ratio) => {
// 在每一帧更新时调用
var currentValue = Math.floor(target.value);
this.coinLabel.string = currentValue.toString();
}
}).call(() => {
// this.rewardBtn.node.active = false
// this.continueBtn.interactable = true
this.backMain();
}).start();
}
runPoint() {
this.runingPoint = true;
}
update(dt) {
if (!this.runingPoint) return; // 更新时间
this.time += dt * this.speed; // 使用正弦函数计算指针的位置
var x = this.amplitude * Math.sin(this.time);
this.pointPos = x; // 设置指针的位置
this.pointer.setPosition(new Vec3(x, 65, 0));
if (Math.abs(x) < 93.079) {
this.rewardDouble = 5;
} else if (Math.abs(x) < 224.786) {
this.rewardDouble = 4;
} else if (Math.abs(x) < 341.818) {
this.rewardDouble = 3;
} else if (Math.abs(x) < 430) {
this.rewardDouble = 2;
}
this.rewardCoin.string = Math.ceil(this.curResult.coinCount * this.rewardDouble).toString();
}
onDestroy() {
this.winTween1.stop();
this.winTween2.stop();
this.winTween3.stop();
}
onOpen() {
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
error: Error()
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
error: Error()
}), AssetController) : AssetController).instance.win);
WinPanel.instance.time = 0;
WinPanel.instance.refresh();
}
}, _class3.instance = void 0, _class3), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "pointer", [_dec2], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "amplitude", [property], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return 450;
}
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "speed", [property], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return 2;
}
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "rewardBtn", [_dec3], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "continueBtn", [_dec4], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "remainTimer", [_dec5], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "killEnemyCount", [_dec6], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "flyMoneyPrefab", [_dec7], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "coinCount", [_dec8], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "rewardCoin", [_dec9], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "rewardTimerCoin", [_dec10], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "rewardKillCoin", [_dec11], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "flyMoneyContent", [_dec12], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "coinLabel", [_dec13], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "continueCoinLabel", [_dec14], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
})), _class2)) || _class));
_cclegacy._RF.pop();
_crd = false;
}
};
});
//# sourceMappingURL=f8f691aa4e9ee54c9f93800a6a699c64dce1eca4.js.map