召唤逻辑改变

This commit is contained in:
2025-06-03 16:34:27 +08:00
parent b66c69d925
commit 899613c689
8 changed files with 943 additions and 804 deletions

View File

@@ -20,40 +20,26 @@ export class CardComp extends CCComp {
is_used:boolean=false;
onLoad(){
this.on(GameEvent.CardRefresh,this.onHandler,this)
this.on(GameEvent.MissionStart,this.onHandler,this)
this.on(GameEvent.MissionEnd,this.onHandler,this)
}
/** 全局消息逻辑处理 */
private onHandler(event: string, args: any) {
switch (event) {
case GameEvent.CardRefresh:
this.onCardRefresh(event,args)
break;
case GameEvent.MissionStart:
this.mission_start(event,args)
break;
case GameEvent.MissionEnd:
this.mission_end(event,args)
break;
}
this.on(GameEvent.HeroSelect,this.onCardRefresh,this)
this.on(GameEvent.HeroSkillSelect,this.onCardRefresh,this)
this.on(GameEvent.CardRefresh,this.onCardRefresh,this)
}
start() {
this.init_card()
}
init_card(){
this.is_used=true
this.node.getChildByName("Button").active=false
this.node.getChildByName("show").active=false
}
mission_start(event: string, args: any){
onHeroSelect(event: string, args: any){
}
mission_end(event: string, args: any){
onHeroSkillSelect(event: string, args: any){
}
onCardRefresh(event: string, args: any){
this.is_used=false
let hero_list =HeroList
let x=RandomManager.instance.getRandomInt(0,hero_list.length,1)
this.c_uuid=hero_list[x]
@@ -93,11 +79,9 @@ export class CardComp extends CCComp {
// return "替换"
// }
// }
return "召唤"
return "选择"
}
use_card(){
if(this.is_used) return
switch(this.c_type){
case 0:
if(smc.vmdata.mission_data.gold< smc.vmdata.mission_data.call_gold){
@@ -114,9 +98,6 @@ export class CardComp extends CCComp {
oops.message.dispatchEvent(GameEvent.UseCard,{uuid:this.c_uuid})
break
}
this.node.getChildByName("show").active=false
this.is_used=true
this.node.getChildByName("Button").active=false
}
reset() {
this.node.destroy();