public static void Apply(AidItemModel item, CharacterModel player) { switch (item.AType) { case AidType.Health: { switch (item.RType) { case RestoreType.Add: player.Health = Math.Min(player.Health + item.Amount, player.DerivedStats.MaxHealth); break; case RestoreType.Boost: player.Health += item.Amount; break; case RestoreType.Override: player.Health = item.Amount; break; default: break; } } break; } }
protected static AidItemScriptResult ApplyScript(AidItemModel item, CharacterModel player, InventoryItemInstance itemInstance) { return(ScriptingModule.CallForResult <AidItemScriptResult>(item.Scripts.OnApply, new ScriptExecutionContext() { Caller = player }, item, itemInstance)); }
protected static float ApplyBase(AidItemModel item, CharacterModel player) { return(ApplyNode(item.AType, item.RType, item.Amount, player)); }