This commit is contained in:
2024-09-29 10:50:07 +08:00
parent 81639781f9
commit 52deb0f864
7 changed files with 5136 additions and 5106 deletions

View File

@@ -12,6 +12,10 @@ import { GameMap } from "./GameMap";
import { MapModelComp } from "./model/MapModelComp";
import { Talent } from "../Role/Talent";
import { Talents } from "../common/config/TalentSet";
import { MonViewComp } from "../mon/MonViewComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { RoleViewComp } from "../Role/RoleViewComp";
import { BossViewComp } from "../Boss/BossViewComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -70,16 +74,37 @@ export class CardControllerComp extends CCComp {
do_minssion_victory(){
this.node.getChildByName("victory").active=true
this.to_mission()
}
do_minssion_defeat(){
this.node.getChildByName("defeat").active=true
this.to_mission()
}
end_mission(){
this.node.getChildByName("victory").active=false
this.node.getChildByName("defeat").active=false
console.log("end_mission")
}
empty_mission(){
let monsters:any= ecs.query(ecs.allOf(MonViewComp));
let heros:any= ecs.query(ecs.allOf(HeroViewComp));
let roles:any= ecs.query(ecs.allOf(RoleViewComp));
let boss:any= ecs.query(ecs.allOf(BossViewComp));
for(let i=0;i<monsters.length;i++){
monsters[i].MonView.ent.destroy()
}
for(let i=0;i<heros.length;i++){
heros[i].HeroView.ent.destroy()
}
for(let i=0;i<roles.length;i++){
roles[i].RoleView.ent.destroy()
}
for(let i=0;i<boss.length;i++){
boss[i].BossView.ent.destroy()
}
}
normal_call(){
if(smc.vm_data.mission.coin >= smc.vm_data.mission.normal_cost){
smc.vm_data.mission.coin -= smc.vm_data.mission.normal_cost
@@ -199,6 +224,9 @@ export class CardControllerComp extends CCComp {
}
to_mission(){
this.node.getChildByName("mission_home").active=true
this.node.getChildByName("mission").active=false
this.node.getChildByName("bar").active=true;
this.node.getChildByName("hero_home").active=false
this.node.getChildByName("shop_home").active=false
this.node.getChildByName("bar").getChildByName("mission_btn").getChildByName("bg").active=true