You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
2.2 KiB
85 lines
2.2 KiB
using UnityEngine;
|
|
|
|
using static BattleMgr;
|
|
|
|
public class HuntEagleDg : GameMod
|
|
{
|
|
[SerializeField] Transform eagleHerdSpawnPos;
|
|
[SerializeField] Transform playerSpawnPos;
|
|
|
|
BattleMgr battleMgr => BattleMgr.Instance;
|
|
float modElapsedTime;
|
|
|
|
IVCharacter player;
|
|
Character eagleHerd;
|
|
|
|
public HuntEagleDgData Data { get; private set; }
|
|
public float ModRemainingTime => Mathf.Max(Data.LimitTime - modElapsedTime, 0f);
|
|
|
|
protected override void OnInitialize()
|
|
{
|
|
if (GameModDataGroup.Instance.TryGetModData(ModID, out HuntEagleDgData modData))
|
|
{
|
|
Data = modData;
|
|
}
|
|
|
|
Debug.Assert(Data != null, Logger.LogMessage(LogType.Assert, nameof(HuntEagleDgData), "Data is null"));
|
|
}
|
|
|
|
protected override void OnStartMod()
|
|
{
|
|
//Summon player
|
|
player = battleMgr.GetPlayer();
|
|
|
|
var buffMgr = BuffMgr.Instance;
|
|
player.ResetDebuff();
|
|
player.SetStatus(
|
|
buffMgr.GetCharAtk(),
|
|
buffMgr.GetCharHp(),
|
|
buffMgr.GetCharCrtDam(),
|
|
buffMgr.GetCharCrtRate(),
|
|
buffMgr.GetCharMov(),
|
|
buffMgr.GetCharSpd(),
|
|
GameProperty.Instance.PlayerCharacterAttackRange);
|
|
player.transform.position = playerSpawnPos.position;
|
|
|
|
player.Summon();
|
|
battleMgr.SetPetsSummonState(true);
|
|
battleMgr.SetGudiansSummonState(true);
|
|
|
|
battleMgr.ShowTalkBox(TalkType.Summon);
|
|
|
|
modElapsedTime = 0f;
|
|
|
|
//Set UI
|
|
GameUIMgr.OnOffStageInfo(false);
|
|
|
|
IVCameraController.SMoveCamera(player.transform.position);
|
|
}
|
|
|
|
protected override void OnUpdate()
|
|
{
|
|
if (BattleMgr.Instance.BattlePause) return;
|
|
|
|
modElapsedTime += Time.deltaTime;
|
|
|
|
if (modElapsedTime >= Data.LimitTime)
|
|
{
|
|
battleMgr.ShowTalkBox(TalkType.Die);
|
|
FireOnDone(Result.Timeout);
|
|
}
|
|
else
|
|
{
|
|
if (player.IsDead)
|
|
{
|
|
battleMgr.ShowTalkBox(TalkType.Die);
|
|
FireOnDone(Result.Dead);
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void OnEndMod()
|
|
{
|
|
GameUIMgr.OnOffStageInfo(true);
|
|
}
|
|
}
|