法杖,武器切换

This commit is contained in:
SoulliesOfficial
2025-12-24 16:58:51 -05:00
parent 2a2aa728d5
commit 3bcd7c1cf8
78 changed files with 230589 additions and 50400 deletions

View File

@@ -20,8 +20,6 @@ namespace Cielonos.MainGame.Inventory
public List<FuncAnimData> fullBodyFuncAnims = new List<FuncAnimData>();
[HideInInspector]
private List<string> registeredFunctionNames = new List<string>();
[FormerlySerializedAs("objectData")]
public ViewObjectData viewObjectData;
public VFXData vfxData;
public ComboData comboData;

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic;
using Cielonos.MainGame.Characters;
using SLSFramework.General;
using UnityEngine;
namespace Cielonos.MainGame.Inventory
@@ -9,7 +11,9 @@ namespace Cielonos.MainGame.Inventory
public override void OnEquipped()
{
base.OnEquipped();
RegisterFunctionsToAnimSc(SwingForward, SwingDown, LightAttack0, LightAttack1_0, LightAttack1_1, LightAttack2, LightAttack3, HeavyAttack);
RegisterFunctionsToAnimSc(SwingForward, SwingDown, LightAttack0, LightAttack1_0, LightAttack1_1,
LightAttack2, LightAttack3, HeavyAttack, ReleaseAura);
PlayTargetedAnimation("Equip");
}
public override void OnPrimaryPress()
@@ -25,7 +29,7 @@ namespace Cielonos.MainGame.Inventory
}
else
{
PlayTargetedAnimation("LightAttack" + comboSm.GetCurrentNodeName(), null, 5f);
PlayTargetedAnimation("LightAttack" + comboSm.GetCurrentNodeName());
}
}
}
@@ -57,6 +61,7 @@ namespace Cielonos.MainGame.Inventory
private void LightAttack2() => GenerateProjectile("NormalProjectile", currentTarget, 10f);
private void LightAttack3() => GenerateProjectile("HeavyProjectile", currentTarget, 10f);
private void HeavyAttack() => GenerateGroundArea("GroundArea");
private void ReleaseAura() => GenerateSquareExpandingAura("SquareExpandingAura");
}
public partial class FutureWand : MainWeaponBase
@@ -69,7 +74,6 @@ namespace Cielonos.MainGame.Inventory
private void SwingForward()
{
Swing("Swing", "Swing", Vector3.forward * 0.2f);
Debug.Log("SwingForward executed");
}
private void SwingDown() => Swing("Swing", "Swing", Vector3.down * 0.3f);
@@ -93,8 +97,8 @@ namespace Cielonos.MainGame.Inventory
.SetAttackSubmodule<Projectile>(attackUnit)
.SetTimeSubmodule<Projectile>(10f)
.SetHitSubmodule<Projectile>()
.SetTraceMoveModule<Projectile>(currentTarget, speed, 5f, 20f, 20f, direction)
.SetRaycastSubmodule<Projectile>()
.SetAdaptiveTraceMoveModule<Projectile>(currentTarget, speed, 5f, 20f, 20f, direction)
.SetRaycastSubmodule<Projectile>(default, 0.25f, 0.5f)
.SetForceSubmodule<Projectile>(5f);
audioContainer.PlaySoundFX(vfxName + "Release", projectile.gameObject, true);
@@ -113,7 +117,7 @@ namespace Cielonos.MainGame.Inventory
area.Initialize<NormalArea>(player, this, Fraction.Enemy)
.SetAttackSubmodule<NormalArea>(attackUnit)
.SetTimeSubmodule<NormalArea>(1f, 0.8f, 0.2f)
.SetTimeSubmodule<NormalArea>(1f, 0.2f, 0.8f)
.SetHitSubmodule<NormalArea>(0.1f, 5)
.SetForceSubmodule<NormalArea>(5f, false);
@@ -122,5 +126,44 @@ namespace Cielonos.MainGame.Inventory
area.hitSm.AddHitSound("NormalHit")
.AddHitEvent((enemy, hitPosition) => feedbackSc["Hit"].Play());
}
private void GenerateSquareExpandingAura(string vfxName)
{
vfxData.SpawnMuzzleVFX(vfxName, muzzle);
NormalArea area = vfxData.SpawnVFX(vfxName).GetComponentInChildren<NormalArea>();
AttackUnit attackUnit = attackData["LightAttack"].Clone();
attackUnit.hitVFX = vfxData.Get(vfxName).hitVFX;
area.Initialize<NormalArea>(player, this, Fraction.Enemy)
.SetAttackSubmodule<NormalArea>(attackUnit)
.SetTimeSubmodule<NormalArea>(4f, 0.2f, 2.8f)
.SetHitSubmodule<NormalArea>()
.SetTransformSubmodule<NormalArea>();
area.transformSm.ApplyScaleMove(Vector3.one, Vector3.one * 50, 1f, EaseType.OutQuart);
area.updateAction = () =>
{
if (area.timeSm.enablingTime > 3f)
{
return;
}
List<Projectile> toBeRemoved = new List<Projectile>();
foreach (Projectile projectile in BattleManager.AttackAreaSm.enemyAttackAreas.activeProjectiles)
{
if (area.areaCollider.IsPointInside(projectile.topParent.transform.position))
{
toBeRemoved.Add(projectile);
}
}
foreach (Projectile projectile in toBeRemoved)
{
projectile.Explode();
}
};
}
}
}

View File

@@ -8,6 +8,7 @@ namespace Cielonos.MainGame.Inventory
{
public partial class Polychrome : MainWeaponBase
{
public BlockData equipBlockData;
public float perfectBlockedTimer;
protected override void Update()
@@ -26,8 +27,11 @@ namespace Cielonos.MainGame.Inventory
LightAttack0, LightAttack1, LightAttack2, LightAttack3,
TripleAttack_0, TripleAttack_1, TripleAttack_2,
DisruptAttack, HeavyAttack, RunAttack, ParryAttack, StayBlocking);
SetBlock(equipBlockData);
}
public override void OnPrimaryPress()
{
if (player.inputSc.IsHoldingSpecialA && functionSm["TripleAttack"].IsAvailable() && fullBodyFuncAnimSm.CheckPlayability())
@@ -296,8 +300,9 @@ namespace Cielonos.MainGame.Inventory
string parryAnimName = "ParryL";
private void SetBlock()
private void SetBlock(BlockData blockData = null)
{
blockData ??= this.blockData;
BlockSource blockSource = blockData.CreateBlockSource(player, this);
blockSource.onNormalBlock = (attackArea) =>
{