卡牌技能

This commit is contained in:
2024-08-21 08:40:25 +08:00
parent b9edfd7001
commit fa8a2d1c6d
23 changed files with 1279 additions and 264 deletions

View File

@@ -6,6 +6,8 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { smc } from "../common/SingletonModuleComp";
import { CardSet } from "../common/config/CardSet";
import { HeroCard } from "./HeroCard";
import { HeroModelComp } from "./HeroModelComp";
import { Hero } from "./Hero";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -98,6 +100,13 @@ export class HeroCardViewComp extends CCComp {
}
use_card(){
Hero
let heros = ecs.query(ecs.allOf(HeroModelComp))
if(heros.length >= 4){
oops.gui.toast("英雄数量达到上限");
this.node.setPosition(this.pos_x,this.pos_y);
return;
}
if(smc.vm_data.gold.min >= this.card_level){
this.in_destroy = true;
this.do_use_card()