public void CreateVector(float damage, float cost, float effect, float offering, GameObject spellEffect, GameObject target) { // We need to get the percentage increase from cost to offering (i.e. offering = 52 and cost = 50, so increase = 52/50 = 1.04 so damage and effect increase by 1.04). float increase = offering / cost; // Create the SpellVector to cast. spellVector = new FireVector( (damage * increase), cost, (effect * increase), spellEffect, target); }
/// <summary> /// Indexing is done with spell type as index key. /// </summary> /// <param name="st">A spell type</param> /// <returns> /// Corresponding value for spell type (or default value), /// NOT modified by the Modifier value! /// </returns> public double this[SpellType st] { get { return(SpellVector.ContainsKey(st) ? SpellVector[st] : NotPresentValue); } set { SpellVector[st] = value; } }