void UpdateCosts() { if (OnSettingsChanged != null) OnSettingsChanged(); // Get spell cost (int _, int spellPointCost) = FormulaHelper.CalculateEffectCosts(EffectEntry); spellCostLabel.Text = spellPointCost.ToString(); }
int GetEffectCastingCost(IEntityEffect effect, TargetTypes targetType, DaggerfallEntity casterEntity) { int goldCost, spellPointCost; FormulaHelper.CalculateEffectCosts(effect, effect.Settings, out goldCost, out spellPointCost, casterEntity); spellPointCost = FormulaHelper.ApplyTargetCostMultiplier(spellPointCost, targetType); //Debug.LogFormat("Calculated {0} spell point cost for effect {1}", spellPointCost, effect.Key); return(spellPointCost); }
void UpdateCosts() { if (OnSettingsChanged != null) { OnSettingsChanged(); } // Get spell cost int goldCost, spellPointCost; FormulaHelper.CalculateEffectCosts(EffectEntry, out goldCost, out spellPointCost); spellCostLabel.Text = spellPointCost.ToString(); }
public override void Start(EntityEffectManager manager, DaggerfallEntityBehaviour caster = null) { base.Start(manager, caster); // Refund spell point cost for this effect before opening trade window // Actual spell point cost is applied when player clicks Identify button in trade window // Any other effects bundled with identify on spell will not have their spell point cost refunded FormulaHelper.SpellCost cost = FormulaHelper.CalculateEffectCosts(this, settings, caster.Entity); caster.Entity.IncreaseMagicka(cost.spellPointCost); // Open identify trade window in spell mode UserInterfaceManager uiManager = DaggerfallUI.UIManager as UserInterfaceManager; DaggerfallTradeWindow tradeWindow = (DaggerfallTradeWindow)UIWindowFactory.GetInstanceWithArgs(UIWindowType.Trade, new object[] { uiManager, null, DaggerfallTradeWindow.WindowModes.Identify, null }); tradeWindow.UsingIdentifySpell = true; tradeWindow.IdentifySpellChance = ChanceValue(); tradeWindow.IdentifySpellCost = cost.spellPointCost; uiManager.PushWindow(tradeWindow); }