穿刺和易伤为100% 暴击和风怒为概率

This commit is contained in:
2025-07-01 17:15:08 +08:00
parent 9b5c2f8fc8
commit bdb0ca5bb1
7 changed files with 170 additions and 47 deletions

View File

@@ -41,14 +41,13 @@ export class SkillConComp extends CCComp {
if(this.HeroView.DEBUFF_STUN <= 0) this.HeroView.at += dt;
let cd = this.get_cd(this.HeroView.cd,this.HeroView)
let count=this.get_count(1,this.HeroView)
// console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从] 准备释放")+SkillSet[this.HeroView.atk_skill].name+"=>"+"=>cd:"+cd+"=> count:"+count)
if (this.HeroView.is_atking &&(this.HeroView.at > cd)) {
if(this.HeroView.is_dead) return
const config = SkillSet[this.HeroView.atk_skill];
if (!config) return;
// console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从] 释放")+"=>"+config.name+"=>"+count)
this.castSkill(config,count);
this.castSkill(config,this.check_wfuny());
this.HeroView.master_count_atk_count()
this.HeroView.friend_count_atk_count()
this.HeroView.at = 0;
@@ -60,18 +59,18 @@ export class SkillConComp extends CCComp {
if(!this.HeroView.is_master) return
console.log("hart cast_skill",uuid ,e)
const config = SkillSet[uuid];
this.castSkill(config,1,this.FIGHTCON.hero_buff.SKILL_DMG)
this.castSkill(config,false,this.FIGHTCON.hero_buff.SKILL_DMG)
}
/** 施放技能 */
castSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1,dmg:number=0) {
castSkill(config: typeof SkillSet[keyof typeof SkillSet],is_wfuny:boolean=false,dmg:number=0) {
// console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
this.doSkill(config,count,dmg);
this.doSkill(config,is_wfuny,dmg);
}
private doSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1,angle:number=0,dmg:number=0) {
private doSkill(config: typeof SkillSet[keyof typeof SkillSet],is_wfuny:boolean=false,dmg:number=0) {
// 添加节点有效性检查
if (!this.node || !this.node.isValid || !this.HeroView || !this.HeroView.node || !this.HeroView.node.isValid) {
return;
@@ -117,26 +116,30 @@ export class SkillConComp extends CCComp {
config.uuid,
new Vec3(targetView.node.position.x, targetView.node.position.y, 0),
this.HeroView,
angle,
0,
dmg
);
}, 300);
if(count > 1 && this.check_double_atk(count)){
if(is_wfuny){
this.scheduleOnce(()=>{
this.HeroView.ex_show("blue")
this.doSkill(config,1)
this.doSkill(config,false,dmg)
},0.05)
}
// 保存定时器ID
this._timers[`skill_${config.uuid}`] = timerId;
}
check_double_atk(count:number){
check_wfuny(){
let buff=this.get_buff(this.HeroView)
if(buff==null) return false
let random = Math.random()*100
if(random < FightSet.DOUBLE_ATK_RATE*count){ //多次攻击概率
if(random < buff.WFUNY){
return true
}
return false
}
/** 筛选最前排单位 */
@@ -213,7 +216,7 @@ export class SkillConComp extends CCComp {
get_count(count:number,view:HeroViewComp){
let buff=this.get_buff(view)
if(buff==null) return count
let re=count+(buff.ATK_COUNT)
let re=count+(buff.WFUNY)
if(re<1) re=1
return re
}