|
@@ -1347,6 +1347,7 @@ var laya = (function (exports) {
|
|
this.BossHp = Number(config[this.Id - 1].boss_HP);
|
|
this.BossHp = Number(config[this.Id - 1].boss_HP);
|
|
this.Goal = Number(config[this.Id - 1].goal);
|
|
this.Goal = Number(config[this.Id - 1].goal);
|
|
this.Modulus = Number(config[this.Id - 1].modulus);
|
|
this.Modulus = Number(config[this.Id - 1].modulus);
|
|
|
|
+ this.isboss = Number(config[this.Id - 1].boss);
|
|
let GradeArray = [];
|
|
let GradeArray = [];
|
|
let num = 0;
|
|
let num = 0;
|
|
let stage = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
let stage = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
@@ -1425,6 +1426,7 @@ var laya = (function (exports) {
|
|
GameManager.Instance.fencerightpos = 0;
|
|
GameManager.Instance.fencerightpos = 0;
|
|
GameManager.Instance.treeleftpos = 0;
|
|
GameManager.Instance.treeleftpos = 0;
|
|
GameManager.Instance.treerightpos = 0;
|
|
GameManager.Instance.treerightpos = 0;
|
|
|
|
+ GameManager.Instance.GuideKill = 0;
|
|
if (this.curstage)
|
|
if (this.curstage)
|
|
this.ClearStageResources();
|
|
this.ClearStageResources();
|
|
var level = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
var level = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
@@ -1567,7 +1569,8 @@ var laya = (function (exports) {
|
|
treepos += 3;
|
|
treepos += 3;
|
|
}
|
|
}
|
|
let STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
let STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
- if (STAGE > 2) {
|
|
|
|
|
|
+ let boss = _stage.isboss == 1 ? true : false;
|
|
|
|
+ if (boss) {
|
|
let EndZ = _stage.curgrades[_stage.curgrades.length - 1].endpointpoint.z * 1.2;
|
|
let EndZ = _stage.curgrades[_stage.curgrades.length - 1].endpointpoint.z * 1.2;
|
|
let EndX = GameTools.RandomANumber(-2, 2);
|
|
let EndX = GameTools.RandomANumber(-2, 2);
|
|
GameManager.Instance.CreatBoss(new Vector3$3(EndX, 0, EndZ));
|
|
GameManager.Instance.CreatBoss(new Vector3$3(EndX, 0, EndZ));
|
|
@@ -1653,9 +1656,11 @@ var laya = (function (exports) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Show() {
|
|
Show() {
|
|
|
|
+ WXSDK.AldEvent("进入游戏内界面");
|
|
let stage = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
let stage = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
|
|
if (stage == 1) {
|
|
if (stage == 1) {
|
|
- this.Guide1.visible = false;
|
|
|
|
|
|
+ this.Guide1.visible = true;
|
|
|
|
+ this.ani1.play(0, true);
|
|
this.Guide2.visible = false;
|
|
this.Guide2.visible = false;
|
|
this.Guide3.visible = false;
|
|
this.Guide3.visible = false;
|
|
this.Guide4.visible = false;
|
|
this.Guide4.visible = false;
|
|
@@ -2050,7 +2055,6 @@ var laya = (function (exports) {
|
|
else
|
|
else
|
|
this.instance = ShopView.Instance;
|
|
this.instance = ShopView.Instance;
|
|
this._data = (this.selfobj.dataSource);
|
|
this._data = (this.selfobj.dataSource);
|
|
- ShopView.Instance._data = this._data;
|
|
|
|
var _id = this._data.id;
|
|
var _id = this._data.id;
|
|
var usingId = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["1"];
|
|
var usingId = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["1"];
|
|
var usingId2 = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"];
|
|
var usingId2 = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"];
|
|
@@ -2060,30 +2064,45 @@ var laya = (function (exports) {
|
|
this._skin.rotation = 0;
|
|
this._skin.rotation = 0;
|
|
if (usingId == _id || usingId2 == _id) {
|
|
if (usingId == _id || usingId2 == _id) {
|
|
this.skinGetForType = SkinGetForType.Using;
|
|
this.skinGetForType = SkinGetForType.Using;
|
|
- this.ShowUi();
|
|
|
|
|
|
+ this.showui();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (hasequip) {
|
|
if (hasequip) {
|
|
this.skinGetForType = SkinGetForType.Geted;
|
|
this.skinGetForType = SkinGetForType.Geted;
|
|
- this.ShowUi();
|
|
|
|
|
|
+ this.showui();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (require_type == 2) {
|
|
if (require_type == 2) {
|
|
this.skinGetForType = SkinGetForType.Bycoin;
|
|
this.skinGetForType = SkinGetForType.Bycoin;
|
|
- this.ShowUi();
|
|
|
|
|
|
+ this.showui();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (require_type == 4) {
|
|
if (require_type == 4) {
|
|
this.skinGetForType = SkinGetForType.GetByActivity;
|
|
this.skinGetForType = SkinGetForType.GetByActivity;
|
|
- this.ShowUi();
|
|
|
|
|
|
+ this.showui();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (require_type == 3) {
|
|
if (require_type == 3) {
|
|
this.skinGetForType = SkinGetForType.GetByVideo;
|
|
this.skinGetForType = SkinGetForType.GetByVideo;
|
|
- this.ShowUi();
|
|
|
|
|
|
+ this.showui();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ showui() {
|
|
|
|
+ var type = this.skinGetForType;
|
|
|
|
+ if (this._data.id == 1 || this._data.id == 50) {
|
|
|
|
+ this._select.visible = true;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this._select.visible = false;
|
|
|
|
+ }
|
|
|
|
+ if (this.skinGetForType == SkinGetForType.Using) {
|
|
|
|
+ this.using.visible = true;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this.using.visible = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
ShowUi() {
|
|
ShowUi() {
|
|
var type = this.skinGetForType;
|
|
var type = this.skinGetForType;
|
|
this._select.visible = type == SkinGetForType.Using;
|
|
this._select.visible = type == SkinGetForType.Using;
|
|
@@ -2123,6 +2142,7 @@ var laya = (function (exports) {
|
|
class ShopView extends ui.SkinViewUI {
|
|
class ShopView extends ui.SkinViewUI {
|
|
constructor() {
|
|
constructor() {
|
|
super();
|
|
super();
|
|
|
|
+ this.firstopen = true;
|
|
this.showroleId = 0;
|
|
this.showroleId = 0;
|
|
this.uiArr = [];
|
|
this.uiArr = [];
|
|
this.CapArray = [];
|
|
this.CapArray = [];
|
|
@@ -2137,6 +2157,7 @@ var laya = (function (exports) {
|
|
return ShopView.ins;
|
|
return ShopView.ins;
|
|
}
|
|
}
|
|
Show() {
|
|
Show() {
|
|
|
|
+ WXSDK.AldEvent("打开皮肤商店界面");
|
|
let data = AccountManager.Instance.curplayerData.GainCollocation("theme");
|
|
let data = AccountManager.Instance.curplayerData.GainCollocation("theme");
|
|
for (let i = 0; i < data.length; i++) {
|
|
for (let i = 0; i < data.length; i++) {
|
|
if (i < 5) {
|
|
if (i < 5) {
|
|
@@ -2167,7 +2188,7 @@ var laya = (function (exports) {
|
|
this.uiArr.push(this.GetByActive);
|
|
this.uiArr.push(this.GetByActive);
|
|
this.equip_Horse = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"];
|
|
this.equip_Horse = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"];
|
|
this.equip_Cap = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["1"];
|
|
this.equip_Cap = AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["1"];
|
|
- this.showroleId = this.equip_Horse;
|
|
|
|
|
|
+ this.showroleId = 1;
|
|
this.ItemList.selectEnable = false;
|
|
this.ItemList.selectEnable = false;
|
|
this.ItemList.vScrollBarSkin = "";
|
|
this.ItemList.vScrollBarSkin = "";
|
|
this.ItemList.renderHandler = Laya.Handler.create(this, this.UpdateItem, null, false);
|
|
this.ItemList.renderHandler = Laya.Handler.create(this, this.UpdateItem, null, false);
|
|
@@ -2180,6 +2201,7 @@ var laya = (function (exports) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
Close() {
|
|
Close() {
|
|
|
|
+ WXSDK.AldEvent("关闭皮肤商城界面");
|
|
}
|
|
}
|
|
ClickClose() {
|
|
ClickClose() {
|
|
var equiphorseid = Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"]);
|
|
var equiphorseid = Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"]);
|
|
@@ -2202,6 +2224,13 @@ var laya = (function (exports) {
|
|
this.ItemList.refresh();
|
|
this.ItemList.refresh();
|
|
}
|
|
}
|
|
ClickCap() {
|
|
ClickCap() {
|
|
|
|
+ this.firstopen = true;
|
|
|
|
+ if (this.equip_Cap) {
|
|
|
|
+ this.showroleId = this.equip_Cap;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this.showroleId = 1;
|
|
|
|
+ }
|
|
this.ShowButton(1);
|
|
this.ShowButton(1);
|
|
this.CharacterLightImage.visible = true;
|
|
this.CharacterLightImage.visible = true;
|
|
this.HorseLightImage.visible = false;
|
|
this.HorseLightImage.visible = false;
|
|
@@ -2210,6 +2239,8 @@ var laya = (function (exports) {
|
|
this.ItemList.renderHandler = Laya.Handler.create(this, this.UpdateItem, null, false);
|
|
this.ItemList.renderHandler = Laya.Handler.create(this, this.UpdateItem, null, false);
|
|
}
|
|
}
|
|
ClickHorse() {
|
|
ClickHorse() {
|
|
|
|
+ this.firstopen = true;
|
|
|
|
+ this.showroleId = this.equip_Horse;
|
|
this.ShowButton(2);
|
|
this.ShowButton(2);
|
|
this.CharacterLightImage.visible = false;
|
|
this.CharacterLightImage.visible = false;
|
|
this.HorseLightImage.visible = true;
|
|
this.HorseLightImage.visible = true;
|
|
@@ -2224,27 +2255,71 @@ var laya = (function (exports) {
|
|
ShowButton(type) {
|
|
ShowButton(type) {
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
var equipcap = Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["1"]);
|
|
var equipcap = Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["1"]);
|
|
- if (equipcap) {
|
|
|
|
- this.GetByCoin.visible = false;
|
|
|
|
- this.GetByVideo.visible = false;
|
|
|
|
- this.GetByActive.visible = false;
|
|
|
|
- this.Geted.visible = false;
|
|
|
|
- this.Using.visible = true;
|
|
|
|
|
|
+ var usingId = equipcap;
|
|
|
|
+ let item = this.CapArray[0].require_type;
|
|
|
|
+ this._data = this.CapArray[0];
|
|
|
|
+ var _id = this._data.id;
|
|
|
|
+ var hasequip = AccountManager.Instance.curplayerData.HasEquip(_id);
|
|
|
|
+ var require_type = item;
|
|
|
|
+ if (usingId == _id) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.Using;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
- this.GetByCoin.visible = false;
|
|
|
|
- this.GetByVideo.visible = false;
|
|
|
|
- this.GetByActive.visible = false;
|
|
|
|
- this.Geted.visible = false;
|
|
|
|
- this.Using.visible = false;
|
|
|
|
|
|
+ if (hasequip) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.Geted;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (require_type == 2) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.Bycoin;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (require_type == 4) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.GetByActivity;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (require_type == 3) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.GetByVideo;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- this.GetByCoin.visible = false;
|
|
|
|
- this.GetByVideo.visible = false;
|
|
|
|
- this.GetByActive.visible = false;
|
|
|
|
- this.Geted.visible = false;
|
|
|
|
- this.Using.visible = true;
|
|
|
|
|
|
+ var equiphorse = Number(AccountManager.Instance.curplayerData.GetUser(AccountUser.equip_themes)["2"]);
|
|
|
|
+ var usingId = equiphorse;
|
|
|
|
+ let item = this.HorseArray[0].require_type;
|
|
|
|
+ this._data = this.HorseArray[0];
|
|
|
|
+ var _id = this._data.id;
|
|
|
|
+ var hasequip = AccountManager.Instance.curplayerData.HasEquip(_id);
|
|
|
|
+ var require_type = item;
|
|
|
|
+ if (usingId == _id) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.Using;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (hasequip) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.Geted;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (require_type == 2) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.Bycoin;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (require_type == 4) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.GetByActivity;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (require_type == 3) {
|
|
|
|
+ this.skinGetForType = SkinGetForType.GetByVideo;
|
|
|
|
+ this.RefreshButton(this.skinGetForType);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ClickGet() {
|
|
ClickGet() {
|
|
@@ -2354,6 +2429,7 @@ var laya = (function (exports) {
|
|
BuySuccess(data) {
|
|
BuySuccess(data) {
|
|
WXSDK.AldEvent("购买" + this._data.name + "成功");
|
|
WXSDK.AldEvent("购买" + this._data.name + "成功");
|
|
this.RefreshItem();
|
|
this.RefreshItem();
|
|
|
|
+ this.RefreshButton(SkinGetForType.Using);
|
|
console.log("购买suc:" + JSON.stringify(data));
|
|
console.log("购买suc:" + JSON.stringify(data));
|
|
}
|
|
}
|
|
BuyFail(data) {
|
|
BuyFail(data) {
|
|
@@ -2464,6 +2540,7 @@ var laya = (function (exports) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
Close() {
|
|
Close() {
|
|
|
|
+ WXSDK.AldEvent("关闭皮肤试用界面");
|
|
}
|
|
}
|
|
ClickClose() {
|
|
ClickClose() {
|
|
var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
|
|
var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
|
|
@@ -2504,7 +2581,6 @@ var laya = (function (exports) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
Complete(_data) {
|
|
Complete(_data) {
|
|
- WXSDK.AldEvent("关闭皮肤试用界面");
|
|
|
|
ShopScene.Instance.CloseShop();
|
|
ShopScene.Instance.CloseShop();
|
|
ViewManager.Instance.ShowView(ViewType.IngameView);
|
|
ViewManager.Instance.ShowView(ViewType.IngameView);
|
|
let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
|
|
let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
|
|
@@ -2577,6 +2653,7 @@ var laya = (function (exports) {
|
|
Init(_data) {
|
|
Init(_data) {
|
|
switch (_data) {
|
|
switch (_data) {
|
|
case 1:
|
|
case 1:
|
|
|
|
+ WXSDK.AldEvent("打开胜利界面");
|
|
this.loseimage.visible = false;
|
|
this.loseimage.visible = false;
|
|
this.reviveimage.visible = false;
|
|
this.reviveimage.visible = false;
|
|
this.NoBtn.visible = false;
|
|
this.NoBtn.visible = false;
|
|
@@ -2585,6 +2662,7 @@ var laya = (function (exports) {
|
|
this.NextLevelBtn.clickHandler = Laya.Handler.create(this, this.NextLevel, [true]);
|
|
this.NextLevelBtn.clickHandler = Laya.Handler.create(this, this.NextLevel, [true]);
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
|
|
+ WXSDK.AldEvent("打开失败界面");
|
|
this.winimage.visible = false;
|
|
this.winimage.visible = false;
|
|
this.reviveimage.visible = false;
|
|
this.reviveimage.visible = false;
|
|
this.NoBtn.visible = false;
|
|
this.NoBtn.visible = false;
|
|
@@ -2593,6 +2671,7 @@ var laya = (function (exports) {
|
|
this.TryAgainBtn.clickHandler = Laya.Handler.create(this, this.TryAgain, [false]);
|
|
this.TryAgainBtn.clickHandler = Laya.Handler.create(this, this.TryAgain, [false]);
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
|
|
+ WXSDK.AldEvent("打开结算界面");
|
|
this.winimage.visible = false;
|
|
this.winimage.visible = false;
|
|
this.loseimage.visible = false;
|
|
this.loseimage.visible = false;
|
|
this.NextLevelBtn.visible = false;
|
|
this.NextLevelBtn.visible = false;
|
|
@@ -2689,6 +2768,7 @@ var laya = (function (exports) {
|
|
|
|
|
|
class ExportView extends ui.ExportViewUI {
|
|
class ExportView extends ui.ExportViewUI {
|
|
OnOpen(data) {
|
|
OnOpen(data) {
|
|
|
|
+ WXSDK.AldEvent("打开全屏幕导出界面");
|
|
this.CloseExportBtn.clickHandler = Laya.Handler.create(this, this.ClickClose, [data]);
|
|
this.CloseExportBtn.clickHandler = Laya.Handler.create(this, this.ClickClose, [data]);
|
|
this.SetData();
|
|
this.SetData();
|
|
this.height = Laya.stage.height;
|
|
this.height = Laya.stage.height;
|
|
@@ -2698,6 +2778,7 @@ var laya = (function (exports) {
|
|
}
|
|
}
|
|
OnHide() {
|
|
OnHide() {
|
|
Laya.timer.clearAll(this);
|
|
Laya.timer.clearAll(this);
|
|
|
|
+ WXSDK.AldEvent("关闭全屏导出界面");
|
|
}
|
|
}
|
|
ClickClose(data) {
|
|
ClickClose(data) {
|
|
ViewManager.Instance.ClosePopView(ViewType.ExportView);
|
|
ViewManager.Instance.ClosePopView(ViewType.ExportView);
|
|
@@ -3485,8 +3566,6 @@ var laya = (function (exports) {
|
|
this.m_npcanimator.play("dierear");
|
|
this.m_npcanimator.play("dierear");
|
|
}
|
|
}
|
|
this.canmove = false;
|
|
this.canmove = false;
|
|
- GameManager.Instance.KillNum++;
|
|
|
|
- InGameView.Instance.InitUI();
|
|
|
|
}
|
|
}
|
|
PiaoZi() {
|
|
PiaoZi() {
|
|
let headshoot = new Laya.Image();
|
|
let headshoot = new Laya.Image();
|
|
@@ -3923,8 +4002,6 @@ var laya = (function (exports) {
|
|
this.die = true;
|
|
this.die = true;
|
|
AudioManager.playMusic(MusicType.die);
|
|
AudioManager.playMusic(MusicType.die);
|
|
this.PiaoZi();
|
|
this.PiaoZi();
|
|
- GameManager.Instance.KillNum++;
|
|
|
|
- InGameView.Instance.InitUI();
|
|
|
|
this.isdead = true;
|
|
this.isdead = true;
|
|
EventManager.StageOff(StageState.Start, this, this.Begin);
|
|
EventManager.StageOff(StageState.Start, this, this.Begin);
|
|
if (this.frontdie) {
|
|
if (this.frontdie) {
|
|
@@ -3980,6 +4057,58 @@ var laya = (function (exports) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ class Dictionary {
|
|
|
|
+ constructor() {
|
|
|
|
+ this.keys = new Array();
|
|
|
|
+ this.values = new Array();
|
|
|
|
+ }
|
|
|
|
+ get count() {
|
|
|
|
+ return this.keys.length;
|
|
|
|
+ }
|
|
|
|
+ add(key, value) {
|
|
|
|
+ let index = this.keys.indexOf(key);
|
|
|
|
+ if (index == -1) {
|
|
|
|
+ this.keys.push(key);
|
|
|
|
+ this.values.push(value);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this.values[index] = value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ remove(key) {
|
|
|
|
+ let index = this.keys.indexOf(key);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ this.keys.splice(index, 1);
|
|
|
|
+ this.values.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ getValue(key) {
|
|
|
|
+ let index = this.keys.indexOf(key);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ return this.values[index];
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ containKey(key) {
|
|
|
|
+ let index = this.keys.indexOf(key);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ containValue(value) {
|
|
|
|
+ let index = this.values.indexOf(value);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ clear() {
|
|
|
|
+ this.keys.length = 0;
|
|
|
|
+ this.values.length = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
var Vector3$7 = Laya.Vector3;
|
|
var Vector3$7 = Laya.Vector3;
|
|
var BossState;
|
|
var BossState;
|
|
(function (BossState) {
|
|
(function (BossState) {
|
|
@@ -4000,6 +4129,7 @@ var laya = (function (exports) {
|
|
this.BossSpeed = 1;
|
|
this.BossSpeed = 1;
|
|
this.CreatGround = false;
|
|
this.CreatGround = false;
|
|
this.randomdir = false;
|
|
this.randomdir = false;
|
|
|
|
+ this.ArrowList = new Dictionary();
|
|
this.currotV = new Vector3$7();
|
|
this.currotV = new Vector3$7();
|
|
this.currot = new Laya.Quaternion;
|
|
this.currot = new Laya.Quaternion;
|
|
this.NormalizeSpeed = new Vector3$7();
|
|
this.NormalizeSpeed = new Vector3$7();
|
|
@@ -4080,6 +4210,16 @@ var laya = (function (exports) {
|
|
Laya.timer.once(2000, this, this.RandomDir);
|
|
Laya.timer.once(2000, this, this.RandomDir);
|
|
}
|
|
}
|
|
this.RayCheck();
|
|
this.RayCheck();
|
|
|
|
+ if (this.ArrowList != null) {
|
|
|
|
+ var keys = this.ArrowList.keys;
|
|
|
|
+ for (var i = 0; i < keys.length; i++) {
|
|
|
|
+ var key = keys[i];
|
|
|
|
+ if (keys[i] != null) {
|
|
|
|
+ var value = this.ArrowList.getValue(keys[i]);
|
|
|
|
+ this.ArrowMove(key, (this.ArrowList.getValue(key))[0], (this.ArrowList.getValue(key))[1]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
TurnDir(_dir) {
|
|
TurnDir(_dir) {
|
|
if (_dir.x != 0) {
|
|
if (_dir.x != 0) {
|
|
@@ -4173,6 +4313,8 @@ var laya = (function (exports) {
|
|
}
|
|
}
|
|
Shoot() {
|
|
Shoot() {
|
|
this.CreatArrow();
|
|
this.CreatArrow();
|
|
|
|
+ var currect = this.m_arrow;
|
|
|
|
+ this.m_arrow = null;
|
|
let ray = this.owner.getChildByName("raypos").getChildAt(0);
|
|
let ray = this.owner.getChildByName("raypos").getChildAt(0);
|
|
let forw = Transform3DHelper.getForward(ray.transform);
|
|
let forw = Transform3DHelper.getForward(ray.transform);
|
|
let raypos = this.owner.getChildByName("raypos");
|
|
let raypos = this.owner.getChildByName("raypos");
|
|
@@ -4182,15 +4324,15 @@ var laya = (function (exports) {
|
|
this.m_bossanimator.play("shoot");
|
|
this.m_bossanimator.play("shoot");
|
|
if (AssetManager.Instance.mainscene.physicsSimulation.rayCast(testRay, hitRes)) {
|
|
if (AssetManager.Instance.mainscene.physicsSimulation.rayCast(testRay, hitRes)) {
|
|
let target = hitRes.collider.owner.parent;
|
|
let target = hitRes.collider.owner.parent;
|
|
- Laya.timer.frameLoop(1, this, this.ArrowMove, [this.m_arrow, forw, target]);
|
|
|
|
|
|
+ this.ArrowList.add(currect, [forw, target]);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- Laya.timer.frameLoop(1, this, this.ArrowMove, [this.m_arrow, forw]);
|
|
|
|
|
|
+ this.ArrowList.add(currect, [forw, null]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ArrowMove(arrow, _dir, target) {
|
|
ArrowMove(arrow, _dir, target) {
|
|
if (target) {
|
|
if (target) {
|
|
- if (this.m_arrow.destroyed)
|
|
|
|
|
|
+ if (arrow.destroyed)
|
|
return;
|
|
return;
|
|
if (arrow.transform.position.z <= target.transform.position.z) {
|
|
if (arrow.transform.position.z <= target.transform.position.z) {
|
|
if (target.name == "player") {
|
|
if (target.name == "player") {
|
|
@@ -4198,7 +4340,9 @@ var laya = (function (exports) {
|
|
_runner.isdead = true;
|
|
_runner.isdead = true;
|
|
this.BossProgress.visible = false;
|
|
this.BossProgress.visible = false;
|
|
}
|
|
}
|
|
- Laya.timer.clear(this, this.ArrowMove);
|
|
|
|
|
|
+ if (this.ArrowList.containKey(arrow)) {
|
|
|
|
+ this.ArrowList.remove(arrow);
|
|
|
|
+ }
|
|
GamePool.Instance.RecoveryModel(arrow);
|
|
GamePool.Instance.RecoveryModel(arrow);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -4220,7 +4364,9 @@ var laya = (function (exports) {
|
|
if (!this.recover) {
|
|
if (!this.recover) {
|
|
this.recover = true;
|
|
this.recover = true;
|
|
Laya.timer.once(1000, this, () => {
|
|
Laya.timer.once(1000, this, () => {
|
|
- Laya.timer.clear(this, this.ArrowMove);
|
|
|
|
|
|
+ if (this.ArrowList.containKey(arrow)) {
|
|
|
|
+ this.ArrowList.remove(arrow);
|
|
|
|
+ }
|
|
GamePool.Instance.RecoveryModel(arrow);
|
|
GamePool.Instance.RecoveryModel(arrow);
|
|
this.recover = false;
|
|
this.recover = false;
|
|
});
|
|
});
|
|
@@ -4367,58 +4513,6 @@ var laya = (function (exports) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- class Dictionary {
|
|
|
|
- constructor() {
|
|
|
|
- this.keys = new Array();
|
|
|
|
- this.values = new Array();
|
|
|
|
- }
|
|
|
|
- get count() {
|
|
|
|
- return this.keys.length;
|
|
|
|
- }
|
|
|
|
- add(key, value) {
|
|
|
|
- let index = this.keys.indexOf(key);
|
|
|
|
- if (index == -1) {
|
|
|
|
- this.keys.push(key);
|
|
|
|
- this.values.push(value);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- this.values[index] = value;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- remove(key) {
|
|
|
|
- let index = this.keys.indexOf(key);
|
|
|
|
- if (index != -1) {
|
|
|
|
- this.keys.splice(index, 1);
|
|
|
|
- this.values.splice(index, 1);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- getValue(key) {
|
|
|
|
- let index = this.keys.indexOf(key);
|
|
|
|
- if (index != -1) {
|
|
|
|
- return this.values[index];
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- containKey(key) {
|
|
|
|
- let index = this.keys.indexOf(key);
|
|
|
|
- if (index != -1) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- containValue(value) {
|
|
|
|
- let index = this.values.indexOf(value);
|
|
|
|
- if (index != -1) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- clear() {
|
|
|
|
- this.keys.length = 0;
|
|
|
|
- this.values.length = 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
var Vector3$8 = Laya.Vector3;
|
|
var Vector3$8 = Laya.Vector3;
|
|
var CharacterState;
|
|
var CharacterState;
|
|
(function (CharacterState) {
|
|
(function (CharacterState) {
|
|
@@ -4734,10 +4828,12 @@ var laya = (function (exports) {
|
|
else if (target.name == "npcrearcollider") {
|
|
else if (target.name == "npcrearcollider") {
|
|
_npcrunner.reardie = true;
|
|
_npcrunner.reardie = true;
|
|
}
|
|
}
|
|
|
|
+ GameManager.Instance.KillNum++;
|
|
|
|
+ InGameView.Instance.InitUI();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (stage == 2) {
|
|
else if (stage == 2) {
|
|
- if (InGameView.Instance.Guide2.visible || GameManager.Instance.GuideKill >= 2) {
|
|
|
|
|
|
+ if (InGameView.Instance.Guide2.visible || GameManager.Instance.GuideKill == 1) {
|
|
if (target.name == "npcfrontcollider") {
|
|
if (target.name == "npcfrontcollider") {
|
|
_npcrunner.frontdie = true;
|
|
_npcrunner.frontdie = true;
|
|
}
|
|
}
|
|
@@ -4745,6 +4841,8 @@ var laya = (function (exports) {
|
|
_npcrunner.reardie = true;
|
|
_npcrunner.reardie = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ GameManager.Instance.KillNum++;
|
|
|
|
+ InGameView.Instance.InitUI();
|
|
}
|
|
}
|
|
else if (stage > 2) {
|
|
else if (stage > 2) {
|
|
if (target.name == "npcfrontcollider") {
|
|
if (target.name == "npcfrontcollider") {
|
|
@@ -4753,13 +4851,15 @@ var laya = (function (exports) {
|
|
else if (target.name == "npcrearcollider") {
|
|
else if (target.name == "npcrearcollider") {
|
|
_npcrunner.reardie = true;
|
|
_npcrunner.reardie = true;
|
|
}
|
|
}
|
|
|
|
+ GameManager.Instance.KillNum++;
|
|
|
|
+ InGameView.Instance.InitUI();
|
|
}
|
|
}
|
|
WXSDK.Shake(true);
|
|
WXSDK.Shake(true);
|
|
WXSDK.stageShake();
|
|
WXSDK.stageShake();
|
|
}
|
|
}
|
|
else if (_chaseNpc) {
|
|
else if (_chaseNpc) {
|
|
if (this.stage == 2) {
|
|
if (this.stage == 2) {
|
|
- if (InGameView.Instance.Guide4.visible && GameManager.Instance.GuideKill >= 2) {
|
|
|
|
|
|
+ if (InGameView.Instance.Guide4.visible && GameManager.Instance.GuideKill >= 1) {
|
|
InGameView.Instance.Guide4.visible = false;
|
|
InGameView.Instance.Guide4.visible = false;
|
|
WXSDK.AldEvent("完成第四阶段引导");
|
|
WXSDK.AldEvent("完成第四阶段引导");
|
|
this.started = true;
|
|
this.started = true;
|
|
@@ -4772,6 +4872,8 @@ var laya = (function (exports) {
|
|
else if (target.name == "npcrearcollider") {
|
|
else if (target.name == "npcrearcollider") {
|
|
_chaseNpc.reardie = true;
|
|
_chaseNpc.reardie = true;
|
|
}
|
|
}
|
|
|
|
+ GameManager.Instance.KillNum++;
|
|
|
|
+ InGameView.Instance.InitUI();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -4781,6 +4883,8 @@ var laya = (function (exports) {
|
|
else if (target.name == "npcrearcollider") {
|
|
else if (target.name == "npcrearcollider") {
|
|
_chaseNpc.reardie = true;
|
|
_chaseNpc.reardie = true;
|
|
}
|
|
}
|
|
|
|
+ GameManager.Instance.KillNum++;
|
|
|
|
+ InGameView.Instance.InitUI();
|
|
}
|
|
}
|
|
WXSDK.Shake(true);
|
|
WXSDK.Shake(true);
|
|
WXSDK.stageShake();
|
|
WXSDK.stageShake();
|
|
@@ -4941,6 +5045,7 @@ var laya = (function (exports) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Init(_player) {
|
|
Init(_player) {
|
|
|
|
+ this.win = false;
|
|
this.Player = _player;
|
|
this.Player = _player;
|
|
this.arrowpos = _player.getChildByName("arrowpos");
|
|
this.arrowpos = _player.getChildByName("arrowpos");
|
|
let runner = this.Player.getComponent(Runner);
|
|
let runner = this.Player.getComponent(Runner);
|
|
@@ -4966,6 +5071,13 @@ var laya = (function (exports) {
|
|
Laya.timer.clear(this, this.CheckWin);
|
|
Laya.timer.clear(this, this.CheckWin);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else if (this.stage > 2 && StageControl.Instance.curstage.isboss == 0) {
|
|
|
|
+ if (this.Player.transform.position.z >= StageControl.Instance.curstage.endposition.z * 1.2 && !this.win) {
|
|
|
|
+ this.win = true;
|
|
|
|
+ EventManager.StageTrigger(StageState.Win);
|
|
|
|
+ Laya.timer.clear(this, this.CheckWin);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
onMouseDown(e) {
|
|
onMouseDown(e) {
|
|
if (!this._runner.canmove)
|
|
if (!this._runner.canmove)
|