You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.8 KiB
90 lines
3.8 KiB
// Learn TypeScript:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
|
|
// Learn Attribute:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
|
|
// Learn life-cycle callbacks:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
|
|
|
|
import BagManager from "./BagManager";
|
|
import InterfaceManager from "./InterfaceManager";
|
|
|
|
|
|
|
|
|
|
|
|
//掏粪
|
|
// const {ccclass, property} = cc._decorator;
|
|
// let TaoFenConfigs = [
|
|
// { buyNum:5, goodId:1601,descStr:'蛇皮袋', goodName:'蛇皮袋', priceNum:3},
|
|
// { buyNum:5, goodId:1602,descStr:'大葱',goodName:'大葱', priceNum:5},
|
|
// { buyNum:5, goodId:1603,descStr:'钓鱼线',goodName:'钓鱼线', priceNum:6},
|
|
// { buyNum:5, goodId:1604,descStr:'螺丝',goodName:'螺丝', priceNum:8},
|
|
// { buyNum:5, goodId:1605,descStr:'白糖',goodName:'白糖', priceNum:9},
|
|
// { buyNum:5, goodId:1606,descStr:'墨水',goodName:'墨水', priceNum:10},
|
|
// { buyNum:5, goodId:1607,descStr:'拖把头子',goodName:'拖把头子', priceNum:12},
|
|
// { buyNum:5, goodId:1608,descStr:'花椒',goodName:'花椒', priceNum:15},
|
|
// { buyNum:5, goodId:1609,descStr:'小黄鸭',goodName:'小黄鸭', priceNum:18},
|
|
// { buyNum:3, goodId:1610,descStr:'瓷盘', goodName:'瓷盘', priceNum:20 },
|
|
// { buyNum:3, goodId:1611,descStr:'佛手柑', goodName:'佛手柑', priceNum:22},
|
|
// { buyNum:3, goodId:1612,descStr:'针线盒', goodName:'针线盒', priceNum:38},
|
|
// { buyNum:3, goodId:1613,descStr:'洞洞鞋', goodName:'洞洞鞋', priceNum:45},
|
|
// { buyNum:3, goodId:1614,descStr:'假发', goodName:'假发', priceNum:50},
|
|
// { buyNum:3, goodId:1615,descStr:'煤气罐', goodName:'煤气罐', priceNum:80},
|
|
// { buyNum:2, goodId:1616,descStr:'润滑油', goodName:'润滑油', priceNum:100},
|
|
// { buyNum:2, goodId:1617,descStr:'口红', goodName:'口红', priceNum:180},
|
|
// { buyNum:2, goodId:1618,descStr:'滑板', goodName:'滑板', priceNum:220},
|
|
// { buyNum:2, goodId:1619,descStr:'大章鱼', goodName:'大章鱼', priceNum:320},
|
|
// { buyNum:1, goodId:1620,descStr:'帽子', goodName:'帽子', priceNum:480},
|
|
// { buyNum:1, goodId:1621,descStr:'琥珀', goodName:'琥珀', priceNum:1000},
|
|
// { buyNum:1, goodId:1622,descStr:'金戒指', goodName:'金戒指', priceNum:1800},
|
|
// { buyNum:1, goodId:1623,descStr:'金项链', goodName:'金项链', priceNum:2400},
|
|
// { buyNum:1, goodId:1624,descStr:'恐龙化石', goodName:'恐龙化石', priceNum:8000},
|
|
// { buyNum:1, goodId:1625,descStr:'钻戒', goodName:'钻戒', priceNum:10000},
|
|
|
|
// ]
|
|
|
|
|
|
|
|
|
|
export default class TaoFenManager{
|
|
static gameConfigs = [];
|
|
|
|
public static getManagerConfigs(){
|
|
return this.gameConfigs
|
|
}
|
|
|
|
|
|
public static initManager(callFunc){
|
|
let self = this
|
|
cc.loader.loadRes('Json/gameConfig/taofen.json', function (err, gameconfig) {
|
|
if (err) {
|
|
console.log(err);
|
|
return;
|
|
}
|
|
self.gameConfigs = gameconfig.json;
|
|
callFunc()
|
|
console.log("游戏配置加载成功taofen");
|
|
});
|
|
}
|
|
|
|
public static getCurGoodList(){
|
|
//将任务/剧情道具替换掉最后的商品
|
|
let daoYeList = InterfaceManager.getDaoyeList()
|
|
let replaceGoodsTab = []
|
|
for(let i=0;i<daoYeList.length;i++){
|
|
let goodId = daoYeList[i].goodId
|
|
if(daoYeList[i].gameType == '管道疏通' && BagManager.getBagGoodNums(goodId) <= 0){
|
|
replaceGoodsTab.push(BagManager.getJuQingGoodConfig(goodId))
|
|
}
|
|
}
|
|
let useConfig = []
|
|
for(let i=0;i<this.gameConfigs.length-replaceGoodsTab.length;i++){
|
|
useConfig.push(this.gameConfigs[i])
|
|
}
|
|
for(let j=0;j<replaceGoodsTab.length;j++){
|
|
useConfig.push(replaceGoodsTab[j])
|
|
}
|
|
return useConfig
|
|
}
|
|
|
|
}
|
|
|