注释 打印+怪物变强
This commit is contained in:
@@ -79,7 +79,7 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
oops.message.on(GameEvent.MissionEnd, this.doDestroy, this);
|
||||
this.node.active = true;
|
||||
// console.log("[SkillCom]:caster",this.caster)
|
||||
// //console.log("[SkillCom]:caster",this.caster)
|
||||
|
||||
|
||||
let collider = this.getComponent(Collider2D);
|
||||
@@ -88,7 +88,7 @@ export class SkillCom extends CCComp {
|
||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
}
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
// console.log(this.group +"技能 collider ",collider);
|
||||
// //console.log(this.group +"技能 collider ",collider);
|
||||
switch(SkillSet[this.s_uuid].AType){
|
||||
case AType.parabolic:
|
||||
this.node.angle +=10
|
||||
@@ -124,24 +124,24 @@ export class SkillCom extends CCComp {
|
||||
this.node.setPosition(this.targetPos.x,this.targetPos.y,0)
|
||||
if(this.node.getComponent(Animation)){
|
||||
let anim = this.node.getComponent(Animation);
|
||||
// console.log("[SkillCom]:has anim",anim)
|
||||
// //console.log("[SkillCom]:has anim",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
if(this.node.getChildByName('anm')){
|
||||
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
|
||||
// console.log("[SkillCom]:has spine",this.spine)
|
||||
// //console.log("[SkillCom]:has spine",this.spine)
|
||||
this.spine.setCompleteListener((trackEntry) => {
|
||||
this.onAnimationFinished()
|
||||
// console.log("[SkillCom]:[track %s][animation %s] complete: %s", trackEntry.trackIndex);
|
||||
// //console.log("[SkillCom]:[track %s][animation %s] complete: %s", trackEntry.trackIndex);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AType.fixedStart:
|
||||
case AType.fixedStart: //都是buff
|
||||
this.node.setPosition(this.startPos.x,this.startPos.y,0)
|
||||
this.scheduleOnce(()=>{
|
||||
this.do_buff()
|
||||
console.log("[SkillCom]:fixedStart",SkillSet[this.s_uuid].in-0.2)
|
||||
//console.log("[SkillCom]:fixedStart",SkillSet[this.s_uuid].in-0.2)
|
||||
},SkillSet[this.s_uuid].in-0.2)
|
||||
break;
|
||||
}
|
||||
@@ -155,6 +155,7 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
//范围伤害
|
||||
range_damage(){
|
||||
console.log("[SkillCom]:range_damage",this.s_uuid)
|
||||
let enemys=ecs.query(ecs.allOf(MonModelComp))
|
||||
if(this.fac==FacSet.MON) enemys=ecs.query(ecs.allOf(HeroModelComp))
|
||||
enemys.forEach(entity => {
|
||||
@@ -169,14 +170,14 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
//单体伤害
|
||||
single_damage(target:HeroViewComp,is_range:boolean=false){
|
||||
// console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit)
|
||||
// //console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit)
|
||||
// if(this.hit_count > 0&&!is_range) this.ap=this.ap*(50+this.puncture_damage)/100 // 穿刺后 伤害减半,过滤范围伤害
|
||||
if(target == null) return;
|
||||
target.do_atked(this.ap,this.caster_crit,this.caster_crit_d,
|
||||
this.burn_count,this.burn_value,
|
||||
this.stun_time,this.stun_ratto,
|
||||
this.frost_time,this.frost_ratto) // ap 及暴击 属性已经在skill.ts 处理
|
||||
console.log("[SkillCom]:single_damage",this.ap,this.caster_crit,this.caster_crit_d,this.hit_count)
|
||||
console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
|
||||
if(SkillSet[this.s_uuid].debuff>0){
|
||||
let deUP =this.get_debuff() // 因为不是每个技能都需要,debuff的增益在这里处理, ap 及暴击 属性已经在skill.ts 处理
|
||||
let debuff=SkillSet[this.s_uuid]
|
||||
@@ -184,7 +185,7 @@ export class SkillCom extends CCComp {
|
||||
let deR=debuff.deR+deUP.deR
|
||||
dev=Math.round(dev*100)/100
|
||||
let deC=debuff.deC+deUP.deC //dec只作为次数叠加
|
||||
// console.log("[SkillCom]:debuff",SkillSet[this.s_uuid].name,debuff.debuff,deUP.deV,deUP.deC)
|
||||
// //console.log("[SkillCom]:debuff",SkillSet[this.s_uuid].name,debuff.debuff,deUP.deV,deUP.deC)
|
||||
target.add_debuff(debuff.debuff,dev,deC,deR)
|
||||
}
|
||||
this.hit_count++
|
||||
@@ -192,11 +193,11 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
|
||||
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
|
||||
// console.log(this.scale+"碰撞开始 ",seCol,oCol);
|
||||
// //console.log(this.scale+"碰撞开始 ",seCol,oCol);
|
||||
let target = oCol.getComponent(HeroViewComp)
|
||||
if(oCol.group!=this.group){
|
||||
if(target == null) return;
|
||||
console.log("[SkillCom]:onBeginContact targetPos||skillPos",target.node.position,this.node.position)
|
||||
console.log("[SkillCom]:onBeginContact oCol||seCol",oCol.node.position,seCol.node.position)
|
||||
this.single_damage(target)
|
||||
// this.ent.destroy()
|
||||
}
|
||||
@@ -243,7 +244,7 @@ export class SkillCom extends CCComp {
|
||||
.start();
|
||||
}
|
||||
private do_buff(){
|
||||
console.log("[SkillCom]:do_buff")
|
||||
//console.log("[SkillCom]:do_buff")
|
||||
let teams=ecs.query(ecs.allOf(HeroModelComp))
|
||||
if(this.fac==FacSet.MON) teams=ecs.query(ecs.allOf(MonModelComp))
|
||||
if(SkillSet[this.s_uuid].TGroup==TGroup.Team||SkillSet[this.s_uuid].TGroup==TGroup.Self) {
|
||||
@@ -261,21 +262,6 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
}
|
||||
|
||||
private startLinearMove(dt: number) {
|
||||
if (!this.speed || this.is_destroy) return;
|
||||
if(this.s_uuid == 6005){
|
||||
// console.log("[SkillCom]:startLinearMove",this.node.position.x)
|
||||
}
|
||||
// 使用角度方向移动
|
||||
const newX = this.node.position.x + this.speed * dt*this.scale;
|
||||
const newY = this.node.position.y;
|
||||
this.node.setPosition(newX, this.node.position.y, this.node.position.z);
|
||||
|
||||
// 检查是否超出边界
|
||||
if (newX < -400 || newX > 400) {
|
||||
this.is_destroy = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
update(deltaTime: number) {
|
||||
@@ -291,7 +277,7 @@ export class SkillCom extends CCComp {
|
||||
if(config.EType==EType.timeEnd){
|
||||
this.run_time+=deltaTime
|
||||
if(this.run_time>config.in){
|
||||
// console.log("[SkillCom]: timeEnd destroy",this.s_uuid,this.run_time)
|
||||
// //console.log("[SkillCom]: timeEnd destroy",this.s_uuid,this.run_time)
|
||||
this.is_destroy=true
|
||||
}
|
||||
}
|
||||
@@ -319,11 +305,11 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
}
|
||||
doDestroy(){
|
||||
// console.log("[SkillCom]:doDestroy")
|
||||
// //console.log("[SkillCom]:doDestroy")
|
||||
this.is_destroy=true
|
||||
}
|
||||
to_console(value:any,value2:any=null,value3:any=null){
|
||||
console.log("[SkillCom]:["+this.s_name+this.s_uuid+"]:",value,value2,value3)
|
||||
//console.log("[SkillCom]:["+this.s_name+this.s_uuid+"]:",value,value2,value3)
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
|
||||
Reference in New Issue
Block a user