天赋 初步, 倒计时 添加

This commit is contained in:
2025-07-28 17:12:43 +08:00
parent b3ea965c46
commit d081695725
10 changed files with 36958 additions and 5179 deletions

View File

@@ -126,6 +126,13 @@ export class CardComp extends CCComp {
let show=this.node.getChildByName("show")
show.getChildByName("name").getChildByName("name").getComponent(Label).string=TalentList[uuid].name
this.do_card_bg_show(TalentList[uuid].quality)
this.node.getChildByName("show").getChildByName("coins").active=false
var icon_path = "game/heros/cards"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = show.getChildByName("mask").getChildByName("tal").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(TalentList[uuid].path);
});
show.getChildByName("info").getComponent(Label).string=TalentList[uuid].info
}
show_skill(uuid:number,data:any){
let show=this.node.getChildByName("show")
@@ -211,6 +218,7 @@ export class CardComp extends CCComp {
show.getChildByName("mask").getChildByName("func").active=false
show.getChildByName("mask").getChildByName("abg").active=false
show.getChildByName("mask").getChildByName("wbg").active=false
show.getChildByName("mask").getChildByName("tal").active=false
show.getChildByName("mask").getChildByName("lv1").active=false
show.getChildByName("mask").getChildByName("lv2").active=false
show.getChildByName("mask").getChildByName("lv3").active=false
@@ -225,6 +233,10 @@ export class CardComp extends CCComp {
show.getChildByName("mask").getChildByName("skill").active=true
show.getChildByName("type").getChildByName("name").getComponent(Label).string="技能"
break
case cardType.TALENT:
show.getChildByName("mask").getChildByName("tal").active=true
show.getChildByName("type").getChildByName("name").getComponent(Label).string="天赋"
break
case cardType.EQUIP:
show.getChildByName("mask").getChildByName("equip").active=true
switch(EquipInfo[this.c_uuid].type){

View File

@@ -27,6 +27,10 @@ export class MissionComp extends CCComp {
is_fight:boolean = false;
enhancements:any=[0,0,0,0,0]
update_count:number = 0;
is_show_time:boolean = false;
time_num:number = 0;
time_cd:Timer=new Timer(1);
next_func?:Function;
onLoad(){
this.on(GameEvent.MissionStart,this.mission_start,this)
this.on(GameEvent.FightEnd,this.fight_end,this)
@@ -48,8 +52,36 @@ export class MissionComp extends CCComp {
smc.vmdata.mission_data.gold+=(smc.vmdata.mission_data.add_gold+smc.vmdata.mission_data.buff_add_gold)
}
}
if(this.is_show_time){
if(this.time_cd.update(dt)){
this.run_time()
}
}
}
show_time(onHide?:Function){
this.node.getChildByName("time").active=true
this.is_show_time=true
this.next_func=onHide
}
hide_time(){
if(this.next_func){
this.next_func()
}
this.node.getChildByName("time").active=false
this.is_show_time=false
this.next_func=undefined
}
run_time(){
tween(this.node.getChildByName("time")).to(0.2, {scale:v3(1.5,1.5,1.5)}, {easing:"backOut"}).start()
tween(this.node.getChildByName("time")).to(0.2, {scale:v3(1,1,1)}, {easing:"backIn"}).start()
tween(this.node.getChildByName("time")).to(0.2, {scale:v3(1.5,1.5,1.5)}, {easing:"backOut"}).start()
this.time_num--
this.node.getChildByName("time").getChildByName("time").getComponent(Label).string=this.time_num.toString()
if(this.time_num<=0){
this.hide_time()
}
}
private on_mon_wave_update(){
smc.vmdata.mission_data.current_wave++
@@ -68,7 +100,9 @@ export class MissionComp extends CCComp {
loading.active=false
},0.5)
this.to_ready()
this.to_fight()
this.time_num=5
this.show_time(this.to_fight.bind(this))
}
to_ready(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:true})
@@ -90,6 +124,7 @@ export class MissionComp extends CCComp {
}
to_fight(){
console.log("[MissionComp] to_fight")
smc.vmdata.mission_data.in_fight=true
oops.message.dispatchEvent(GameEvent.FightStart) //MissionMonComp 监听刷怪
}

View File

@@ -32,7 +32,7 @@ export class MissionMonCompComp extends CCComp {
rogueAttack?: number // 肉鸽固定攻击力
}> = [];
private isSpawning: boolean = false;// 是否正在生成怪物
private spawnInterval: number = 0.5; // 每个怪物生成间隔时间
private spawnInterval: number = 0.1; // 每个怪物生成间隔时间
private spawnTimer: number = 0; // 生成计时器
private is_fight:boolean = false;