```
feat(gameplay): 更新狼人技能机制并优化战斗体验 - 重命名【嗜血狂暴】为【利爪撕裂】,调整技能描述和效果说明 - 新增技能动作加速配置,将2.4秒动画压缩至1.0秒提升出招速度 - 10级【不灭狼王】新增巨狼化体型放大1.25倍效果 - 统一技能伤害模式,移除6级扇形AOE改为纯粹单体撕裂 - 添加狼王爆发红光特效和体型缩放平滑过渡动画 - 荆野猎手攻击时长从0调整为1.2秒以改善战斗节奏 ```
This commit is contained in:
1 parent
2ff98e8923
commit
714cb7d825
19 files changed
+14872
-116
No files matched your search
@@ -4,13 +4,17 @@ using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 狂暴狼人技能:嗜血狂暴体系(吸血战坦 · 1/3/6/10 级完整阶梯)
|
||||
/// 1级【嗜血狂暴】:重抓撕咬造成 150% 伤害(立即回复该次伤害 50% 生命);激活 5 秒【嗜血状态】,普攻吸血 +30%,攻速 +25%
|
||||
/// 3级【血脉沸腾】:嗜血状态延长至 6.5 秒,期间普攻吸血提升至 45%,攻速 +35%,撕咬伤害提升至 190%
|
||||
/// 6级【残虐血性】:撕咬升级为前方扇形 AOE 撕裂;嗜血期间触发【背水一战】:自身血量每降低 10%,伤害减免 +3%,普攻吸血额外 +5%
|
||||
/// 10级【不灭狼王】:释放技能临时提升 35% 最大生命值上限及等额回血;技能期间只要击杀敌人,立即回复 20% 最大生命值并刷新嗜血时间!
|
||||
/// 1级【利爪撕裂】:原地撕咬重创造成 150% 物理伤害(立即回复该次伤害 50% 的生命);并激活持续 5 秒的【嗜血状态】,普攻吸血 +30% 且攻速 +25%
|
||||
/// 3级【血脉沸腾】:嗜血状态延长至 6.5 秒;期间普攻吸血提升至 45%,攻速提升至 35%,撕裂伤害提升至 190%!且单体撕裂附带流血撕口!
|
||||
/// 6级【背水一战】:保持纯粹单体撕裂;处于嗜血状态时触发【背水一战】:自身血量每降低 10%,受击伤害减免 +3%,普攻吸血额外 +5%(血越残越硬越能吸,真正的打不死战坦)!
|
||||
/// 10级【不灭狼王】:释放技能爆发狼王之怒,体型放大 1.25 倍(巨狼化)、临时提升 35% 最大生命值上限并获得等额生命回复!技能期间只要击杀敌人,立即瞬间回复 20% 最大生命值并刷新嗜血狂暴时间!
|
||||
/// </summary>
|
||||
public class WerewolfSkill : UnitSkill
|
||||
{
|
||||
[Header("动作加速配置")]
|
||||
[Tooltip("技能动画目标时长(秒)。原动画长达 2.4s,压缩至 1.0s 实现出招速度翻倍以上")]
|
||||
public float skillTargetDuration = 1.0f;
|
||||
|
||||
[Header("特效资源")]
|
||||
[Tooltip("重抓抓痕特效 (SwordSlashMiniRed)")]
|
||||
public GameObject clawSlashVfxPrefab;
|
||||
@@ -18,6 +22,9 @@ public class WerewolfSkill : UnitSkill
|
||||
[Tooltip("受击鲜血爆裂特效 (BloodExplosion)")]
|
||||
public GameObject bloodHitVfxPrefab;
|
||||
|
||||
[Tooltip("10级狼王爆发红光特效 (EnergyExplosionRed)")]
|
||||
public GameObject wolfKingRageVfxPrefab;
|
||||
|
||||
private bool isSkillPending = false;
|
||||
private bool isBloodthirstActive = false;
|
||||
private float bloodthirstTimer = 0f;
|
||||
@@ -30,6 +37,11 @@ public class WerewolfSkill : UnitSkill
|
||||
private float appliedAttackSpeedMultiplier = 1f;
|
||||
private float temporaryBonusMaxHealth = 0f;
|
||||
|
||||
// 10 级体型放大记录与协程
|
||||
private Vector3 originalModelScale = Vector3.one;
|
||||
private bool isScaleBoosted = false;
|
||||
private Coroutine scaleCoroutine;
|
||||
|
||||
private void EnsureUnit()
|
||||
{
|
||||
if (unit == null)
|
||||
@@ -42,11 +54,16 @@ public class WerewolfSkill : UnitSkill
|
||||
{
|
||||
base.Awake();
|
||||
EnsureUnit();
|
||||
if (unit != null)
|
||||
{
|
||||
originalModelScale = unit.transform.localScale;
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
EnsureUnit();
|
||||
WorldHealthBar.OnUnitKilled -= OnGlobalUnitKilled;
|
||||
WorldHealthBar.OnUnitKilled += OnGlobalUnitKilled;
|
||||
}
|
||||
|
||||
@@ -66,18 +83,45 @@ public class WerewolfSkill : UnitSkill
|
||||
unit.FaceCurrentTarget(0f);
|
||||
isSkillPending = true;
|
||||
|
||||
// 10级大招临时提升 35% 最大生命上限
|
||||
if (unit.level >= 10 && temporaryBonusMaxHealth <= 0f)
|
||||
// 10级大招:临时提升 35% 最大生命上限并回血 + 体型巨狼化放大 1.25 倍
|
||||
if (unit.level >= 10)
|
||||
{
|
||||
temporaryBonusMaxHealth = healthBar.maxHealth * 0.35f;
|
||||
healthBar.maxHealth += temporaryBonusMaxHealth;
|
||||
healthBar.Heal(temporaryBonusMaxHealth);
|
||||
Debug.Log($"<color=red>【不灭狼王】爆发!</color> 狼王之怒提升生命上限 +{temporaryBonusMaxHealth:F0} 并回血!");
|
||||
TriggerWolfKingAscension(healthBar);
|
||||
}
|
||||
|
||||
// 播放大招攻击动画(挠击动作)
|
||||
unit.PlaySkillAnimation(OnSkillAnimationFinished, 1.2f);
|
||||
Debug.Log($"<color=red>【狂暴狼人】释放大招【嗜血狂暴】</color>,等待挠击命中帧!");
|
||||
// 技能动作速度翻倍:将 2.4 秒的动画压缩到 1.0 秒播放,撕咬出招迅猛凌厉!
|
||||
unit.PlaySkillAnimation(OnSkillAnimationFinished, skillTargetDuration);
|
||||
Debug.Log($"<color=red>【狂暴狼人】释放大招【利爪撕裂】</color>,动作速度加速 1 倍(时长: {skillTargetDuration:F1}s)!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 10 级【不灭狼王】爆发:生命上限提升 35% 并回血,模型体型等比放大 1.25 倍
|
||||
/// </summary>
|
||||
private void TriggerWolfKingAscension(WorldHealthBar healthBar)
|
||||
{
|
||||
// 每次释放大招,如果尚未获得 35% 加成,则增加 35% 基础生命上限;若已有加成,则直接满额治疗回血!
|
||||
if (temporaryBonusMaxHealth <= 0f)
|
||||
{
|
||||
float bonus = healthBar.maxHealth * 0.35f;
|
||||
temporaryBonusMaxHealth = bonus;
|
||||
healthBar.maxHealth += bonus;
|
||||
healthBar.Heal(bonus);
|
||||
Debug.Log($"<color=red>【不灭狼王】狼王真身觉醒!</color> 最大生命上限 +{bonus:F0},当前上限变为: {healthBar.maxHealth:F0}!");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已在狼王状态下再次开大:直接享受 35% 巨额生命恢复
|
||||
healthBar.Heal(temporaryBonusMaxHealth);
|
||||
Debug.Log($"<color=red>【不灭狼王】续战愈合!</color> 回复 +{temporaryBonusMaxHealth:F0} 生命值!");
|
||||
}
|
||||
|
||||
// 播放红光爆裂特效
|
||||
PlayWolfKingVfx();
|
||||
|
||||
// 巨狼化体型放大 1.25 倍平滑过渡
|
||||
if (scaleCoroutine != null) StopCoroutine(scaleCoroutine);
|
||||
scaleCoroutine = StartCoroutine(SmoothScaleModel(originalModelScale * 1.25f, 0.25f));
|
||||
isScaleBoosted = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -97,7 +141,7 @@ public class WerewolfSkill : UnitSkill
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实际结算大招重抓撕咬伤害与启动嗜血狂暴
|
||||
/// 实际结算大招单体撕裂重创伤害与启动嗜血狂暴
|
||||
/// </summary>
|
||||
private void ExecuteBiteStrike()
|
||||
{
|
||||
@@ -112,19 +156,11 @@ public class WerewolfSkill : UnitSkill
|
||||
|
||||
int level = unit.level;
|
||||
|
||||
// 伤害倍率:1级 150%,3级+ 190%
|
||||
// 伤害倍率:1级 150%,3级+ 190% (始终保持纯粹单体撕裂,不分散伤害)
|
||||
float damageMultiplier = level >= 3 ? 1.90f : 1.50f;
|
||||
float damage = unit.attackPower * damageMultiplier;
|
||||
|
||||
// 6级升级为扇形前方 AOE 撕咬,否则为单体重抓
|
||||
if (level >= 6)
|
||||
{
|
||||
ExecuteCleaveBite(damage);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecuteSingleBite(damage);
|
||||
}
|
||||
ExecuteSingleBite(damage);
|
||||
|
||||
// 激活【嗜血状态】
|
||||
ActivateBloodthirst(level);
|
||||
@@ -158,60 +194,7 @@ public class WerewolfSkill : UnitSkill
|
||||
{
|
||||
float healAmount = dealtDamage * 0.5f;
|
||||
myBar.Heal(healAmount);
|
||||
Debug.Log($"<color=green>【嗜血狂暴】撕咬重创!</color> 造成 {dealtDamage:F1} 伤害,吸血回复 +{healAmount:F1} HP!");
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteCleaveBite(float damage)
|
||||
{
|
||||
float cleaveRadius = 2.4f;
|
||||
float cleaveAngle = 120f;
|
||||
Vector3 forward = unit.transform.forward;
|
||||
Vector3 myPos = unit.transform.position;
|
||||
|
||||
UnitTeam myTeam = unit.GetComponent<UnitTeam>();
|
||||
var allTeams = FindObjectsOfType<UnitTeam>();
|
||||
float totalDealt = 0f;
|
||||
|
||||
foreach (var t in allTeams)
|
||||
{
|
||||
if (t == null || !t.gameObject.activeInHierarchy || myTeam == null || !myTeam.IsEnemy(t.gameObject)) continue;
|
||||
|
||||
Vector3 toEnemy = t.transform.position - myPos;
|
||||
toEnemy.y = 0f;
|
||||
if (toEnemy.sqrMagnitude <= cleaveRadius * cleaveRadius)
|
||||
{
|
||||
float angle = Vector3.Angle(forward, toEnemy.normalized);
|
||||
if (angle <= cleaveAngle * 0.5f)
|
||||
{
|
||||
PlayClawAndBloodVfx(t.transform.position + Vector3.up * 0.8f);
|
||||
|
||||
var targetUnit = t.GetComponentInParent<UnitBase>();
|
||||
if (targetUnit != null)
|
||||
{
|
||||
targetUnit.ReceiveDamage(damage, unit.gameObject);
|
||||
totalDealt += damage;
|
||||
}
|
||||
else
|
||||
{
|
||||
var bar = t.GetComponentInParent<WorldHealthBar>();
|
||||
if (bar != null)
|
||||
{
|
||||
bar.TakeDamage(damage, unit.gameObject);
|
||||
totalDealt += damage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 6级扇形撕裂吸血:回复总伤害的 50%
|
||||
WorldHealthBar myBar = unit.GetComponent<WorldHealthBar>();
|
||||
if (myBar != null && totalDealt > 0f)
|
||||
{
|
||||
float healAmount = totalDealt * 0.5f;
|
||||
myBar.Heal(healAmount);
|
||||
Debug.Log($"<color=green>【残虐血性】扇形撕裂!</color> 命中敌群造成 {totalDealt:F1} 伤害,吸血狂吸 +{healAmount:F1} HP!");
|
||||
Debug.Log($"<color=green>【利爪撕裂】重创!</color> 造成 {dealtDamage:F1} 伤害,吸血回复 +{healAmount:F1} HP!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +298,14 @@ public class WerewolfSkill : UnitSkill
|
||||
}
|
||||
temporaryBonusMaxHealth = 0f;
|
||||
}
|
||||
|
||||
// 还原体型大小
|
||||
if (isScaleBoosted)
|
||||
{
|
||||
if (scaleCoroutine != null) StopCoroutine(scaleCoroutine);
|
||||
scaleCoroutine = StartCoroutine(SmoothScaleModel(originalModelScale, 0.3f));
|
||||
isScaleBoosted = false;
|
||||
}
|
||||
}
|
||||
|
||||
baseBonusLifesteal = 0f;
|
||||
@@ -322,7 +313,7 @@ public class WerewolfSkill : UnitSkill
|
||||
dynamicLossDamageReduction = 0f;
|
||||
appliedAttackSpeedMultiplier = 1f;
|
||||
|
||||
Debug.Log($"<color=gray>【嗜血状态结束】属性恢复正常。</color>");
|
||||
Debug.Log($"<color=gray>【嗜血状态结束】属性与体型恢复正常。</color>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -349,6 +340,26 @@ public class WerewolfSkill : UnitSkill
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator SmoothScaleModel(Vector3 targetScale, float duration)
|
||||
{
|
||||
if (unit == null) yield break;
|
||||
Vector3 from = unit.transform.localScale;
|
||||
float elapsed = 0f;
|
||||
|
||||
while (elapsed < duration)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
float t = Mathf.Clamp01(elapsed / duration);
|
||||
if (unit != null)
|
||||
{
|
||||
unit.transform.localScale = Vector3.Lerp(from, targetScale, Mathf.SmoothStep(0f, 1f, t));
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (unit != null) unit.transform.localScale = targetScale;
|
||||
}
|
||||
|
||||
private void PlayClawAndBloodVfx(Vector3 position)
|
||||
{
|
||||
// 1. 鲜血飞溅
|
||||
@@ -383,6 +394,24 @@ public class WerewolfSkill : UnitSkill
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayWolfKingVfx()
|
||||
{
|
||||
GameObject vfxPrefab = wolfKingRageVfxPrefab;
|
||||
#if UNITY_EDITOR
|
||||
if (vfxPrefab == null)
|
||||
{
|
||||
vfxPrefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>("Assets/TJGeneratorLibEffects/Prefabs/Combat/Explosions/EnergyExplosion/EnergyExplosionRed.prefab");
|
||||
}
|
||||
#endif
|
||||
if (vfxPrefab != null && unit != null)
|
||||
{
|
||||
Vector3 pos = unit.transform.position + Vector3.up * 0.8f;
|
||||
var vfx = Instantiate(vfxPrefab, pos, Quaternion.identity);
|
||||
vfx.transform.localScale = Vector3.one * 1.5f;
|
||||
Destroy(vfx, 2.0f);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSkillAnimationFinished()
|
||||
{
|
||||
if (isSkillPending)
|
||||
|
||||
Reference in new issue
Block a user