feat: 重构英雄与怪物系统并添加等级机制
- 调整怪物配置映射,将兽人系列怪物ID从5xxx改为6xxx - 为英雄系统添加等级支持,英雄属性随等级线性增长 - 重构卡牌系统,区分英雄卡和功能卡显示逻辑 - 重新组织英雄配置数据,按职业分类并添加等级字段 - 扩展技能配置,为各等级添加对应技能变体 - 简化特殊卡配置结构,添加名称和描述字段
This commit is contained in:
@@ -2,7 +2,7 @@ import { mLogger } from "../common/Logger";
|
||||
import { _decorator, Animation, AnimationClip, EventTouch, Label, Node, NodeEventType, Sprite, SpriteAtlas, Tween, tween, UIOpacity, Vec3, resources } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { CardConfig, CardType } from "../common/config/CardSet";
|
||||
import { CardConfig, CardType, SpecialCardList } from "../common/config/CardSet";
|
||||
import { CardUseComp } from "./CardUseComp";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { BuffsList, SkillSet } from "../common/config/SkillSet";
|
||||
@@ -22,9 +22,9 @@ export class CardComp extends CCComp {
|
||||
@property(Node)
|
||||
unLock: Node = null!
|
||||
@property(Node)
|
||||
ap_node=null!
|
||||
info_node=null!
|
||||
@property(Node)
|
||||
hp_node=null!
|
||||
oinfo_node=null!
|
||||
@property(Node)
|
||||
name_node=null!
|
||||
@property(Node)
|
||||
@@ -320,10 +320,23 @@ export class CardComp extends CCComp {
|
||||
this.iconVisualToken += 1;
|
||||
if (this.opacityComp) this.opacityComp.opacity = 255;
|
||||
this.node.setPosition(this.restPosition);
|
||||
this.setLabel(this.name_node, `${CardType[this.card_type]}-${this.card_uuid}`);
|
||||
|
||||
|
||||
if(this.card_type===CardType.Hero){
|
||||
this.setLabel(this.name_node, `${HeroInfo[this.card_uuid].name}Lv.${this.cardData.hero_lv}`);
|
||||
this.info_node.active = true;
|
||||
this.oinfo_node.active = false;
|
||||
this.info_node.getChildByName("ap").getChildByName("val").getComponent(Label).string = `${HeroInfo[this.card_uuid].ap*this.cardData.hero_lv}`;
|
||||
this.info_node.getChildByName("hp").getChildByName("val").getComponent(Label).string = `${HeroInfo[this.card_uuid].hp*this.cardData.hero_lv}`;
|
||||
}else{
|
||||
this.setLabel(this.name_node, `${SpecialCardList[this.card_uuid].name}Lv.${this.cardData.lv}`);
|
||||
this.info_node.active = false;
|
||||
this.oinfo_node.active = true;
|
||||
this.oinfo_node.getChildByName("info").getComponent(Label).string = `${SpecialCardList[this.card_uuid].info}`;
|
||||
}
|
||||
|
||||
this.setLabel(this.cost_node, `${this.card_cost}`);
|
||||
if (this.ap_node) this.ap_node.active = false;
|
||||
if (this.hp_node) this.hp_node.active = false;
|
||||
|
||||
const iconNode = this.icon_node as Node;
|
||||
if (this.card_type === CardType.Hero) {
|
||||
this.updateHeroAnimation(iconNode, this.card_uuid, this.iconVisualToken);
|
||||
@@ -383,8 +396,8 @@ export class CardComp extends CCComp {
|
||||
this.iconVisualToken += 1;
|
||||
this.setLabel(this.name_node, "");
|
||||
this.setLabel(this.cost_node, "");
|
||||
if (this.ap_node) this.ap_node.active = false;
|
||||
if (this.hp_node) this.hp_node.active = false;
|
||||
if (this.info_node) this.info_node.active = false;
|
||||
if (this.oinfo_node) this.oinfo_node.active = false;
|
||||
this.clearIconAnimation(this.icon_node as Node);
|
||||
const sprite = this.icon_node?.getComponent(Sprite) || this.icon_node?.getComponentInChildren(Sprite);
|
||||
if (sprite) sprite.spriteFrame = null;
|
||||
|
||||
@@ -52,17 +52,17 @@ export class MissionHeroCompComp extends CCComp {
|
||||
}
|
||||
|
||||
private call_hero(event: string, args: any){
|
||||
this.addHero(args.uuid)
|
||||
this.addHero(args.uuid,args.hero_lv)
|
||||
}
|
||||
/** 添加英雄 */
|
||||
private addHero(uuid:number=1001) {
|
||||
private addHero(uuid:number=1001,hero_lv:number=1) {
|
||||
console.log("addHero uuid:",uuid)
|
||||
let hero_pos=0
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
let landingPos:Vec3 = HeroPos[hero_pos].pos;
|
||||
let spawnPos:Vec3 = v3(landingPos.x, landingPos.y + MissionHeroCompComp.HERO_DROP_HEIGHT, 0);
|
||||
hero.load(spawnPos,scale,uuid,landingPos.y);
|
||||
hero.load(spawnPos,scale,uuid,landingPos.y,hero_lv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ export const MonType = {
|
||||
//
|
||||
}
|
||||
export const MonList = {
|
||||
[MonType.AP]: [5201,5401], // 近战高功
|
||||
[MonType.SPEED]: [5301], // 高速贴近
|
||||
[MonType.HP]: [5501], // 高血皮厚
|
||||
[MonType.AP]: [6001,6002], // 近战高功
|
||||
[MonType.SPEED]: [6003], // 高速贴近
|
||||
[MonType.HP]: [6009], // 高血皮厚
|
||||
//远程攻击
|
||||
//
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user