涨能量需要再处理下, 怪物被攻击算命中 如何涨
This commit is contained in:
@@ -16,7 +16,6 @@ const { ccclass, property } = _decorator;
|
||||
export class EquipSkillComp extends CCComp {
|
||||
skill1:any=null
|
||||
skill2:any=null
|
||||
skill3:any=null
|
||||
boxs:Node=null
|
||||
skill1_cd_bar_progress:any=null
|
||||
skill2_cd_bar_progress:any=null
|
||||
@@ -29,7 +28,6 @@ export class EquipSkillComp extends CCComp {
|
||||
this.boxs=this.node.getChildByName("boxs")
|
||||
this.skill1_cd_bar_progress=this.boxs.getChildByName("skill1").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar)
|
||||
this.skill2_cd_bar_progress=this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar)
|
||||
this.skill3_cd_bar_progress=this.boxs.getChildByName("skill3").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar)
|
||||
}
|
||||
start(){
|
||||
this.fight_ready()
|
||||
@@ -42,15 +40,7 @@ export class EquipSkillComp extends CCComp {
|
||||
this.get_skill(null,{slot:"skill2",uuid:hero.skills[2]})
|
||||
}
|
||||
}
|
||||
skill_stone_up(e:GameEvent,data:any){
|
||||
console.log("[EquipSkillComp]: skill_stone_up",data)
|
||||
smc.vmdata.mission_data.skill_stone+=data
|
||||
if(smc.vmdata.mission_data.skill_stone >= smc.vmdata.mission_data.skill_stone_max){
|
||||
this.show_skill_get("skill1")
|
||||
this.show_skill_get("skill2")
|
||||
this.show_skill_get("skill3")
|
||||
}
|
||||
}
|
||||
|
||||
fight_ready(){
|
||||
this.boxs=this.node.getChildByName("boxs")
|
||||
console.log("[EquipSkillComp]: fight_ready",this.node)
|
||||
@@ -71,6 +61,7 @@ export class EquipSkillComp extends CCComp {
|
||||
quality:0,
|
||||
cd:0,
|
||||
cd_time:0,
|
||||
active:false,
|
||||
}
|
||||
this.skill2={
|
||||
uuid:0,
|
||||
@@ -80,16 +71,9 @@ export class EquipSkillComp extends CCComp {
|
||||
quality:0,
|
||||
cd:0,
|
||||
cd_time:0,
|
||||
active:false,
|
||||
}
|
||||
this.skill3={
|
||||
uuid:0,
|
||||
name:"skill3",
|
||||
type:0,//
|
||||
level:0,
|
||||
quality:0,
|
||||
cd:0,
|
||||
cd_time:0,
|
||||
}
|
||||
|
||||
}
|
||||
update(dt: number): void {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
@@ -104,28 +88,11 @@ export class EquipSkillComp extends CCComp {
|
||||
}
|
||||
this.skill1_cd_bar_progress.progress=(1-this.skill1.cd_time/cd)
|
||||
}
|
||||
if(this.skill2.uuid!=0){
|
||||
let cd=this.skill2.cd*(100-smc.vmdata.hero.skill_cd_buff)/100
|
||||
if(this.skill2.cd_time < cd){
|
||||
this.skill2.cd_time+=dt
|
||||
}else{
|
||||
if(this.skill2.type==1){
|
||||
this.do_skill2()
|
||||
}
|
||||
}
|
||||
this.skill2_cd_bar_progress.progress=(1-this.skill2.cd_time/cd)
|
||||
if(this.skill2.uuid!=0&&smc.vmdata.hero.power>=smc.vmdata.hero.power_max){
|
||||
this.do_skill2()
|
||||
smc.vmdata.hero.power=0
|
||||
}
|
||||
if(this.skill3.uuid!=0){
|
||||
let cd=this.skill3.cd*(100-smc.vmdata.hero.skill_cd_buff)/100
|
||||
if(this.skill3.cd_time < cd){
|
||||
this.skill3.cd_time+=dt
|
||||
}else{
|
||||
if(this.skill3.type==1){
|
||||
// this.do_skill3()
|
||||
}
|
||||
}
|
||||
this.skill3_cd_bar_progress.progress=(1-this.skill3.cd_time/cd)
|
||||
}
|
||||
|
||||
}
|
||||
do_skill1(){
|
||||
console.log("do_skill1")
|
||||
@@ -135,28 +102,15 @@ export class EquipSkillComp extends CCComp {
|
||||
}}).start()
|
||||
this.do_skill(this.skill1.uuid)
|
||||
}
|
||||
|
||||
do_skill2(){
|
||||
console.log("do_skill2")
|
||||
this.skill2.cd_time=0
|
||||
tween(this.boxs.getChildByName("skill2")).to(0.1, {scale:v3(1.2,1.2,1)},{onComplete:()=>{
|
||||
tween(this.boxs.getChildByName("skill2")).to(0.2, {scale:v3(1,1,1)}).start()
|
||||
}}).start()
|
||||
this.do_skill(this.skill2.uuid)
|
||||
}
|
||||
do_skill3(){
|
||||
if(this.skill3.uuid==0) return
|
||||
if(this.skill3.cd_time < (this.skill3.cd)) return
|
||||
if(smc.vmdata.mission_data.skill_stone < SkillSet[this.skill3.uuid].cost){
|
||||
oops.gui.toast("技能石不足", false);
|
||||
return
|
||||
}
|
||||
smc.vmdata.mission_data.skill_stone-=SkillSet[this.skill3.uuid].cost
|
||||
this.skill3.cd_time=0
|
||||
tween(this.boxs.getChildByName("skill3")).to(0.1, {scale:v3(1.2,1.2,1)},{onComplete:()=>{
|
||||
tween(this.boxs.getChildByName("skill3")).to(0.2, {scale:v3(1,1,1)}).start()
|
||||
}}).start()
|
||||
oops.message.dispatchEvent(GameEvent.MaxSkill,{uuid:this.skill3.uuid})
|
||||
}
|
||||
|
||||
|
||||
do_skill(uuid:number){
|
||||
console.log("出发技能:",uuid)
|
||||
@@ -194,32 +148,11 @@ export class EquipSkillComp extends CCComp {
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[data.uuid].path);
|
||||
});
|
||||
break
|
||||
case "skill3":
|
||||
this.skill3.uuid=data.uuid
|
||||
this.skill3.skill_name=SkillSet[data.uuid].name
|
||||
this.skill3.type=1
|
||||
this.skill3.cd=SkillSet[data.uuid].cd
|
||||
this.skill3.cd_time=SkillSet[data.uuid].cd
|
||||
let icon = this.boxs.getChildByName("skill3").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/cards"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon.getChildByName("skill").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[data.uuid].path);
|
||||
});
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
call_skill_card(e:any,data:any){
|
||||
let mission_data=smc.vmdata.mission_data
|
||||
if(mission_data.skill_stone < mission_data.skill_stone_max){
|
||||
oops.gui.toast("技能石不足", false);
|
||||
return
|
||||
}
|
||||
oops.message.dispatchEvent(GameEvent.HeroSkillSelect,{slot:data})
|
||||
mission_data.skill_stone-=mission_data.skill_stone_max
|
||||
mission_data.skill_stone_max=mission_data.skill_stone_max*2
|
||||
}
|
||||
|
||||
|
||||
@@ -236,15 +169,22 @@ export class EquipSkillComp extends CCComp {
|
||||
this.boxs.getChildByName("skill2").getChildByName("tip").active =true
|
||||
this.boxs.getChildByName("skill2").getChildByName("tip").getComponent(Label).string="学习"
|
||||
}
|
||||
if(this.skill3.uuid==0&&this.skill1.uuid!=0&&this.skill2.uuid!=0){
|
||||
this.boxs.getChildByName("skill3").getChildByName("get").active =true
|
||||
this.boxs.getChildByName("skill3").getChildByName("light").active=true
|
||||
this.boxs.getChildByName("skill3").getChildByName("tip").active =true
|
||||
this.boxs.getChildByName("skill3").getChildByName("tip").getComponent(Label).string="学习"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
show_info(e:any,data:any){
|
||||
switch(data){
|
||||
case "skill1":
|
||||
console.log("[EquipSkillComp]: show_info",this.skill1)
|
||||
break
|
||||
case "skill2":
|
||||
console.log("[EquipSkillComp]: show_info",this.skill2)
|
||||
break
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private hide_skill_get(e:any,data:string){
|
||||
this.boxs.getChildByName("skill1").getChildByName("get").active =false
|
||||
this.boxs.getChildByName("skill1").getChildByName("tip").active =false
|
||||
@@ -266,9 +206,7 @@ export class EquipSkillComp extends CCComp {
|
||||
if(this.skill2.uuid!=0){
|
||||
this.boxs.getChildByName("skill2").getChildByName("change").active =true
|
||||
}
|
||||
if(this.skill3.uuid!=0){
|
||||
this.boxs.getChildByName("skill3").getChildByName("change").active =true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private hide_skill_change(e:any,data:any){
|
||||
|
||||
Reference in New Issue
Block a user