feat(天赋系统): 实现天赋效果并应用至相关游戏系统
- 在 MissionCardComp 中应用 RefreshDiscount 天赋以减少刷新消耗 - 在 CardComp 中应用 BuyDiscount 天赋以减少英雄购买消耗 - 在 HInfoComp 中应用 SellBonus 天赋以增加英雄出售收益 - 统一 TalentType 枚举类型,增强类型安全性 - 更新 SingletonModuleComp 中 talents 数据结构以支持类型化 - 修改 HeroAttrsComp.getTalentValue 方法参数类型为 TalentType
This commit is contained in:
@@ -7,6 +7,8 @@ import { WxCloudApi } from "../wx_clound_client_api/WxCloudApi";
|
||||
import { GameEvent } from "./config/GameEvent";
|
||||
import { GameScoreStats } from "./config/HeroAttrs";
|
||||
import { mLogger } from "./Logger";
|
||||
import { TalentType } from "./config/TalentSet";
|
||||
|
||||
/**
|
||||
* 用远程数据覆盖本地数据(统一方法)
|
||||
* @param remoteData 远程数据(云端或本地调试)
|
||||
@@ -16,7 +18,7 @@ interface GameDate{
|
||||
heros:any,
|
||||
fight_hero:number,
|
||||
collection?: {
|
||||
talents: Record<number, number>,
|
||||
talents: Partial<Record<TalentType, number>>,
|
||||
player_level: number,
|
||||
player_exp: number,
|
||||
talent_points: number,
|
||||
@@ -63,7 +65,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
heros:any= [5001]
|
||||
|
||||
collection: {
|
||||
talents: Record<number, number>;
|
||||
talents: Partial<Record<TalentType, number>>;
|
||||
player_level: number;
|
||||
player_exp: number;
|
||||
talent_points: number;
|
||||
|
||||
@@ -42,29 +42,29 @@ export const TalentConfig = {
|
||||
{ maxLevel: 30, expPerLevel: 200 }
|
||||
],
|
||||
|
||||
// 天赋列表
|
||||
// 所有天赋定义(使用数组维护)
|
||||
talents: [
|
||||
{ id: 1, name: "攻击强化", icon: "⚔️", desc: "所有英雄 ATK +{value}%",
|
||||
{ id: TalentType.Attack, name: "攻击强化", icon: "⚔️", desc: "所有英雄 ATK +{value}%",
|
||||
maxLevel: 5, values: [3, 6, 9, 12, 15], costs: [1, 1, 2, 2, 3] },
|
||||
{ id: 2, name: "生命强化", icon: "❤️", desc: "所有英雄 HP +{value}%",
|
||||
{ id: TalentType.Hp, name: "生命强化", icon: "❤️", desc: "所有英雄 HP +{value}%",
|
||||
maxLevel: 5, values: [5, 10, 15, 20, 25], costs: [1, 1, 2, 2, 3] },
|
||||
{ id: 3, name: "暴击强化", icon: "🔥", desc: "所有英雄暴击率 +{value}%",
|
||||
{ id: TalentType.Critical, name: "暴击强化", icon: "🔥", desc: "所有英雄暴击率 +{value}%",
|
||||
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
||||
{ id: 4, name: "风怒强化", icon: "⚡", desc: "所有英雄风怒率 +{value}%",
|
||||
{ id: TalentType.WindFury, name: "风怒强化", icon: "⚡", desc: "所有英雄风怒率 +{value}%",
|
||||
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
||||
{ id: 5, name: "冰冻强化", icon: "❄️", desc: "所有英雄冰冻率 +{value}%",
|
||||
{ id: TalentType.Freeze, name: "冰冻强化", icon: "❄️", desc: "所有英雄冰冻率 +{value}%",
|
||||
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
|
||||
{ id: 6, name: "穿刺强化", icon: "🗡️", desc: "所有英雄穿刺 +{value}",
|
||||
{ id: TalentType.Puncture, name: "穿刺强化", icon: "🗡️", desc: "所有英雄穿刺 +{value}",
|
||||
maxLevel: 5, values: [0.2, 0.4, 0.6, 0.8, 1.0], costs: [1, 1, 2, 2, 3] },
|
||||
{ id: 7, name: "亡语强化", icon: "🛡️", desc: "死亡触发技能额外触发次数+{value}次",
|
||||
{ id: TalentType.DeadTrigger, name: "亡语强化", icon: "🛡️", desc: "死亡触发技能额外触发次数+{value}次",
|
||||
maxLevel: 5, values: [1], costs: [25] },
|
||||
{ id: 8, name: "召唤强化", icon: "🛡️", desc: "召唤触发技能额外触发次数+{value}次",
|
||||
{ id: TalentType.Summon, name: "召唤强化", icon: "🛡️", desc: "召唤触发技能额外触发次数+{value}次",
|
||||
maxLevel: 1, values: [1], costs: [25] },
|
||||
{ id: 9, name: "采购优惠", icon: "🛒", desc: "购买英雄 -{value}金",
|
||||
{ id: TalentType.BuyDiscount, name: "采购优惠", icon: "🛒", desc: "购买英雄 -{value}金",
|
||||
maxLevel: 1, values: [1], costs: [10] },
|
||||
{ id: 10, name: "刷新优惠", icon: "🔄", desc: "刷新重抽 -{value}金",
|
||||
{ id: TalentType.RefreshDiscount, name: "刷新优惠", icon: "🔄", desc: "刷新重抽 -{value}金",
|
||||
maxLevel: 1, values: [1], costs: [10] },
|
||||
{ id: 11, name: "出售补贴", icon: "💰", desc: "出售英雄返还 +{value}%金币",
|
||||
{ id: TalentType.SellBonus, name: "出售补贴", icon: "💰", desc: "出售英雄返还 +{value}金币",
|
||||
maxLevel: 1, values: [1], costs: [10] }
|
||||
] as TalentInfo[]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user