删除好多英雄 专精几个英雄,继续英雄页面
This commit is contained in:
@@ -12,14 +12,11 @@ import { HeroSpine } from "./HeroSpine";
|
||||
import { HeroModelComp } from "./HeroModelComp";
|
||||
import { BoxSet, GameSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { Skill } from "../skills/Skill";
|
||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
import { SkillCom } from "../skills/SkillCom";
|
||||
import { SkillSet, SkTG, SkType } from "../common/config/SkillSet";
|
||||
import { Tooltip } from "../skills/Tooltip";
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
import { TimerManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/TimerManager";
|
||||
import { HeroSet } from "../common/config/heroSet";
|
||||
import { BuffComp } from "./BuffComp";
|
||||
import { MonModelComp } from "./MonModelComp";
|
||||
@@ -172,39 +169,11 @@ export class HeroViewComp extends CCComp {
|
||||
// console.log(Date.now()+this.hero_name+":"+this.uuid+' onBeginContact: '+skill.s_name+skill.uuid);
|
||||
if(this.hp <= 0 ) return
|
||||
if(skill.tg< 3) return
|
||||
this.check_uatk(skill);
|
||||
|
||||
}
|
||||
if(oCol.group == seCol.group&&oCol.tag==BoxSet.SKILL_TAG){
|
||||
let skill = oCol.node.getComponent(SkillCom)!;
|
||||
if(skill.tg==2||skill.tg==0){
|
||||
this.do_buff(skill)
|
||||
}
|
||||
this.check_uatk(skill);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
do_buff(skill:any){
|
||||
if(SkillSet[skill.s_uuid].hp > 0){ //buff加血
|
||||
// let increase_hp=Math.floor(skill.hp/(skill.in_time/skill.cd))
|
||||
let increase_hp=Math.floor(skill.hp)
|
||||
this.add_hp(increase_hp)
|
||||
}
|
||||
|
||||
if(SkillSet[skill.s_uuid].apup > 0){ //buff加攻击
|
||||
// let increase_atk=Math.floor(skill.apup/(skill.in_time/skill.cd))
|
||||
let increase_atk=Math.floor(skill.apup)
|
||||
this.add_ap(increase_atk)
|
||||
}
|
||||
|
||||
if(SkillSet[skill.s_uuid].shield > 0){ //buff护盾
|
||||
this.add_shield(skill.shield)
|
||||
}
|
||||
if(SkillSet[skill.s_uuid].mhp > 0){ //hp最大值
|
||||
// console.log("do_buff mhp: ",skill.mhp/(skill.in_time/skill.cd))
|
||||
this.add_hp_max(skill.mhp/(skill.in_time/skill.cd))
|
||||
}
|
||||
}
|
||||
|
||||
onEndContact (seCol: Collider2D, oCol: Collider2D) {
|
||||
|
||||
}
|
||||
@@ -384,7 +353,7 @@ export class HeroViewComp extends CCComp {
|
||||
* @param l_hp - 可选参数,表示英雄的当前生命值,默认为0
|
||||
*/
|
||||
check_debuff(skill:any,l_hp:number=0){
|
||||
console.log(this.hero_name+this.uuid+": skillname: "+skill.s_name+" :check_debuff "+skill.debuff);
|
||||
// console.log(this.hero_name+this.uuid+": skillname: "+skill.s_name+" :check_debuff "+skill.debuff);
|
||||
if(skill.debuff == 0) return
|
||||
let num=RandomManager.instance.getRandomInt(0,100)
|
||||
switch (skill.debuff){
|
||||
@@ -488,7 +457,7 @@ export class HeroViewComp extends CCComp {
|
||||
// console.log("攻击判断: i="+i+":akr="+this.akr);
|
||||
if(i < this.akr){
|
||||
// console.log("攻击触发: i="+i+":akr="+this.akr);
|
||||
this.BUFFCOMP.max_show()
|
||||
// this.BUFFCOMP.max_show()
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
@@ -499,7 +468,7 @@ export class HeroViewComp extends CCComp {
|
||||
// console.log("闪避判断: i="+i+":dgr="+this.dgr);
|
||||
if(i < this.dgr){
|
||||
// console.log("闪避触发: i="+i+":dgr="+this.dgr);
|
||||
this.BUFFCOMP.max_show()
|
||||
// this.BUFFCOMP.max_show()
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
@@ -511,7 +480,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(i < this.crr){
|
||||
// console.log("暴击触发: i="+i+":crr="+this.crr);
|
||||
|
||||
this.BUFFCOMP.max_show()
|
||||
// this.BUFFCOMP.max_show()
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
@@ -521,7 +490,7 @@ export class HeroViewComp extends CCComp {
|
||||
// console.log("受伤判断:i="+i+":akr="+this.uar);
|
||||
if(i < this.uar){
|
||||
// console.log("受伤触发: i="+i+":uar="+this.uar);
|
||||
this.BUFFCOMP.max_show()
|
||||
// this.BUFFCOMP.max_show()
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
@@ -645,22 +614,10 @@ export class HeroViewComp extends CCComp {
|
||||
left_x = hero.node.position.x
|
||||
f_hero = hero
|
||||
}
|
||||
if(this.box_group==BoxSet.MONSTER){
|
||||
if(hero.node.position.x < right_x){
|
||||
right_x = hero.node.position.x
|
||||
f_hero = hero
|
||||
}
|
||||
}
|
||||
if(hero.node.position.x < right_x){
|
||||
right_x = hero.node.position.x
|
||||
b_hero = hero
|
||||
}
|
||||
if(this.box_group==BoxSet.MONSTER){
|
||||
if(hero.node.position.x > left_x){
|
||||
left_x = hero.node.position.x
|
||||
b_hero = hero
|
||||
}
|
||||
}
|
||||
}
|
||||
return {l_hero,m_hero,f_hero,b_hero,r_hero}
|
||||
}
|
||||
@@ -747,20 +704,20 @@ export class HeroViewComp extends CCComp {
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let pos=v3(0,0)
|
||||
let t_pos = pos
|
||||
this.to_console("to_all_buff:"+sk)
|
||||
// this.to_console("to_all_buff:"+sk)
|
||||
let is_crit=this.check_crit()
|
||||
skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add,this.rhp_max);
|
||||
this.to_console("使用buff:"+sk+" t_pos:"+t_pos+" box:"+this.box_group);
|
||||
// this.to_console("使用buff:"+sk+" t_pos:"+t_pos+" box:"+this.box_group);
|
||||
}
|
||||
|
||||
do_add_buff(hero:any,sk:number){
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let t_pos=hero.node.position
|
||||
let pos = this.node.position
|
||||
this.to_console("do_add_buff:"+hero.hero_name+" "+sk);
|
||||
// this.to_console("do_add_buff:"+hero.hero_name+" "+sk);
|
||||
let is_crit=this.check_crit()
|
||||
skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add,this.rhp_max);
|
||||
this.to_console(this.scale+this.hero_name+"使用buff:"+sk+SkillSet[sk].name+" t_pos:"+t_pos+" box:"+this.box_group,);
|
||||
// this.to_console(this.scale+this.hero_name+"使用buff:"+sk+SkillSet[sk].name+" t_pos:"+t_pos+" box:"+this.box_group,);
|
||||
}
|
||||
|
||||
exp_add(exp:number=0){
|
||||
@@ -896,7 +853,7 @@ export class HeroViewComp extends CCComp {
|
||||
let Drops = getMonsterDrops(1, MonsterType.Normal, 1.2);
|
||||
if(this.is_boss) Drops =getMonsterDrops(1, MonsterType.Elite, 1.2);
|
||||
if(this.is_big_boss) Drops =getMonsterDrops(1, MonsterType.Boss, 1.2);
|
||||
console.log("掉落物品:",Drops);
|
||||
// console.log("掉落物品:",Drops);
|
||||
//根据掉落类型和uuid 写入用户数据文件SingletonModuleComp =smc,英雄碎片对应smc.heros[uuid].num,smc.heros[uuid].x1 记录本局掉落的数量,也需要添加对应值
|
||||
//金币uuid=9001 对应smc.vmdata.gold.num,宝箱uuid1003,对应smc.vmdata.box.num ,smc.itmes[9001].x1,smc.itmes[1003].x1 记录本局
|
||||
for (let i = 0; i < Drops.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user