chore: 移除游戏内天赋系统相关代码
1. 删除所有TalentType相关导入和天赋数据存储逻辑 2. 移除英雄属性天赋加成计算逻辑 3. 移除卡牌购买、刷新、售卖的天赋优惠逻辑 4. 将getTalentValue方法降级为空实现 5. 清理多余的空行代码格式
This commit is contained in:
@@ -7,7 +7,6 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { GameEvent } from "./config/GameEvent";
|
||||
import { GameScoreStats } from "./config/HeroAttrs";
|
||||
import { mLogger } from "./Logger";
|
||||
import { TalentType } from "./config/TalentSet";
|
||||
import { gameDataSync } from "./GameDataSync";
|
||||
import { FightSet } from "./config/GameSet";
|
||||
|
||||
@@ -18,12 +17,6 @@ import { FightSet } from "./config/GameSet";
|
||||
export interface GameDate {
|
||||
gold: number,
|
||||
timestamp?: number, // 用于比对本地与云端数据的最新状态
|
||||
collection?: {
|
||||
talents: Record<TalentType, number>,
|
||||
player_level: number,
|
||||
player_exp: number,
|
||||
talent_points?: number,
|
||||
}
|
||||
}
|
||||
export interface CloudData {
|
||||
openid: string;
|
||||
@@ -65,30 +58,6 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
guides: any = [0, 0, 0, 0, 0]
|
||||
current_guide: number = 0
|
||||
|
||||
collection: {
|
||||
talents: Record<TalentType, number>;
|
||||
player_level: number;
|
||||
player_exp: number;
|
||||
talent_points?: number;
|
||||
} = {
|
||||
talents: {
|
||||
[TalentType.Attack]: 0,
|
||||
[TalentType.Hp]: 0,
|
||||
[TalentType.Critical]: 0,
|
||||
[TalentType.WindFury]: 0,
|
||||
[TalentType.Freeze]: 0,
|
||||
[TalentType.Puncture]: 0,
|
||||
[TalentType.DeadTrigger]: 0,
|
||||
[TalentType.Summon]: 0,
|
||||
[TalentType.BuyDiscount]: 0,
|
||||
[TalentType.RefreshDiscount]: 0,
|
||||
[TalentType.SellBonus]: 0
|
||||
}, // 存储各个天赋的等级: { talent_id: level }
|
||||
player_level: 1, // 玩家等级
|
||||
player_exp: 0, // 玩家当前经验
|
||||
talent_points: 0, // 兼容旧存档的历史字段
|
||||
};
|
||||
|
||||
vmdata: any = {
|
||||
game_over: false,
|
||||
game_pause: false,
|
||||
@@ -249,16 +218,6 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
if (data.gold !== undefined) {
|
||||
this.vmdata.gold = data.gold;
|
||||
}
|
||||
// 恢复收集记录
|
||||
if (data.collection) {
|
||||
const remoteCol = data.collection;
|
||||
if (remoteCol.talents) {
|
||||
Object.assign(this.collection.talents, remoteCol.talents);
|
||||
}
|
||||
if (typeof remoteCol.player_level === 'number') this.collection.player_level = remoteCol.player_level;
|
||||
if (typeof remoteCol.player_exp === 'number') this.collection.player_exp = remoteCol.player_exp;
|
||||
if (typeof remoteCol.talent_points === 'number') this.collection.talent_points = remoteCol.talent_points;
|
||||
}
|
||||
}
|
||||
|
||||
// 触发UI更新
|
||||
@@ -271,7 +230,6 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
getGameDate() {
|
||||
let data: GameDate = {
|
||||
gold: this.vmdata.gold,
|
||||
collection: this.collection,
|
||||
timestamp: Date.now() // 每次获取当前数据结构时都附带最新的时间戳
|
||||
};
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user