三连胜提交
This commit is contained in:
@@ -849,7 +849,7 @@ var GameTool = {
|
||||
//更改用户道具数
|
||||
buyProp(propid, callback: Function) {
|
||||
//@ts-ignore
|
||||
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) {
|
||||
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null) || propid === 2006 || propid === 2007) {
|
||||
|
||||
let num = 3;
|
||||
let cost = 600;
|
||||
@@ -861,6 +861,10 @@ var GameTool = {
|
||||
else if (propid == 2002) {
|
||||
num = 1;
|
||||
}
|
||||
else if (propid == 2006 || propid == 2007) {
|
||||
cost = propid == 2006 ? 200 : 800;
|
||||
if (cc.fx.GameConfig.GM_INFO.coin < cost) return;
|
||||
}
|
||||
//console.log("_____________新版本", num);
|
||||
cc.fx.GameTool.changeCoin(-cost);
|
||||
const dataTemp = {
|
||||
@@ -887,11 +891,19 @@ var GameTool = {
|
||||
cc.fx.GameConfig.GM_INFO.magicAmount += num;
|
||||
propNumber = cc.fx.GameConfig.GM_INFO.magicAmount;
|
||||
}
|
||||
else if (propid == 2006 || propid == 2007) {
|
||||
const prop = propid == 2006 ? "hourglass" : "rocket";
|
||||
_id = prop + "_in_game";
|
||||
cc.fx.GameConfig.GM_INFO[prop + "Amount"] += num;
|
||||
propNumber = cc.fx.GameConfig.GM_INFO[prop + "Amount"];
|
||||
}
|
||||
const timestamp = Date.now();
|
||||
let propInfo = cc.fx.StorageMessage.getStorage("prop");
|
||||
let propInfo = cc.fx.StorageMessage.getStorage("prop") || {};
|
||||
propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
|
||||
propInfo.magicAmount = cc.fx.GameConfig.GM_INFO.magicAmount;
|
||||
propInfo.freezeAmount = cc.fx.GameConfig.GM_INFO.freezeAmount;
|
||||
propInfo.hourglassAmount = cc.fx.GameConfig.GM_INFO.hourglassAmount;
|
||||
propInfo.rocketAmount = cc.fx.GameConfig.GM_INFO.rocketAmount;
|
||||
propInfo.timestamp = timestamp;
|
||||
|
||||
cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||
@@ -937,6 +949,15 @@ var GameTool = {
|
||||
},
|
||||
|
||||
//改变用户道具
|
||||
saveStartBoostInventory(prop: "hourglass" | "rocket") {
|
||||
const amount = cc.fx.GameConfig.GM_INFO[prop + "Amount"];
|
||||
const cached = cc.fx.StorageMessage.getStorage("prop") || {};
|
||||
cached[prop + "Amount"] = amount;
|
||||
cached.timestamp = Date.now();
|
||||
cc.fx.StorageMessage.setStorage("prop", cached);
|
||||
this.setUserProp(prop === "hourglass" ? 2006 : 2007, amount, null);
|
||||
},
|
||||
|
||||
setUserProp(propid, amount, callback) {
|
||||
//@ts-ignore
|
||||
if ((typeof wx !== 'undefined' && wx !== null) || (typeof tt !== 'undefined' && tt !== null)) {
|
||||
@@ -958,7 +979,7 @@ var GameTool = {
|
||||
else if (propid == 2002) {
|
||||
newPropData = amount;
|
||||
}
|
||||
else if (propid == 2003) {
|
||||
else if (propid == 2003 || propid == 2006 || propid == 2007) {
|
||||
newPropData = amount;
|
||||
}
|
||||
|
||||
@@ -1546,10 +1567,12 @@ var GameTool = {
|
||||
stage_id: userLevel,
|
||||
is_frenzy: data.is_frenzy,
|
||||
infinity: data.infinity,
|
||||
pilot_drop: data.pilot_drop || 0,
|
||||
}
|
||||
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
||||
eventData = {
|
||||
stage_id: cc.fx.GameConfig.GM_INFO.otherLevel,
|
||||
pilot_drop: data.pilot_drop || 0,
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user