修复负体力BUG,修复小方块缺失
This commit is contained in:
parent
39a369adfa
commit
81d32e336d
File diff suppressed because it is too large
Load Diff
|
@ -694,6 +694,17 @@ export default class JiaZai extends cc.Component {
|
||||||
// 处理下一个订单
|
// 处理下一个订单
|
||||||
processOrder(index + 1);
|
processOrder(index + 1);
|
||||||
}, order.outTradeNo);
|
}, order.outTradeNo);
|
||||||
|
let price = order.price || 0;
|
||||||
|
const dataSuccess = {
|
||||||
|
outTradeNo: order,
|
||||||
|
price: price,
|
||||||
|
payment_name: productId,
|
||||||
|
payment_num: 1,
|
||||||
|
type: systemType,
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
||||||
|
let name = "补发充值成功" + productId;
|
||||||
|
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name);
|
||||||
} else {
|
} else {
|
||||||
// 如果当前订单不处理,直接处理下一个订单
|
// 如果当前订单不处理,直接处理下一个订单
|
||||||
processOrder(index + 1);
|
processOrder(index + 1);
|
||||||
|
|
|
@ -644,6 +644,7 @@ export default class MapConroler extends cc.Component {
|
||||||
let pointD = cc.v2(pointA.x, pointA.y + 1);
|
let pointD = cc.v2(pointA.x, pointA.y + 1);
|
||||||
let pointE = cc.v2(pointA.x, pointA.y - 1);
|
let pointE = cc.v2(pointA.x, pointA.y - 1);
|
||||||
let opacity = 0;
|
let opacity = 0;
|
||||||
|
let turn = 0;
|
||||||
if (type == "wall") opacity = 255;
|
if (type == "wall") opacity = 255;
|
||||||
if (type == "turn") opacity = 250;
|
if (type == "turn") opacity = 250;
|
||||||
|
|
||||||
|
@ -654,6 +655,13 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
else dir.push("right");
|
else dir.push("right");
|
||||||
}
|
}
|
||||||
|
else if (type == "turn") {
|
||||||
|
if (this.mapBlocksWall[pointB.x][pointB.y].opacity == 249) {
|
||||||
|
dir.push("right");
|
||||||
|
turn += 1;
|
||||||
|
console.log("从转角处增加", turn);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pointC.x >= 0) {
|
if (pointC.x >= 0) {
|
||||||
if (this.mapBlocksWall[pointC.x][pointC.y].opacity == opacity) {
|
if (this.mapBlocksWall[pointC.x][pointC.y].opacity == opacity) {
|
||||||
|
@ -662,6 +670,13 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
else dir.push("left");
|
else dir.push("left");
|
||||||
}
|
}
|
||||||
|
else if (type == "turn") {
|
||||||
|
if (this.mapBlocksWall[pointC.x][pointC.y].opacity == 249) {
|
||||||
|
dir.push("left");
|
||||||
|
turn += 1;
|
||||||
|
console.log("从转角处增加", turn);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pointD.y < this.mapHeight) {
|
if (pointD.y < this.mapHeight) {
|
||||||
if (this.mapBlocksWall[pointD.x][pointD.y].opacity == opacity) {
|
if (this.mapBlocksWall[pointD.x][pointD.y].opacity == opacity) {
|
||||||
|
@ -670,6 +685,13 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
else dir.push("up");
|
else dir.push("up");
|
||||||
}
|
}
|
||||||
|
else if (type == "turn") {
|
||||||
|
if (this.mapBlocksWall[pointD.x][pointD.y].opacity == 249) {
|
||||||
|
dir.push("up");
|
||||||
|
turn += 1;
|
||||||
|
console.log("从转角处增加", turn);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pointE.y >= 0) {
|
if (pointE.y >= 0) {
|
||||||
if (this.mapBlocksWall[pointE.x][pointE.y].opacity == opacity) {
|
if (this.mapBlocksWall[pointE.x][pointE.y].opacity == opacity) {
|
||||||
|
@ -678,16 +700,24 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
else dir.push("down");
|
else dir.push("down");
|
||||||
}
|
}
|
||||||
|
else if (type == "turn") {
|
||||||
|
if (this.mapBlocksWall[pointE.x][pointE.y].opacity == 249) {
|
||||||
|
dir.push("down");
|
||||||
|
turn += 1;
|
||||||
|
console.log("从转角处增加", turn);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dir.length > 2) {
|
if (dir.length > 2 || turn > 1) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (dir.length == 1) {
|
if (dir.length == 1) {
|
||||||
if (type == "wall")
|
if (type == "wall")
|
||||||
return dir[0];
|
return dir[0];
|
||||||
else
|
else {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (dir.length == 2) {
|
else if (dir.length == 2) {
|
||||||
return dir[0] + dir[1];
|
return dir[0] + dir[1];
|
||||||
|
@ -700,6 +730,7 @@ export default class MapConroler extends cc.Component {
|
||||||
let block = this.wallInfo[i];
|
let block = this.wallInfo[i];
|
||||||
if (block.opacity != 250) {
|
if (block.opacity != 250) {
|
||||||
let dir = this.getWllDiraction("turn", cc.v2(block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY));
|
let dir = this.getWllDiraction("turn", cc.v2(block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY));
|
||||||
|
console.log("转角方向", dir, block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY);
|
||||||
if (dir != null) {
|
if (dir != null) {
|
||||||
this.createTurn(dir, block, block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY);
|
this.createTurn(dir, block, block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY);
|
||||||
}
|
}
|
||||||
|
@ -1602,10 +1633,10 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
againLevel() {
|
againLevel() {
|
||||||
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
|
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
|
||||||
// if (cc.fx.GameConfig.GM_INFO.hp < 1) {
|
if (cc.fx.GameConfig.GM_INFO.hp < 1) {
|
||||||
// MiniGameSdk.API.showToast("体力值不足");
|
MiniGameSdk.API.showToast("体力值不足");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
if (!this.againCanTouch) return;
|
if (!this.againCanTouch) return;
|
||||||
|
|
||||||
this.againCanTouch = false;
|
this.againCanTouch = false;
|
||||||
|
|
|
@ -81,7 +81,13 @@ export default class Utils {
|
||||||
|
|
||||||
}
|
}
|
||||||
static getPayInfo(callBack) {
|
static getPayInfo(callBack) {
|
||||||
const delays = [1000, 3000, 6000, 9000, 12000];// 延迟时间数组
|
// 延迟时间数组,按照 1 秒 3 次、2 秒 5 次、5 秒 6 次、15 秒 5 次的规则生成
|
||||||
|
const delays = [
|
||||||
|
...Array(3).fill(1000),
|
||||||
|
...Array(5).fill(2000),
|
||||||
|
...Array(6).fill(5000),
|
||||||
|
...Array(5).fill(15000)
|
||||||
|
];
|
||||||
let attempt = 0; // 轮询次数
|
let attempt = 0; // 轮询次数
|
||||||
|
|
||||||
const poll = () => {
|
const poll = () => {
|
||||||
|
@ -92,7 +98,7 @@ export default class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("请求uid:", Utils.uid);
|
console.log("请求uid:", Utils.uid);
|
||||||
console.log("outTradeNo:", this.outTradeNo);
|
console.log("outTradeNo:", Utils.outTradeNo);
|
||||||
Utils.POST("wx/getPayInfo", { uid: Utils.uid, outTradeNo: Utils.outTradeNo }, res => {
|
Utils.POST("wx/getPayInfo", { uid: Utils.uid, outTradeNo: Utils.outTradeNo }, res => {
|
||||||
console.log("查询字符结果:", res);
|
console.log("查询字符结果:", res);
|
||||||
if (res.code === 1 && (res.data.pay_state === 1 || res.data.pay_state === 2)) {
|
if (res.code === 1 && (res.data.pay_state === 1 || res.data.pay_state === 2)) {
|
||||||
|
@ -176,7 +182,13 @@ export default class Utils {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static getIosPayInfo(order, callBack) {
|
static getIosPayInfo(order, callBack) {
|
||||||
const delays = [1000, 3000, 6000, 9000, 12000];// 延迟时间数组
|
// 延迟时间数组,按照 1 秒 3 次、2 秒 5 次、5 秒 6 次、15 秒 5 次的规则生成
|
||||||
|
const delays = [
|
||||||
|
...Array(3).fill(1000),
|
||||||
|
...Array(5).fill(2000),
|
||||||
|
...Array(6).fill(5000),
|
||||||
|
...Array(5).fill(15000)
|
||||||
|
];
|
||||||
let attempt = 0; // 轮询次数
|
let attempt = 0; // 轮询次数
|
||||||
const iosOutTradeNo = order;
|
const iosOutTradeNo = order;
|
||||||
|
|
||||||
|
@ -857,10 +869,10 @@ export default class Utils {
|
||||||
Utils.POST("monthlyCard", setData, res => {
|
Utils.POST("monthlyCard", setData, res => {
|
||||||
// console.log("获得monthlyCard数据:", res);
|
// console.log("获得monthlyCard数据:", res);
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
console.log("服务器:获取monthlyCard成功'✅ ", res);
|
// console.log("服务器:获取monthlyCard成功'✅ ", res);
|
||||||
if (callBack) callBack(res);
|
if (callBack) callBack(res);
|
||||||
} else {
|
} else {
|
||||||
console.log("服务器:获取monthlyCard失败'❌ ", res);
|
// console.log("服务器:获取monthlyCard失败'❌ ", res);
|
||||||
if (callBack) callBack(res);
|
if (callBack) callBack(res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -885,10 +897,10 @@ export default class Utils {
|
||||||
Utils.POST("monthlyCard", setData, res => {
|
Utils.POST("monthlyCard", setData, res => {
|
||||||
// console.log("获得monthlyCard数据:", res);
|
// console.log("获得monthlyCard数据:", res);
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
console.log("服务器:上传monthlyCard成功'✅ ", res);
|
// console.log("服务器:上传monthlyCard成功'✅ ", res);
|
||||||
if (callBack) callBack(res);
|
if (callBack) callBack(res);
|
||||||
} else {
|
} else {
|
||||||
console.log("服务器:上传monthlyCard失败'❌ ", res);
|
// console.log("服务器:上传monthlyCard失败'❌ ", res);
|
||||||
if (callBack) callBack(res);
|
if (callBack) callBack(res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -623,6 +623,8 @@ var GameTool = {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cc.fx.GameConfig.GM_INFO.hp += health;
|
cc.fx.GameConfig.GM_INFO.hp += health;
|
||||||
|
if (cc.fx.GameConfig.GM_INFO.hp < 0)
|
||||||
|
cc.fx.GameConfig.GM_INFO.hp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// else MiniGameSdk.API.showToast("体力值恢复");
|
// else MiniGameSdk.API.showToast("体力值恢复");
|
||||||
|
|
|
@ -491,7 +491,8 @@ export default class NewClass extends cc.Component {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Utils.getPayInfo((data) => {
|
Utils.getPayInfo((data) => {
|
||||||
//console.log("7.14_______________充值成功,准备轮训");
|
// MiniGameSdk.API.showToast("充值成功");
|
||||||
|
console.log("7.28_______________充值成功,准备轮训");
|
||||||
//console.log("获得轮训结果:", data);
|
//console.log("获得轮训结果:", data);
|
||||||
this.closeLoad();
|
this.closeLoad();
|
||||||
if (data.data.pay_state == 1) {
|
if (data.data.pay_state == 1) {
|
||||||
|
@ -518,7 +519,7 @@ export default class NewClass extends cc.Component {
|
||||||
}
|
}
|
||||||
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
||||||
let name = "购买金币道具:" + productId;
|
let name = "购买金币道具:" + productId;
|
||||||
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name)
|
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name);
|
||||||
console.log("7.14_______________充值成功,轮训成功,准备发货");
|
console.log("7.14_______________充值成功,轮训成功,准备发货");
|
||||||
Utils.setPayInfo(
|
Utils.setPayInfo(
|
||||||
(res) => {
|
(res) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user