做了几个buff 效果
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* @LastEditTime: 2022-08-17 12:36:18
|
||||
*/
|
||||
|
||||
import { _decorator} from "cc";
|
||||
import { _decorator,Sprite,Color} 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 { MonsterSpine } from "./MonsterSpine";
|
||||
@@ -94,6 +94,8 @@ export class MonsterBuffComp extends CCComp {
|
||||
if(b.skill_uuid==buff.skill_uuid){
|
||||
b.time=buff.time;
|
||||
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);
|
||||
}
|
||||
if(buff.hp>0){
|
||||
@@ -113,6 +115,8 @@ export class MonsterBuffComp extends CCComp {
|
||||
this.buffs.push(buff);
|
||||
if(buff.atk>0){
|
||||
this.mv.atk+=buff.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;
|
||||
@@ -127,11 +131,18 @@ export class MonsterBuffComp extends CCComp {
|
||||
console.log("buff add:",this.mv);
|
||||
}
|
||||
buff_remove(index:number){
|
||||
this.mv.atk-=this.buffs[index].atk;
|
||||
this.mv.hp_max-=this.buffs[index].hp;
|
||||
// this.mv.shield=0;
|
||||
this.mv.shield_max-=this.buffs[index].shield;
|
||||
console.log("buff remove:",this.mv);
|
||||
if(this.buffs[index].atk>0){
|
||||
this.mv.atk-=this.buffs[index].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;
|
||||
}
|
||||
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(){
|
||||
this.buffs.forEach((buff:any,index:number)=>{
|
||||
|
||||
Reference in New Issue
Block a user