using BigFloatNumerics; using System; using System.Numerics; using UnityEngine; [CreateAssetMenu(fileName = "ProtectTheMerchantDgProp", menuName = "ScriptableObject/GameMod/ProtectTheMerchantDgProp")] public class ProtectTheMerchantDgProp : GameModProperty { [Serializable] public struct GoodsCreator { public ItemProp itemProp; public float startCount; public float multiplierPerLevel; public float adderPerLevel; public BigInteger GetCount(uint level) { return Formula.Calculate(startCount, multiplierPerLevel, adderPerLevel, level); } } [Serializable] public struct MerchantCreator { public CharacterProperty property; public float hp; public BigFloat GetHp() => hp; } [Serializable] public struct EnemyCreator { [Serializable] struct StatProperty { public float baseV; public float multiplierPerLevel; public float adderPerLevel; } public CharacterProperty property; public uint countPerWave; [SerializeField] StatProperty hpStat; [SerializeField] float atkStat; public BigFloat GetHp(uint level) { return Formula.Calculate(hpStat.baseV, hpStat.multiplierPerLevel, hpStat.adderPerLevel, level); } public BigFloat GetAtk() => atkStat; } public static string CodeName => "ProtectTheMerchantDg"; public override string codeName => CodeName; public uint openStage = 1; public int waveCount = 1; public float waveIntervalTime = 1; public MerchantCreator merchantCreator; public EnemyCreator[] normalEnemyCreator; public float limitTime = 1; public GoodsCreator[] rewards; public override GameModData CreateData(GameModPlayProperty playProperty) { Debug.Assert(playProperty is ProtectTheMerchantDgPlayProp, "Invalid play property type."); return new ProtectTheMerchantDgData(this, playProperty as ProtectTheMerchantDgPlayProp); } }