148 lines
5.5 KiB
C#
148 lines
5.5 KiB
C#
using System.Collections.Generic;
|
|
using Cielonos.MainGame.Characters;
|
|
using SLSUtilities.FunctionalAnimation;
|
|
using SLSUtilities.General;
|
|
using SLSUtilities.WwiseAssistance;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
|
{
|
|
public partial class FutureWand
|
|
{
|
|
private VFXObject _spinAreaChargeVFX;
|
|
private uint _chargePlayID;
|
|
|
|
private void FAPF_GenerateLightning(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
|
|
List<Enemy> targets = CombatManager.EnemySm.Query(25f).From(player.transform).Candidates();
|
|
|
|
if (targets.Count > 0)
|
|
{
|
|
foreach (Enemy target in targets)
|
|
{
|
|
GenerateLightning(p.str0, attackData[p.str1], target);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GenerateLightning(p.str0, attackData[p.str1], null, player.transform.position + player.transform.forward * 10f);
|
|
}
|
|
}
|
|
|
|
private void FAPF_GenerateTornado(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
GenerateTornado(p.str0, attackData[p.str1], PrimaryTarget, 25f);
|
|
}
|
|
|
|
private void FAPF_GenerateBoltOnWand(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
GenerateProjectile(p.str0, attackData[p.str1], PrimaryTarget);
|
|
}
|
|
|
|
private void FAPF_GenerateBoltOnHand(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
GenerateProjectile(p.str0, attackData[p.str1], PrimaryTarget, true, player.bodyPartsSc.leftHand);
|
|
}
|
|
|
|
private void FAPF_GenerateUltimateBeam(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
GenerateUltimateBeam(p.str0, attackData[p.str1]);
|
|
}
|
|
|
|
private void FAPF_GenerateGroundArea(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
GenerateGroundArea(p.str0, attackData[p.str1]);
|
|
}
|
|
|
|
private void FAPF_GenerateWandMuzzle(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
vfxData.SpawnMuzzleVFX("SpinAreaCharge", player, Muzzle);
|
|
}
|
|
|
|
private void FAPF_GenerateSpinAreaCharge(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
StopSpinAreaCharge(true);
|
|
_spinAreaChargeVFX = vfxData.SpawnVFX("SpinAreaCharge", player).GetComponent<VFXObject>();
|
|
ParticleSystem coreParticle = _spinAreaChargeVFX?.parts["Core"].GetComponent<ParticleSystem>();
|
|
if (coreParticle != null)
|
|
{
|
|
var main = coreParticle.main;
|
|
main.startSize = 0.5f;
|
|
_chargePlayID = AudioManager.Post(AK.EVENTS.FUTUREWAND_SPINAREACHARGE, coreParticle.gameObject);
|
|
}
|
|
}
|
|
|
|
private void FAPF_RemoveSpinAreaCharge(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
StopSpinAreaCharge();
|
|
}
|
|
|
|
private void StopSpinAreaCharge(bool resetUpgradeCount = false)
|
|
{
|
|
if (_spinAreaChargeVFX != null)
|
|
{
|
|
_spinAreaChargeVFX.StopAndDespawn();
|
|
_spinAreaChargeVFX = null;
|
|
}
|
|
|
|
if(_chargePlayID != AkUnitySoundEngine.AK_INVALID_PLAYING_ID)
|
|
{
|
|
AudioManager.Stop(_chargePlayID, 0.5f);
|
|
_chargePlayID = AkUnitySoundEngine.AK_INVALID_PLAYING_ID;
|
|
}
|
|
|
|
if (resetUpgradeCount)
|
|
{
|
|
_spinAreaUpgradeCount = 0;
|
|
}
|
|
}
|
|
|
|
private void FAPF_UpgradeSpinArea(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
ParticleSystem coreParticle = _spinAreaChargeVFX?.parts["Core"].GetComponent<ParticleSystem>();
|
|
if (coreParticle != null)
|
|
{
|
|
var main = coreParticle.main;
|
|
if (_spinAreaUpgradeCount < 2)
|
|
{
|
|
_spinAreaUpgradeCount++;
|
|
main.startSize = 0.5f + _spinAreaUpgradeCount * 1f;
|
|
AudioManager.Post(AK.EVENTS.FUTUREWAND_SPINAREAUPGRADE, coreParticle.gameObject);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void FAPF_GenerateSpinArea(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
StopSpinAreaCharge();
|
|
GenerateSpinArea(p.str0, attackData[p.str1]);
|
|
}
|
|
|
|
private void FAPF_GenerateMultipleBolts(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringStringInt p = rtFuncAnim.GetParams<CustomFunction.PC_StringStringInt>();
|
|
List<Enemy> targets = _hasCubicScatterIndexer ? GetCubicScatterIndexerTargets(p.int0) : GetCurrentTargets(p.int0);
|
|
vfxData.SpawnMuzzleVFX(p.str0, player, Muzzle);
|
|
if (targets.Count > 0)
|
|
{
|
|
foreach (Enemy target in targets)
|
|
{
|
|
GenerateProjectile(p.str0, attackData[p.str1], target, false);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GenerateProjectile(p.str0, attackData[p.str1], null, false);
|
|
}
|
|
}
|
|
}
|
|
}
|