dd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, Label, Node, ProgressBar, tween, v3 } from "cc";
|
||||
import { _decorator, Label, Node, ProgressBar, resources, Sprite, SpriteAtlas, tween, v3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { ButtonTouchLong } from "../../../../extensions/oops-plugin-framework/assets/libs/gui/button/ButtonTouchLong";
|
||||
@@ -8,6 +8,8 @@ import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { MasterModelComp } from "../hero/MasterModel";
|
||||
import { FriendModelComp } from "../hero/FriendModel";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { FacSet } from "../common/config/BoxSet";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -22,7 +24,8 @@ export class BarCompComp extends CCComp {
|
||||
protected onLoad(): void {
|
||||
this.on(GameEvent.FightReady,this.readay,this)
|
||||
this.on(GameEvent.FriendCalled,this.friend_called,this)
|
||||
|
||||
this.on(GameEvent.MasterCalled,this.master_called,this)
|
||||
this.on(GameEvent.APChange,this.ap_change,this)
|
||||
|
||||
}
|
||||
start() {
|
||||
@@ -36,10 +39,43 @@ export class BarCompComp extends CCComp {
|
||||
this.node.getChildByName("bar").getChildByName("more").active=false
|
||||
this.node.getChildByName("fbar").getChildByName("more").active=false
|
||||
}
|
||||
private friend_called(){
|
||||
this.node.getChildByName("fbar").active=true
|
||||
private master_called(e:any,data:any){
|
||||
this.node.getChildByName("bar").active = true
|
||||
let show=this.node.getChildByName("bar").getChildByName("hero")
|
||||
var icon_path = "game/heros/herois"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = show.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[data.uuid].path);
|
||||
});
|
||||
}
|
||||
private friend_called(e:any,data:any){
|
||||
this.node.getChildByName("fbar").active=true
|
||||
let show=this.node.getChildByName("fbar").getChildByName("hero")
|
||||
var icon_path = "game/heros/herois"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = show.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[data.uuid].path);
|
||||
});
|
||||
}
|
||||
private ap_change(e:any,data:any){
|
||||
console.log("[barcomp]:ap_change",data)
|
||||
if(data.fac==FacSet.HERO){
|
||||
let barNode = this.node.getChildByName("bar").getChildByName("ap").getChildByName("val")
|
||||
tween(barNode).to(0.2, {scale:v3(1.5,1.5,1)},{
|
||||
onComplete:()=>{
|
||||
tween(barNode).to(0.1, {scale:v3(1,1,1)}).start()
|
||||
}
|
||||
}).start()
|
||||
|
||||
}else{
|
||||
let barNode = this.node.getChildByName("fbar").getChildByName("ap").getChildByName("val")
|
||||
tween(barNode).to(0.2, {scale:v3(1.5,1.5,1)},{
|
||||
onComplete:()=>{
|
||||
tween(barNode).to(0.1, {scale:v3(1,1,1)}).start()
|
||||
}
|
||||
}).start()
|
||||
}
|
||||
}
|
||||
|
||||
show_master_more(){
|
||||
let barNode = this.node.getChildByName("bar");
|
||||
let node = barNode.getChildByName("more");
|
||||
|
||||
@@ -172,7 +172,7 @@ export class CardsCompComp extends CCComp {
|
||||
tween().to(0.3, { scale: v3(1, 1, 1) }, { easing: 'backOut' }),
|
||||
tween().to(0.3, { position: v3(0, 640, 0) }, { easing: 'backOut' })
|
||||
)
|
||||
.start();
|
||||
.start();
|
||||
let vip = RandomManager.instance.getRandomInt(0,100)
|
||||
console.log("[CardsComp]:vip",vip)
|
||||
if(vip < 30){
|
||||
|
||||
@@ -129,7 +129,7 @@ export class EquipSkillComp extends CCComp {
|
||||
}
|
||||
|
||||
get_skill(e:GameEvent,data:any){
|
||||
console.log("get_skill")
|
||||
console.log("get_skill",data)
|
||||
switch(data.slot){
|
||||
case "skill1":
|
||||
this.skill1.uuid=data.uuid
|
||||
|
||||
@@ -155,6 +155,14 @@ export class MissionComp extends CCComp {
|
||||
smc.mission.play = true;
|
||||
smc.vmdata.mission_data = JSON.parse(JSON.stringify(MissionData));
|
||||
this.GlodAddTimer=new Timer(smc.vmdata.mission_data.refrsh_time)
|
||||
this.hide_call_friend()
|
||||
this.hide_skill_get(null,"skill1")
|
||||
this.hide_skill_get(null,"skill2")
|
||||
this.hide_skill_get(null,"skill3")
|
||||
this.hide_skill_change(null,"skill1")
|
||||
this.hide_skill_change(null,"skill2")
|
||||
this.hide_skill_change(null,"skill3")
|
||||
|
||||
}
|
||||
|
||||
//角色初始化
|
||||
@@ -200,8 +208,9 @@ export class MissionComp extends CCComp {
|
||||
mission_data.gold-=(mission_data.refresh_gold+mission_data.buff_refresh_gold)
|
||||
|
||||
}
|
||||
call_skill_card(e:any){
|
||||
oops.message.dispatchEvent(GameEvent.HeroSkillSelect,{slot:e})
|
||||
call_skill_card(e:any,data:any){
|
||||
console.log("call_skill_card",e)
|
||||
oops.message.dispatchEvent(GameEvent.HeroSkillSelect,{slot:data})
|
||||
}
|
||||
private cleanComponents() {
|
||||
ecs.query(ecs.allOf(HeroViewComp)).forEach(entity => {entity.remove(HeroViewComp);entity.destroy()});
|
||||
|
||||
@@ -134,7 +134,6 @@ export class MissionHeroCompComp extends CCComp {
|
||||
let scale = 1
|
||||
let pos:Vec3 = HeroPos[freind_pos].pos;
|
||||
hero.load(pos,scale,uuid,info,freind_pos);
|
||||
oops.message.dispatchEvent(GameEvent.FriendCalled)
|
||||
}
|
||||
|
||||
get_info_and_remove(fight_pos:number,uuid:number){
|
||||
|
||||
Reference in New Issue
Block a user