feat(卡牌系统): 为卡牌和天赋添加kind类型字段
为ICardInfo接口和talConf配置添加kind字段,用于区分卡牌和天赋的不同类型
This commit is contained in:
@@ -10,6 +10,7 @@ import { CardType } from "./GameSet";
|
||||
export interface ICardInfo {
|
||||
uuid: number;
|
||||
type: CardType;
|
||||
kind: CardKind;
|
||||
name: string;
|
||||
desc: string;
|
||||
icon: string;
|
||||
@@ -86,6 +87,7 @@ function getCardBaseInfo(type: CardType, uuid: number): ICardInfo | null {
|
||||
let name = "";
|
||||
let desc = "";
|
||||
let icon = "";
|
||||
let kind = CardKind.Attr;
|
||||
let tag = undefined;
|
||||
|
||||
switch (type) {
|
||||
@@ -95,6 +97,7 @@ function getCardBaseInfo(type: CardType, uuid: number): ICardInfo | null {
|
||||
name = baseInfo.desc.split(" ")[0] || "属性";
|
||||
desc = baseInfo.desc;
|
||||
icon = baseInfo.icon;
|
||||
kind = CardKind.Attr;
|
||||
tag = baseInfo.isSpecial ? "special" : undefined;
|
||||
break;
|
||||
case CardType.Talent:
|
||||
@@ -103,6 +106,7 @@ function getCardBaseInfo(type: CardType, uuid: number): ICardInfo | null {
|
||||
name = baseInfo.name;
|
||||
desc = baseInfo.desc;
|
||||
icon = baseInfo.icon;
|
||||
kind = baseInfo.kind;
|
||||
break;
|
||||
case CardType.Skill:
|
||||
baseInfo = SkillSet[uuid];
|
||||
@@ -110,19 +114,22 @@ function getCardBaseInfo(type: CardType, uuid: number): ICardInfo | null {
|
||||
name = baseInfo.name;
|
||||
desc = baseInfo.info;
|
||||
icon = baseInfo.icon;
|
||||
kind = CardKind.Skill;
|
||||
break;
|
||||
case CardType.Partner:
|
||||
baseInfo = HeroInfo[uuid];
|
||||
if (!baseInfo) return null;
|
||||
name = baseInfo.name;
|
||||
desc = baseInfo.info;
|
||||
icon = baseInfo.path;
|
||||
icon = baseInfo.icon;
|
||||
kind = CardKind.Partner;
|
||||
break;
|
||||
}
|
||||
|
||||
return {
|
||||
uuid,
|
||||
type,
|
||||
kind,
|
||||
name,
|
||||
desc,
|
||||
icon,
|
||||
|
||||
Reference in New Issue
Block a user