技能 继续
This commit is contained in:
@@ -36,7 +36,11 @@ export class CardControllerComp extends CCComp {
|
||||
reward_lv = 0;
|
||||
|
||||
protected onLoad(): void {
|
||||
oops.message.on("do_reward", this.do_reward, this)
|
||||
// oops.message.on("do_reward", this.do_reward, this)
|
||||
oops.message.on("minssion_victory", this.do_minssion_victory, this)
|
||||
oops.message.on("minssion_defeat", this.do_minssion_defeat, this)
|
||||
|
||||
|
||||
}
|
||||
start() {
|
||||
|
||||
@@ -65,13 +69,24 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
}
|
||||
|
||||
do_minssion_victory(){
|
||||
this.node.getChildByName("victory").active=true
|
||||
}
|
||||
|
||||
do_minssion_defeat(){
|
||||
this.node.getChildByName("defeat").active=true
|
||||
}
|
||||
end_mission(){
|
||||
this.node.getChildByName("victory").active=false
|
||||
this.node.getChildByName("defeat").active=false
|
||||
console.log("end_mission")
|
||||
}
|
||||
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
|
||||
oops.message.dispatchEvent("normal_call");
|
||||
}else{
|
||||
oops.gui.toast("铜币不够!");
|
||||
oops.gui.toast("铜币不足!");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -88,7 +103,11 @@ export class CardControllerComp extends CCComp {
|
||||
|
||||
|
||||
do_reward(){
|
||||
if(!smc.vm_data.mission.coin >= smc.vm_data.mission.enhancement_cost) return
|
||||
smc.vm_data.mission.coin -= smc.vm_data.mission.enhancement_cost
|
||||
|
||||
smc.vm_data.game_pause = true;
|
||||
|
||||
this.reward_lv+=1
|
||||
this.rewards_set=JSON.parse(JSON.stringify(RewardSet[1]));
|
||||
// console.log("rewards_set:",this.rewards_set,RewardSet[1])
|
||||
|
||||
Reference in New Issue
Block a user