护盾改为 护甲值
This commit is contained in:
@@ -9,6 +9,7 @@ import { GameEvent } from "../common/config/GameEvent";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { MonModelComp } from "../hero/MonModelComp";
|
||||
import { SkillCom } from "../skills/SkillCom";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -46,12 +47,17 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
|
||||
do_mon_dead(){
|
||||
smc.addGold(1)
|
||||
smc.vmdata.mission_data.mon_num--
|
||||
console.log("[MissionComp] do_mon_dead",smc.vmdata.mission_data.mon_num)
|
||||
if(smc.vmdata.mission_data.mon_num<=0) {
|
||||
smc.addMission()
|
||||
smc.vmdata.mission_data.level++
|
||||
if(smc.vmdata.mission_data.level < smc.vmdata.mission_data.max_mission){
|
||||
oops.message.dispatchEvent(GameEvent.NewWave)
|
||||
return
|
||||
}
|
||||
smc.addMission(1)
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:true})
|
||||
oops.gui.open(UIID.Victory,{victory:true})
|
||||
}
|
||||
}
|
||||
do_hero_dead(){
|
||||
@@ -59,6 +65,7 @@ export class MissionComp extends CCComp {
|
||||
console.log("[MissionComp] do_hero_dead",smc.vmdata.mission_data.hero_num)
|
||||
if(smc.vmdata.mission_data.hero_num<=0) {
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||
oops.gui.open(UIID.Victory,{victory:false})
|
||||
}
|
||||
}
|
||||
do_ad(){
|
||||
@@ -79,7 +86,6 @@ export class MissionComp extends CCComp {
|
||||
|
||||
async mission_start(){
|
||||
console.log("[MissionComp] ** 1 ** mission_start")
|
||||
|
||||
this.node.getChildByName("ending").getComponent(Animation).play("startFight")
|
||||
oops.message.dispatchEvent(GameEvent.FightReady)
|
||||
this.node.active=true
|
||||
@@ -103,6 +109,7 @@ export class MissionComp extends CCComp {
|
||||
|
||||
to_end_fight(){
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||
oops.gui.open(UIID.Victory,{victory:false})
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +124,7 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
|
||||
mission_end(){
|
||||
console.log("[MissionComp] mission_end")
|
||||
this.node.getChildByName("ending").active=false
|
||||
this.node.active=false
|
||||
}
|
||||
@@ -126,6 +134,7 @@ export class MissionComp extends CCComp {
|
||||
smc.mission.play = true;
|
||||
smc.vmdata.mission_data.in_fight=false
|
||||
smc.vmdata.mission_data.fight_time=0
|
||||
smc.vmdata.mission_data.level=0
|
||||
smc.initReward()
|
||||
console.log("[MissionComp]局内数据初始化",smc.vmdata.mission_data)
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
||||
|
||||
|
||||
onLoad(){
|
||||
// this.on(GameEvent.NewWave,this.do_mon_wave,this)
|
||||
this.on(GameEvent.FightReady,this.fight_ready,this)
|
||||
this.on(GameEvent.NewWave,this.fight_ready,this)
|
||||
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
|
||||
@@ -16,49 +16,34 @@ export class VictoryComp extends CCComp {
|
||||
reward_num:number=2
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
protected onLoad(): void {
|
||||
this.on(GameEvent.MissionStart,this.mission_start,this)
|
||||
this.on(GameEvent.FightEnd,this.fight_end,this)
|
||||
|
||||
}
|
||||
|
||||
onAdded(args: any) {
|
||||
console.log("[VictoryComp] onAdded",args)
|
||||
this.node.getChildByName("title").getChildByName("victory").active=args.victory
|
||||
this.node.getChildByName("title").getChildByName("defeat").active=!args.victory
|
||||
this.node.getChildByName("btns").getChildByName("next").active=false
|
||||
this.scheduleOnce(()=>{
|
||||
this.node.getChildByName("btns").getChildByName("next").active=true
|
||||
},0.2)
|
||||
}
|
||||
mission_start(){
|
||||
this.hide()
|
||||
}
|
||||
fight_end(e:any,val:any){
|
||||
this.node.getChildByName("title").getChildByName("victory").active=val.victory
|
||||
this.node.getChildByName("title").getChildByName("defeat").active=!val.victory
|
||||
this.open()
|
||||
}
|
||||
|
||||
|
||||
victory_end(){
|
||||
this.hide()
|
||||
oops.message.dispatchEvent(GameEvent.MissionEnd)
|
||||
oops.gui.removeByNode(this.node)
|
||||
}
|
||||
|
||||
restart(){
|
||||
this.hide()
|
||||
oops.message.dispatchEvent(GameEvent.MissionStart)
|
||||
oops.gui.removeByNode(this.node)
|
||||
}
|
||||
open(){
|
||||
this.show()
|
||||
}
|
||||
show(){
|
||||
this.node.setPosition(v3(0,640,0))
|
||||
}
|
||||
hide(){
|
||||
this.node.setPosition(v3(-1500,640,0))
|
||||
}
|
||||
do_x10(){
|
||||
this.clear_x1()
|
||||
}
|
||||
do_x1(){
|
||||
this.clear_x1()
|
||||
}
|
||||
clear_x1(){
|
||||
this.victory_end()
|
||||
}
|
||||
|
||||
item_show(e:any,val:any){
|
||||
console.log("item_show",val)
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
console.log("释放胜利界面");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user