金币系统

This commit is contained in:
2025-05-30 10:34:18 +08:00
parent 564b3e2de9
commit 96db3dc1bd
10 changed files with 2261 additions and 107 deletions

View File

@@ -7,6 +7,7 @@ import { RandomManager } from "db://oops-framework/core/common/random/RandomMana
import { oops } from "db://oops-framework/core/Oops";
import { HeroModelComp } from "../hero/HeroModelComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { smc } from "../common/SingletonModuleComp";
const { ccclass, property } = _decorator;
@@ -34,7 +35,7 @@ export class CardComp extends CCComp {
}
mission_end(){
}
onCardRefresh(event: string, args: any){
this.is_used=false
@@ -80,10 +81,16 @@ export class CardComp extends CCComp {
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){
oops.gui.toast("金币不足", false);
return
}
oops.message.dispatchEvent(GameEvent.UseHeroCard,{uuid:this.c_uuid})
smc.vmdata.mission_data.gold-=smc.vmdata.mission_data.call_gold
break
case 1:
oops.message.dispatchEvent(GameEvent.UseSkillCard,{uuid:this.c_uuid})