예제 #1
0
        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;
            }
        }
예제 #2
0
 protected static AidItemScriptResult ApplyScript(AidItemModel item, CharacterModel player, InventoryItemInstance itemInstance)
 {
     return(ScriptingModule.CallForResult <AidItemScriptResult>(item.Scripts.OnApply, new ScriptExecutionContext()
     {
         Caller = player
     }, item, itemInstance));
 }
예제 #3
0
 protected static float ApplyBase(AidItemModel item, CharacterModel player)
 {
     return(ApplyNode(item.AType, item.RType, item.Amount, player));
 }