Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard.Battle.Player.Emotion/EmotionBase.cs
gamer147 c9628dee01 cull(engine-cleanup): pass-8 phase-2 cascade round 1
[trim] fully-unreachable files deleted: 6
[trim] files edited: 55, files deleted: 0, nodes removed: 244
[type-trim] files edited: 1, types removed: 1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:18:18 -04:00

132 lines
3.9 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
using Wizard.Battle.Player.ClassCharacter;
using Wizard.Battle.View.Vfx;
namespace Wizard.Battle.Player.Emotion;
public abstract class EmotionBase : IEmotion
{
protected readonly string _emotionId;
protected readonly IClassCharacter _classCharacter;
public Vector3 LeaderPosition
{
get
{
if (_classCharacter.GameObject == null)
{
return Vector3.zero;
}
return _classCharacter.GameObject.transform.position;
}
}
public bool Enable { get; set; }
public event Func<ClassCharaPrm.EmotionType, VfxBase> OnPlay;
protected EmotionBase(string emotionId, IClassCharacter classCharacter)
{
Enable = true;
_emotionId = emotionId;
_classCharacter = classCharacter;
}
public VfxBase PlayEmotion(ClassCharaPrm.EmotionType emoteType, float hideTextTime)
{
if (!Enable)
{
return NullVfx.GetInstance();
}
// Pre-Phase-5b: emotion data headless-empty; branch dead
return NullVfx.GetInstance();
}
public virtual VfxBase PlayEmotion(ClassCharaPrm.MotionType motionType, ClassCharaPrm.FaceType faceType, string voiceId, string text)
{
return PlayEmotion(motionType, faceType, voiceId, text, 1.5f);
}
public bool IsSkinEvolved()
{
// Pre-Phase-5b: no mgr in scope; skin-evolved gate defaults to false
return false;
}
public virtual VfxBase PlayEmotion(ClassCharaPrm.MotionType motionType, ClassCharaPrm.FaceType faceType, string voiceId, string text, float hideTextTime, bool forcePlay = false)
{
if (!Enable)
{
return NullVfx.GetInstance();
}
if (IsSkinEvolved())
{
switch (motionType)
{
case ClassCharaPrm.MotionType.extra_2:
motionType = ClassCharaPrm.MotionType.z_extra_2;
break;
case ClassCharaPrm.MotionType.damage:
motionType = ClassCharaPrm.MotionType.z_damage;
break;
case ClassCharaPrm.MotionType.greet:
motionType = ClassCharaPrm.MotionType.z_greet;
break;
case ClassCharaPrm.MotionType.idle:
motionType = ClassCharaPrm.MotionType.z_idle;
break;
case ClassCharaPrm.MotionType.negative:
motionType = ClassCharaPrm.MotionType.z_negative;
break;
case ClassCharaPrm.MotionType.negative_2:
motionType = ClassCharaPrm.MotionType.z_negative_2;
break;
case ClassCharaPrm.MotionType.negative_2_a:
motionType = ClassCharaPrm.MotionType.z_negative_2_a;
break;
case ClassCharaPrm.MotionType.positive:
motionType = ClassCharaPrm.MotionType.z_positive;
break;
case ClassCharaPrm.MotionType.positive_2:
motionType = ClassCharaPrm.MotionType.z_positive_2;
break;
case ClassCharaPrm.MotionType.shock:
motionType = ClassCharaPrm.MotionType.z_shock;
break;
case ClassCharaPrm.MotionType.think:
motionType = ClassCharaPrm.MotionType.z_think;
break;
}
}
if (text == "NONE")
{
return SequentialVfxPlayer.Create(_classCharacter.CreateLoadVoiceResource(voiceId), InstantVfx.Create(delegate
{
_classCharacter.PlayMotion(motionType);
_classCharacter.ChangeFace(faceType);
}), _classCharacter.PlayVoice(voiceId, forcePlay), WaitVfx.Create(hideTextTime));
}
VfxBase vfxBase = NullVfx.GetInstance();
VfxBase vfxBase2 = NullVfx.GetInstance();
if (text != string.Empty)
{
vfxBase = _classCharacter.ShowVoiceMessage(text);
vfxBase2 = _classCharacter.HideVoiceMessage();
}
return SequentialVfxPlayer.Create(_classCharacter.CreateLoadVoiceResource(voiceId), InstantVfx.Create(delegate
{
_classCharacter.PlayMotion(motionType);
_classCharacter.ChangeFace(faceType);
}), _classCharacter.PlayVoice(voiceId, forcePlay), vfxBase, (hideTextTime > 0f) ? ((VfxBase)WaitVfx.Create(hideTextTime)) : ((VfxBase)new OpeningVfx.WaitVoiceEndVfx()), vfxBase2);
}
public virtual VfxBase ReceiveOpponentEmotion(ClassCharaPrm.EmotionType emotionType)
{
return NullVfx.GetInstance();
}
}