注释 打印+怪物变强
This commit is contained in:
@@ -116,7 +116,7 @@ export class HeroViewComp extends CCComp {
|
||||
onLoad() {
|
||||
this.as = this.getComponent(HeroSpine);
|
||||
this.FIGHTCON=this.node.parent.getComponent(FightConComp);
|
||||
console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
|
||||
//console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
|
||||
this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_atk,this)
|
||||
this.on(GameEvent.UpdateHP,this.update_hp,this)
|
||||
this.on(GameEvent.EXPUP,this.exp_up,this)
|
||||
@@ -159,7 +159,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.processDamageQueue();
|
||||
}
|
||||
use_enhancement(e:GameEvent,data:any){
|
||||
console.log("[HeroViewComp]:use_enhancement",data)
|
||||
//console.log("[HeroViewComp]:use_enhancement",data)
|
||||
if(this.is_master){
|
||||
switch(data.type){
|
||||
case EnhancementType.ATTACK:
|
||||
@@ -230,7 +230,7 @@ export class HeroViewComp extends CCComp {
|
||||
// this.BUFFCOMP.tooltip(TooltipTypes.speedup,speed.toFixed(0));
|
||||
}
|
||||
add_ap(ap: number,is_num:boolean=true){
|
||||
console.log("[HeroViewComp]:add_ap add:",ap,this.ap)
|
||||
//console.log("[HeroViewComp]:add_ap add:",ap,this.ap)
|
||||
if(is_num){
|
||||
this.ap += Math.floor(ap);
|
||||
}else{
|
||||
@@ -242,7 +242,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
de_ap(ap: number,is_num:boolean=true){
|
||||
console.log("[HeroViewComp]:de_ap de:",ap,this.ap)
|
||||
//console.log("[HeroViewComp]:de_ap de:",ap,this.ap)
|
||||
if(is_num){
|
||||
this.ap -= Math.floor(ap);
|
||||
}else{
|
||||
@@ -251,7 +251,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.BUFFCOMP.vmdata_update()
|
||||
}
|
||||
update_hp(e:GameEvent,data:any){
|
||||
console.log("[HeroViewComp]:update_hp",data)
|
||||
//console.log("[HeroViewComp]:update_hp",data)
|
||||
if(this.is_master===data.is_master&&this.fac===FacSet.HERO){
|
||||
this.buff_hp += data.hp
|
||||
if(data.hp > 0){
|
||||
@@ -271,7 +271,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过buff_hp处理
|
||||
console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
|
||||
//console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
|
||||
this.hp_max -= Math.floor(hp) ;
|
||||
this.BUFFCOMP.vmdata_update(true)
|
||||
}
|
||||
@@ -339,7 +339,7 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
do_dead(){
|
||||
this.do_dead_trigger()
|
||||
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
|
||||
//console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
|
||||
|
||||
if(this.fac==FacSet.MON){
|
||||
let exp=getExpDrops(HeroInfo[this.hero_uuid].quality,this.lv)
|
||||
@@ -353,7 +353,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
if(this.fac==FacSet.HERO){
|
||||
console.log("[HeroViewComp]:英雄死亡")
|
||||
//console.log("[HeroViewComp]:英雄死亡")
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
let n_deR=deR-DEBUFF_DOWN-buff_debuff_down // 触发概率
|
||||
let r=RandomManager.instance.getRandomInt(0,100) // 随机数
|
||||
console.log("[HeroViewComp]:类型,值,次数,技能概率,实际概率,随机数",type,deV,deC,deR,n_deR,r)
|
||||
//console.log("[HeroViewComp]:类型,值,次数,技能概率,实际概率,随机数",type,deV,deC,deR,n_deR,r)
|
||||
if(r < n_deR) {
|
||||
// this.BUFFCOMP.tooltip(TooltipTypes.uskill,"*抵抗*")
|
||||
return
|
||||
@@ -434,7 +434,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
break
|
||||
}
|
||||
console.log("[HeroViewComp]:debuffs",type,deV,deC,deR,this.DEBUFF_BURNS)
|
||||
//console.log("[HeroViewComp]:debuffs",type,deV,deC,deR,this.DEBUFF_BURNS)
|
||||
}
|
||||
|
||||
add_buff(buff:number,count:number,type:number){
|
||||
@@ -482,7 +482,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.is_dead=true
|
||||
this.BUFFCOMP.dead()
|
||||
this.do_dead()
|
||||
console.log("[HeroViewComp]:dead,fac => "+(this.fac==FacSet.HERO?"hero":"monster"))
|
||||
//console.log("[HeroViewComp]:dead,fac => "+(this.fac==FacSet.HERO?"hero":"monster"))
|
||||
if(this.ent == null) return;
|
||||
if(this.fac ==FacSet.HERO){
|
||||
this.to_grave()
|
||||
@@ -519,7 +519,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(buff!==null) buff_def=buff.DEF
|
||||
|
||||
damage=remainingDamage*(100-(buff_def+def)+Burn)/100
|
||||
console.log("[HeroViewComp]:最终伤害,敌人伤害值,免伤,防御,易伤",damage,remainingDamage,buff_def,def,Burn)
|
||||
////console.log("[HeroViewComp]:最终伤害,敌人伤害值,免伤,防御,易伤",damage,remainingDamage,buff_def,def,Burn)
|
||||
return Math.floor(damage)
|
||||
}
|
||||
count_debuff(){
|
||||
@@ -559,11 +559,11 @@ export class HeroViewComp extends CCComp {
|
||||
if(crit > 0){
|
||||
let random = Math.random()*100
|
||||
if(random < crit) {
|
||||
console.log("[HeroViewComp]:crit",crit,random)
|
||||
//console.log("[HeroViewComp]:crit",crit,random)
|
||||
return true
|
||||
}
|
||||
}
|
||||
console.log("[HeroViewComp]:crit",crit)
|
||||
//console.log("[HeroViewComp]:crit",crit)
|
||||
return false
|
||||
}
|
||||
// dead(){
|
||||
@@ -575,14 +575,14 @@ export class HeroViewComp extends CCComp {
|
||||
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
|
||||
let count = 1
|
||||
for(let i=0;i<count;i++){
|
||||
console.log("[HeroViewComp]:dead"+i+"次")
|
||||
//console.log("[HeroViewComp]:dead"+i+"次")
|
||||
}
|
||||
}
|
||||
do_atked_trigger(){
|
||||
if(this.is_dead||this.fac==FacSet.MON) return
|
||||
let count = 1
|
||||
if(this.double_atked) {
|
||||
console.log("[HeroViewComp]:double_atked")
|
||||
//console.log("[HeroViewComp]:double_atked")
|
||||
count =2
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
to_console(value:any,value2:any=null,value3:any=null){
|
||||
console.log("["+this.scale+this.hero_name+']'+value,value2,value3)
|
||||
//console.log("["+this.scale+this.hero_name+']'+value,value2,value3)
|
||||
}
|
||||
|
||||
reset() {
|
||||
@@ -641,13 +641,13 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
exp_up(e:any,data:any){
|
||||
if(this.fac==FacSet.MON) return
|
||||
console.log("[HeroViewComp]:经验提高",data.exp)
|
||||
//console.log("[HeroViewComp]:经验提高",data.exp)
|
||||
this.exp+=data.exp
|
||||
this.next_exp=getUpExp(this.lv)
|
||||
let diff=this.exp-this.next_exp
|
||||
if(diff >= 0){
|
||||
this.exp=diff
|
||||
console.log("[HeroViewComp]:exp_up",this.exp,this.next_exp)
|
||||
//console.log("[HeroViewComp]:exp_up",this.exp,this.next_exp)
|
||||
oops.message.dispatchEvent(GameEvent.EnhancementSelect)
|
||||
this.to_update()
|
||||
}
|
||||
@@ -704,10 +704,10 @@ export class HeroViewComp extends CCComp {
|
||||
this.atked_count++;
|
||||
if (isCrit) {
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.crit, damage.toFixed(0), damage);
|
||||
// console.log("暴击伤害:" + damage);
|
||||
// //console.log("暴击伤害:" + damage);
|
||||
} else {
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.life, damage.toFixed(0), damage);
|
||||
// console.log("普通伤害:" + damage);
|
||||
// //console.log("普通伤害:" + damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,8 +76,8 @@ export class Monster extends ecs.Entity {
|
||||
// 怪物属性随等级增长 (根据Design.md中的公式)
|
||||
// HP增长: Math.floor(baseHp * (1 + (level-1) * 0.3))
|
||||
// AP增长: Math.floor(baseAp * (1 + (level-1) * 0.25))
|
||||
const levelHp = Math.floor(baseHp * (1 + (lv - 1) * 0.3));
|
||||
const levelAp = Math.floor(baseAp * (1 + (lv - 1) * 0.25));
|
||||
const levelHp = Math.floor(baseHp * (1 + (lv - 1) * 0.5));
|
||||
const levelAp = Math.floor(baseAp * (1 + (lv - 1) * 0.1));
|
||||
|
||||
hv.hp = hv.hp_max = levelHp;
|
||||
hv.ap = levelAp;
|
||||
|
||||
@@ -37,13 +37,13 @@ export class SkillConComp extends CCComp {
|
||||
onLoad(){
|
||||
this.HeroView=this.node.getComponent(HeroViewComp)
|
||||
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
|
||||
// console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp onLoad")
|
||||
// //console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp onLoad")
|
||||
this.on(GameEvent.CastHeroSkill,this.cast_master_skill,this)
|
||||
oops.message.on(GameEvent.MaxSkill,this.use_max_skill,this)
|
||||
|
||||
}
|
||||
start() {
|
||||
// console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp start")
|
||||
// //console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp start")
|
||||
this.HeroEntity=this.HeroView.ent
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export class SkillConComp extends CCComp {
|
||||
this.HeroView.at = 0;
|
||||
}
|
||||
if (this.aoe_queues.length > 0) {
|
||||
console.log("[FightConComp]:aoe_queues:",this.aoe_queues)
|
||||
//console.log("[FightConComp]:aoe_queues:",this.aoe_queues)
|
||||
|
||||
// 遍历所有必杀技技能,更新它们的计时器
|
||||
for (let i = this.aoe_queues.length - 1; i >= 0; i--) {
|
||||
@@ -93,13 +93,13 @@ export class SkillConComp extends CCComp {
|
||||
cast_master_skill(e:string,uuid:any){
|
||||
if(!this.HeroView) return
|
||||
if(!this.HeroView.is_master) return
|
||||
console.log("hart cast_skill",uuid ,e)
|
||||
//console.log("hart cast_skill",uuid ,e)
|
||||
const config = SkillSet[uuid];
|
||||
this.castSkill(config,false,this.FIGHTCON.hero_buff.SKILL_DMG)
|
||||
}
|
||||
/** 施放技能 */
|
||||
castSkill(config: typeof SkillSet[keyof typeof SkillSet],is_wfuny:boolean=false,dmg:number=0) {
|
||||
// console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
|
||||
// //console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
|
||||
|
||||
this.doSkill(config,is_wfuny,dmg);
|
||||
|
||||
@@ -109,7 +109,7 @@ export class SkillConComp extends CCComp {
|
||||
use_max_skill(e:GameEvent,data:any){
|
||||
if(!this.HeroView) return
|
||||
if(!this.HeroView.is_master) return
|
||||
console.log("[SkillConComp]:use_max_skill:",data)
|
||||
//console.log("[SkillConComp]:use_max_skill:",data)
|
||||
this.skill_id_counter++;
|
||||
this.aoe_queues.push({
|
||||
id: this.skill_id_counter,
|
||||
@@ -258,7 +258,7 @@ export class SkillConComp extends CCComp {
|
||||
target_pos= new Vec3(targets[0].get(HeroViewComp).node.position.x,0,0)
|
||||
}
|
||||
let start_pos=new Vec3(-280,50,0)
|
||||
// console.log("[Skill]:node=>",start_pos)
|
||||
// //console.log("[Skill]:node=>",start_pos)
|
||||
skill.load(
|
||||
start_pos,
|
||||
this.node.parent,
|
||||
@@ -284,7 +284,7 @@ export class SkillConComp extends CCComp {
|
||||
|
||||
|
||||
public clear_timer() {
|
||||
// console.log("clear_timer");
|
||||
// //console.log("clear_timer");
|
||||
Object.values(this._timers).forEach(clearTimeout);
|
||||
}
|
||||
get_cd(cd:number,view:HeroViewComp){
|
||||
|
||||
Reference in New Issue
Block a user