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.
56 lines
1.7 KiB
56 lines
1.7 KiB
using IVDataFormat;
|
|
using IVServerFormat;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Numerics;
|
|
|
|
[Serializable]
|
|
public class TrainDgData : GameModData
|
|
{
|
|
TrainDgProp Property => property as TrainDgProp;
|
|
TrainDgPlayProp PlayProperty => playProperty as TrainDgPlayProp;
|
|
|
|
public override string NameKey => "dungeon_title_Train";
|
|
public int OpenStage => (int)Property.openStage;
|
|
|
|
public IReadOnlyList<TrainDgProp.EnemyCreator> NormalEnemyCreators => Property.normalEnemyCreator;
|
|
public int WaveCount => (int)Property.waveCount;
|
|
|
|
public float LimitTime => Property.limitTime;
|
|
|
|
public TrainDgData(TrainDgProp property, TrainDgPlayProp playProperty)
|
|
: base(property, playProperty)
|
|
{
|
|
if(DataHandler.PlayAwaken.awaken + 1 != Level)
|
|
{
|
|
SetLevel((uint)DataHandler.PlayAwaken.awaken + 1);
|
|
}
|
|
}
|
|
|
|
public override void SetLevel(uint level)
|
|
{
|
|
level = Math.Min(level, MaxLevel);
|
|
|
|
PlayProperty.level = level;
|
|
|
|
DataHandler.PlayAwaken.awaken = (int)level - 1;
|
|
DataHandler.PlayAwaken.Save();
|
|
}
|
|
|
|
public void TryUnlockPlayerAwaken(Action<bool> onDone)
|
|
{
|
|
SvConnectManager.Instance.RequestSvPost<nCharAwakenReturn>(true, 0, UrlApi.GetUrl(UrlApi.AwakenUp), (arg0, arg1) => onDone(true), (arg0, arg1) => onDone(false), DataHandler.PlayAwaken, true);
|
|
}
|
|
|
|
public bool IsClear(uint level) => level < Level;
|
|
|
|
public BigInteger GetRecommendBattlePower(uint level)
|
|
{
|
|
BigInteger total = 0;
|
|
foreach (var creator in NormalEnemyCreators)
|
|
{
|
|
total += DataHandler.CalcBattlePower(creator.GetHp(level), creator.GetAtk(level));
|
|
}
|
|
return total;
|
|
}
|
|
}
|