debuff 灼烧完成
This commit is contained in:
@@ -206,20 +206,30 @@ export class BuffComp extends Component {
|
||||
let pos =v3(15,30);
|
||||
node.setPosition(pos)
|
||||
node.parent = this.node;
|
||||
}
|
||||
in_iced(t:number=1) {
|
||||
}
|
||||
in_iced(t:number=1,ap:number=0) {
|
||||
var path = "game/skills/iced";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.getComponent(timedCom).time = t;
|
||||
node.getComponent(timedCom).ap = ap;
|
||||
node.parent = this.node;
|
||||
}
|
||||
in_yun(t:number=1) {
|
||||
in_fired(t:number=1,ap:number=0) {
|
||||
var path = "game/skills/fired";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.getComponent(timedCom).time = t;
|
||||
node.getComponent(timedCom).ap = ap;
|
||||
node.parent = this.node;
|
||||
}
|
||||
in_yun(t:number=1,ap:number=0) {
|
||||
var path = "game/skills/yun";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.setPosition(v3(0,90));
|
||||
node.getComponent(timedCom).time = t;
|
||||
node.getComponent(timedCom).ap = ap;
|
||||
node.parent = this.node;
|
||||
}
|
||||
to_speek(words:string,time:number=0.5){
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @LastEditTime: 2022-08-17 12:36:18
|
||||
*/
|
||||
|
||||
import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label,RigidBody2D ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game} from "cc";
|
||||
import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label,RigidBody2D ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween} 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 { HeroSpine } from "./HeroSpine";
|
||||
@@ -23,6 +23,7 @@ import { RandomManager } from "../../../../extensions/oops-plugin-framework/asse
|
||||
import { TimerManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/TimerManager";
|
||||
import { HeroSet } from "../common/config/heroSet";
|
||||
import { BuffComp } from "./BuffComp";
|
||||
import { BossList } from "../common/config/MissionSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 角色显示组件 */
|
||||
@@ -341,19 +342,22 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
return
|
||||
}
|
||||
this.check_debuff(skill)
|
||||
if(this.check_dodge()) return
|
||||
this.in_atked();
|
||||
let d=this.def/skill.ap
|
||||
if(d > 1) d = 1
|
||||
let l_hp=skill.ap*(1-d*GameSet.DEF_RATE) //防御最高减免伤害比率计算
|
||||
if(skill.is_crit){
|
||||
l_hp = l_hp * (150+skill.crit_add)/100
|
||||
}
|
||||
l_hp=Math.ceil(l_hp)
|
||||
let l_hp=this.check_less(skill.ap,skill.is_crit,skill.crit_add)
|
||||
this.check_debuff(skill,l_hp*skill.derate)
|
||||
this.hp_less(l_hp,skill.is_crit);
|
||||
}
|
||||
check_debuff(skill:any){
|
||||
check_less(ap:number,is_crit:boolean,crit_add:number=0){
|
||||
let d=this.def/ap
|
||||
if(d > 1) d = 1
|
||||
let l_hp=ap*(1-d*GameSet.DEF_RATE) //防御最高减免伤害比率计算
|
||||
if(is_crit){
|
||||
l_hp = l_hp * (150+crit_add)/100
|
||||
}
|
||||
return Math.ceil(l_hp)
|
||||
}
|
||||
check_debuff(skill:any,l_hp:number=0){
|
||||
console.log(this.hero_name+":"+this.uuid+"check_debuff "+skill.debuff);
|
||||
|
||||
if(skill.debuff == 0) return
|
||||
@@ -361,43 +365,52 @@ export class HeroViewComp extends CCComp {
|
||||
switch (skill.debuff){
|
||||
case 1:
|
||||
// console.log(this.hero_name+":"+this.uuid+"冰冻触判断: i="+num+":rate="+skill.rate);
|
||||
if(num > skill.rate) return
|
||||
// console.log(this.hero_name+":"+this.uuid+"冰冻触成功: i="+num+":decd="+skill.decd);
|
||||
this.ice_cd = skill.decd
|
||||
this.BUFFCOMP.in_iced(skill.decd)
|
||||
if(num > skill.depb) return
|
||||
// console.log(this.hero_name+":"+this.uuid+"冰冻触成功: i="+num+":debtime="+skill.debtime);
|
||||
this.ice_cd = skill.debtime
|
||||
this.BUFFCOMP.in_iced(skill.debtime)
|
||||
break;
|
||||
case 2:
|
||||
if(num > skill.rate) return
|
||||
if(num > skill.depb) return
|
||||
console.log(this.hero_name+":"+this.uuid+"debuff触发成功: i="+num+":debtime="+skill.debtime+":l_hp="+l_hp);
|
||||
this.BUFFCOMP.in_fired(skill.debtime,l_hp)
|
||||
break;
|
||||
case 3:
|
||||
if(num > skill.rate) return
|
||||
this.yun_cd = skill.decd
|
||||
this.BUFFCOMP.in_yun(skill.decd)
|
||||
if(num > skill.depb) return
|
||||
this.yun_cd = skill.debtime
|
||||
this.BUFFCOMP.in_yun(skill.debtime)
|
||||
break;
|
||||
case 4:
|
||||
if(num > skill.rate) return
|
||||
if(num > skill.depb) return
|
||||
break;
|
||||
case 5:
|
||||
if(num > skill.rate) return
|
||||
if(num > skill.depb) return
|
||||
break;
|
||||
case 6:
|
||||
if(num > skill.rate) return
|
||||
if(num > skill.depb) return
|
||||
break;
|
||||
case 7:
|
||||
if(num > skill.rate) return
|
||||
if(num > skill.depb) return
|
||||
break;
|
||||
case 8:
|
||||
if(num > skill.rate) return
|
||||
if(num > skill.depb) return
|
||||
tween(this.node).to( 0.1,
|
||||
{ position: new Vec3(this.node.position.x-this.scale*50,this.node.position.y) },
|
||||
{
|
||||
|
||||
}
|
||||
).start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//能量判断
|
||||
check_power(){
|
||||
if(this.pw >= this.pwm){
|
||||
this.pw = 0
|
||||
this.BUFFCOMP.max_show()
|
||||
|
||||
this.handle_skill(this.sk2)
|
||||
this.do_skill(this.sk2)
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
@@ -448,7 +461,7 @@ export class HeroViewComp extends CCComp {
|
||||
* 检查并处理角色的攻击、闪避、暴击和受伤计数。
|
||||
* 当计数达到一定值时,会触发相应的技能效果,并重置计数。
|
||||
* 触发效果包括激活名为"max"的节点,并在0.8秒后关闭。
|
||||
* 使用handle_skill方法处理触发的技能。
|
||||
* 使用do_skill方法处理触发的技能。
|
||||
*/
|
||||
check_atk_counts() {
|
||||
if (this.atk_count >= this.akc) {
|
||||
@@ -459,7 +472,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(i < this.akr){
|
||||
// console.log("攻击触发: i="+i+":akr="+this.akr);
|
||||
this.BUFFCOMP.max_show()
|
||||
this.handle_skill(this.sk3)
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
if(this.dodge_count >= this.dgc){
|
||||
@@ -470,7 +483,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(i < this.dgr){
|
||||
// console.log("闪避触发: i="+i+":dgr="+this.dgr);
|
||||
this.BUFFCOMP.max_show()
|
||||
this.handle_skill(this.sk3)
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
if(this.crit_count >= this.crc){
|
||||
@@ -482,7 +495,7 @@ export class HeroViewComp extends CCComp {
|
||||
// console.log("暴击触发: i="+i+":crr="+this.crr);
|
||||
|
||||
this.BUFFCOMP.max_show()
|
||||
this.handle_skill(this.sk3)
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
if(this.atked_count >= this.uac){
|
||||
@@ -492,7 +505,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(i < this.uar){
|
||||
// console.log("受伤触发: i="+i+":uar="+this.uar);
|
||||
this.BUFFCOMP.max_show()
|
||||
this.handle_skill(this.sk3)
|
||||
this.do_skill(this.sk3)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -512,7 +525,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
}
|
||||
//使用max_skill
|
||||
handle_skill(skill:number){
|
||||
do_skill(skill:number){
|
||||
this.as.max()
|
||||
this.at = 0;
|
||||
this.BUFFCOMP.tooltip(3,SkillSet[skill].name,skill);
|
||||
@@ -679,8 +692,8 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
in_atked() {
|
||||
this.BUFFCOMP.in_atked()
|
||||
// this.as.atked();
|
||||
// this.BUFFCOMP.in_atked()
|
||||
this.as.atked();
|
||||
this.atked_count++;
|
||||
this.exp_add(this.uaexp)
|
||||
this.power_add(this.uapw)
|
||||
|
||||
Reference in New Issue
Block a user