去掉skillcom处理 buff skill只负责动画运行和碰撞伤害

This commit is contained in:
2025-08-12 10:31:01 +08:00
parent ca8bbd397b
commit 1273ec6e99
13 changed files with 166 additions and 443 deletions

View File

@@ -453,7 +453,7 @@ export const EquipInfo: { [key: number]: EquipData } = {
{ type: BuffAttr.ATK, value: 300, target: EquipAttrTarget.HERO }, { type: BuffAttr.ATK, value: 300, target: EquipAttrTarget.HERO },
{ type: BuffAttr.ATK_CD, value: 0, target: EquipAttrTarget.HERO }, // CD修正0% { type: BuffAttr.ATK_CD, value: 0, target: EquipAttrTarget.HERO }, // CD修正0%
{ type: BuffAttr.WFUNY, value: 60, target: EquipAttrTarget.HERO }, // 风怒概率60% { type: BuffAttr.WFUNY, value: 60, target: EquipAttrTarget.HERO }, // 风怒概率60%
{ type: BuffAttr.STUN_RATTO, value: 12.5, target: EquipAttrTarget.HERO }, // 击晕概率12.5% { type: BuffAttr.STUN_RATIO, value: 12.5, target: EquipAttrTarget.HERO }, // 击晕概率12.5%
], ],
}, },
@@ -507,7 +507,7 @@ export const EquipInfo: { [key: number]: EquipData } = {
{ type: BuffAttr.ATK_CD, value: -6.7, target: EquipAttrTarget.HERO }, // CD修正+6.7% { type: BuffAttr.ATK_CD, value: -6.7, target: EquipAttrTarget.HERO }, // CD修正+6.7%
{ type: BuffAttr.CRITICAL, value: 30, target: EquipAttrTarget.HERO }, // 暴击率30% { type: BuffAttr.CRITICAL, value: 30, target: EquipAttrTarget.HERO }, // 暴击率30%
{ type: BuffAttr.CRITICAL_DMG, value: 70, target: EquipAttrTarget.HERO }, // 暴击伤害+70% { type: BuffAttr.CRITICAL_DMG, value: 70, target: EquipAttrTarget.HERO }, // 暴击伤害+70%
{ type: BuffAttr.STUN_RATTO, value: 15, target: EquipAttrTarget.HERO }, // 击晕概率+15% { type: BuffAttr.STUN_RATIO, value: 15, target: EquipAttrTarget.HERO }, // 击晕概率+15%
], ],
}, },
5104: { 5104: {
@@ -523,7 +523,7 @@ export const EquipInfo: { [key: number]: EquipData } = {
{ type: BuffAttr.ATK, value: 360, target: EquipAttrTarget.HERO }, { type: BuffAttr.ATK, value: 360, target: EquipAttrTarget.HERO },
{ type: BuffAttr.ATK_CD, value: -6.7, target: EquipAttrTarget.HERO }, // CD修正+6.7% { type: BuffAttr.ATK_CD, value: -6.7, target: EquipAttrTarget.HERO }, // CD修正+6.7%
{ type: BuffAttr.CRITICAL, value: 30, target: EquipAttrTarget.HERO }, // 暴击率30% { type: BuffAttr.CRITICAL, value: 30, target: EquipAttrTarget.HERO }, // 暴击率30%
{ type: BuffAttr.STUN_RATTO, value: 30, target: EquipAttrTarget.HERO }, // 击晕概率30% { type: BuffAttr.STUN_RATIO, value: 30, target: EquipAttrTarget.HERO }, // 击晕概率30%
], ],
}, },

View File

@@ -113,13 +113,12 @@ export enum BuffAttr {
SKILL_DMG = 6, // 技能效果 SKILL_DMG = 6, // 技能效果
SKILL_CD = 7, // 技能冷却缩减 SKILL_CD = 7, // 技能冷却缩减
CARD_EFFECT = 8, // 卡牌效果 CARD_EFFECT = 8, // 卡牌效果
CARD_COUNT = 8, // 卡牌起效次数,每3次多起效一次
CRITICAL = 9, //暴击率 CRITICAL = 9, //暴击率
CRITICAL_DMG = 10, //暴击伤害 CRITICAL_DMG = 10, //暴击伤害
CRITICAL_NO = 11, //暴击免疫 CRITICAL_NO = 11, //暴击免疫
DODGE = 12, //闪避 DODGE = 12, //闪避
DODGE_NO = 13, //闪避免疫 DODGE_NO = 13, //闪避免疫
DEBUFF_COUNT = 14, //debuff次数 DEBUFF_COUNT = 14, //debuff持续时间提升
DEBUFF_VALUE = 15, //debuff效果 DEBUFF_VALUE = 15, //debuff效果
DEBUFF_UP = 16, //debuff概率提升 DEBUFF_UP = 16, //debuff概率提升
DEBUFF_DOWN = 17, //被debuff概率降低 DEBUFF_DOWN = 17, //被debuff概率降低
@@ -131,15 +130,55 @@ export enum BuffAttr {
BURN_COUNT = 23, //易伤额外次数 BURN_COUNT = 23, //易伤额外次数
BURN_VALUE = 24,//易伤效果 BURN_VALUE = 24,//易伤效果
STUN_TIME = 25, //击晕额外时间 STUN_TIME = 25, //击晕额外时间
STUN_RATTO = 26, //击晕概率 STUN_RATIO = 26, //击晕概率
FROST_TIME = 27, //冰冻时间 FROST_TIME = 27, //冰冻时间
HP_MAX = 28, //最大生命值数值 HP_MAX = 28, //最大生命值数值
POWER_UP = 29, //能量增加 POWER_UP = 29, //能量增加
LIFESTEAL = 30, //吸血 LIFESTEAL = 30, //吸血
DMG_RED = 31, //免伤 DMG_RED = 31, //免伤
INVINCIBLE = 32, //无敌 INVINCIBLE = 32, //无敌
DIS = 33, //距离
SPEED = 34, //速度
}
export const getBuffNum=()=>{
return {
[BuffAttr.AP]:0, //攻击力 数值
[BuffAttr.ATK]:0, // 攻击力
[BuffAttr.WFUNY]:0, // 风怒概率
[BuffAttr.ATK_CD]:0, // 攻击速度
[BuffAttr.HP]:0, // 生命值 比例
[BuffAttr.DEF]:0, // 免伤
[BuffAttr.SKILL_DMG]:0, // 技能效果
[BuffAttr.SKILL_CD]:0, // 技能冷却缩减
[BuffAttr.CARD_EFFECT]:0, // 卡牌效果
[BuffAttr.CRITICAL]:0, //暴击
[BuffAttr.CRITICAL_DMG]:0, //暴击伤害
[BuffAttr.CRITICAL_NO]:0, //暴击免疫
[BuffAttr.DODGE]:0, //闪避
[BuffAttr.DODGE_NO]:0, //闪避免疫
[BuffAttr.DEBUFF_COUNT]:0, //debuff次数
[BuffAttr.DEBUFF_VALUE]:0, //debuff效果
[BuffAttr.DEBUFF_UP]:0, //debuff概率提升
[BuffAttr.DEBUFF_DOWN]:0, //被debuff概率降低
[BuffAttr.PUNCTURE]:0, //穿刺敌人伤害后方敌人
[BuffAttr.PUNCTURE_DMG]:0, //穿刺敌人伤害后方敌人伤害加成
[BuffAttr.FROST_RATIO]:0, //冰冻比率
[BuffAttr.REFLECT]:0, //反伤比率
[BuffAttr.KNOCKBACK]:0, //击退概率
[BuffAttr.BURN_COUNT]:0, //易伤额外次数
[BuffAttr.BURN_VALUE]:0,
[BuffAttr.STUN_TIME]:0,
[BuffAttr.STUN_RATIO]:0,
[BuffAttr.FROST_TIME]:0,
[BuffAttr.HP_MAX]:0,//最大生命值数值
[BuffAttr.POWER_UP]:0,//能量增加
[BuffAttr.LIFESTEAL]:0,//吸血
[BuffAttr.DMG_RED]:0,//免伤
[BuffAttr.INVINCIBLE]:0,//无敌
[BuffAttr.DIS]:0,//距离
[BuffAttr.SPEED]:0,//速度
}
} }
export const geDebuffNum=()=>{ export const geDebuffNum=()=>{
return { return {
STUN:0, //眩晕 STUN:0, //眩晕
@@ -157,44 +196,7 @@ export const geDebuffNum=()=>{
} }
export const getBuffNum=()=>{
return {
AP:0, //攻击力 数值
ATK:0, // 攻击力
WFUNY:0, // 风怒概率
ATK_CD:0, // 攻击速度
HP:0, // 生命值 比例
DEF:0, // 免伤
SKILL_DMG:0, // 技能效果
SKILL_CD:0, // 技能冷却缩减
CARD_EFFECT:0, // 卡牌效果
CARD_COUNT:0, // 卡牌起效次数,每3次多起效一次
CRITICAL:0, //暴击
CRITICAL_DMG:0, //暴击伤害
CRITICAL_NO:0, //暴击免疫
DODGE:0, //闪避
DODGE_NO:0, //闪避免疫
DEBUFF_COUNT:0, //debuff次数
DEBUFF_VALUE:0, //debuff效果
DEBUFF_UP:0, //debuff概率提升
DEBUFF_DOWN:0, //被debuff概率降低
PUNCTURE:0, //穿刺敌人伤害后方敌人
PUNCTURE_DMG:0, //穿刺敌人伤害后方敌人伤害加成
FROST_RATIO:0, //冰冻比率
REFLECT:0, //反伤比率
KNOCKBACK:0, //击退概率
BURN_COUNT:0, //易伤额外次数
BURN_VALUE:0,
STUN_TIME:0,
STUN_RATTO:0,
FROST_TIME:0,
HP_MAX:0,//最大生命值数值
POWER_UP:0,//能量增加
LIFESTEAL:0,//吸血
DMG_RED:0,//免伤
INVINCIBLE:0,//无敌
}
}
export enum Quality{ export enum Quality{
WHITE=1, WHITE=1,

View File

@@ -35,7 +35,7 @@ export interface TalentConfig {
* | 10 | 技能加速 | +40% | BuffAttr.SKILL_CD | 技能冷却缩减 | * | 10 | 技能加速 | +40% | BuffAttr.SKILL_CD | 技能冷却缩减 |
* | 11 | 冰冻强化 | +10% | BuffAttr.FROST_RATIO| 冰冻概率加成 | * | 11 | 冰冻强化 | +10% | BuffAttr.FROST_RATIO| 冰冻概率加成 |
* | 12 | 击退强化 | +10% | BuffAttr.KNOCKBACK | 击退概率加成 | * | 12 | 击退强化 | +10% | BuffAttr.KNOCKBACK | 击退概率加成 |
* | 13 | 击晕强化 | +10% | BuffAttr.STUN_RATTO | 击晕概率加成 | * | 13 | 击晕强化 | +10% | BuffAttr.STUN_RATIO | 击晕概率加成 |
* | 14 | 反伤强化 | +20% | BuffAttr.REFLECT | 反伤百分比加成 | * | 14 | 反伤强化 | +20% | BuffAttr.REFLECT | 反伤百分比加成 |
* | 15 | 吸血强化 | +20% | BuffAttr.LIFESTEAL | 吸血百分比加成 | * | 15 | 吸血强化 | +20% | BuffAttr.LIFESTEAL | 吸血百分比加成 |
*/ */
@@ -65,7 +65,7 @@ export const TalentList: { [key: number]: TalentConfig } = {
1010: {uuid:1010,name:"技能加速",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.SKILL_CD,value:24,info:"技能冷却缩减+24%"}, 1010: {uuid:1010,name:"技能加速",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.SKILL_CD,value:24,info:"技能冷却缩减+24%"},
1011: {uuid:1011,name:"冰冻强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.FROST_RATIO,value:6,info:"冰冻概率+6%"}, 1011: {uuid:1011,name:"冰冻强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.FROST_RATIO,value:6,info:"冰冻概率+6%"},
1012: {uuid:1012,name:"击退强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.KNOCKBACK,value:6,info:"击退概率+6%"}, 1012: {uuid:1012,name:"击退强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.KNOCKBACK,value:6,info:"击退概率+6%"},
1013: {uuid:1013,name:"击晕强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.STUN_RATTO,value:6,info:"击晕概率+6%"}, 1013: {uuid:1013,name:"击晕强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.STUN_RATIO,value:6,info:"击晕概率+6%"},
1014: {uuid:1015,name:"吸血强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.LIFESTEAL,value:12,info:"吸血+12%"}, 1014: {uuid:1015,name:"吸血强化",path:"3063",quality:TalentQuality.BLUE,buffType:BuffAttr.LIFESTEAL,value:12,info:"吸血+12%"},
// ==================== 紫色品质天赋 ==================== // ==================== 紫色品质天赋 ====================
@@ -81,7 +81,7 @@ export const TalentList: { [key: number]: TalentConfig } = {
2010: {uuid:2010,name:"技能加速大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.SKILL_CD,value:40,info:"技能冷却缩减+40%"}, 2010: {uuid:2010,name:"技能加速大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.SKILL_CD,value:40,info:"技能冷却缩减+40%"},
2011: {uuid:2011,name:"冰冻大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.FROST_RATIO,value:10,info:"冰冻概率+10%"}, 2011: {uuid:2011,name:"冰冻大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.FROST_RATIO,value:10,info:"冰冻概率+10%"},
2012: {uuid:2012,name:"击退大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.KNOCKBACK,value:10,info:"击退概率+10%"}, 2012: {uuid:2012,name:"击退大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.KNOCKBACK,value:10,info:"击退概率+10%"},
2013: {uuid:2013,name:"击晕大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.STUN_RATTO,value:10,info:"击晕概率+10%"}, 2013: {uuid:2013,name:"击晕大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.STUN_RATIO,value:10,info:"击晕概率+10%"},
2014: {uuid:2015,name:"吸血大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.LIFESTEAL,value:20,info:"吸血+20%"}, 2014: {uuid:2015,name:"吸血大师",path:"3063",quality:TalentQuality.PURPLE,buffType:BuffAttr.LIFESTEAL,value:20,info:"吸血+20%"},
}; };

View File

@@ -74,7 +74,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
view.status_change("idle"); view.status_change("idle");
} }
} }
this.checkEnemiesInBase(e);
return; return;
} }
@@ -116,7 +115,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
move.direction = 1; move.direction = 1;
view.node.setScale(1, 1, 1); // 面向右侧 view.node.setScale(1, 1, 1); // 面向右侧
} }
this.checkEnemiesInBase(e);
return; return;
} }
@@ -139,7 +137,6 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
view.status_change("idle"); view.status_change("idle");
// 因为敌人在面前而暂时停止不设置moving为false保持检查状态 // 因为敌人在面前而暂时停止不设置moving为false保持检查状态
} }
this.checkEnemiesInBase(e)
// console.log(`[${view.hero_name}] 类型:${view.type} 是否停止:${shouldStop} 方向:${move.direction} 位置:${view.node.position.x.toFixed(1)}`); // console.log(`[${view.hero_name}] 类型:${view.type} 是否停止:${shouldStop} 方向:${move.direction} 位置:${view.node.position.x.toFixed(1)}`);
} }
@@ -192,20 +189,7 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
const view = entity.get(HeroViewComp); const view = entity.get(HeroViewComp);
return view.node.position.x === -1000 || view.node.position.x === 1000; return view.node.position.x === -1000 || view.node.position.x === 1000;
} }
/**检测敌人是否进入我方基地 */
private checkEnemiesInBase(entity: ecs.Entity) {
const view = entity.get(HeroViewComp);
if(view.fac==FacSet.MON){
if(view.atk_heart) return
if(view.node.position.x <= FightSet.HEARTPOS){
oops.message.dispatchEvent(GameEvent.LifeChange,-1)
view.atk_heart=true
view.is_dead=true
view.BUFFCOMP.dead()
view.do_dead()
}
}
}
/** 检测攻击范围内敌人 */ /** 检测攻击范围内敌人 */
private checkEnemiesInRange(entity: ecs.Entity, range: number): boolean { private checkEnemiesInRange(entity: ecs.Entity, range: number): boolean {
const currentPos = entity.get(HeroViewComp).node.position; const currentPos = entity.get(HeroViewComp).node.position;

View File

@@ -10,7 +10,7 @@ import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
import { FriendModelComp } from "./FriendModel"; import { FriendModelComp } from "./FriendModel";
import { MasterModelComp } from "./MasterModel"; import { MasterModelComp } from "./MasterModel";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
import { BuffAttr, SkillSet } from "../common/config/SkillSet"; import { BuffAttr, getBuffNum, SkillSet } from "../common/config/SkillSet";
import { FightSet } from "../common/config/Mission"; import { FightSet } from "../common/config/Mission";
import { Skill } from "../skills/Skill"; import { Skill } from "../skills/Skill";
/** 角色实体 */ /** 角色实体 */
@@ -80,62 +80,15 @@ export class Hero extends ecs.Entity {
hv.box_group = BoxSet.HERO; hv.box_group = BoxSet.HERO;
hv.hero_uuid= uuid; hv.hero_uuid= uuid;
hv.hero_name= hero.name; hv.hero_name= hero.name;
hv.speed =hv.ospeed = hero.speed; hv.Attrs=getBuffNum()
hv.dis = hero.dis; hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed;
hv.cd = hv.cd_base = hero.cd hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis;
hv.hp = hv.hp_max = hv.hp_base=hero.hp+info.hp hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
hv.ap = hv.ap_base=hero.ap+info.ap; hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hero.hp+info.hp
hv.Attrs[BuffAttr.AP]=hv.ap=hero.ap+info.ap;
hv.Attrs[BuffAttr.DEF]=hv.def=hero.def+info.def;
hero.buff.forEach((buff:any)=>{ hero.buff.forEach((buff:any)=>{
switch(buff.buff_type){ hv.apply_buff(buff.type,buff.value)
case BuffAttr.CRITICAL:
hv.crit=buff.value
break
case BuffAttr.CRITICAL_DMG:
hv.crit_d=buff.value
break
case BuffAttr.DODGE:
hv.dod=buff.value
break
case BuffAttr.DODGE_NO:
hv.dod_no=buff.value
break
case BuffAttr.CRITICAL_NO:
hv.crit_no=buff.value
break
case BuffAttr.PUNCTURE:
hv.puncture=buff.value
break
case BuffAttr.PUNCTURE_DMG:
hv.puncture_damage=buff.value
break
case BuffAttr.WFUNY:
hv.wfuny=buff.value
break
case BuffAttr.ATK_CD:
hv.cd=hv.cd*(100-buff.value)/100
break
case BuffAttr.HP:
hv.hp_max=hv.hp_max*(100+buff.value)/100
break
case BuffAttr.DEF:
hv.def=buff.value
break
case BuffAttr.ATK:
hv.ap=hv.ap*(100+buff.value)/100
break
case BuffAttr.STUN_RATTO:
hv.stun_ratto=buff.value
break
case BuffAttr.FROST_RATIO:
hv.frost_ratto=buff.value
break
case BuffAttr.KNOCKBACK:
hv.knockback=buff.value
break
case BuffAttr.POWER_UP:
smc.vmdata.hero.POWER_UP+=buff.value
break
}
}) })
for(let i=0;i<hero.skills.length;i++){ for(let i=0;i<hero.skills.length;i++){
hv.skills.push({ hv.skills.push({

View File

@@ -32,7 +32,7 @@ export class HeroConComp extends CCComp {
[BuffAttr.PUNCTURE_DMG, 'handlePunctureDmgBuff'], [BuffAttr.PUNCTURE_DMG, 'handlePunctureDmgBuff'],
[BuffAttr.FROST_RATIO, 'handleFrostBuff'], [BuffAttr.FROST_RATIO, 'handleFrostBuff'],
[BuffAttr.KNOCKBACK, 'handleKnockbackBuff'], [BuffAttr.KNOCKBACK, 'handleKnockbackBuff'],
[BuffAttr.STUN_RATTO, 'handleStunBuff'], [BuffAttr.STUN_RATIO, 'handleStunBuff'],
[BuffAttr.REFLECT, 'handleReflectBuff'], [BuffAttr.REFLECT, 'handleReflectBuff'],
[BuffAttr.LIFESTEAL, 'handleLifestealBuff'] [BuffAttr.LIFESTEAL, 'handleLifestealBuff']
]); ]);
@@ -116,22 +116,22 @@ export class HeroConComp extends CCComp {
} }
// Buff处理方法 // Buff处理方法
private handleAPBuff(value: number): void { this.heroView.change_ap(value, true); } private handleAPBuff(value: number): void { this.heroView.apply_buff(BuffAttr.AP, value); }
private handleATKBuff(value: number): void { this.heroView.change_ap(value, false); } private handleATKBuff(value: number): void { this.heroView.apply_buff(BuffAttr.ATK, value); }
private handleSpeedBuff(value: number): void { this.heroView.add_speed(value); } private handleSpeedBuff(value: number): void { this.heroView.apply_buff(BuffAttr.ATK_CD, value); }
private handleDefBuff(value: number): void { this.heroView.change_def(value); } private handleDefBuff(value: number): void { this.heroView.apply_buff(BuffAttr.DEF, value); }
private handleHPBuff(value: number): void { this.heroView.change_hp_max(value, false); } private handleHPBuff(value: number): void { this.heroView.apply_buff(BuffAttr.HP, value); }
private handleHPMaxBuff(value: number): void { this.heroView.change_hp_max(value, true); } private handleHPMaxBuff(value: number): void { this.heroView.apply_buff(BuffAttr.HP_MAX, value); }
private handleCritBuff(value: number): void { this.heroView.change_crit(value); } private handleCritBuff(value: number): void { this.heroView.apply_buff(BuffAttr.CRITICAL, value); }
private handleCritDmgBuff(value: number): void { this.heroView.change_crit_d(value); } private handleCritDmgBuff(value: number): void { this.heroView.apply_buff(BuffAttr.CRITICAL_DMG, value); }
private handleDodgeBuff(value: number): void { this.heroView.change_dodge(value); } private handleDodgeBuff(value: number): void { this.heroView.apply_buff(BuffAttr.DODGE, value); }
private handlePunctureBuff(value: number): void { this.heroView.change_puncture(value); } private handlePunctureBuff(value: number): void { this.heroView.apply_buff(BuffAttr.PUNCTURE, value); }
private handlePunctureDmgBuff(value: number): void { this.heroView.change_puncture_damage(value); } private handlePunctureDmgBuff(value: number): void { this.heroView.apply_buff(BuffAttr.PUNCTURE_DMG, value); }
private handleFrostBuff(value: number): void { this.heroView.change_frost_ratto(value); } private handleFrostBuff(value: number): void { this.heroView.apply_buff(BuffAttr.FROST_RATIO, value); }
private handleKnockbackBuff(value: number): void { this.heroView.change_knockback(value); } private handleKnockbackBuff(value: number): void { this.heroView.apply_buff(BuffAttr.KNOCKBACK, value); }
private handleStunBuff(value: number): void { this.heroView.change_stun_ratto(value); } private handleStunBuff(value: number): void { this.heroView.apply_buff(BuffAttr.STUN_RATIO, value); }
private handleReflectBuff(value: number): void { this.heroView.change_reflect(value); } private handleReflectBuff(value: number): void { this.heroView.apply_buff(BuffAttr.REFLECT, value); }
private handleLifestealBuff(value: number): void { this.heroView.change_lifesteal(value); } private handleLifestealBuff(value: number): void { this.heroView.apply_buff(BuffAttr.LIFESTEAL, value); }
/** 组件重置 */ /** 组件重置 */
reset(): void { reset(): void {
this.node.destroy(); this.node.destroy();

View File

@@ -5,7 +5,7 @@ import { HeroSpine } from "./HeroSpine";
import { BoxSet, FacSet } from "../common/config/BoxSet"; import { BoxSet, FacSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp"; import { smc } from "../common/SingletonModuleComp";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
import { BuffAttr, DebuffAttr, SkillSet, TGroup, TType } from "../common/config/SkillSet"; import { BuffAttr, DebuffAttr, geDebuffNum, getBuffNum, SkillSet, TGroup, TType } from "../common/config/SkillSet";
import { BuffComp } from "./BuffComp"; import { BuffComp } from "./BuffComp";
import { oops } from "db://oops-framework/core/Oops"; import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
@@ -44,27 +44,25 @@ export class HeroViewComp extends CCComp {
is_friend:boolean =false; is_friend:boolean =false;
is_kalami:boolean =false; is_kalami:boolean =false;
speed: number = 100; /** 角色移动速度 */
speed_base: number = 100; /** 角色初始速度 */
hp: number = 100; /** 血量 */ hp: number = 100; /** 血量 */
hp_max: number = 100; /** 最大血量 */ hp_max: number = 100; /** 最大血量 */
hp_buff:number=0;
hp_base:number=0; hp_base:number=0;
ap: number = 10; /**攻击力 */ ap: number = 10; /**攻击力 */
ap_buff:number=0;
ap_base:number=0; ap_base:number=0;
// atk_speed: number = 1; // atk_speed: number = 1;
cd_base:number=1.3;
cd: number = 1.3; /**攻击速度 攻击间隔 */ cd: number = 1.3; /**攻击速度 攻击间隔 */
cd_buff:number=0; def: number = 0; //防御
dmg_red:number=0//免伤
dis: number = 80; dis: number = 80;
skills:any[]=[] skills:any[]=[]
puncture:number=0; //穿刺敌人伤害后方敌人个数 puncture:number=0; //穿刺敌人伤害后方敌人个数
puncture_damage:number=0; //后伤害加成 puncture_damage:number=0; //后伤害加成
def: number = 0; //防御
dmg_red:number=0//免伤
burn: number = 0; //易伤 伤害加成 burn: number = 0; //易伤 伤害加成
stun_time:number=0; //眩晕加成 stun_time:number=0; //眩晕加成
stun_ratto:number=0; //攻击眩晕概率加成 stun_ratio:number=0; //攻击眩晕概率加成
stun_no:boolean=false; //眩晕免疫 stun_no:boolean=false; //眩晕免疫
dod: number = 0; //闪避率 dod: number = 0; //闪避率
dod_no:boolean=false; dod_no:boolean=false;
@@ -72,29 +70,29 @@ export class HeroViewComp extends CCComp {
crit_no:boolean=false; //暴击免疫 crit_no:boolean=false; //暴击免疫
crit_d:number=0; //暴击伤害 crit_d:number=0; //暴击伤害
wfuny:number=0; //风怒概率 wfuny:number=0; //风怒概率
frost_ratto:number=0; //冰冻概率 frost_ratio:number=0; //冰冻概率
frost_time:number=0; //冰冻时间 frost_time:number=0; //冰冻时间
frost_no:boolean=false; //冰冻免疫 frost_no:boolean=false; //冰冻免疫
knockback:number=0; //击退概率 knockback:number=0; //击退概率
knockback_no:boolean=false; //击退免疫 knockback_no:boolean=false; //击退免疫
shield:number = 0; //护盾,免伤1次减1 shield:number = 0; //护盾,免伤1次减1
speed: number = 100; /** 角色移动速度 */
ospeed: number = 100; /** 角色初始速度 */
reflect:number=0; //反射伤害比率 reflect:number=0; //反射伤害比率
lifesteal:number=0; //吸血比率 lifesteal:number=0; //吸血比率
skill_dmg:number=0 skill_dmg:number=0
debuff_down:number=0
Attrs:any=getBuffNum()
debuff_status:any=geDebuffNum()
atk_count: number = 0; atk_count: number = 0;
atked_count: number = 0; atked_count: number = 0;
stop_cd: number = 0; /*停止倒计时*/ stop_cd: number = 0; /*停止倒计时*/
speek_time:number = 0; speek_time:number = 0;
debuff_down_ratto:number=0 BUFFS:Array<{value: number, duration: number,type:number}> = [] //buff
BUFF_DEFS: Array<{value: number, duration: number}> = [] //防御提升
BUFF_ATKS: Array<{value: number, duration: number}> = [] //攻击提升
BUFF_CDS: Array<{value: number, duration: number}> = [] //攻击加速
BUFF_DEDOWN:Array<{value: number, duration: number}> = [] //debuff 概率降低
DEBUFF_BURNS: Array<{value: number, duration: number}> = [] //易伤 DEBUFF_BURNS: Array<{value: number, duration: number}> = [] //易伤
DEBUFF_DEATKS: Array<{value: number, duration: number}> = [] //减攻击 DEBUFF_DEATKS: Array<{value: number, duration: number}> = [] //减攻击
@@ -138,7 +136,6 @@ export class HeroViewComp extends CCComp {
start () { start () {
this.as.idle() this.as.idle()
this.BUFFCOMP=this.node.getComponent(BuffComp); this.BUFFCOMP=this.node.getComponent(BuffComp);
/** 方向 */ /** 方向 */
this.node.setScale(this.scale,1); this.node.setScale(this.scale,1);
this.node.getChildByName("top").setScale(this.scale,1); this.node.getChildByName("top").setScale(this.scale,1);
@@ -209,136 +206,12 @@ export class HeroViewComp extends CCComp {
if(this.shield>6) this.shield=6 if(this.shield>6) this.shield=6
if(this.shield>0) this.BUFFCOMP.show_shield(true) if(this.shield>0) this.BUFFCOMP.show_shield(true)
} }
change_wfuny(wfuny: number){
this.wfuny+=wfuny
if(this.wfuny<0) this.wfuny=0
}
change_puncture(puncture: number){
this.puncture+=puncture
if(this.puncture<1) this.puncture=1
}
change_puncture_damage(puncture_damage: number){
this.puncture_damage+=puncture_damage
if(this.puncture_damage<0) this.puncture_damage=0
if(this.puncture_damage>80) this.puncture_damage=80
}
change_dodge(dodge: number){
this.dod+=dodge
if(this.dod<0) this.dod=0
if(this.dod>90) this.dod=90
}
change_frost_ratto(frost_ratto: number){
this.frost_ratto+=frost_ratto
if(this.frost_ratto<0) this.frost_ratto=0
if(this.frost_ratto>90) this.frost_ratto=90
}
change_knockback(knockback: number){
this.knockback+=knockback
if(this.knockback<0) this.knockback=0
}
change_stun_ratto(stun_ratto: number){
this.stun_ratto+=stun_ratto
if(this.stun_ratto<0) this.stun_ratto=0
}
change_def(def: number){
this.def+=def
if(this.def>90) this.def=90
if(this.def<0) this.def=0
// this.BUFFCOMP.tooltip(TooltipTypes.defup,def.toFixed(0));
}
change_crit(crit: number){
this.crit+=crit
if(this.crit<0) this.crit=0
}
change_crit_d(crit_d: number){
this.crit_d+=crit_d
if(this.crit_d<0) this.crit_d=0
}
change_reflect(reflect: number){
this.reflect+=reflect
if(this.reflect<0) this.reflect=0
}
change_lifesteal(lifesteal: number){
this.lifesteal+=lifesteal
if(this.lifesteal<0) this.lifesteal=0
}
check_atrr(buff:BuffAttr){
switch(buff){
case BuffAttr.ATK:
return Math.floor(this.ap_base*(100+this.ap_buff)/100)
case BuffAttr.ATK_CD:
return this.cd_base/((this.cd_buff)/100+1)
case BuffAttr.HP:
return Math.floor(this.hp_base*(100+this.hp_buff)/100)
}
}
count_atrr(buff:BuffAttr){
switch(buff){
case BuffAttr.ATK:
this.ap=this.check_atrr(BuffAttr.ATK)
break
case BuffAttr.ATK_CD:
this.cd=this.check_atrr(BuffAttr.ATK_CD)
break
case BuffAttr.HP:
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.hp_max=this.check_atrr(BuffAttr.HP)
this.hp+=diff
this.hp_show()
break
}
}
add_speed(cd: number){
this.cd_buff+=cd
this.count_atrr(BuffAttr.ATK_CD)
// this.BUFFCOMP.tooltip(TooltipTypes.speedup,speed.toFixed(0));
}
change_ap(ap: number,is_num:boolean=true){
// console.log("[HeroViewComp]:add_ap add:",ap,this.ap)
if(is_num){
this.ap_base += Math.floor(ap);
}else{
this.ap_buff += Math.floor(ap/100*this.ap_base);
}
this.count_atrr(BuffAttr.ATK)
}
change_hp_max(hp: number=0,is_num:boolean=false){
// console.log("[HeroViewComp]:add_hp_max add:",hp,this.currentHpMax)
if(is_num){
this.hp_base += Math.floor(hp) ;
}else{
this.hp_buff+=hp
}
this.count_atrr(BuffAttr.HP)
// this.update_vm
}
add_hp(hp: number = 0,is_num:boolean=true) { add_hp(hp: number = 0,is_num:boolean=true) {
this.BUFFCOMP.heathed(); this.BUFFCOMP.heathed();
let real_hp=0 let real_hp=0
let hp_max=Math.floor(this.hp_max*(100+this.hp_buff)/100) let hp_max=this.hp_max
let lost_hp=hp_max-this.hp let lost_hp=hp_max-this.hp
if(is_num){ if(is_num){
if(lost_hp > hp){ if(lost_hp > hp){
@@ -402,17 +275,8 @@ export class HeroViewComp extends CCComp {
} }
get_debuff(){
}
add_debuff(type:number,deV:number,deC:number,deR:number){ add_debuff(type:number,deV:number,deC:number,deR:number){
let DEBUFF_DOWN=0 let n_deR=deR-this.Attrs[BuffAttr.DEBUFF_DOWN]
for(let i=0;i<this.BUFF_DEDOWN.length;i++){
DEBUFF_DOWN+=this.BUFF_DEDOWN[i].value
// 不再在这里减少duration改为在update中按时间减少
}
let n_deR=deR-DEBUFF_DOWN-this.debuff_down_ratto // 触发概率
let r=RandomManager.instance.getRandomInt(0,100) // 随机数 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) { if(r < n_deR) {
@@ -469,35 +333,12 @@ export class HeroViewComp extends CCComp {
// 更新所有按时间减少的buff和debuff // 更新所有按时间减少的buff和debuff
updateBuffsAndDebuffs(dt: number) { updateBuffsAndDebuffs(dt: number) {
// 更新BUFF_DEFS // 更新BUFFS
for(let i = this.BUFF_DEFS.length - 1; i >= 0; i--) { for(let i = this.BUFFS.length - 1; i >= 0; i--) {
this.BUFF_DEFS[i].duration -= dt; this.BUFFS[i].duration -= dt;
if(this.BUFF_DEFS[i].duration <= 0) { if(this.BUFFS[i].duration <= 0) {
this.BUFF_DEFS.splice(i, 1); this.apply_buff(this.BUFFS[i].type,-this.BUFFS[i].value)
} this.BUFFS.splice(i, 1);
}
// 更新BUFF_ATKS
for(let i = this.BUFF_ATKS.length - 1; i >= 0; i--) {
this.BUFF_ATKS[i].duration -= dt;
if(this.BUFF_ATKS[i].duration <= 0) {
this.BUFF_ATKS.splice(i, 1);
}
}
// 更新BUFF_CDS
for(let i = this.BUFF_CDS.length - 1; i >= 0; i--) {
this.BUFF_CDS[i].duration -= dt;
if(this.BUFF_CDS[i].duration <= 0) {
this.BUFF_CDS.splice(i, 1);
}
}
// 更新BUFF_DEDOWN
for(let i = this.BUFF_DEDOWN.length - 1; i >= 0; i--) {
this.BUFF_DEDOWN[i].duration -= dt;
if(this.BUFF_DEDOWN[i].duration <= 0) {
this.BUFF_DEDOWN.splice(i, 1);
} }
} }
@@ -527,27 +368,40 @@ export class HeroViewComp extends CCComp {
} }
add_buff(buff:number,duration:number,type:number){ add_buff(buff:number,duration:number,type:number){
switch(type){ if(this.BUFFS.find(b=>b.type==type)) {
case BuffAttr.DEF: if(this.BUFFS.find(b=>b.type==type).value<buff) {
this.BUFF_DEFS.push({value:buff,duration:duration}) let dis_buff_value=buff-this.BUFFS.find(b=>b.type==type).value
this.BUFFS.find(b=>b.type==type).value=buff
this.BUFFS.find(b=>b.type==type).duration=duration
this.apply_buff(type,dis_buff_value)
}
}else{
this.BUFFS.push({value:buff,duration:duration,type:type})
this.apply_buff(type,buff)
}
}
// 应用buff,有基础值的需要特殊处理,其他的直接加减
apply_buff(buff_type:number,buff_value:number){
switch(buff_type){
case BuffAttr.ATK: //攻击百分比
this.Attrs[BuffAttr.AP]+=Math.floor(buff_value/100*this.ap)
break break
case BuffAttr.ATK: case BuffAttr.ATK_CD: //攻击速度百分比
this.BUFF_ATKS.push({value:buff,duration:duration}) this.Attrs[BuffAttr.ATK_CD]+=buff_value/100*this.cd
break break
case BuffAttr.ATK_CD: case BuffAttr.HP: //血量百分比
this.BUFF_CDS.push({value:buff,duration:duration}) this.Attrs[BuffAttr.HP_MAX]+=Math.floor(buff_value/100*this.hp_max)
break break
case BuffAttr.DEBUFF_DOWN: default:
this.BUFF_DEDOWN.push({value:buff,duration:duration}) this.Attrs[buff_type]+=buff_value
break break
} }
} }
do_atked(remainingDamage:number, do_atked(remainingDamage:number,
crit:number=0,crit_d:number=0, crit:number=0,crit_d:number=0,
burn_count:number=0,burn_value:number=0, burn_count:number=0,burn_value:number=0,
stun_time:number=0,stun_ratto:number=0, stun_time:number=0,stun_ratio:number=0,
frost_time:number=0,frost_ratto:number=0, frost_time:number=0,frost_ratio:number=0,
atked_anm:string="atked" atked_anm:string="atked"
){ ){
this.do_atked_trigger() this.do_atked_trigger()
@@ -555,7 +409,7 @@ export class HeroViewComp extends CCComp {
this.add_debuff(DebuffAttr.BURN,burn_value,burn_count,100) this.add_debuff(DebuffAttr.BURN,burn_value,burn_count,100)
} }
if(stun_time>0){ if(stun_time>0){
this.add_debuff(DebuffAttr.STUN,stun_time,1,stun_ratto) this.add_debuff(DebuffAttr.STUN,stun_time,1,stun_ratio)
} }
if(this.check_shield()) return if(this.check_shield()) return
if(this.check_dodge()) return if(this.check_dodge()) return
@@ -730,8 +584,8 @@ export class HeroViewComp extends CCComp {
if(this.fac==FacSet.MON) return if(this.fac==FacSet.MON) return
console.log("[HeroViewComp]:升级",this.BUFFCOMP) console.log("[HeroViewComp]:升级",this.BUFFCOMP)
if(this.hero_uuid!=data.uuid) return if(this.hero_uuid!=data.uuid) return
this.change_ap(HeroInfo[data.uuid].ap,true) this.apply_buff(BuffAttr.HP_MAX,data.hp)
this.change_hp_max(HeroInfo[data.uuid].hp,true) this.apply_buff(BuffAttr.AP,data.ap)
this.BUFFCOMP.lv_up() this.BUFFCOMP.lv_up()
// this.BUFFCOMP.tooltip(TooltipTypes.lvup) // this.BUFFCOMP.tooltip(TooltipTypes.lvup)
} }

View File

@@ -75,7 +75,7 @@ export class Monster extends ecs.Entity {
hv.box_group = box_group; hv.box_group = box_group;
hv.hero_uuid= uuid; hv.hero_uuid= uuid;
hv.hero_name= hero.name; hv.hero_name= hero.name;
hv.speed =hv.ospeed = hero.speed; hv.speed =hv.speed_base = hero.speed;
hv.dis = hero.dis; hv.dis = hero.dis;
// 肉鸽模式使用固定数值,否则使用等级计算 // 肉鸽模式使用固定数值,否则使用等级计算
@@ -174,7 +174,7 @@ export class Monster extends ecs.Entity {
hv.ap=hv.ap*(100+buff.value)/100 hv.ap=hv.ap*(100+buff.value)/100
break break
case BuffAttr.FROST_RATIO: case BuffAttr.FROST_RATIO:
hv.frost_ratto+=buff.value hv.frost_ratio+=buff.value
break break
} }
} }

View File

@@ -1,6 +1,6 @@
import { _decorator, Component, Node, v3, Vec3 } from 'cc'; import { _decorator, Component, Node, v3, Vec3 } from 'cc';
import { HeroViewComp } from './HeroViewComp'; import { HeroViewComp } from './HeroViewComp';
import { DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet'; import { BuffAttr, DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet';
import { Skill } from '../skills/Skill'; import { Skill } from '../skills/Skill';
import { ecs } from 'db://oops-framework/libs/ecs/ECS'; import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { oops } from 'db://oops-framework/core/Oops'; import { oops } from 'db://oops-framework/core/Oops';
@@ -50,7 +50,7 @@ export class SkillConComp extends CCComp {
if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) { if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) {
for(let i=0;i<this.HeroView.skills.length;i++){ for(let i=0;i<this.HeroView.skills.length;i++){
this.HeroView.skills[i].cd += dt; this.HeroView.skills[i].cd += dt;
if(this.HeroView.skills[i].cd > (i==0?this.count_cd(this.HeroView.skills[i].cd_max,this.HeroView):this.HeroView.skills[i].cd_max)){ if(this.HeroView.skills[i].cd > (i==0?this.HeroView.Attrs[BuffAttr.ATK_CD]:this.HeroView.skills[i].cd_max)){
let sc=SkillSet[this.HeroView.skills[i].uuid] let sc=SkillSet[this.HeroView.skills[i].uuid]
if(!sc) return if(!sc) return
if(sc.SType==SType.damage&&!this.HeroView.is_atking) return if(sc.SType==SType.damage&&!this.HeroView.is_atking) return
@@ -90,21 +90,7 @@ export class SkillConComp extends CCComp {
} }
} }
count_cd(cd:number,view:HeroViewComp){
// 汇总DEBUFF_DECD不再按次数减少改为按时间减少
let decd = 0;
for (let i = view.DEBUFF_DECDS.length - 1; i >= 0; i--) {
decd += view.DEBUFF_DECDS[i].value;
// 不再在这里减少duration改为在update中按时间减少
}
let bcd=0
for (let i = view.BUFF_CDS.length - 1; i >= 0; i--) {
bcd += view.BUFF_CDS[i].value;
// 不再在这里减少duration改为在update中按时间减少
}
return cd/((bcd+decd)/100+1)
}
/** 施放技能 */ /** 施放技能 */
castSkill(config: typeof SkillSet[keyof typeof SkillSet]) { castSkill(config: typeof SkillSet[keyof typeof SkillSet]) {
// //console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid); // //console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
@@ -171,7 +157,7 @@ export class SkillConComp extends CCComp {
check_wfuny(){ check_wfuny(){
let random = Math.random()*100 let random = Math.random()*100
if(random < this.HeroView.wfuny){ if(random < this.HeroView.Attrs[BuffAttr.WFUNY]){
return true return true
} }
return false return false

View File

@@ -663,7 +663,7 @@ export class RogueConfig {
break; break;
case BuffAttr.FROST_RATIO: case BuffAttr.FROST_RATIO:
// 冰冻概率提升3倍效果 // 冰冻概率提升3倍效果
modifiedStats.frost_ratto = (modifiedStats.frost_ratto || 0) + enhancedValue; modifiedStats.frost_ratio = (modifiedStats.frost_ratio || 0) + enhancedValue;
break; break;
} }

View File

@@ -2,7 +2,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { BoxSet, FacSet } from "../common/config/BoxSet"; import { BoxSet, FacSet } from "../common/config/BoxSet";
import { HType } from "../common/config/heroSet"; import { HType } from "../common/config/heroSet";
import { SkillSet } from "../common/config/SkillSet"; import { BuffAttr, SkillSet } from "../common/config/SkillSet";
import { smc } from "../common/SingletonModuleComp"; import { smc } from "../common/SingletonModuleComp";
import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroViewComp } from "../hero/HeroViewComp";
import { SkillCom } from "./SkillCom"; import { SkillCom } from "./SkillCom";
@@ -86,79 +86,34 @@ export class Skill extends ecs.Entity {
return; return;
} }
// 获取计算后的属性数据
let ap_data = this.get_ap(caster,dmg,uuid)
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问 // 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
Object.assign(SComp, { Object.assign(SComp, {
// 核心标识 // 核心标识
s_uuid: uuid, s_uuid: uuid,
// 位置和施法者信息 // 位置和施法者信息
startPos: startPos, startPos: startPos,
targetPos: targetPos, targetPos: targetPos,
caster: caster, caster: caster,
group: caster.box_group, group: caster.box_group,
fac: caster.fac, fac: caster.fac,
// 技能数值
// 计算后的战斗数据 ap: caster.Attrs[BuffAttr.AP],
ap: ap_data.ap, caster_crit: caster.Attrs[BuffAttr.CRITICAL],
caster_crit: ap_data.crit, caster_crit_d: caster.Attrs[BuffAttr.CRITICAL_DMG],
caster_crit_d: ap_data.crit_d, puncture: caster.Attrs[BuffAttr.PUNCTURE],
puncture: ap_data.puncture, puncture_damage: caster.Attrs[BuffAttr.PUNCTURE_DMG],
puncture_damage: ap_data.puncture_damage, burn_count: caster.Attrs[BuffAttr.BURN_COUNT],
burn_count: ap_data.burn_count, burn_value: caster.Attrs[BuffAttr.BURN_VALUE],
burn_value: ap_data.burn_value, stun_time: caster.Attrs[BuffAttr.STUN_TIME],
stun_time: ap_data.stun_time, stun_ratio: caster.Attrs[BuffAttr.STUN_RATIO],
stun_ratto: ap_data.stun_ratto, frost_time: caster.Attrs[BuffAttr.FROST_TIME],
frost_time: ap_data.frost_time, frost_ratio: caster.Attrs[BuffAttr.FROST_RATIO],
frost_ratto: ap_data.frost_ratto, debuff_up: caster.Attrs[BuffAttr.DEBUFF_UP],
debuff_value: caster.Attrs[BuffAttr.DEBUFF_VALUE],
debuff_count: caster.Attrs[BuffAttr.DEBUFF_COUNT],
}); });
this.add(SComp); this.add(SComp);
} }
get_ap(view:HeroViewComp,dmg:number=0,uuid:number=0){
let ap=0
let crit=0
let crit_d=0
let buffap=1
let puncture=0
let puncture_damage=0
let burn_count=0
let burn_value=0
let stun_time=0
let stun_ratto=0
let frost_time=0
let frost_ratto=0
// 汇总DEBUFF_DECD并处理count值
let BUFF_ATK = 0
let DEBUFF_DEATK = 0
if(view.BUFF_ATKS.length>0){
for (let i = view.BUFF_ATKS.length - 1; i >= 0; i--) {
BUFF_ATK += view.BUFF_ATKS[i].value;
// 不再在这里减少duration改为在update中按时间减少
}
}
if(view.DEBUFF_DEATKS.length>0) {
for (let i = view.DEBUFF_DEATKS.length - 1; i >= 0; i--) {
DEBUFF_DEATK += view.DEBUFF_DEATKS[i].value;
// 不再在这里减少duration改为在update中按时间减少
}
}
let BUFF_AP=(100-DEBUFF_DEATK+BUFF_ATK+dmg)/100 //buff区 总加成
puncture =view.puncture
puncture_damage=view.puncture_damage
ap=view.ap*buffap*BUFF_AP*SkillSet[uuid].ap/100
crit=view.crit
crit_d=view.crit_d
burn_count=view.burn_count
burn_value=view.burn_value
stun_time=view.stun_time
stun_ratto=view.stun_ratto
frost_time=view.frost_time
frost_ratto=view.frost_ratto
return {ap,crit,crit_d,puncture,puncture_damage,burn_count,burn_value,stun_time,stun_ratto,frost_time,frost_ratto}
}
} }

View File

@@ -36,8 +36,8 @@ export class SkillCom extends CCComp {
burn_count:number=0; burn_count:number=0;
burn_value:number=0; burn_value:number=0;
stun_time:number=0; stun_time:number=0;
stun_ratto:number=0; stun_ratio:number=0;
frost_ratto:number=0; frost_ratio:number=0;
frost_time:number=0; frost_time:number=0;
run_time:number=0; run_time:number=0;
hited_time:number=0; hited_time:number=0;
@@ -46,7 +46,9 @@ export class SkillCom extends CCComp {
caster_crit_d:number=0; caster_crit_d:number=0;
puncture:number=0; puncture:number=0;
puncture_damage:number=0; puncture_damage:number=0;
debuff_up:number=0;
debuff_value:number=0;
debuff_count:number=0;
// 组件引用 // 组件引用
spine:sp.Skeleton=null; spine:sp.Skeleton=null;
anim:Animation=null; anim:Animation=null;
@@ -159,23 +161,10 @@ export class SkillCom extends CCComp {
onAnimationFinished(){ onAnimationFinished(){
// console.log("[SkillCom]:onAnimationFinished",this.s_uuid) // console.log("[SkillCom]:onAnimationFinished",this.s_uuid)
if (!this.skillConfig) return; if (!this.skillConfig) return;
if(this.skillConfig.EType==EType.timeEnd) return if(this.skillConfig.EType==EType.timeEnd) return
if(this.skillConfig.SType!=SType.damage){
this.to_do_buff()
}
this.is_destroy=true this.is_destroy=true
} }
to_do_buff(){
if (!this.skillConfig) return;
switch(this.skillConfig.SType){
case SType.shield:
this.caster.add_shield(this.skillConfig.buV)
break;
}
}
//单体伤害 //单体伤害
single_damage(target:HeroViewComp,is_range:boolean=false){ 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)
@@ -188,17 +177,17 @@ export class SkillCom extends CCComp {
} }
target.do_atked(ap,this.caster_crit,this.caster_crit_d, target.do_atked(ap,this.caster_crit,this.caster_crit_d,
this.burn_count,this.burn_value, this.burn_count,this.burn_value,
this.stun_time,this.stun_ratto, this.stun_time,this.stun_ratio,
this.frost_time,this.frost_ratto, this.frost_time,this.frost_ratio,
this.skillConfig.AtkedType this.skillConfig.AtkedType
) // ap 及暴击 属性已经在skill.ts 处理 ) // ap 及暴击 属性已经在skill.ts 处理
// console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position) // console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
if(this.skillConfig.debuff>0){ if(this.skillConfig.debuff>0){
let debuff=this.skillConfig let debuff=this.skillConfig
let dev=debuff.deV*(100+this.caster.DEBUFF_VALUE)/100 let dev=debuff.deV*(100+this.debuff_value)/100
let deR=debuff.deR+this.caster.DEBUFF_UP let deR=debuff.deR+this.debuff_up
dev=Math.round(dev*100)/100 dev=Math.round(dev*100)/100
let deC=debuff.deC+this.caster.DEBUFF_COUNT //dec只作为次数叠加 let deC=debuff.deC+this.debuff_count //dec只作为次数叠加
// //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC) // //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC)
target.add_debuff(debuff.debuff,dev,deC,deR) target.add_debuff(debuff.debuff,dev,deC,deR)
} }

View File

@@ -97,7 +97,7 @@ interface TalentConfig {
| 技能冷却 | SKILL_CD | +24% | +40% | 技能冷却缩减 | | 技能冷却 | SKILL_CD | +24% | +40% | 技能冷却缩减 |
| 冰冻概率 | FROST_RATIO | +6% | +10% | 冰冻效果概率 | | 冰冻概率 | FROST_RATIO | +6% | +10% | 冰冻效果概率 |
| 击退概率 | KNOCKBACK | +6% | +10% | 击退效果概率 | | 击退概率 | KNOCKBACK | +6% | +10% | 击退效果概率 |
| 击晕概率 | STUN_RATTO | +6% | +10% | 击晕效果概率 | | 击晕概率 | STUN_RATIO | +6% | +10% | 击晕效果概率 |
| 反伤 | REFLECT | +12% | +20% | 反伤比例 | | 反伤 | REFLECT | +12% | +20% | 反伤比例 |
| 吸血 | POWER_UP | +12% | +20% | 吸血比例 | | 吸血 | POWER_UP | +12% | +20% | 吸血比例 |