物品图标

This commit is contained in:
2024-08-29 23:59:27 +08:00
parent 01fa44c19d
commit 6b4789d07c
22 changed files with 1089 additions and 903 deletions

View File

@@ -51,7 +51,7 @@ export class MonsterBuffComp extends CCComp {
}
add_buff(uuid:number=0,eid:number=0,group:number=0){
add_buff(uuid:number=0,args:any[]){
// console.log("add_buff",smc.skills[uuid]);
let new_buff={
@@ -63,15 +63,9 @@ export class MonsterBuffComp extends CCComp {
time:smc.skills[uuid].bsd,
bcd:smc.skills[uuid].bcd,
sk_uuid:smc.skills[uuid].uuid,
args:args
}
if(eid !=0 && group ==0 ){
if(this.mv.ent.eid == eid){
this.buff_add(new_buff);
}
}
if(eid ==0 && group == this.group){
this.buff_add(new_buff);
}
this.buff_add(new_buff);
}
@@ -96,15 +90,16 @@ export class MonsterBuffComp extends CCComp {
if(buff.atk>0){
this.node.getChildByName("avatar").setScale(1.2,1.2)
this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#F16F6F");
this.mv.atk+=(buff.atk-b.atk);
this.mv.atk+=(buff.atk+buff.args.atk-b.atk);
}
if(buff.hp>0){
this.mv.hp+=(buff.hp-b.hp);
this.mv.hp_max+=(buff.hp-b.hp);
this.mv.hp+=(buff.hp+buff.args.hp);
this.mv.add_hp(buff.hp+buff.args.hp);
// this.mv.hp_max+=(buff.hp-b.hp);
}
if(buff.shield>0){
this.mv.shield=buff.shield;
this.mv.shield_max=buff.shield;
this.mv.shield=(buff.shield+buff.args.shield);
// this.mv.shield_max=(buff.shield+buff.args.shield);
}
i=index
@@ -114,17 +109,18 @@ export class MonsterBuffComp extends CCComp {
if (i==0||this.buffs.length==0) {
this.buffs.push(buff);
if(buff.atk>0){
this.mv.atk+=buff.atk;
this.mv.atk+=(buff.atk+buff.args.atk);
this.node.getChildByName("avatar").setScale(1.2,1.2)
this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#F16F6F");
}
if(buff.hp>0){
this.mv.hp+=buff.hp;
this.mv.hp_max+=buff.hp;
this.mv.hp+=(buff.hp+buff.args.hp);
this.mv.add_hp(buff.hp+buff.args.hp);
// this.mv.hp_max+=buff.hp;
}
if(buff.shield>0){
this.mv.shield=buff.shield;
this.mv.shield_max=buff.shield;
this.mv.shield=(buff.shield+buff.args.shield);
// this.mv.shield_max=(buff.shield+buff.args.shield);
}
}
@@ -132,16 +128,17 @@ export class MonsterBuffComp extends CCComp {
}
buff_remove(index:number){
if(this.buffs[index].atk>0){
this.mv.atk-=this.buffs[index].atk;
this.mv.atk-=(this.buffs[index].atk+this.buffs[index].args.atk);
this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#FFFFFF");
this.node.getChildByName("avatar").setScale(1,1)
}
if(this.buffs[index].shield>0){
this.mv.shield_max-=this.buffs[index].shield;
this.mv.shield=0
// this.mv.shield_max-=(this.buffs[index].shield+this.buffs[index].args.shield);
}
if(this.buffs[index].hp>0){
this.mv.hp_max-=this.buffs[index].hp;
}
// if(this.buffs[index].hp>0){
// this.mv.hp_max-=this.buffs[index].hp;
// }
console.log("buff remove:",this.mv,this.buffs[index]);
}
buff_update(){