FututeWand初步
This commit is contained in:
@@ -13,6 +13,9 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
|
||||
private NormalArea _activeSpinArea;
|
||||
|
||||
private VFXObject _spinAreaChargeVFX;
|
||||
private int _spinAreaUpgradeCount = 0;
|
||||
|
||||
private Transform Muzzle => viewObjects["Wand"].functionalParts["Muzzle"].transform;
|
||||
|
||||
public override void OnEquipped()
|
||||
@@ -45,32 +48,44 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
RecallActiveSpinArea();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轻攻击(普攻)输入处理
|
||||
/// </summary>
|
||||
public override void OnPrimaryPress()
|
||||
{
|
||||
// 判定是否满足特殊蓄力攻击条件
|
||||
if (!_isHoldingAttack && player.inputSc.IsHoldingSpecialA)
|
||||
{
|
||||
PlayTargetedAnimation("HoldAttackStart", currentTarget);
|
||||
_isHoldingAttack = true;
|
||||
if (PlayHoldAttackStart(currentTarget))
|
||||
{
|
||||
_isHoldingAttack = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 常规地面轻攻击连击
|
||||
if (functionSm["LightAttack"].IsAvailable() && fullBodyFuncAnimSm.CheckPlayability())
|
||||
{
|
||||
comboSm.main.NextCombo("L");
|
||||
functionSm["LightAttack"].Execute();
|
||||
currentTarget = CombatManager.EnemySm.GetNearestEnemy(25f);
|
||||
PlayTargetedAnimation("Attack" + comboSm.main.GetCurrentNodeName(), currentTarget, 5f);
|
||||
string nextNodeName = comboSm.main.GetNextNodeName("L");
|
||||
if (PlayNormalAttackL(currentTarget, nextNodeName))
|
||||
{
|
||||
comboSm.main.NextCombo("L");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轻攻击释放处理
|
||||
/// </summary>
|
||||
public override void OnPrimaryRelease()
|
||||
{
|
||||
if (_isHoldingAttack)
|
||||
{
|
||||
string animName = player.animationSc.fullBodyFuncAnimSm.currentRuntimeFuncAnim?.animationName;
|
||||
if(animName == "HoldAttackLoop" || animName == "HoldAttackStart")
|
||||
if (animName == "HoldAttackLoop" || animName == "HoldAttackStart")
|
||||
{
|
||||
PlayTargetedAnimation("HoldAttackEnd");
|
||||
PlayHoldAttackEnd();
|
||||
}
|
||||
RecallActiveSpinArea();
|
||||
}
|
||||
@@ -78,30 +93,31 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
_isHoldingAttack = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重攻击输入处理
|
||||
/// </summary>
|
||||
public override void OnSecondaryPress()
|
||||
{
|
||||
if (_isHoldingAttack) return;
|
||||
|
||||
// 常规地面重攻击连击
|
||||
if (functionSm["HeavyAttack"].IsAvailable() && fullBodyFuncAnimSm.CheckPlayability())
|
||||
{
|
||||
comboSm.main.NextCombo("R");
|
||||
functionSm["HeavyAttack"].Execute();
|
||||
currentTarget = CombatManager.EnemySm.GetNearestEnemy(25f);
|
||||
PlayTargetedAnimation("Attack" + comboSm.main.GetCurrentNodeName(), currentTarget, 5f);
|
||||
string nextNodeName = comboSm.main.GetNextNodeName("R");
|
||||
if (PlayNormalAttackR(currentTarget, nextNodeName))
|
||||
{
|
||||
comboSm.main.NextCombo("R");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class FutureWand
|
||||
{
|
||||
private void RecallActiveSpinArea()
|
||||
{
|
||||
if (_activeSpinArea?.moveSm is BoomerangMoveSubmodule boomerangSm)
|
||||
{
|
||||
boomerangSm.TriggerReturn(20, 10, float.MaxValue, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 玩家受击回调:中断当前的蓄力行为,并收回飞盘法阵
|
||||
/// </summary>
|
||||
private void OnPlayerGetHit(AttackAreaBase attackArea)
|
||||
{
|
||||
if (_isHoldingAttack)
|
||||
@@ -109,7 +125,7 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
string animName = player.animationSc.fullBodyFuncAnimSm.currentRuntimeFuncAnim?.animationName;
|
||||
if (animName == "HoldAttackLoop" || animName == "HoldAttackStart")
|
||||
{
|
||||
PlayTargetedAnimation("HoldAttackEnd");
|
||||
PlayHoldAttackEnd();
|
||||
}
|
||||
_isHoldingAttack = false;
|
||||
}
|
||||
|
||||
@@ -42,9 +42,39 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
GenerateGroundArea(p.str0, attackData[p.str1]);
|
||||
}
|
||||
|
||||
private void FAPF_GenerateSpinAreaCharge(RuntimeFuncAnim rtFuncAnim)
|
||||
{
|
||||
_spinAreaChargeVFX = vfxData.SpawnVFX("SpinAreaCharge", player).GetComponent<VFXObject>();
|
||||
ParticleSystem coreParticle = _spinAreaChargeVFX?.parts["Core"].GetComponent<ParticleSystem>();
|
||||
_spinAreaUpgradeCount = 0;
|
||||
if (coreParticle != null)
|
||||
{
|
||||
var main = coreParticle.main;
|
||||
main.startSize = 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
private void FAPF_GenerateWandMuzzle(RuntimeFuncAnim rtFuncAnim)
|
||||
{
|
||||
vfxData.SpawnMuzzleVFX("SpinAreaCharge", player, Muzzle);
|
||||
}
|
||||
|
||||
private void FAPF_UpgradeSpinArea(RuntimeFuncAnim rtFuncAnim)
|
||||
{
|
||||
ParticleSystem coreParticle = _spinAreaChargeVFX?.parts["Core"].GetComponent<ParticleSystem>();
|
||||
if (coreParticle != null)
|
||||
{
|
||||
var main = coreParticle.main;
|
||||
_spinAreaUpgradeCount++;
|
||||
_spinAreaUpgradeCount = Mathf.Clamp(_spinAreaUpgradeCount, 0, 2);
|
||||
main.startSize = 0.5f + _spinAreaUpgradeCount * 1f;
|
||||
}
|
||||
}
|
||||
|
||||
private void FAPF_GenerateSpinArea(RuntimeFuncAnim rtFuncAnim)
|
||||
{
|
||||
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
||||
_spinAreaChargeVFX?.StopAndDespawn();
|
||||
GenerateSpinArea(p.str0, attackData[p.str1]);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
area.hitSm.AddHitSound(AK.EVENTS.FUTUREWAND_MEDIUMATTACKHIT);
|
||||
|
||||
AudioManager.Post(AK.EVENTS.FUTUREWAND_ULTIMATEBEAMPOWERUP, area.gameObject);
|
||||
area.timeSm.AddScheduleAction(() =>
|
||||
area.AddScheduleAction(() =>
|
||||
{
|
||||
AudioManager.Post(AK.EVENTS.FUTUREWAND_ULTIMATEBEAMSHOOT);
|
||||
feedbackSc.PlayFeedback("UltimateBeamShoot");
|
||||
@@ -146,28 +146,28 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
|
||||
private void GenerateSpinArea(string vfxName, AttackUnit attackUnit)
|
||||
{
|
||||
AttackUnit upgradedAttackUnit = attackUnit.Clone();
|
||||
float damageMultiplier = 1f + _spinAreaUpgradeCount * 0.25f;
|
||||
upgradedAttackUnit.startDamage *= damageMultiplier;
|
||||
|
||||
vfxData.SpawnMuzzleVFX(vfxName, player, Muzzle);
|
||||
NormalArea area = vfxData.SpawnVFX(vfxName, player).GetComponentInChildren<NormalArea>();
|
||||
AudioManager.Post(AK.EVENTS.FUTUREWAND_GROUNDAREA, area.gameObject);
|
||||
|
||||
area.Initialize<NormalArea>(player, this, Fraction.Enemy)
|
||||
.SetAttackSubmodule<NormalArea>(attackUnit)
|
||||
.SetAttackSubmodule<NormalArea>(upgradedAttackUnit)
|
||||
.SetTimeSubmodule<NormalArea>(int.MaxValue, 0.5f, int.MaxValue, null, Shrink)
|
||||
.SetHitSubmodule<NormalArea>(0.5f, int.MaxValue)
|
||||
.SetHitSubmodule<NormalArea>(0.25f, int.MaxValue)
|
||||
.SetBoomerangMoveSubmodule<NormalArea>(currentTarget, 10f, 0f, 360f, 0f, player.transform.forward)
|
||||
.SetTransformSubmodule<NormalArea>();
|
||||
|
||||
area.SetBoomerangMoveSubmodule(currentTarget, 10f, 360f, player.transform.forward)
|
||||
.WithAutoReturn(float.MaxValue)
|
||||
.WithCatch(1.5f, Shrink)
|
||||
.WithTargeting(true, 25f)
|
||||
.WithKeepFlat(true);
|
||||
|
||||
(area.moveSm as BoomerangMoveSubmodule)!.WithAutoReturn(5f + _spinAreaUpgradeCount * 2.5f).WithCatch(1.5f, Shrink).WithTargeting(true, 25f).WithKeepFlat(true).WithReturnParameters(20f, 10f, float.MaxValue, 0f);
|
||||
area.transformSm.ApplyScaleMove(Vector3.zero, Vector3.one * 3, 0.5f, EaseType.OutQuad);
|
||||
|
||||
area.SetImpulseSubmodule().WithSuction(4f);
|
||||
area.hitSm.AddHitSound(AK.EVENTS.FUTUREWAND_WEAKATTACKHIT);
|
||||
|
||||
int fusionStack = attackUnit.GetSubmodule<AttackUnit.ParameterSubmodule>().GetParameter<int>("Buff_Fusion_Stack");
|
||||
int fusionStack = upgradedAttackUnit.GetSubmodule<AttackUnit.ParameterSubmodule>().GetParameter<int>("Buff_Fusion_Stack");
|
||||
area.hitSm.AddHitEvent((enemy, hitPosition) =>
|
||||
{
|
||||
new Fusion(fusionStack).Apply(enemy);
|
||||
@@ -176,44 +176,39 @@ namespace Cielonos.MainGame.Inventory.Collections
|
||||
|
||||
_activeSpinArea = area;
|
||||
|
||||
/*area.updateAction = () => // 消除敌方投射物
|
||||
{
|
||||
if (area.timeSm.enablingTimer > 3f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<Projectile> toBeRemoved = new List<Projectile>();
|
||||
|
||||
foreach (Projectile projectile in CombatManager.AttackAreaSm.enemyAttackAreas.activeProjectiles)
|
||||
{
|
||||
if (area.areaCollider.IsPointInside(projectile.topParent.transform.position))
|
||||
{
|
||||
toBeRemoved.Add(projectile);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Projectile projectile in toBeRemoved)
|
||||
{
|
||||
projectile.Explode();
|
||||
}
|
||||
};*/
|
||||
|
||||
|
||||
return;
|
||||
|
||||
void Shrink()
|
||||
{
|
||||
if (_activeSpinArea == area)
|
||||
{
|
||||
_activeSpinArea = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Trying to shrink a spin area that is not active.");
|
||||
}
|
||||
|
||||
area.transformSm.Reset().ApplyScaleMove(Vector3.one * 3, Vector3.zero, 0.5f, EaseType.OutQuad);
|
||||
area.timeSm.AddScheduleAction(() => LeanPool.Despawn(area.topParent.gameObject), 0.5f);
|
||||
if(_activeSpinArea == null) return;
|
||||
_activeSpinArea.transformSm.Reset().ApplyScaleMove(Vector3.one * 3, Vector3.zero, 0.5f, EaseType.OutQuad);
|
||||
_activeSpinArea.AddScheduleAction(() => LeanPool.Despawn(area.topParent.gameObject), 0.5f);
|
||||
_activeSpinArea = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*area.updateAction = () => // 消除敌方投射物
|
||||
{
|
||||
if (area.timeSm.enablingTimer > 3f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<Projectile> toBeRemoved = new List<Projectile>();
|
||||
|
||||
foreach (Projectile projectile in CombatManager.AttackAreaSm.enemyAttackAreas.activeProjectiles)
|
||||
{
|
||||
if (area.areaCollider.IsPointInside(projectile.topParent.transform.position))
|
||||
{
|
||||
toBeRemoved.Add(projectile);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Projectile projectile in toBeRemoved)
|
||||
{
|
||||
projectile.Explode();
|
||||
}
|
||||
};*/
|
||||
@@ -0,0 +1,71 @@
|
||||
using Cielonos.MainGame.Characters;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cielonos.MainGame.Inventory.Collections
|
||||
{
|
||||
public partial class FutureWand
|
||||
{
|
||||
/// <summary>
|
||||
/// 播放常规地面轻攻击连击
|
||||
/// </summary>
|
||||
/// <param name="target">攻击朝向的目标敌人</param>
|
||||
/// <param name="nextNodeName">连击树中的下一个节点名称</param>
|
||||
/// <returns>是否成功播放</returns>
|
||||
private bool PlayNormalAttackL(CharacterBase target, string nextNodeName)
|
||||
{
|
||||
bool played = PlayTargetedAnimation("Attack" + nextNodeName, target, 5f);
|
||||
if (played)
|
||||
{
|
||||
functionSm["LightAttack"].Execute();
|
||||
}
|
||||
return played;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放蓄力攻击起手动画
|
||||
/// </summary>
|
||||
/// <param name="target">朝向的敌方目标</param>
|
||||
/// <returns>是否成功播放</returns>
|
||||
private bool PlayHoldAttackStart(CharacterBase target)
|
||||
{
|
||||
return PlayTargetedAnimation("HoldAttackStart", target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放蓄力攻击收招动画
|
||||
/// </summary>
|
||||
/// <returns>是否成功播放</returns>
|
||||
private bool PlayHoldAttackEnd()
|
||||
{
|
||||
return PlayTargetedAnimation("HoldAttackEnd");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放常规地面重攻击连击
|
||||
/// </summary>
|
||||
/// <param name="target">攻击朝向的目标敌人</param>
|
||||
/// <param name="nextNodeName">连击树中的下一个节点名称</param>
|
||||
/// <returns>是否成功播放</returns>
|
||||
private bool PlayNormalAttackR(CharacterBase target, string nextNodeName)
|
||||
{
|
||||
bool played = PlayTargetedAnimation("Attack" + nextNodeName, target, 5f);
|
||||
if (played)
|
||||
{
|
||||
functionSm["HeavyAttack"].Execute();
|
||||
}
|
||||
return played;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 召回当前在战场中飞旋的法盘区域(SpinArea)
|
||||
/// </summary>
|
||||
private void RecallActiveSpinArea()
|
||||
{
|
||||
if (_activeSpinArea?.moveSm is BoomerangMoveSubmodule boomerangSm)
|
||||
{
|
||||
// 触发回力标的返回机制,将自动使用配置好的收回速度配置
|
||||
boomerangSm.TriggerReturn();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f21ea98ab9ac5d54f8f5866012e7651c
|
||||
Reference in New Issue
Block a user