feat(天赋系统): 实现天赋效果并应用至相关游戏系统
- 在 MissionCardComp 中应用 RefreshDiscount 天赋以减少刷新消耗 - 在 CardComp 中应用 BuyDiscount 天赋以减少英雄购买消耗 - 在 HInfoComp 中应用 SellBonus 天赋以增加英雄出售收益 - 统一 TalentType 枚举类型,增强类型安全性 - 更新 SingletonModuleComp 中 talents 数据结构以支持类型化 - 修改 HeroAttrsComp.getTalentValue 方法参数类型为 TalentType
This commit is contained in:
@@ -48,6 +48,7 @@ import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { FacSet, FightSet } from "../common/config/GameSet";
|
||||
import { MoveComp } from "../hero/MoveComp";
|
||||
import { MissionHeroCompComp } from "./MissionHeroComp";
|
||||
import { TalentType } from "../common/config/TalentSet";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -840,7 +841,10 @@ export class MissionCardComp extends CCComp {
|
||||
}
|
||||
|
||||
private getRefreshCost(): number {
|
||||
return Math.max(0, Math.floor(this.refreshCost));
|
||||
let cost = this.refreshCost;
|
||||
const discount = HeroAttrsComp.getTalentValue(TalentType.RefreshDiscount);
|
||||
cost = Math.max(0, cost - discount);
|
||||
return Math.floor(cost);
|
||||
}
|
||||
|
||||
private ensureHeroInfoPanel(eid: number, model: HeroAttrsComp) {
|
||||
|
||||
Reference in New Issue
Block a user