Commit 5d6271da by 张树文

去除体力系统

1 parent eeda0317
Showing with 96 additions and 1087 deletions
...@@ -5,7 +5,6 @@ export interface GlobalVariableType extends EditorGlobalVariableType { ...@@ -5,7 +5,6 @@ export interface GlobalVariableType extends EditorGlobalVariableType {
/**存回档后不变的数据 */ /**存回档后不变的数据 */
customPlots: { [key: string]: ReadonlyPlot }; customPlots: { [key: string]: ReadonlyPlot };
customPlotId: number; customPlotId: number;
plotUseEnergy: number;
} }
export interface RecordVariableType extends EditorRecordVariableType { export interface RecordVariableType extends EditorRecordVariableType {
...@@ -26,7 +25,6 @@ export const recordVariableConstrains: { [key: string]: { min?: number, max?: nu ...@@ -26,7 +25,6 @@ export const recordVariableConstrains: { [key: string]: { min?: number, max?: nu
export const defaultGlobalVariables: GlobalVariableType = { export const defaultGlobalVariables: GlobalVariableType = {
customPlots: {}, customPlots: {},
customPlotId: -100, customPlotId: -100,
plotUseEnergy: -1,
...editorDefaultGlobalVariables ...editorDefaultGlobalVariables
} }
......
...@@ -1072,54 +1072,6 @@ export namespace GameModelManager { ...@@ -1072,54 +1072,6 @@ export namespace GameModelManager {
GameRecord.autoSave(); GameRecord.autoSave();
} }
export async function plotUseEnergy(plotId: number) {
if (GameRecord.globalVariables.plotUseEnergy === plotId) return true; // 当前剧情已扣过体力
let player = getPlayerData();
let currEnergy = player.getEnergy();
const costEnergy: boolean = false;//是否消耗体力
if (!costEnergy) {
GameRecord.globalVariables.plotUseEnergy = plotId;
return true;
}
// if (currEnergy >= GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE) {
// GameRecord.globalVariables.plotUseEnergy = plotId;
// player.addEnergy(GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE * (-1));
// return true;
// }
// // TODO 提示体力不足,跳转购买体力?
// let ret = await UIUtils.showAddEnergy(getItemConfig(GameConstData.GAME_CONST_ENERGY_PROPS_ID), getPlayerData().getProps(GameConstData.GAME_CONST_ENERGY_PROPS_ID));
// if (ret) {
// let itemconfig = GameModelManager.getItemConfig(GameConstData.GAME_CONST_ENERGY_PROPS_ID);
// player.addEnergy(itemconfig.energy_recover - GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE);
// GameRecord.globalVariables.plotUseEnergy = plotId;
// UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_ADADDSUCCESS_VALUE));
// return true;
// } else {
// let itemcount = player.getProps(GameConstData.GAME_CONST_ENERGY_PROPS_ID);
// itemcount = itemcount === undefined ? 0 : itemcount;
// if (itemcount <= 0) {
// UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_ADADDFAILED_VALUE));
// }
// return false;
// }
}
// functions about gift
/**
* return:1.return all gifts ids which you can use to show;
* 2.contains default unlocked gifts and plot-unlcked-and really unlocked gifts
*/
// export function getGiftList(): number[] {
// analysisGiftConfigArr();
// let r = getRecordAlreadyUnlockedGifts();
// let ret: number[] = [];
// ret = ret.concat(defaultUnlockedGiftArr, r);
// return ret;
// }
/** /**
* return:1.return all of the plot-unlocked-gifts ids arr; * return:1.return all of the plot-unlocked-gifts ids arr;
*/ */
...@@ -1492,50 +1444,6 @@ export namespace GameModelManager { ...@@ -1492,50 +1444,6 @@ export namespace GameModelManager {
return ret; return ret;
} }
//about lucky draw end
// export function getDateSceneKeyPlotsProgress(sceneId: number): number {
// let progresss: number = 0;
// let cfg = ConfigManager.getConfig(dateSceneConfig, sceneId);
// let keyPlots = cfg.accomplish_plots;
// if (!keyPlots || keyPlots.length === 0) {
// progresss = 100;
// } else {
// let recordKeyStr: string = "date_key_plots_scene_" + sceneId;
// let recordStr: string = GameRecord.globalVariables[recordKeyStr] as string;
// let recordKeyPlots: number[] = [];
// if (recordStr && "" !== recordStr.trim()) {
// recordKeyPlots = JSON.parse(recordStr) as number[];
// }
// progresss = recordKeyPlots.length / keyPlots.length * 100;
// }
// return progresss;
// }
// export function pushDateSceneKeyPlot(sceneId: number, plotId: number) {
// let progress = getDateSceneKeyPlotsProgress(sceneId);
// if (progress === 100) {
// return;
// }
// let cfg = ConfigManager.getConfig(dateSceneConfig, sceneId);
// let keyPlots = cfg.accomplish_plots;
// if (keyPlots.findIndex((v) => v === plotId) < 0) {
// return;
// }
// let recordKeyStr: string = "date_key_plots_scene_" + sceneId;
// let recordStr: string = GameRecord.globalVariables[recordKeyStr] as string;
// let recordKeyPlots: number[] = [];
// if (recordStr && "" !== recordStr.trim()) {
// recordKeyPlots = JSON.parse(recordStr) as number[];
// }
// if (recordKeyPlots.findIndex((v) => v === plotId) < 0) {
// recordKeyPlots.push(plotId);
// GameRecord.globalVariables[recordKeyStr] = JSON.stringify(recordKeyPlots);
// GameRecord.saveRecord();
// GameModelManager.RefreshDateSceneProgress.emit();
// }
// }
export function getGraceLevelByGraceValue(value: number): number { export function getGraceLevelByGraceValue(value: number): number {
let level = 0; let level = 0;
let cfgs = ConfigManager.getAllConfig(relationLevelConfig); let cfgs = ConfigManager.getAllConfig(relationLevelConfig);
...@@ -1700,31 +1608,6 @@ export namespace GameModelManager { ...@@ -1700,31 +1608,6 @@ export namespace GameModelManager {
return mark; return mark;
} }
export function checkIsNeedResumeFullEnergy(): boolean {
let isResume: boolean = false;
let timeKeyStr: string = "resume_full_energy_time";
let timeRecord = GameRecord.globalVariables[timeKeyStr] as number;
if (timeRecord) {
let over = checkOverdue(timeRecord);
if (over) {
isResume = true;
}
}
return isResume;
}
export function dealAutoResumeFullEnergy() {
let isResume: boolean = checkIsNeedResumeFullEnergy();
if (isResume) {
let r = getPlayerData();
let e = r.getEnergy();
r.addEnergy(GameConstData.GAME_CONST_ENERGY_MAX - e);
let timeKeyStr: string = "resume_full_energy_time";
GameRecord.globalVariables[timeKeyStr] = 0;
GameRecord.saveRecord();
}
}
export function checkIsOverPlotLimitTime() { export function checkIsOverPlotLimitTime() {
let isOver: boolean = false; let isOver: boolean = false;
let timeKeyStr: string = "plot_limit_time"; let timeKeyStr: string = "plot_limit_time";
......
...@@ -13,13 +13,9 @@ import { GameModelManager } from "./GameModelManager"; ...@@ -13,13 +13,9 @@ import { GameModelManager } from "./GameModelManager";
export default class GameRoleDataModel { export default class GameRoleDataModel {
private _cfg: DeepReadonlyObject<IRole> = undefined as unknown as DeepReadonlyObject<IRole>; private _cfg: DeepReadonlyObject<IRole> = undefined as unknown as DeepReadonlyObject<IRole>;
private _goldcoin: number = 0;//金币
private _clothcoin: number = 0;//服装币
private _skins: number[] = [];
private _curSkin: number = -1; private _curSkin: number = -1;
private _skinMaps: Set<number> = new Set<number>(); private _skinMaps: Set<number> = new Set<number>();
private _roleName: string = ""; private _roleName: string = "";
private _energyValue: number = 0;//灵力值
private _itemMaps: Map<number, number> = new Map<number, number>(); private _itemMaps: Map<number, number> = new Map<number, number>();
...@@ -34,7 +30,6 @@ export default class GameRoleDataModel { ...@@ -34,7 +30,6 @@ export default class GameRoleDataModel {
initDate() { initDate() {
this.initSkin(); this.initSkin();
this.initCoin();
this.initData(); this.initData();
this.initVariablesChange(); this.initVariablesChange();
} }
...@@ -168,10 +163,6 @@ export default class GameRoleDataModel { ...@@ -168,10 +163,6 @@ export default class GameRoleDataModel {
} }
} }
initCoin() {
}
getOwnedSkins(): Set<number> { getOwnedSkins(): Set<number> {
return this._skinMaps; return this._skinMaps;
} }
...@@ -230,44 +221,6 @@ export default class GameRoleDataModel { ...@@ -230,44 +221,6 @@ export default class GameRoleDataModel {
return ret; return ret;
} }
public getEnergy(isceil: boolean = true): number {
let e = this._itemMaps.get(GamePropType.Energy) as number;
if (isceil) {
return Math.ceil(e);
}
return e;
}
public addEnergy(value: number) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// GameDotMgr.getInstance().dotCost(CostType.EnergyCost, Math.abs(value));
// }
this.addProps(GamePropType.Energy, value);
}
public getGoldCoin(): number {
return this._itemMaps.get(GamePropType.GoldCoin) as number;
}
public addGoldCoin(value: number) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// GameDotMgr.getInstance().dotCost(CostType.GoldCost, Math.abs(value));
// }
this.addProps(GamePropType.GoldCoin, value);
}
public getClothCoin() {
let coin = this._itemMaps.get(GamePropType.Diamond) as number;
return coin ? coin : 0;
}
public addClothCoin(value: number) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// // GameDotMgr.getInstance().dotCost(CostType.SilverCost, Math.abs(value));
// GameDotMgr.getInstance().dotCost(CostType.DiamondCost, Math.abs(value));
// }
this.addProps(GamePropType.Diamond, value);
}
public getRoleName() { public getRoleName() {
if (!this._roleName || this._roleName === "") { if (!this._roleName || this._roleName === "") {
......
...@@ -136,32 +136,24 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList ...@@ -136,32 +136,24 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList
GameModelManager.dotMainLinePlotStart(); GameModelManager.dotMainLinePlotStart();
} }
this._currPlotShowed = false; this._currPlotShowed = false;
let player = GameModelManager.getPlayerData();
// if (player.getEnergy() >= GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE)//little brother bojie has written wrong judgement condition ,let me modify try try
// await this.showCurrPlot();
let item = this.convertPlotToViewModel(this._currPlot); let item = this.convertPlotToViewModel(this._currPlot);
let e = player.getEnergy(); await this.showCurrPlot();
let through = e !== 0; if (this._plotChangeLike) {
let costEnergy = false; item = { ...this._chatList.pop()! };
through = costEnergy ? through : true; if (item.type === "plot") {
if (through) { item.addLike = this._plotChangeLike;
await this.showCurrPlot(); }
if (this._plotChangeLike) { this._chatList.push(item);
item = { ...this._chatList.pop()! }; this.view.updateProps({ items: this._chatList });
if (item.type === "plot") { }
item.addLike = this._plotChangeLike; if (item) {
} if (this._cachePId !== this._currPlot.id && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
this._chatList.push(item); this._chatList.push(item);
this._cachePId = this._currPlot.id;
this.view.updateProps({ items: this._chatList }); this.view.updateProps({ items: this._chatList });
} }
if (item) {
if (this._cachePId !== this._currPlot.id && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
this._chatList.push(item);
this._cachePId = this._currPlot.id;
this.view.updateProps({ items: this._chatList });
}
}
} }
} }
} }
...@@ -216,11 +208,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList ...@@ -216,11 +208,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList
selectSentence = (index: number) => { selectSentence = (index: number) => {
if (!this._currPlot) throw new Error("ChatList: ePlot error! No currnt plot!"); if (!this._currPlot) throw new Error("ChatList: ePlot error! No currnt plot!");
// let t = GameModelManager.checkIsDotTutorial();
// if (t) {
// let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + PlotSceneType.Message] as number;
// GameDotMgr.getInstance().dotTutorial(TutorialType.Message, TutorialState.SelectSentenceRet, { session: plotScenTypeSession, plotId: this._currPlot!.id, select: index });
// }
this.completePlot(index, ChatListAutoNextPlot); this.completePlot(index, ChatListAutoNextPlot);
} }
...@@ -228,9 +215,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList ...@@ -228,9 +215,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList
if (this._currPlot && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) { if (this._currPlot && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
let item = this.convertPlotToViewModel(this._currPlot); let item = this.convertPlotToViewModel(this._currPlot);
if (item && this._currPlot.sentences[0].roleId !== 1 && item.type !== "customplot") { // 除了旁白,扣体力 if (item && this._currPlot.sentences[0].roleId !== 1 && item.type !== "customplot") { // 除了旁白,扣体力
if (!await GameModelManager.plotUseEnergy(this._currPlot.id)) {
return;
}
if (!this._currPlot) return; if (!this._currPlot) return;
} }
this._excutedPlots[this._currPlot.id] = true; this._excutedPlots[this._currPlot.id] = true;
......
...@@ -38,7 +38,6 @@ export default class DatingEventViewPresenter extends Presenter<undefined, Datin ...@@ -38,7 +38,6 @@ export default class DatingEventViewPresenter extends Presenter<undefined, Datin
onOpen() { onOpen() {
super.onOpen(undefined); super.onOpen(undefined);
this._disposable.add(GameModelManager.CheckDateSceneProgress.on(this.checkDateProgress));
this._disposable.add(GameModelManager.ShowDatingEventArrowGuide.on(this.onShowDatingEventArrowGuide)); this._disposable.add(GameModelManager.ShowDatingEventArrowGuide.on(this.onShowDatingEventArrowGuide));
this.onShow(); this.onShow();
} }
...@@ -60,33 +59,6 @@ export default class DatingEventViewPresenter extends Presenter<undefined, Datin ...@@ -60,33 +59,6 @@ export default class DatingEventViewPresenter extends Presenter<undefined, Datin
super.onClose(); super.onClose();
} }
checkDateProgress = () => {
// let info = GameModelManager.getShowDateProgressInfo();
// if (!info.isSkin && !info.sceneId) {
// return;
// }
// GameModelManager.registerAutoPopView(AutoPopViewType.DatingProgress);
// if (info.isSkin) {
// let itemId = 0;
// let cfgs = ConfigManager.getAllConfig(itemConfig);
// for (let id in cfgs) {
// let cfg = cfgs[id];
// if (cfg && cfg.ItemUnlockType === ItemUnlockType.ItemUnlock_DateProgress) {
// itemId = cfg.id;
// }
// }
// let item = ConfigManager.getConfig(itemConfig, itemId);
// let splitArr: string[] = item.icon.split("_");
// let roleId = parseInt(splitArr[0]);
// let skinId = parseInt(splitArr[1]);
// let role = GameModelManager.getRoleData(roleId);
// if (role) {
// role.addSkin(skinId);
// GameModelManager.addSkinItemToRecord(itemId);
// }
// }
}
onShowDatingEventArrowGuide = (isShow: boolean, wordPos?: cc.Vec3) => { onShowDatingEventArrowGuide = (isShow: boolean, wordPos?: cc.Vec3) => {
this.view.showArrowGuide(isShow, wordPos); this.view.showArrowGuide(isShow, wordPos);
} }
...@@ -449,113 +421,12 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> { ...@@ -449,113 +421,12 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {
this.refreshItems(); this.refreshItems();
} }
onItemEnergyCostClick = (key: string) => {
// GameModelManager.setGuideEventItemRecord(key, GuideState.Complete);
// let m = this._modelMap[key];
// let cost = m.config.first_energy_cost;
// let isReview: boolean = false;
// switch (m.status) {
// case DatingEventStatus.New:
// {
// cost = m.config.first_energy_cost;
// }
// break;
// case DatingEventStatus.InProgress:
// {
// cost = 0;
// }
// break;
// case DatingEventStatus.Locked:
// {
// cost = 0;
// }
// break;
// case DatingEventStatus.Completed:
// {
// cost = m.config.memory_energy_cost;
// isReview = true;
// }
// break;
// }
// let role = GameModelManager.getPlayerData();
// let energy = role.getEnergy();
// let isEnergyEnough = energy >= cost;
// let isEnterWhenEnergyEnough: boolean = true;
// if (isEnterWhenEnergyEnough) {
// if (isEnergyEnough) {
// role.addEnergy(cost * (-1));
// this.enterDatingScene(key);
// return;
// }
// }
// if (cost === 0) {
// this.enterDatingScene(key);
// } else {
// let ennergyPropNum = role.getProps(GamePropType.EnergyDrink);
// ennergyPropNum = ennergyPropNum ? ennergyPropNum : 0;
// let cfg = ConfigManager.getConfig(itemConfig, GamePropType.EnergyDrink);
// let hasAd = energy < cost && ennergyPropNum < 1;
// let title = energy < cost ? GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_ENERGY_WEAK)
// : GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_ENERGY_COST);
// let content = "";
// if (energy >= cost) {
// let formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_ENERGY_REVIEW);
// if (!isReview) {
// formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_ENERGY_OPEN);
// }
// content = StringUtils.format(formatStr, cost, energy);
// } else {
// if (!hasAd) {
// let formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_DRINK_REVIEW);
// if (!isReview) {
// formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_DRINK_OPEN);
// }
// content = StringUtils.format(formatStr, 1, cfg.energy_recover, cost, ennergyPropNum);
// } else {
// if (isReview) {
// content = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_SHOW_AD_REVIEW);
// } else {
// content = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_SHOW_AD_OPEN);
// }
// }
// }
// this.isReview = isReview;
// let temp: AlertDialogViewProps =
// {
// dataptr: { key, cost },
// titlecontent: title,
// content: content,
// ishasad: hasAd,
// istwobtn: true,
// adconfig: hasAd ? "inject_fruit" : "",
// // items: [],
// location: CommonLocation.Event,
// callback:
// energy >= cost ? this.costEnergyCallBack
// : hasAd ? this.showAdCallBack : this.costDrinkCallBack,
// hasBanner: true
// };
// //弹框打点
// let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event;
// let location = EventLocation.ShowEnergyCost;
// if (energy >= cost) { //花费体力
// } else if (!hasAd) { //能量饮料
// oprType = EventOperationType.power
// location = EventLocation.ShowPowerPopup;
// }
// GameDotMgr.getInstance().dotEvent(oprType, location);
// UIManager.pushPresenter(AlertDialogViewPresenter, temp);
// }
}
costEnergyCallBack = (type, ret: boolean, param: any) => { costEnergyCallBack = (type, ret: boolean, param: any) => {
if (ret) { if (ret) {
let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event; let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event;
let location = EventLocation.ClickEnergyCost; let location = EventLocation.ClickEnergyCost;
GameDotMgr.getInstance().dotEvent(oprType, location); GameDotMgr.getInstance().dotEvent(oprType, location);
let role = GameModelManager.getPlayerData(); let role = GameModelManager.getPlayerData();
role.addEnergy(param.cost * (-1));
let key = param["key"] as string; let key = param["key"] as string;
let m = this._modelMap[key]; let m = this._modelMap[key];
this.pushSceneAdToRecord(m.id); this.pushSceneAdToRecord(m.id);
...@@ -565,25 +436,6 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> { ...@@ -565,25 +436,6 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {
} }
} }
costDrinkCallBack = (type, ret: boolean, param: any) => {
// if (ret) {
// let oprType = EventOperationType.power
// let location = EventLocation.ClickPowerPopup;
// GameDotMgr.getInstance().dotEvent(oprType, location);
// let role = GameModelManager.getPlayerData();
// let cfg = ConfigManager.getConfig(itemConfig, GamePropType.EnergyDrink);
// role.addEnergy(cfg.energy_recover);
// role.addProps(GamePropType.EnergyDrink, -1);
// role.addEnergy(param.cost * (-1));
// let key = param["key"] as string;
// let m = this._modelMap[key];
// this.pushSceneAdToRecord(m.id);
// setTimeout(() => {
// this.enterDatingScene(key);
// }, 300);
// }
}
refreshArrowGuide() { refreshArrowGuide() {
let srcModels = GameModelManager.getMainDatingEventScenesModelByChapterindex(this._curChapterIndex); let srcModels = GameModelManager.getMainDatingEventScenesModelByChapterindex(this._curChapterIndex);
...@@ -618,7 +470,7 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> { ...@@ -618,7 +470,7 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {
if (!this._isStartBranches) { if (!this._isStartBranches) {
this.onItemAdModeClick(k); this.onItemAdModeClick(k);
} else { } else {
// this.view.unschedule(this.checkCanEnterDatingScene); //@ts-ignore
this.view.schedule(this.checkCanEnterDatingScene, 0.1); this.view.schedule(this.checkCanEnterDatingScene, 0.1);
} }
} }
...@@ -626,6 +478,7 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> { ...@@ -626,6 +478,7 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {
checkCanEnterDatingScene = () => { checkCanEnterDatingScene = () => {
if (!this._isStartBranches) { if (!this._isStartBranches) {
this.onItemAdModeClick(this._clickKey); this.onItemAdModeClick(this._clickKey);
//@ts-ignore
this.view.unschedule(this.checkCanEnterDatingScene); this.view.unschedule(this.checkCanEnterDatingScene);
} }
} }
......
...@@ -146,16 +146,4 @@ export default class ExchangeCodeViewPresenter extends Presenter<ExchangeCodePar ...@@ -146,16 +146,4 @@ export default class ExchangeCodeViewPresenter extends Presenter<ExchangeCodePar
} }
} }
} }
addSkin(itemId: number) {
// let item = ConfigManager.getConfig(itemConfig, itemId);
// let splitArr: string[] = item.icon.split("_");
// let roleId = parseInt(splitArr[0]);
// let skinId = parseInt(splitArr[1]);
// let role = GameModelManager.getRoleData(roleId);
// if (role) {
// role.addSkin(skinId);
// GameModelManager.addSkinItemToRecord(itemId);
// }
}
} }
\ No newline at end of file
...@@ -162,7 +162,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -162,7 +162,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
this._viewProps.selectedTab = MainTabs.datingEventTab; this._viewProps.selectedTab = MainTabs.datingEventTab;
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态 //进入主界面更新红点状态
setTimeout(() => { setTimeout(() => {
//关闭等待界面 //关闭等待界面
...@@ -498,8 +497,7 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -498,8 +497,7 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
GameModelManager.checkAutoPopView(); GameModelManager.checkAutoPopView();
} }
} }
this._tabClickAble = true; this._tabClickAble = true
GameModelManager.dealAutoResumeFullEnergy();
} }
/** /**
......
...@@ -11,18 +11,13 @@ const GameTextData_1 = require("../../common/gameplay/gamedata/GameTextData"); ...@@ -11,18 +11,13 @@ const GameTextData_1 = require("../../common/gameplay/gamedata/GameTextData");
const UIManager_1 = require("../../common/gameplay/managers/UIManager"); const UIManager_1 = require("../../common/gameplay/managers/UIManager");
const StringUtils_1 = require("../../common/utils/StringUtils"); const StringUtils_1 = require("../../common/utils/StringUtils");
const RelationLevelConfig_1 = require("../../config/RelationLevelConfig"); const RelationLevelConfig_1 = require("../../config/RelationLevelConfig");
const Enums_1 = require("../Enums");
const GameModelManager_1 = require("./GameModelManager"); const GameModelManager_1 = require("./GameModelManager");
class GameRoleDataModel { class GameRoleDataModel {
constructor() { constructor() {
this._cfg = undefined; this._cfg = undefined;
this._goldcoin = 0; //金币
this._clothcoin = 0; //服装币
this._skins = [];
this._curSkin = -1; this._curSkin = -1;
this._skinMaps = new Set(); this._skinMaps = new Set();
this._roleName = ""; this._roleName = "";
this._energyValue = 0; //灵力值
this._itemMaps = new Map(); this._itemMaps = new Map();
} }
setConfig(cfg) { setConfig(cfg) {
...@@ -34,7 +29,6 @@ class GameRoleDataModel { ...@@ -34,7 +29,6 @@ class GameRoleDataModel {
} }
initDate() { initDate() {
this.initSkin(); this.initSkin();
this.initCoin();
this.initData(); this.initData();
this.initVariablesChange(); this.initVariablesChange();
} }
...@@ -154,8 +148,6 @@ class GameRoleDataModel { ...@@ -154,8 +148,6 @@ class GameRoleDataModel {
this._skinMaps.add(parseInt(skinSpilt[index])); this._skinMaps.add(parseInt(skinSpilt[index]));
} }
} }
initCoin() {
}
getOwnedSkins() { getOwnedSkins() {
return this._skinMaps; return this._skinMaps;
} }
...@@ -214,39 +206,6 @@ class GameRoleDataModel { ...@@ -214,39 +206,6 @@ class GameRoleDataModel {
AVG_1.GameRecord.saveRecord(); AVG_1.GameRecord.saveRecord();
return ret; return ret;
} }
getEnergy(isceil = true) {
let e = this._itemMaps.get(Enums_1.GamePropType.Energy);
if (isceil) {
return Math.ceil(e);
}
return e;
}
addEnergy(value) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// GameDotMgr.getInstance().dotCost(CostType.EnergyCost, Math.abs(value));
// }
this.addProps(Enums_1.GamePropType.Energy, value);
}
getGoldCoin() {
return this._itemMaps.get(Enums_1.GamePropType.GoldCoin);
}
addGoldCoin(value) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// GameDotMgr.getInstance().dotCost(CostType.GoldCost, Math.abs(value));
// }
this.addProps(Enums_1.GamePropType.GoldCoin, value);
}
getClothCoin() {
let coin = this._itemMaps.get(Enums_1.GamePropType.Diamond);
return coin ? coin : 0;
}
addClothCoin(value) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// // GameDotMgr.getInstance().dotCost(CostType.SilverCost, Math.abs(value));
// GameDotMgr.getInstance().dotCost(CostType.DiamondCost, Math.abs(value));
// }
this.addProps(Enums_1.GamePropType.Diamond, value);
}
getRoleName() { getRoleName() {
if (!this._roleName || this._roleName === "") { if (!this._roleName || this._roleName === "") {
return this._cfg.name; return this._cfg.name;
......
...@@ -1023,51 +1023,6 @@ var GameModelManager; ...@@ -1023,51 +1023,6 @@ var GameModelManager;
AVG_1.GameRecord.autoSave(); AVG_1.GameRecord.autoSave();
} }
GameModelManager.setRedPotState = setRedPotState; GameModelManager.setRedPotState = setRedPotState;
async function plotUseEnergy(plotId) {
if (AVG_1.GameRecord.globalVariables.plotUseEnergy === plotId)
return true; // 当前剧情已扣过体力
let player = getPlayerData();
let currEnergy = player.getEnergy();
const costEnergy = false; //是否消耗体力
if (!costEnergy) {
AVG_1.GameRecord.globalVariables.plotUseEnergy = plotId;
return true;
}
// if (currEnergy >= GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE) {
// GameRecord.globalVariables.plotUseEnergy = plotId;
// player.addEnergy(GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE * (-1));
// return true;
// }
// // TODO 提示体力不足,跳转购买体力?
// let ret = await UIUtils.showAddEnergy(getItemConfig(GameConstData.GAME_CONST_ENERGY_PROPS_ID), getPlayerData().getProps(GameConstData.GAME_CONST_ENERGY_PROPS_ID));
// if (ret) {
// let itemconfig = GameModelManager.getItemConfig(GameConstData.GAME_CONST_ENERGY_PROPS_ID);
// player.addEnergy(itemconfig.energy_recover - GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE);
// GameRecord.globalVariables.plotUseEnergy = plotId;
// UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_ADADDSUCCESS_VALUE));
// return true;
// } else {
// let itemcount = player.getProps(GameConstData.GAME_CONST_ENERGY_PROPS_ID);
// itemcount = itemcount === undefined ? 0 : itemcount;
// if (itemcount <= 0) {
// UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_ADADDFAILED_VALUE));
// }
// return false;
// }
}
GameModelManager.plotUseEnergy = plotUseEnergy;
// functions about gift
/**
* return:1.return all gifts ids which you can use to show;
* 2.contains default unlocked gifts and plot-unlcked-and really unlocked gifts
*/
// export function getGiftList(): number[] {
// analysisGiftConfigArr();
// let r = getRecordAlreadyUnlockedGifts();
// let ret: number[] = [];
// ret = ret.concat(defaultUnlockedGiftArr, r);
// return ret;
// }
/** /**
* return:1.return all of the plot-unlocked-gifts ids arr; * return:1.return all of the plot-unlocked-gifts ids arr;
*/ */
...@@ -1435,47 +1390,6 @@ var GameModelManager; ...@@ -1435,47 +1390,6 @@ var GameModelManager;
return ret; return ret;
} }
GameModelManager.checkSkinAndGraceCondition = checkSkinAndGraceCondition; GameModelManager.checkSkinAndGraceCondition = checkSkinAndGraceCondition;
//about lucky draw end
// export function getDateSceneKeyPlotsProgress(sceneId: number): number {
// let progresss: number = 0;
// let cfg = ConfigManager.getConfig(dateSceneConfig, sceneId);
// let keyPlots = cfg.accomplish_plots;
// if (!keyPlots || keyPlots.length === 0) {
// progresss = 100;
// } else {
// let recordKeyStr: string = "date_key_plots_scene_" + sceneId;
// let recordStr: string = GameRecord.globalVariables[recordKeyStr] as string;
// let recordKeyPlots: number[] = [];
// if (recordStr && "" !== recordStr.trim()) {
// recordKeyPlots = JSON.parse(recordStr) as number[];
// }
// progresss = recordKeyPlots.length / keyPlots.length * 100;
// }
// return progresss;
// }
// export function pushDateSceneKeyPlot(sceneId: number, plotId: number) {
// let progress = getDateSceneKeyPlotsProgress(sceneId);
// if (progress === 100) {
// return;
// }
// let cfg = ConfigManager.getConfig(dateSceneConfig, sceneId);
// let keyPlots = cfg.accomplish_plots;
// if (keyPlots.findIndex((v) => v === plotId) < 0) {
// return;
// }
// let recordKeyStr: string = "date_key_plots_scene_" + sceneId;
// let recordStr: string = GameRecord.globalVariables[recordKeyStr] as string;
// let recordKeyPlots: number[] = [];
// if (recordStr && "" !== recordStr.trim()) {
// recordKeyPlots = JSON.parse(recordStr) as number[];
// }
// if (recordKeyPlots.findIndex((v) => v === plotId) < 0) {
// recordKeyPlots.push(plotId);
// GameRecord.globalVariables[recordKeyStr] = JSON.stringify(recordKeyPlots);
// GameRecord.saveRecord();
// GameModelManager.RefreshDateSceneProgress.emit();
// }
// }
function getGraceLevelByGraceValue(value) { function getGraceLevelByGraceValue(value) {
let level = 0; let level = 0;
let cfgs = simba_config_manager_1.ConfigManager.getAllConfig(RelationLevelConfig_1.relationLevelConfig); let cfgs = simba_config_manager_1.ConfigManager.getAllConfig(RelationLevelConfig_1.relationLevelConfig);
...@@ -1637,31 +1551,6 @@ var GameModelManager; ...@@ -1637,31 +1551,6 @@ var GameModelManager;
return mark; return mark;
} }
GameModelManager.checkResumeFullEnergyMarked = checkResumeFullEnergyMarked; GameModelManager.checkResumeFullEnergyMarked = checkResumeFullEnergyMarked;
function checkIsNeedResumeFullEnergy() {
let isResume = false;
let timeKeyStr = "resume_full_energy_time";
let timeRecord = AVG_1.GameRecord.globalVariables[timeKeyStr];
if (timeRecord) {
let over = checkOverdue(timeRecord);
if (over) {
isResume = true;
}
}
return isResume;
}
GameModelManager.checkIsNeedResumeFullEnergy = checkIsNeedResumeFullEnergy;
function dealAutoResumeFullEnergy() {
let isResume = checkIsNeedResumeFullEnergy();
if (isResume) {
let r = getPlayerData();
let e = r.getEnergy();
r.addEnergy(GameConstData_1.GameConstData.GAME_CONST_ENERGY_MAX - e);
let timeKeyStr = "resume_full_energy_time";
AVG_1.GameRecord.globalVariables[timeKeyStr] = 0;
AVG_1.GameRecord.saveRecord();
}
}
GameModelManager.dealAutoResumeFullEnergy = dealAutoResumeFullEnergy;
function checkIsOverPlotLimitTime() { function checkIsOverPlotLimitTime() {
let isOver = false; let isOver = false;
let timeKeyStr = "plot_limit_time"; let timeKeyStr = "plot_limit_time";
......
...@@ -39,32 +39,6 @@ let DatingEventViewPresenter = /** @class */ (() => { ...@@ -39,32 +39,6 @@ let DatingEventViewPresenter = /** @class */ (() => {
let DatingEventViewPresenter = class DatingEventViewPresenter extends PresenterBase_1.Presenter { let DatingEventViewPresenter = class DatingEventViewPresenter extends PresenterBase_1.Presenter {
constructor() { constructor() {
super(); super();
this.checkDateProgress = () => {
// let info = GameModelManager.getShowDateProgressInfo();
// if (!info.isSkin && !info.sceneId) {
// return;
// }
// GameModelManager.registerAutoPopView(AutoPopViewType.DatingProgress);
// if (info.isSkin) {
// let itemId = 0;
// let cfgs = ConfigManager.getAllConfig(itemConfig);
// for (let id in cfgs) {
// let cfg = cfgs[id];
// if (cfg && cfg.ItemUnlockType === ItemUnlockType.ItemUnlock_DateProgress) {
// itemId = cfg.id;
// }
// }
// let item = ConfigManager.getConfig(itemConfig, itemId);
// let splitArr: string[] = item.icon.split("_");
// let roleId = parseInt(splitArr[0]);
// let skinId = parseInt(splitArr[1]);
// let role = GameModelManager.getRoleData(roleId);
// if (role) {
// role.addSkin(skinId);
// GameModelManager.addSkinItemToRecord(itemId);
// }
// }
};
this.onShowDatingEventArrowGuide = (isShow, wordPos) => { this.onShowDatingEventArrowGuide = (isShow, wordPos) => {
this.view.showArrowGuide(isShow, wordPos); this.view.showArrowGuide(isShow, wordPos);
}; };
...@@ -72,7 +46,6 @@ let DatingEventViewPresenter = /** @class */ (() => { ...@@ -72,7 +46,6 @@ let DatingEventViewPresenter = /** @class */ (() => {
} }
onOpen() { onOpen() {
super.onOpen(undefined); super.onOpen(undefined);
this._disposable.add(GameModelManager_1.GameModelManager.CheckDateSceneProgress.on(this.checkDateProgress));
this._disposable.add(GameModelManager_1.GameModelManager.ShowDatingEventArrowGuide.on(this.onShowDatingEventArrowGuide)); this._disposable.add(GameModelManager_1.GameModelManager.ShowDatingEventArrowGuide.on(this.onShowDatingEventArrowGuide));
this.onShow(); this.onShow();
} }
...@@ -216,111 +189,12 @@ let DatingEventSubpresenter = /** @class */ (() => { ...@@ -216,111 +189,12 @@ let DatingEventSubpresenter = /** @class */ (() => {
this.onRefreshDateSceneProgress = () => { this.onRefreshDateSceneProgress = () => {
this.refreshItems(); this.refreshItems();
}; };
this.onItemEnergyCostClick = (key) => {
// GameModelManager.setGuideEventItemRecord(key, GuideState.Complete);
// let m = this._modelMap[key];
// let cost = m.config.first_energy_cost;
// let isReview: boolean = false;
// switch (m.status) {
// case DatingEventStatus.New:
// {
// cost = m.config.first_energy_cost;
// }
// break;
// case DatingEventStatus.InProgress:
// {
// cost = 0;
// }
// break;
// case DatingEventStatus.Locked:
// {
// cost = 0;
// }
// break;
// case DatingEventStatus.Completed:
// {
// cost = m.config.memory_energy_cost;
// isReview = true;
// }
// break;
// }
// let role = GameModelManager.getPlayerData();
// let energy = role.getEnergy();
// let isEnergyEnough = energy >= cost;
// let isEnterWhenEnergyEnough: boolean = true;
// if (isEnterWhenEnergyEnough) {
// if (isEnergyEnough) {
// role.addEnergy(cost * (-1));
// this.enterDatingScene(key);
// return;
// }
// }
// if (cost === 0) {
// this.enterDatingScene(key);
// } else {
// let ennergyPropNum = role.getProps(GamePropType.EnergyDrink);
// ennergyPropNum = ennergyPropNum ? ennergyPropNum : 0;
// let cfg = ConfigManager.getConfig(itemConfig, GamePropType.EnergyDrink);
// let hasAd = energy < cost && ennergyPropNum < 1;
// let title = energy < cost ? GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_ENERGY_WEAK)
// : GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_ENERGY_COST);
// let content = "";
// if (energy >= cost) {
// let formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_ENERGY_REVIEW);
// if (!isReview) {
// formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_ENERGY_OPEN);
// }
// content = StringUtils.format(formatStr, cost, energy);
// } else {
// if (!hasAd) {
// let formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_DRINK_REVIEW);
// if (!isReview) {
// formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_DRINK_OPEN);
// }
// content = StringUtils.format(formatStr, 1, cfg.energy_recover, cost, ennergyPropNum);
// } else {
// if (isReview) {
// content = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_SHOW_AD_REVIEW);
// } else {
// content = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_SHOW_AD_OPEN);
// }
// }
// }
// this.isReview = isReview;
// let temp: AlertDialogViewProps =
// {
// dataptr: { key, cost },
// titlecontent: title,
// content: content,
// ishasad: hasAd,
// istwobtn: true,
// adconfig: hasAd ? "inject_fruit" : "",
// // items: [],
// location: CommonLocation.Event,
// callback:
// energy >= cost ? this.costEnergyCallBack
// : hasAd ? this.showAdCallBack : this.costDrinkCallBack,
// hasBanner: true
// };
// //弹框打点
// let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event;
// let location = EventLocation.ShowEnergyCost;
// if (energy >= cost) { //花费体力
// } else if (!hasAd) { //能量饮料
// oprType = EventOperationType.power
// location = EventLocation.ShowPowerPopup;
// }
// GameDotMgr.getInstance().dotEvent(oprType, location);
// UIManager.pushPresenter(AlertDialogViewPresenter, temp);
// }
};
this.costEnergyCallBack = (type, ret, param) => { this.costEnergyCallBack = (type, ret, param) => {
if (ret) { if (ret) {
let oprType = this.isReview ? Enums_1.EventOperationType.memory : Enums_1.EventOperationType.event; let oprType = this.isReview ? Enums_1.EventOperationType.memory : Enums_1.EventOperationType.event;
let location = Enums_1.EventLocation.ClickEnergyCost; let location = Enums_1.EventLocation.ClickEnergyCost;
GameDotMgr_1.default.getInstance().dotEvent(oprType, location); GameDotMgr_1.default.getInstance().dotEvent(oprType, location);
let role = GameModelManager_1.GameModelManager.getPlayerData(); let role = GameModelManager_1.GameModelManager.getPlayerData();
role.addEnergy(param.cost * (-1));
let key = param["key"]; let key = param["key"];
let m = this._modelMap[key]; let m = this._modelMap[key];
this.pushSceneAdToRecord(m.id); this.pushSceneAdToRecord(m.id);
...@@ -329,24 +203,6 @@ let DatingEventSubpresenter = /** @class */ (() => { ...@@ -329,24 +203,6 @@ let DatingEventSubpresenter = /** @class */ (() => {
}, 300); }, 300);
} }
}; };
this.costDrinkCallBack = (type, ret, param) => {
// if (ret) {
// let oprType = EventOperationType.power
// let location = EventLocation.ClickPowerPopup;
// GameDotMgr.getInstance().dotEvent(oprType, location);
// let role = GameModelManager.getPlayerData();
// let cfg = ConfigManager.getConfig(itemConfig, GamePropType.EnergyDrink);
// role.addEnergy(cfg.energy_recover);
// role.addProps(GamePropType.EnergyDrink, -1);
// role.addEnergy(param.cost * (-1));
// let key = param["key"] as string;
// let m = this._modelMap[key];
// this.pushSceneAdToRecord(m.id);
// setTimeout(() => {
// this.enterDatingScene(key);
// }, 300);
// }
};
this.onForceClickItem = (id) => { this.onForceClickItem = (id) => {
console.log("DatingEventSubpresenter onForceClickItem id = ", id); console.log("DatingEventSubpresenter onForceClickItem id = ", id);
let k = id + ""; let k = id + "";
...@@ -358,13 +214,14 @@ let DatingEventSubpresenter = /** @class */ (() => { ...@@ -358,13 +214,14 @@ let DatingEventSubpresenter = /** @class */ (() => {
this.onItemAdModeClick(k); this.onItemAdModeClick(k);
} }
else { else {
// this.view.unschedule(this.checkCanEnterDatingScene); //@ts-ignore
this.view.schedule(this.checkCanEnterDatingScene, 0.1); this.view.schedule(this.checkCanEnterDatingScene, 0.1);
} }
}; };
this.checkCanEnterDatingScene = () => { this.checkCanEnterDatingScene = () => {
if (!this._isStartBranches) { if (!this._isStartBranches) {
this.onItemAdModeClick(this._clickKey); this.onItemAdModeClick(this._clickKey);
//@ts-ignore
this.view.unschedule(this.checkCanEnterDatingScene); this.view.unschedule(this.checkCanEnterDatingScene);
} }
}; };
......
...@@ -326,7 +326,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -326,7 +326,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
}; };
/** /**
* 卧室返回点击UI事件 * 卧室返回点击UI事件
...@@ -391,7 +390,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -391,7 +390,6 @@ let MainViewPresenter = /** @class */ (() => {
this._viewProps.selectedTab = Enums_1.MainTabs.datingEventTab; this._viewProps.selectedTab = Enums_1.MainTabs.datingEventTab;
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态 //进入主界面更新红点状态
setTimeout(() => { setTimeout(() => {
//关闭等待界面 //关闭等待界面
......
...@@ -8,7 +8,7 @@ exports.defaultRecordVariables = exports.defaultGlobalVariables = exports.record ...@@ -8,7 +8,7 @@ exports.defaultRecordVariables = exports.defaultGlobalVariables = exports.record
const EditorGameVariables_1 = require("./EditorGameVariables"); const EditorGameVariables_1 = require("./EditorGameVariables");
exports.globalVariableConstrains = Object.assign({}, EditorGameVariables_1.editorGlobalVariableConstrains); exports.globalVariableConstrains = Object.assign({}, EditorGameVariables_1.editorGlobalVariableConstrains);
exports.recordVariableConstrains = Object.assign({}, EditorGameVariables_1.editorRecordVariableConstrains); exports.recordVariableConstrains = Object.assign({}, EditorGameVariables_1.editorRecordVariableConstrains);
exports.defaultGlobalVariables = Object.assign({ customPlots: {}, customPlotId: -100, plotUseEnergy: -1 }, EditorGameVariables_1.editorDefaultGlobalVariables); exports.defaultGlobalVariables = Object.assign({ customPlots: {}, customPlotId: -100 }, EditorGameVariables_1.editorDefaultGlobalVariables);
exports.defaultRecordVariables = Object.assign(Object.assign({}, EditorGameVariables_1.editorDefaultRecordVariables), { bgm: "" }); exports.defaultRecordVariables = Object.assign(Object.assign({}, EditorGameVariables_1.editorDefaultRecordVariables), { bgm: "" });
cc._RF.pop(); cc._RF.pop();
\ No newline at end of file
{"version":3,"sources":["assets/script/avg/game-data/GameVariables.ts"],"names":[],"mappings":";;;;;;;AAAA,+DAAuN;AAiB1M,QAAA,wBAAwB,qBAC9B,oDAA8B,EACpC;AAEY,QAAA,wBAAwB,qBAC9B,oDAA8B,EACpC;AAEY,QAAA,sBAAsB,mBAC/B,WAAW,EAAE,EAAE,EACf,YAAY,EAAE,CAAC,GAAG,EAClB,aAAa,EAAE,CAAC,CAAC,IACd,kDAA4B,EAClC;AAEY,QAAA,sBAAsB,mCAC5B,kDAA4B,KAC/B,GAAG,EAAE,EAAE,IACV","file":"","sourceRoot":"/","sourcesContent":["import { editorDefaultGlobalVariables, editorDefaultRecordVariables, editorGlobalVariableConstrains, EditorGlobalVariableType, editorRecordVariableConstrains, EditorRecordVariableType } from \"./EditorGameVariables\";\nimport { ReadonlyPlot } from \"simba-avg-core/dist/model/PlotModel\";\n\nexport interface GlobalVariableType extends EditorGlobalVariableType {\n /**存回档后不变的数据 */\n customPlots: { [key: string]: ReadonlyPlot };\n customPlotId: number;\n plotUseEnergy: number;\n}\n\nexport interface RecordVariableType extends EditorRecordVariableType {\n /**存跟着回档变化的数据 */\n \n /**当前游戏音乐 */\n bgm: string\n}\n\nexport const globalVariableConstrains: { [key: string]: { min?: number, max?: number } } = {\n ...editorGlobalVariableConstrains\n}\n\nexport const recordVariableConstrains: { [key: string]: { min?: number, max?: number } } = {\n ...editorRecordVariableConstrains\n}\n\nexport const defaultGlobalVariables: GlobalVariableType = {\n customPlots: {},\n customPlotId: -100,\n plotUseEnergy: -1,\n ...editorDefaultGlobalVariables\n}\n\nexport const defaultRecordVariables: RecordVariableType = {\n ...editorDefaultRecordVariables,\n bgm: \"\"\n}\n"]} {"version":3,"sources":["assets/script/avg/game-data/GameVariables.ts"],"names":[],"mappings":";;;;;;;AAAA,+DAAuN;AAgB1M,QAAA,wBAAwB,qBAC9B,oDAA8B,EACpC;AAEY,QAAA,wBAAwB,qBAC9B,oDAA8B,EACpC;AAEY,QAAA,sBAAsB,mBAC/B,WAAW,EAAE,EAAE,EACf,YAAY,EAAE,CAAC,GAAG,IACf,kDAA4B,EAClC;AAEY,QAAA,sBAAsB,mCAC5B,kDAA4B,KAC/B,GAAG,EAAE,EAAE,IACV","file":"","sourceRoot":"/","sourcesContent":["import { editorDefaultGlobalVariables, editorDefaultRecordVariables, editorGlobalVariableConstrains, EditorGlobalVariableType, editorRecordVariableConstrains, EditorRecordVariableType } from \"./EditorGameVariables\";\nimport { ReadonlyPlot } from \"simba-avg-core/dist/model/PlotModel\";\n\nexport interface GlobalVariableType extends EditorGlobalVariableType {\n /**存回档后不变的数据 */\n customPlots: { [key: string]: ReadonlyPlot };\n customPlotId: number;\n}\n\nexport interface RecordVariableType extends EditorRecordVariableType {\n /**存跟着回档变化的数据 */\n \n /**当前游戏音乐 */\n bgm: string\n}\n\nexport const globalVariableConstrains: { [key: string]: { min?: number, max?: number } } = {\n ...editorGlobalVariableConstrains\n}\n\nexport const recordVariableConstrains: { [key: string]: { min?: number, max?: number } } = {\n ...editorRecordVariableConstrains\n}\n\nexport const defaultGlobalVariables: GlobalVariableType = {\n customPlots: {},\n customPlotId: -100,\n ...editorDefaultGlobalVariables\n}\n\nexport const defaultRecordVariables: RecordVariableType = {\n ...editorDefaultRecordVariables,\n bgm: \"\"\n}\n"]}
\ No newline at end of file \ No newline at end of file
...@@ -158,17 +158,6 @@ let ExchangeCodeViewPresenter = /** @class */ (() => { ...@@ -158,17 +158,6 @@ let ExchangeCodeViewPresenter = /** @class */ (() => {
super.onClose(); super.onClose();
this.view.setContentTxt("", ""); this.view.setContentTxt("", "");
} }
addSkin(itemId) {
// let item = ConfigManager.getConfig(itemConfig, itemId);
// let splitArr: string[] = item.icon.split("_");
// let roleId = parseInt(splitArr[0]);
// let skinId = parseInt(splitArr[1]);
// let role = GameModelManager.getRoleData(roleId);
// if (role) {
// role.addSkin(skinId);
// GameModelManager.addSkinItemToRecord(itemId);
// }
}
}; };
ExchangeCodeViewPresenter.uuid = "ExchangeCodeViewPresenter"; ExchangeCodeViewPresenter.uuid = "ExchangeCodeViewPresenter";
ExchangeCodeViewPresenter = __decorate([ ExchangeCodeViewPresenter = __decorate([
......
...@@ -83,20 +83,12 @@ let ChatListViewPresenter = /** @class */ (() => { ...@@ -83,20 +83,12 @@ let ChatListViewPresenter = /** @class */ (() => {
this.selectSentence = (index) => { this.selectSentence = (index) => {
if (!this._currPlot) if (!this._currPlot)
throw new Error("ChatList: ePlot error! No currnt plot!"); throw new Error("ChatList: ePlot error! No currnt plot!");
// let t = GameModelManager.checkIsDotTutorial();
// if (t) {
// let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + PlotSceneType.Message] as number;
// GameDotMgr.getInstance().dotTutorial(TutorialType.Message, TutorialState.SelectSentenceRet, { session: plotScenTypeSession, plotId: this._currPlot!.id, select: index });
// }
this.completePlot(index, ChatListView_1.ChatListAutoNextPlot); this.completePlot(index, ChatListView_1.ChatListAutoNextPlot);
}; };
this.showCurrPlot = async () => { this.showCurrPlot = async () => {
if (this._currPlot && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) { if (this._currPlot && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
let item = this.convertPlotToViewModel(this._currPlot); let item = this.convertPlotToViewModel(this._currPlot);
if (item && this._currPlot.sentences[0].roleId !== 1 && item.type !== "customplot") { // 除了旁白,扣体力 if (item && this._currPlot.sentences[0].roleId !== 1 && item.type !== "customplot") { // 除了旁白,扣体力
if (!await GameModelManager_1.GameModelManager.plotUseEnergy(this._currPlot.id)) {
return;
}
if (!this._currPlot) if (!this._currPlot)
return; return;
} }
...@@ -406,31 +398,22 @@ let ChatListViewPresenter = /** @class */ (() => { ...@@ -406,31 +398,22 @@ let ChatListViewPresenter = /** @class */ (() => {
GameModelManager_1.GameModelManager.dotMainLinePlotStart(); GameModelManager_1.GameModelManager.dotMainLinePlotStart();
} }
this._currPlotShowed = false; this._currPlotShowed = false;
let player = GameModelManager_1.GameModelManager.getPlayerData();
// if (player.getEnergy() >= GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE)//little brother bojie has written wrong judgement condition ,let me modify try try
// await this.showCurrPlot();
let item = this.convertPlotToViewModel(this._currPlot); let item = this.convertPlotToViewModel(this._currPlot);
let e = player.getEnergy(); await this.showCurrPlot();
let through = e !== 0; if (this._plotChangeLike) {
let costEnergy = false; item = Object.assign({}, this._chatList.pop());
through = costEnergy ? through : true; if (item.type === "plot") {
if (through) { item.addLike = this._plotChangeLike;
await this.showCurrPlot(); }
if (this._plotChangeLike) { this._chatList.push(item);
item = Object.assign({}, this._chatList.pop()); this.view.updateProps({ items: this._chatList });
if (item.type === "plot") { }
item.addLike = this._plotChangeLike; if (item) {
} if (this._cachePId !== this._currPlot.id && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
this._chatList.push(item); this._chatList.push(item);
this._cachePId = this._currPlot.id;
this.view.updateProps({ items: this._chatList }); this.view.updateProps({ items: this._chatList });
} }
if (item) {
if (this._cachePId !== this._currPlot.id && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
this._chatList.push(item);
this._cachePId = this._currPlot.id;
this.view.updateProps({ items: this._chatList });
}
}
} }
} }
} }
......
...@@ -705,8 +705,8 @@ ...@@ -705,8 +705,8 @@
"relativePath": "resources/prefab/ui/SectionBtn.prefab" "relativePath": "resources/prefab/ui/SectionBtn.prefab"
}, },
"8c59299e-f7a6-4b18-bb15-ebe2570da3a3": { "8c59299e-f7a6-4b18-bb15-ebe2570da3a3": {
"asset": 1636336778870, "asset": 1643265507388,
"meta": 1636336778871, "meta": 1643265507395,
"relativePath": "resources/prefab/ui/SentenceSelectorView.prefab" "relativePath": "resources/prefab/ui/SentenceSelectorView.prefab"
}, },
"63764aa1-7e47-4e21-a847-809b1d441c66": { "63764aa1-7e47-4e21-a847-809b1d441c66": {
...@@ -4169,11 +4169,6 @@ ...@@ -4169,11 +4169,6 @@
"meta": 1642668338745, "meta": 1642668338745,
"relativePath": "script/avg/game-data" "relativePath": "script/avg/game-data"
}, },
"9ac19f74-706c-48d0-94e5-99251864829e": {
"asset": 1636336499443,
"meta": 1636336785927,
"relativePath": "script/avg/game-data/GameVariables.ts"
},
"bbd28677-aed7-48ee-9b5b-60ca08d83527": { "bbd28677-aed7-48ee-9b5b-60ca08d83527": {
"asset": 1636336499450, "asset": 1636336499450,
"meta": 1636336785928, "meta": 1636336785928,
...@@ -4669,11 +4664,6 @@ ...@@ -4669,11 +4664,6 @@
"meta": 1636336788620, "meta": 1636336788620,
"relativePath": "script/game/ui/presenter/AlertDialogViewPresenter.ts" "relativePath": "script/game/ui/presenter/AlertDialogViewPresenter.ts"
}, },
"cc2ae273-cdb2-44c9-bdb2-c7cc3d991f47": {
"asset": 1639979472881,
"meta": 1639979554541,
"relativePath": "script/game/ui/presenter/ChatListViewPresenter.ts"
},
"f4e610b6-673a-40f7-8c7b-fe0cc9a629f3": { "f4e610b6-673a-40f7-8c7b-fe0cc9a629f3": {
"asset": 1642668301983, "asset": 1642668301983,
"meta": 1642668340334, "meta": 1642668340334,
...@@ -4869,11 +4859,6 @@ ...@@ -4869,11 +4859,6 @@
"meta": 1636336790454, "meta": 1636336790454,
"relativePath": "script/game/ui/view/impl/message/ImagePreviewViewImpl.ts" "relativePath": "script/game/ui/view/impl/message/ImagePreviewViewImpl.ts"
}, },
"a21abc61-863d-4b61-9f90-995f04a35c25": {
"asset": 1636336499495,
"meta": 1636336790489,
"relativePath": "script/game/ui/view/impl/message/SentenceSelectorViewImpl.ts"
},
"c3e1fc3a-21fc-4185-9b54-095990c4972c": { "c3e1fc3a-21fc-4185-9b54-095990c4972c": {
"asset": 1642668301986, "asset": 1642668301986,
"meta": 1642668341163, "meta": 1642668341163,
...@@ -6189,16 +6174,6 @@ ...@@ -6189,16 +6174,6 @@
"meta": 1642668336924, "meta": 1642668336924,
"relativePath": "resources/plots/27332.json" "relativePath": "resources/plots/27332.json"
}, },
"0a3cee0e-d616-496c-ac8f-17c583b5ee07": {
"asset": 1642668301974,
"meta": 1642668339783,
"relativePath": "script/game/model/GameRoleDataModel.ts"
},
"6bc4c8b1-0f3e-4663-84cd-3d5670f40a40": {
"asset": 1642668301976,
"meta": 1642668340161,
"relativePath": "script/game/ui/presenter/DatingEventViewPresenter.ts"
},
"b174b63a-9a19-4c9e-8beb-8dd0d20ee4a7": { "b174b63a-9a19-4c9e-8beb-8dd0d20ee4a7": {
"asset": 1642668301819, "asset": 1642668301819,
"meta": 1642668337543, "meta": 1642668337543,
...@@ -6264,11 +6239,6 @@ ...@@ -6264,11 +6239,6 @@
"meta": 1642668341231, "meta": 1642668341231,
"relativePath": "script/GameConfig.ts" "relativePath": "script/GameConfig.ts"
}, },
"13297d9a-7696-4c46-96e0-0bbebf0919d2": {
"asset": 1642668301973,
"meta": 1642668339725,
"relativePath": "script/game/model/GameModelManager.ts"
},
"4c7e0a8c-5efd-41d1-be91-b1a80af75ac2": { "4c7e0a8c-5efd-41d1-be91-b1a80af75ac2": {
"asset": 1642668337288, "asset": 1642668337288,
"meta": 1642668337289, "meta": 1642668337289,
...@@ -6544,11 +6514,6 @@ ...@@ -6544,11 +6514,6 @@
"meta": 1642731654791, "meta": 1642731654791,
"relativePath": "script/game/ui/presenter/DebugViewPresenter.ts" "relativePath": "script/game/ui/presenter/DebugViewPresenter.ts"
}, },
"c1dcd2f0-53b5-45aa-8b5c-8f322a23573d": {
"asset": 1642731589925,
"meta": 1642731654878,
"relativePath": "script/game/ui/presenter/ExchangeCodeViewPresenter.ts"
},
"91d17cbc-e923-43ee-ae72-0c256447f83a": { "91d17cbc-e923-43ee-ae72-0c256447f83a": {
"asset": 1642731649489, "asset": 1642731649489,
"meta": 1642731655033, "meta": 1642731655033,
...@@ -7089,11 +7054,6 @@ ...@@ -7089,11 +7054,6 @@
"meta": 1643263368862, "meta": 1643263368862,
"relativePath": "script/game/ui/view/type/DatingSceneView.ts" "relativePath": "script/game/ui/view/type/DatingSceneView.ts"
}, },
"73860035-95fb-42c3-a0c8-4a1754585f6c": {
"asset": 1643263401646,
"meta": 1643263404560,
"relativePath": "script/game/ui/presenter/MainViewPresenter.ts"
},
"b020f340-f6ad-428d-8769-c332b5e22752": { "b020f340-f6ad-428d-8769-c332b5e22752": {
"asset": 1643263859456, "asset": 1643263859456,
"meta": 1643263876993, "meta": 1643263876993,
...@@ -7108,5 +7068,45 @@ ...@@ -7108,5 +7068,45 @@
"asset": 1643263834956, "asset": 1643263834956,
"meta": 1643263877020, "meta": 1643263877020,
"relativePath": "script/game/ui/view/type/ExtraPlotView.ts" "relativePath": "script/game/ui/view/type/ExtraPlotView.ts"
},
"9ac19f74-706c-48d0-94e5-99251864829e": {
"asset": 1643265268052,
"meta": 1643265270462,
"relativePath": "script/avg/game-data/GameVariables.ts"
},
"13297d9a-7696-4c46-96e0-0bbebf0919d2": {
"asset": 1643265262675,
"meta": 1643265270931,
"relativePath": "script/game/model/GameModelManager.ts"
},
"0a3cee0e-d616-496c-ac8f-17c583b5ee07": {
"asset": 1643264607892,
"meta": 1643265271038,
"relativePath": "script/game/model/GameRoleDataModel.ts"
},
"cc2ae273-cdb2-44c9-bdb2-c7cc3d991f47": {
"asset": 1643265259271,
"meta": 1643265271182,
"relativePath": "script/game/ui/presenter/ChatListViewPresenter.ts"
},
"6bc4c8b1-0f3e-4663-84cd-3d5670f40a40": {
"asset": 1643264847484,
"meta": 1643265271321,
"relativePath": "script/game/ui/presenter/DatingEventViewPresenter.ts"
},
"c1dcd2f0-53b5-45aa-8b5c-8f322a23573d": {
"asset": 1643264852330,
"meta": 1643265271355,
"relativePath": "script/game/ui/presenter/ExchangeCodeViewPresenter.ts"
},
"a21abc61-863d-4b61-9f90-995f04a35c25": {
"asset": 1643264494841,
"meta": 1643265271490,
"relativePath": "script/game/ui/view/impl/message/SentenceSelectorViewImpl.ts"
},
"73860035-95fb-42c3-a0c8-4a1754585f6c": {
"asset": 1643265322675,
"meta": 1643265328186,
"relativePath": "script/game/ui/presenter/MainViewPresenter.ts"
} }
} }
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -19,7 +19,7 @@ exports.defaultRecordVariables = exports.defaultGlobalVariables = exports.record ...@@ -19,7 +19,7 @@ exports.defaultRecordVariables = exports.defaultGlobalVariables = exports.record
const EditorGameVariables_1 = require("./EditorGameVariables"); const EditorGameVariables_1 = require("./EditorGameVariables");
exports.globalVariableConstrains = Object.assign({}, EditorGameVariables_1.editorGlobalVariableConstrains); exports.globalVariableConstrains = Object.assign({}, EditorGameVariables_1.editorGlobalVariableConstrains);
exports.recordVariableConstrains = Object.assign({}, EditorGameVariables_1.editorRecordVariableConstrains); exports.recordVariableConstrains = Object.assign({}, EditorGameVariables_1.editorRecordVariableConstrains);
exports.defaultGlobalVariables = Object.assign({ customPlots: {}, customPlotId: -100, plotUseEnergy: -1 }, EditorGameVariables_1.editorDefaultGlobalVariables); exports.defaultGlobalVariables = Object.assign({ customPlots: {}, customPlotId: -100 }, EditorGameVariables_1.editorDefaultGlobalVariables);
exports.defaultRecordVariables = Object.assign(Object.assign({}, EditorGameVariables_1.editorDefaultRecordVariables), { bgm: "" }); exports.defaultRecordVariables = Object.assign(Object.assign({}, EditorGameVariables_1.editorDefaultRecordVariables), { bgm: "" });
cc._RF.pop(); cc._RF.pop();
...@@ -33,4 +33,4 @@ cc._RF.pop(); ...@@ -33,4 +33,4 @@ cc._RF.pop();
}); });
} }
})(); })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvYXZnL2dhbWUtZGF0YS9HYW1lVmFyaWFibGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLCtEQUF1TjtBQWlCMU0sUUFBQSx3QkFBd0IscUJBQzlCLG9EQUE4QixFQUNwQztBQUVZLFFBQUEsd0JBQXdCLHFCQUM5QixvREFBOEIsRUFDcEM7QUFFWSxRQUFBLHNCQUFzQixtQkFDL0IsV0FBVyxFQUFFLEVBQUUsRUFDZixZQUFZLEVBQUUsQ0FBQyxHQUFHLEVBQ2xCLGFBQWEsRUFBRSxDQUFDLENBQUMsSUFDZCxrREFBNEIsRUFDbEM7QUFFWSxRQUFBLHNCQUFzQixtQ0FDNUIsa0RBQTRCLEtBQy9CLEdBQUcsRUFBRSxFQUFFLElBQ1YiLCJmaWxlIjoiIiwic291cmNlUm9vdCI6Ii8iLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBlZGl0b3JEZWZhdWx0R2xvYmFsVmFyaWFibGVzLCBlZGl0b3JEZWZhdWx0UmVjb3JkVmFyaWFibGVzLCBlZGl0b3JHbG9iYWxWYXJpYWJsZUNvbnN0cmFpbnMsIEVkaXRvckdsb2JhbFZhcmlhYmxlVHlwZSwgZWRpdG9yUmVjb3JkVmFyaWFibGVDb25zdHJhaW5zLCBFZGl0b3JSZWNvcmRWYXJpYWJsZVR5cGUgfSBmcm9tIFwiLi9FZGl0b3JHYW1lVmFyaWFibGVzXCI7XG5pbXBvcnQgeyBSZWFkb25seVBsb3QgfSBmcm9tIFwic2ltYmEtYXZnLWNvcmUvZGlzdC9tb2RlbC9QbG90TW9kZWxcIjtcblxuZXhwb3J0IGludGVyZmFjZSBHbG9iYWxWYXJpYWJsZVR5cGUgZXh0ZW5kcyBFZGl0b3JHbG9iYWxWYXJpYWJsZVR5cGUge1xuICAgIC8qKuWtmOWbnuaho+WQjuS4jeWPmOeahOaVsOaNriAqL1xuICAgIGN1c3RvbVBsb3RzOiB7IFtrZXk6IHN0cmluZ106IFJlYWRvbmx5UGxvdCB9O1xuICAgIGN1c3RvbVBsb3RJZDogbnVtYmVyO1xuICAgIHBsb3RVc2VFbmVyZ3k6IG51bWJlcjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBSZWNvcmRWYXJpYWJsZVR5cGUgZXh0ZW5kcyBFZGl0b3JSZWNvcmRWYXJpYWJsZVR5cGUge1xuICAgIC8qKuWtmOi3n+edgOWbnuaho+WPmOWMlueahOaVsOaNriAqL1xuICAgIFxuICAgIC8qKuW9k+WJjea4uOaIj+mfs+S5kCAgKi9cbiAgICBiZ206IHN0cmluZ1xufVxuXG5leHBvcnQgY29uc3QgZ2xvYmFsVmFyaWFibGVDb25zdHJhaW5zOiB7IFtrZXk6IHN0cmluZ106IHsgbWluPzogbnVtYmVyLCBtYXg/OiBudW1iZXIgfSB9ID0ge1xuICAgIC4uLmVkaXRvckdsb2JhbFZhcmlhYmxlQ29uc3RyYWluc1xufVxuXG5leHBvcnQgY29uc3QgcmVjb3JkVmFyaWFibGVDb25zdHJhaW5zOiB7IFtrZXk6IHN0cmluZ106IHsgbWluPzogbnVtYmVyLCBtYXg/OiBudW1iZXIgfSB9ID0ge1xuICAgIC4uLmVkaXRvclJlY29yZFZhcmlhYmxlQ29uc3RyYWluc1xufVxuXG5leHBvcnQgY29uc3QgZGVmYXVsdEdsb2JhbFZhcmlhYmxlczogR2xvYmFsVmFyaWFibGVUeXBlID0ge1xuICAgIGN1c3RvbVBsb3RzOiB7fSxcbiAgICBjdXN0b21QbG90SWQ6IC0xMDAsXG4gICAgcGxvdFVzZUVuZXJneTogLTEsXG4gICAgLi4uZWRpdG9yRGVmYXVsdEdsb2JhbFZhcmlhYmxlc1xufVxuXG5leHBvcnQgY29uc3QgZGVmYXVsdFJlY29yZFZhcmlhYmxlczogUmVjb3JkVmFyaWFibGVUeXBlID0ge1xuICAgIC4uLmVkaXRvckRlZmF1bHRSZWNvcmRWYXJpYWJsZXMsXG4gICAgYmdtOiBcIlwiXG59XG4iXX0= //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvYXZnL2dhbWUtZGF0YS9HYW1lVmFyaWFibGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLCtEQUF1TjtBQWdCMU0sUUFBQSx3QkFBd0IscUJBQzlCLG9EQUE4QixFQUNwQztBQUVZLFFBQUEsd0JBQXdCLHFCQUM5QixvREFBOEIsRUFDcEM7QUFFWSxRQUFBLHNCQUFzQixtQkFDL0IsV0FBVyxFQUFFLEVBQUUsRUFDZixZQUFZLEVBQUUsQ0FBQyxHQUFHLElBQ2Ysa0RBQTRCLEVBQ2xDO0FBRVksUUFBQSxzQkFBc0IsbUNBQzVCLGtEQUE0QixLQUMvQixHQUFHLEVBQUUsRUFBRSxJQUNWIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIvIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZWRpdG9yRGVmYXVsdEdsb2JhbFZhcmlhYmxlcywgZWRpdG9yRGVmYXVsdFJlY29yZFZhcmlhYmxlcywgZWRpdG9yR2xvYmFsVmFyaWFibGVDb25zdHJhaW5zLCBFZGl0b3JHbG9iYWxWYXJpYWJsZVR5cGUsIGVkaXRvclJlY29yZFZhcmlhYmxlQ29uc3RyYWlucywgRWRpdG9yUmVjb3JkVmFyaWFibGVUeXBlIH0gZnJvbSBcIi4vRWRpdG9yR2FtZVZhcmlhYmxlc1wiO1xuaW1wb3J0IHsgUmVhZG9ubHlQbG90IH0gZnJvbSBcInNpbWJhLWF2Zy1jb3JlL2Rpc3QvbW9kZWwvUGxvdE1vZGVsXCI7XG5cbmV4cG9ydCBpbnRlcmZhY2UgR2xvYmFsVmFyaWFibGVUeXBlIGV4dGVuZHMgRWRpdG9yR2xvYmFsVmFyaWFibGVUeXBlIHtcbiAgICAvKirlrZjlm57moaPlkI7kuI3lj5jnmoTmlbDmja4gKi9cbiAgICBjdXN0b21QbG90czogeyBba2V5OiBzdHJpbmddOiBSZWFkb25seVBsb3QgfTtcbiAgICBjdXN0b21QbG90SWQ6IG51bWJlcjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBSZWNvcmRWYXJpYWJsZVR5cGUgZXh0ZW5kcyBFZGl0b3JSZWNvcmRWYXJpYWJsZVR5cGUge1xuICAgIC8qKuWtmOi3n+edgOWbnuaho+WPmOWMlueahOaVsOaNriAqL1xuICAgIFxuICAgIC8qKuW9k+WJjea4uOaIj+mfs+S5kCAgKi9cbiAgICBiZ206IHN0cmluZ1xufVxuXG5leHBvcnQgY29uc3QgZ2xvYmFsVmFyaWFibGVDb25zdHJhaW5zOiB7IFtrZXk6IHN0cmluZ106IHsgbWluPzogbnVtYmVyLCBtYXg/OiBudW1iZXIgfSB9ID0ge1xuICAgIC4uLmVkaXRvckdsb2JhbFZhcmlhYmxlQ29uc3RyYWluc1xufVxuXG5leHBvcnQgY29uc3QgcmVjb3JkVmFyaWFibGVDb25zdHJhaW5zOiB7IFtrZXk6IHN0cmluZ106IHsgbWluPzogbnVtYmVyLCBtYXg/OiBudW1iZXIgfSB9ID0ge1xuICAgIC4uLmVkaXRvclJlY29yZFZhcmlhYmxlQ29uc3RyYWluc1xufVxuXG5leHBvcnQgY29uc3QgZGVmYXVsdEdsb2JhbFZhcmlhYmxlczogR2xvYmFsVmFyaWFibGVUeXBlID0ge1xuICAgIGN1c3RvbVBsb3RzOiB7fSxcbiAgICBjdXN0b21QbG90SWQ6IC0xMDAsXG4gICAgLi4uZWRpdG9yRGVmYXVsdEdsb2JhbFZhcmlhYmxlc1xufVxuXG5leHBvcnQgY29uc3QgZGVmYXVsdFJlY29yZFZhcmlhYmxlczogUmVjb3JkVmFyaWFibGVUeXBlID0ge1xuICAgIC4uLmVkaXRvckRlZmF1bHRSZWNvcmRWYXJpYWJsZXMsXG4gICAgYmdtOiBcIlwiXG59XG4iXX0=
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ exports.defaultRecordVariables = exports.defaultGlobalVariables = exports.record ...@@ -8,7 +8,7 @@ exports.defaultRecordVariables = exports.defaultGlobalVariables = exports.record
const EditorGameVariables_1 = require("./EditorGameVariables"); const EditorGameVariables_1 = require("./EditorGameVariables");
exports.globalVariableConstrains = Object.assign({}, EditorGameVariables_1.editorGlobalVariableConstrains); exports.globalVariableConstrains = Object.assign({}, EditorGameVariables_1.editorGlobalVariableConstrains);
exports.recordVariableConstrains = Object.assign({}, EditorGameVariables_1.editorRecordVariableConstrains); exports.recordVariableConstrains = Object.assign({}, EditorGameVariables_1.editorRecordVariableConstrains);
exports.defaultGlobalVariables = Object.assign({ customPlots: {}, customPlotId: -100, plotUseEnergy: -1 }, EditorGameVariables_1.editorDefaultGlobalVariables); exports.defaultGlobalVariables = Object.assign({ customPlots: {}, customPlotId: -100 }, EditorGameVariables_1.editorDefaultGlobalVariables);
exports.defaultRecordVariables = Object.assign(Object.assign({}, EditorGameVariables_1.editorDefaultRecordVariables), { bgm: "" }); exports.defaultRecordVariables = Object.assign(Object.assign({}, EditorGameVariables_1.editorDefaultRecordVariables), { bgm: "" });
cc._RF.pop(); cc._RF.pop();
\ No newline at end of file
...@@ -1023,51 +1023,6 @@ var GameModelManager; ...@@ -1023,51 +1023,6 @@ var GameModelManager;
AVG_1.GameRecord.autoSave(); AVG_1.GameRecord.autoSave();
} }
GameModelManager.setRedPotState = setRedPotState; GameModelManager.setRedPotState = setRedPotState;
async function plotUseEnergy(plotId) {
if (AVG_1.GameRecord.globalVariables.plotUseEnergy === plotId)
return true; // 当前剧情已扣过体力
let player = getPlayerData();
let currEnergy = player.getEnergy();
const costEnergy = false; //是否消耗体力
if (!costEnergy) {
AVG_1.GameRecord.globalVariables.plotUseEnergy = plotId;
return true;
}
// if (currEnergy >= GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE) {
// GameRecord.globalVariables.plotUseEnergy = plotId;
// player.addEnergy(GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE * (-1));
// return true;
// }
// // TODO 提示体力不足,跳转购买体力?
// let ret = await UIUtils.showAddEnergy(getItemConfig(GameConstData.GAME_CONST_ENERGY_PROPS_ID), getPlayerData().getProps(GameConstData.GAME_CONST_ENERGY_PROPS_ID));
// if (ret) {
// let itemconfig = GameModelManager.getItemConfig(GameConstData.GAME_CONST_ENERGY_PROPS_ID);
// player.addEnergy(itemconfig.energy_recover - GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE);
// GameRecord.globalVariables.plotUseEnergy = plotId;
// UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_ADADDSUCCESS_VALUE));
// return true;
// } else {
// let itemcount = player.getProps(GameConstData.GAME_CONST_ENERGY_PROPS_ID);
// itemcount = itemcount === undefined ? 0 : itemcount;
// if (itemcount <= 0) {
// UIManager.showToast(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_ADADDFAILED_VALUE));
// }
// return false;
// }
}
GameModelManager.plotUseEnergy = plotUseEnergy;
// functions about gift
/**
* return:1.return all gifts ids which you can use to show;
* 2.contains default unlocked gifts and plot-unlcked-and really unlocked gifts
*/
// export function getGiftList(): number[] {
// analysisGiftConfigArr();
// let r = getRecordAlreadyUnlockedGifts();
// let ret: number[] = [];
// ret = ret.concat(defaultUnlockedGiftArr, r);
// return ret;
// }
/** /**
* return:1.return all of the plot-unlocked-gifts ids arr; * return:1.return all of the plot-unlocked-gifts ids arr;
*/ */
...@@ -1435,47 +1390,6 @@ var GameModelManager; ...@@ -1435,47 +1390,6 @@ var GameModelManager;
return ret; return ret;
} }
GameModelManager.checkSkinAndGraceCondition = checkSkinAndGraceCondition; GameModelManager.checkSkinAndGraceCondition = checkSkinAndGraceCondition;
//about lucky draw end
// export function getDateSceneKeyPlotsProgress(sceneId: number): number {
// let progresss: number = 0;
// let cfg = ConfigManager.getConfig(dateSceneConfig, sceneId);
// let keyPlots = cfg.accomplish_plots;
// if (!keyPlots || keyPlots.length === 0) {
// progresss = 100;
// } else {
// let recordKeyStr: string = "date_key_plots_scene_" + sceneId;
// let recordStr: string = GameRecord.globalVariables[recordKeyStr] as string;
// let recordKeyPlots: number[] = [];
// if (recordStr && "" !== recordStr.trim()) {
// recordKeyPlots = JSON.parse(recordStr) as number[];
// }
// progresss = recordKeyPlots.length / keyPlots.length * 100;
// }
// return progresss;
// }
// export function pushDateSceneKeyPlot(sceneId: number, plotId: number) {
// let progress = getDateSceneKeyPlotsProgress(sceneId);
// if (progress === 100) {
// return;
// }
// let cfg = ConfigManager.getConfig(dateSceneConfig, sceneId);
// let keyPlots = cfg.accomplish_plots;
// if (keyPlots.findIndex((v) => v === plotId) < 0) {
// return;
// }
// let recordKeyStr: string = "date_key_plots_scene_" + sceneId;
// let recordStr: string = GameRecord.globalVariables[recordKeyStr] as string;
// let recordKeyPlots: number[] = [];
// if (recordStr && "" !== recordStr.trim()) {
// recordKeyPlots = JSON.parse(recordStr) as number[];
// }
// if (recordKeyPlots.findIndex((v) => v === plotId) < 0) {
// recordKeyPlots.push(plotId);
// GameRecord.globalVariables[recordKeyStr] = JSON.stringify(recordKeyPlots);
// GameRecord.saveRecord();
// GameModelManager.RefreshDateSceneProgress.emit();
// }
// }
function getGraceLevelByGraceValue(value) { function getGraceLevelByGraceValue(value) {
let level = 0; let level = 0;
let cfgs = simba_config_manager_1.ConfigManager.getAllConfig(RelationLevelConfig_1.relationLevelConfig); let cfgs = simba_config_manager_1.ConfigManager.getAllConfig(RelationLevelConfig_1.relationLevelConfig);
...@@ -1637,31 +1551,6 @@ var GameModelManager; ...@@ -1637,31 +1551,6 @@ var GameModelManager;
return mark; return mark;
} }
GameModelManager.checkResumeFullEnergyMarked = checkResumeFullEnergyMarked; GameModelManager.checkResumeFullEnergyMarked = checkResumeFullEnergyMarked;
function checkIsNeedResumeFullEnergy() {
let isResume = false;
let timeKeyStr = "resume_full_energy_time";
let timeRecord = AVG_1.GameRecord.globalVariables[timeKeyStr];
if (timeRecord) {
let over = checkOverdue(timeRecord);
if (over) {
isResume = true;
}
}
return isResume;
}
GameModelManager.checkIsNeedResumeFullEnergy = checkIsNeedResumeFullEnergy;
function dealAutoResumeFullEnergy() {
let isResume = checkIsNeedResumeFullEnergy();
if (isResume) {
let r = getPlayerData();
let e = r.getEnergy();
r.addEnergy(GameConstData_1.GameConstData.GAME_CONST_ENERGY_MAX - e);
let timeKeyStr = "resume_full_energy_time";
AVG_1.GameRecord.globalVariables[timeKeyStr] = 0;
AVG_1.GameRecord.saveRecord();
}
}
GameModelManager.dealAutoResumeFullEnergy = dealAutoResumeFullEnergy;
function checkIsOverPlotLimitTime() { function checkIsOverPlotLimitTime() {
let isOver = false; let isOver = false;
let timeKeyStr = "plot_limit_time"; let timeKeyStr = "plot_limit_time";
......
...@@ -11,18 +11,13 @@ const GameTextData_1 = require("../../common/gameplay/gamedata/GameTextData"); ...@@ -11,18 +11,13 @@ const GameTextData_1 = require("../../common/gameplay/gamedata/GameTextData");
const UIManager_1 = require("../../common/gameplay/managers/UIManager"); const UIManager_1 = require("../../common/gameplay/managers/UIManager");
const StringUtils_1 = require("../../common/utils/StringUtils"); const StringUtils_1 = require("../../common/utils/StringUtils");
const RelationLevelConfig_1 = require("../../config/RelationLevelConfig"); const RelationLevelConfig_1 = require("../../config/RelationLevelConfig");
const Enums_1 = require("../Enums");
const GameModelManager_1 = require("./GameModelManager"); const GameModelManager_1 = require("./GameModelManager");
class GameRoleDataModel { class GameRoleDataModel {
constructor() { constructor() {
this._cfg = undefined; this._cfg = undefined;
this._goldcoin = 0; //金币
this._clothcoin = 0; //服装币
this._skins = [];
this._curSkin = -1; this._curSkin = -1;
this._skinMaps = new Set(); this._skinMaps = new Set();
this._roleName = ""; this._roleName = "";
this._energyValue = 0; //灵力值
this._itemMaps = new Map(); this._itemMaps = new Map();
} }
setConfig(cfg) { setConfig(cfg) {
...@@ -34,7 +29,6 @@ class GameRoleDataModel { ...@@ -34,7 +29,6 @@ class GameRoleDataModel {
} }
initDate() { initDate() {
this.initSkin(); this.initSkin();
this.initCoin();
this.initData(); this.initData();
this.initVariablesChange(); this.initVariablesChange();
} }
...@@ -154,8 +148,6 @@ class GameRoleDataModel { ...@@ -154,8 +148,6 @@ class GameRoleDataModel {
this._skinMaps.add(parseInt(skinSpilt[index])); this._skinMaps.add(parseInt(skinSpilt[index]));
} }
} }
initCoin() {
}
getOwnedSkins() { getOwnedSkins() {
return this._skinMaps; return this._skinMaps;
} }
...@@ -214,39 +206,6 @@ class GameRoleDataModel { ...@@ -214,39 +206,6 @@ class GameRoleDataModel {
AVG_1.GameRecord.saveRecord(); AVG_1.GameRecord.saveRecord();
return ret; return ret;
} }
getEnergy(isceil = true) {
let e = this._itemMaps.get(Enums_1.GamePropType.Energy);
if (isceil) {
return Math.ceil(e);
}
return e;
}
addEnergy(value) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// GameDotMgr.getInstance().dotCost(CostType.EnergyCost, Math.abs(value));
// }
this.addProps(Enums_1.GamePropType.Energy, value);
}
getGoldCoin() {
return this._itemMaps.get(Enums_1.GamePropType.GoldCoin);
}
addGoldCoin(value) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// GameDotMgr.getInstance().dotCost(CostType.GoldCost, Math.abs(value));
// }
this.addProps(Enums_1.GamePropType.GoldCoin, value);
}
getClothCoin() {
let coin = this._itemMaps.get(Enums_1.GamePropType.Diamond);
return coin ? coin : 0;
}
addClothCoin(value) {
// if (value < 0 && this._cfg && RoleType.Role_Player === this._cfg.RoleType) {
// // GameDotMgr.getInstance().dotCost(CostType.SilverCost, Math.abs(value));
// GameDotMgr.getInstance().dotCost(CostType.DiamondCost, Math.abs(value));
// }
this.addProps(Enums_1.GamePropType.Diamond, value);
}
getRoleName() { getRoleName() {
if (!this._roleName || this._roleName === "") { if (!this._roleName || this._roleName === "") {
return this._cfg.name; return this._cfg.name;
......
...@@ -83,20 +83,12 @@ let ChatListViewPresenter = /** @class */ (() => { ...@@ -83,20 +83,12 @@ let ChatListViewPresenter = /** @class */ (() => {
this.selectSentence = (index) => { this.selectSentence = (index) => {
if (!this._currPlot) if (!this._currPlot)
throw new Error("ChatList: ePlot error! No currnt plot!"); throw new Error("ChatList: ePlot error! No currnt plot!");
// let t = GameModelManager.checkIsDotTutorial();
// if (t) {
// let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + PlotSceneType.Message] as number;
// GameDotMgr.getInstance().dotTutorial(TutorialType.Message, TutorialState.SelectSentenceRet, { session: plotScenTypeSession, plotId: this._currPlot!.id, select: index });
// }
this.completePlot(index, ChatListView_1.ChatListAutoNextPlot); this.completePlot(index, ChatListView_1.ChatListAutoNextPlot);
}; };
this.showCurrPlot = async () => { this.showCurrPlot = async () => {
if (this._currPlot && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) { if (this._currPlot && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
let item = this.convertPlotToViewModel(this._currPlot); let item = this.convertPlotToViewModel(this._currPlot);
if (item && this._currPlot.sentences[0].roleId !== 1 && item.type !== "customplot") { // 除了旁白,扣体力 if (item && this._currPlot.sentences[0].roleId !== 1 && item.type !== "customplot") { // 除了旁白,扣体力
if (!await GameModelManager_1.GameModelManager.plotUseEnergy(this._currPlot.id)) {
return;
}
if (!this._currPlot) if (!this._currPlot)
return; return;
} }
...@@ -406,31 +398,22 @@ let ChatListViewPresenter = /** @class */ (() => { ...@@ -406,31 +398,22 @@ let ChatListViewPresenter = /** @class */ (() => {
GameModelManager_1.GameModelManager.dotMainLinePlotStart(); GameModelManager_1.GameModelManager.dotMainLinePlotStart();
} }
this._currPlotShowed = false; this._currPlotShowed = false;
let player = GameModelManager_1.GameModelManager.getPlayerData();
// if (player.getEnergy() >= GameConstData.GAME_CONST_PLOT_ENERGY_COST_VALUE)//little brother bojie has written wrong judgement condition ,let me modify try try
// await this.showCurrPlot();
let item = this.convertPlotToViewModel(this._currPlot); let item = this.convertPlotToViewModel(this._currPlot);
let e = player.getEnergy(); await this.showCurrPlot();
let through = e !== 0; if (this._plotChangeLike) {
let costEnergy = false; item = Object.assign({}, this._chatList.pop());
through = costEnergy ? through : true; if (item.type === "plot") {
if (through) { item.addLike = this._plotChangeLike;
await this.showCurrPlot(); }
if (this._plotChangeLike) { this._chatList.push(item);
item = Object.assign({}, this._chatList.pop()); this.view.updateProps({ items: this._chatList });
if (item.type === "plot") { }
item.addLike = this._plotChangeLike; if (item) {
} if (this._cachePId !== this._currPlot.id && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
this._chatList.push(item); this._chatList.push(item);
this._cachePId = this._currPlot.id;
this.view.updateProps({ items: this._chatList }); this.view.updateProps({ items: this._chatList });
} }
if (item) {
if (this._cachePId !== this._currPlot.id && !this._excutedPlots[this._currPlot.id] && !this._plotExecuting && !this._currPlotShowed) {
this._chatList.push(item);
this._cachePId = this._currPlot.id;
this.view.updateProps({ items: this._chatList });
}
}
} }
} }
} }
......
...@@ -39,32 +39,6 @@ let DatingEventViewPresenter = /** @class */ (() => { ...@@ -39,32 +39,6 @@ let DatingEventViewPresenter = /** @class */ (() => {
let DatingEventViewPresenter = class DatingEventViewPresenter extends PresenterBase_1.Presenter { let DatingEventViewPresenter = class DatingEventViewPresenter extends PresenterBase_1.Presenter {
constructor() { constructor() {
super(); super();
this.checkDateProgress = () => {
// let info = GameModelManager.getShowDateProgressInfo();
// if (!info.isSkin && !info.sceneId) {
// return;
// }
// GameModelManager.registerAutoPopView(AutoPopViewType.DatingProgress);
// if (info.isSkin) {
// let itemId = 0;
// let cfgs = ConfigManager.getAllConfig(itemConfig);
// for (let id in cfgs) {
// let cfg = cfgs[id];
// if (cfg && cfg.ItemUnlockType === ItemUnlockType.ItemUnlock_DateProgress) {
// itemId = cfg.id;
// }
// }
// let item = ConfigManager.getConfig(itemConfig, itemId);
// let splitArr: string[] = item.icon.split("_");
// let roleId = parseInt(splitArr[0]);
// let skinId = parseInt(splitArr[1]);
// let role = GameModelManager.getRoleData(roleId);
// if (role) {
// role.addSkin(skinId);
// GameModelManager.addSkinItemToRecord(itemId);
// }
// }
};
this.onShowDatingEventArrowGuide = (isShow, wordPos) => { this.onShowDatingEventArrowGuide = (isShow, wordPos) => {
this.view.showArrowGuide(isShow, wordPos); this.view.showArrowGuide(isShow, wordPos);
}; };
...@@ -72,7 +46,6 @@ let DatingEventViewPresenter = /** @class */ (() => { ...@@ -72,7 +46,6 @@ let DatingEventViewPresenter = /** @class */ (() => {
} }
onOpen() { onOpen() {
super.onOpen(undefined); super.onOpen(undefined);
this._disposable.add(GameModelManager_1.GameModelManager.CheckDateSceneProgress.on(this.checkDateProgress));
this._disposable.add(GameModelManager_1.GameModelManager.ShowDatingEventArrowGuide.on(this.onShowDatingEventArrowGuide)); this._disposable.add(GameModelManager_1.GameModelManager.ShowDatingEventArrowGuide.on(this.onShowDatingEventArrowGuide));
this.onShow(); this.onShow();
} }
...@@ -216,111 +189,12 @@ let DatingEventSubpresenter = /** @class */ (() => { ...@@ -216,111 +189,12 @@ let DatingEventSubpresenter = /** @class */ (() => {
this.onRefreshDateSceneProgress = () => { this.onRefreshDateSceneProgress = () => {
this.refreshItems(); this.refreshItems();
}; };
this.onItemEnergyCostClick = (key) => {
// GameModelManager.setGuideEventItemRecord(key, GuideState.Complete);
// let m = this._modelMap[key];
// let cost = m.config.first_energy_cost;
// let isReview: boolean = false;
// switch (m.status) {
// case DatingEventStatus.New:
// {
// cost = m.config.first_energy_cost;
// }
// break;
// case DatingEventStatus.InProgress:
// {
// cost = 0;
// }
// break;
// case DatingEventStatus.Locked:
// {
// cost = 0;
// }
// break;
// case DatingEventStatus.Completed:
// {
// cost = m.config.memory_energy_cost;
// isReview = true;
// }
// break;
// }
// let role = GameModelManager.getPlayerData();
// let energy = role.getEnergy();
// let isEnergyEnough = energy >= cost;
// let isEnterWhenEnergyEnough: boolean = true;
// if (isEnterWhenEnergyEnough) {
// if (isEnergyEnough) {
// role.addEnergy(cost * (-1));
// this.enterDatingScene(key);
// return;
// }
// }
// if (cost === 0) {
// this.enterDatingScene(key);
// } else {
// let ennergyPropNum = role.getProps(GamePropType.EnergyDrink);
// ennergyPropNum = ennergyPropNum ? ennergyPropNum : 0;
// let cfg = ConfigManager.getConfig(itemConfig, GamePropType.EnergyDrink);
// let hasAd = energy < cost && ennergyPropNum < 1;
// let title = energy < cost ? GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_ENERGY_WEAK)
// : GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_ENERGY_COST);
// let content = "";
// if (energy >= cost) {
// let formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_ENERGY_REVIEW);
// if (!isReview) {
// formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_ENERGY_OPEN);
// }
// content = StringUtils.format(formatStr, cost, energy);
// } else {
// if (!hasAd) {
// let formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_DRINK_REVIEW);
// if (!isReview) {
// formatStr = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_COST_DRINK_OPEN);
// }
// content = StringUtils.format(formatStr, 1, cfg.energy_recover, cost, ennergyPropNum);
// } else {
// if (isReview) {
// content = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_SHOW_AD_REVIEW);
// } else {
// content = GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_SHOW_AD_OPEN);
// }
// }
// }
// this.isReview = isReview;
// let temp: AlertDialogViewProps =
// {
// dataptr: { key, cost },
// titlecontent: title,
// content: content,
// ishasad: hasAd,
// istwobtn: true,
// adconfig: hasAd ? "inject_fruit" : "",
// // items: [],
// location: CommonLocation.Event,
// callback:
// energy >= cost ? this.costEnergyCallBack
// : hasAd ? this.showAdCallBack : this.costDrinkCallBack,
// hasBanner: true
// };
// //弹框打点
// let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event;
// let location = EventLocation.ShowEnergyCost;
// if (energy >= cost) { //花费体力
// } else if (!hasAd) { //能量饮料
// oprType = EventOperationType.power
// location = EventLocation.ShowPowerPopup;
// }
// GameDotMgr.getInstance().dotEvent(oprType, location);
// UIManager.pushPresenter(AlertDialogViewPresenter, temp);
// }
};
this.costEnergyCallBack = (type, ret, param) => { this.costEnergyCallBack = (type, ret, param) => {
if (ret) { if (ret) {
let oprType = this.isReview ? Enums_1.EventOperationType.memory : Enums_1.EventOperationType.event; let oprType = this.isReview ? Enums_1.EventOperationType.memory : Enums_1.EventOperationType.event;
let location = Enums_1.EventLocation.ClickEnergyCost; let location = Enums_1.EventLocation.ClickEnergyCost;
GameDotMgr_1.default.getInstance().dotEvent(oprType, location); GameDotMgr_1.default.getInstance().dotEvent(oprType, location);
let role = GameModelManager_1.GameModelManager.getPlayerData(); let role = GameModelManager_1.GameModelManager.getPlayerData();
role.addEnergy(param.cost * (-1));
let key = param["key"]; let key = param["key"];
let m = this._modelMap[key]; let m = this._modelMap[key];
this.pushSceneAdToRecord(m.id); this.pushSceneAdToRecord(m.id);
...@@ -329,24 +203,6 @@ let DatingEventSubpresenter = /** @class */ (() => { ...@@ -329,24 +203,6 @@ let DatingEventSubpresenter = /** @class */ (() => {
}, 300); }, 300);
} }
}; };
this.costDrinkCallBack = (type, ret, param) => {
// if (ret) {
// let oprType = EventOperationType.power
// let location = EventLocation.ClickPowerPopup;
// GameDotMgr.getInstance().dotEvent(oprType, location);
// let role = GameModelManager.getPlayerData();
// let cfg = ConfigManager.getConfig(itemConfig, GamePropType.EnergyDrink);
// role.addEnergy(cfg.energy_recover);
// role.addProps(GamePropType.EnergyDrink, -1);
// role.addEnergy(param.cost * (-1));
// let key = param["key"] as string;
// let m = this._modelMap[key];
// this.pushSceneAdToRecord(m.id);
// setTimeout(() => {
// this.enterDatingScene(key);
// }, 300);
// }
};
this.onForceClickItem = (id) => { this.onForceClickItem = (id) => {
console.log("DatingEventSubpresenter onForceClickItem id = ", id); console.log("DatingEventSubpresenter onForceClickItem id = ", id);
let k = id + ""; let k = id + "";
...@@ -358,13 +214,14 @@ let DatingEventSubpresenter = /** @class */ (() => { ...@@ -358,13 +214,14 @@ let DatingEventSubpresenter = /** @class */ (() => {
this.onItemAdModeClick(k); this.onItemAdModeClick(k);
} }
else { else {
// this.view.unschedule(this.checkCanEnterDatingScene); //@ts-ignore
this.view.schedule(this.checkCanEnterDatingScene, 0.1); this.view.schedule(this.checkCanEnterDatingScene, 0.1);
} }
}; };
this.checkCanEnterDatingScene = () => { this.checkCanEnterDatingScene = () => {
if (!this._isStartBranches) { if (!this._isStartBranches) {
this.onItemAdModeClick(this._clickKey); this.onItemAdModeClick(this._clickKey);
//@ts-ignore
this.view.unschedule(this.checkCanEnterDatingScene); this.view.unschedule(this.checkCanEnterDatingScene);
} }
}; };
......
...@@ -158,17 +158,6 @@ let ExchangeCodeViewPresenter = /** @class */ (() => { ...@@ -158,17 +158,6 @@ let ExchangeCodeViewPresenter = /** @class */ (() => {
super.onClose(); super.onClose();
this.view.setContentTxt("", ""); this.view.setContentTxt("", "");
} }
addSkin(itemId) {
// let item = ConfigManager.getConfig(itemConfig, itemId);
// let splitArr: string[] = item.icon.split("_");
// let roleId = parseInt(splitArr[0]);
// let skinId = parseInt(splitArr[1]);
// let role = GameModelManager.getRoleData(roleId);
// if (role) {
// role.addSkin(skinId);
// GameModelManager.addSkinItemToRecord(itemId);
// }
}
}; };
ExchangeCodeViewPresenter.uuid = "ExchangeCodeViewPresenter"; ExchangeCodeViewPresenter.uuid = "ExchangeCodeViewPresenter";
ExchangeCodeViewPresenter = __decorate([ ExchangeCodeViewPresenter = __decorate([
......
...@@ -326,7 +326,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -326,7 +326,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
}; };
/** /**
* 卧室返回点击UI事件 * 卧室返回点击UI事件
...@@ -391,7 +390,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -391,7 +390,6 @@ let MainViewPresenter = /** @class */ (() => {
this._viewProps.selectedTab = Enums_1.MainTabs.datingEventTab; this._viewProps.selectedTab = Enums_1.MainTabs.datingEventTab;
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态 //进入主界面更新红点状态
setTimeout(() => { setTimeout(() => {
//关闭等待界面 //关闭等待界面
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!