去除buff 相关console

This commit is contained in:
2024-09-11 10:44:47 +08:00
parent b5406bd9af
commit bdeb8fdf65
4 changed files with 0 additions and 22 deletions

View File

@@ -37,7 +37,6 @@ export class RoleBuffComp extends CCComp {
} }
add_buff(uuid:number=0,args:any[]){ add_buff(uuid:number=0,args:any[]){
// console.log("add_buff",smc.skills[uuid]);
let new_buff={ let new_buff={
skill_uuid:uuid, skill_uuid:uuid,
@@ -109,7 +108,6 @@ export class RoleBuffComp extends CCComp {
} }
} }
console.log("buff add:",this.mv);
} }
buff_remove(index:number){ buff_remove(index:number){
if(this.buffs[index].atk>0){ if(this.buffs[index].atk>0){
@@ -124,7 +122,6 @@ export class RoleBuffComp extends CCComp {
// if(this.buffs[index].hp>0){ // if(this.buffs[index].hp>0){
// this.mv.hp_max-=this.buffs[index].hp; // this.mv.hp_max-=this.buffs[index].hp;
// } // }
console.log("buff remove:",this.mv,this.buffs[index]);
} }
buff_update(){ buff_update(){
this.buffs.forEach((buff:any,index:number)=>{ this.buffs.forEach((buff:any,index:number)=>{
@@ -134,6 +131,5 @@ export class RoleBuffComp extends CCComp {
} }
}) })
this.buffs = this.buffs.filter((buff:any) => buff.time > 0); this.buffs = this.buffs.filter((buff:any) => buff.time > 0);
// console.log(this.buffs,this.buffs);
} }
} }

View File

@@ -51,7 +51,6 @@ export class HeroBuffComp extends CCComp {
} }
add_buff(uuid:number=0,args:any[]){ add_buff(uuid:number=0,args:any[]){
// console.log("add_buff",smc.skills[uuid]);
let new_buff={ let new_buff={
skill_uuid:uuid, skill_uuid:uuid,
@@ -119,7 +118,6 @@ export class HeroBuffComp extends CCComp {
} }
} }
console.log("buff add:",this.mv);
} }
buff_remove(index:number){ buff_remove(index:number){
if(this.buffs[index].atk>0){ if(this.buffs[index].atk>0){
@@ -132,7 +130,6 @@ export class HeroBuffComp extends CCComp {
// if(this.buffs[index].hp>0){ // if(this.buffs[index].hp>0){
// this.mv.hp_max-=this.buffs[index].hp; // this.mv.hp_max-=this.buffs[index].hp;
// } // }
console.log("buff remove:",this.mv,this.buffs[index]);
} }
buff_update(){ buff_update(){
this.buffs.forEach((buff:any,index:number)=>{ this.buffs.forEach((buff:any,index:number)=>{
@@ -142,6 +139,5 @@ export class HeroBuffComp extends CCComp {
} }
}) })
this.buffs = this.buffs.filter((buff:any) => buff.time > 0); this.buffs = this.buffs.filter((buff:any) => buff.time > 0);
// console.log(this.buffs,this.buffs);
} }
} }

View File

@@ -51,7 +51,6 @@ export class MonBuffComp extends CCComp {
} }
add_buff(uuid:number=0,args:any[]){ add_buff(uuid:number=0,args:any[]){
// console.log("add_buff",smc.skills[uuid]);
let new_buff={ let new_buff={
skill_uuid:uuid, skill_uuid:uuid,
@@ -119,7 +118,6 @@ export class MonBuffComp extends CCComp {
} }
} }
console.log("buff add:",this.mv);
} }
buff_remove(index:number){ buff_remove(index:number){
if(this.buffs[index].atk>0){ if(this.buffs[index].atk>0){
@@ -132,7 +130,6 @@ export class MonBuffComp extends CCComp {
// if(this.buffs[index].hp>0){ // if(this.buffs[index].hp>0){
// this.mv.hp_max-=this.buffs[index].hp; // this.mv.hp_max-=this.buffs[index].hp;
// } // }
console.log("buff remove:",this.mv,this.buffs[index]);
} }
buff_update(){ buff_update(){
this.buffs.forEach((buff:any,index:number)=>{ this.buffs.forEach((buff:any,index:number)=>{
@@ -142,6 +139,5 @@ export class MonBuffComp extends CCComp {
} }
}) })
this.buffs = this.buffs.filter((buff:any) => buff.time > 0); this.buffs = this.buffs.filter((buff:any) => buff.time > 0);
// console.log(this.buffs,this.buffs);
} }
} }

View File

@@ -68,15 +68,11 @@ export class CSkillComp extends CCComp {
m_pos = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE) m_pos = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
} }
t_pos = v3(m_pos.x-this.node.position.x,m_pos.y-this.node.position.y) // 目标增量 t_pos = v3(m_pos.x-this.node.position.x,m_pos.y-this.node.position.y) // 目标增量
// console.log("m_pos",m_pos);
// console.log("pos",this.node.position);
// console.log("t_pos",t_pos);
let dx=m_pos.x-this.node.position.x let dx=m_pos.x-this.node.position.x
let dy=m_pos.y-this.node.position.y let dy=m_pos.y-this.node.position.y
let dir=v3(dx,dy,0) let dir=v3(dx,dy,0)
let randian=Math.atan2(dir.y,dir.x) let randian=Math.atan2(dir.y,dir.x)
angle = randian * (180 / Math.PI); angle = randian * (180 / Math.PI);
// console.log("angle",angle);
let scale = this.scale let scale = this.scale
let dis = smc.skills[this.skill_uuid].dis+this.dis; let dis = smc.skills[this.skill_uuid].dis+this.dis;
let atk = smc.skills[this.skill_uuid].atk+this.atk; let atk = smc.skills[this.skill_uuid].atk+this.atk;
@@ -108,14 +104,11 @@ export class CSkillComp extends CCComp {
if (heros.length > 0) { if (heros.length > 0) {
if(SkillSet[uuid].type==92){ //随机添加buff if(SkillSet[uuid].type==92){ //随机添加buff
let i = RandomManager.instance.getRandomInt(0,heros.length-1,3) let i = RandomManager.instance.getRandomInt(0,heros.length-1,3)
console.log("i %%length:",i,heros.length)
heros[i].HeroBuff.add_buff(uuid,args); heros[i].HeroBuff.add_buff(uuid,args);
}else{ }else{
for (let i = 0; i < heros.length; i++) { for (let i = 0; i < heros.length; i++) {
let hero = heros[i]; let hero = heros[i];
// console.log(" CSkillComp hero",hero);
if(SkillSet[uuid].type==91){ //血量最少单体 if(SkillSet[uuid].type==91){ //血量最少单体
console.log(" CSkillComp hero 91",hero,least_hp,t_hero);
if(hero.HeroView.hp < least_hp){ if(hero.HeroView.hp < least_hp){
least_hp = hero.HeroView.hp least_hp = hero.HeroView.hp
t_hero = hero t_hero = hero
@@ -144,10 +137,7 @@ export class CSkillComp extends CCComp {
to_destroy() { to_destroy() {
this.is_destroy = true this.is_destroy = true
this.remove_buff() this.remove_buff()
// console.log("CSkillComp toDestroy");
if (this.node.isValid) { if (this.node.isValid) {
// console.log("CSkillComp.node.isValid");
// console.log("CSkillComp.node.destroy",this);
this.ent.destroy() this.ent.destroy()
} }
} }