示例#1
0
	float CheckAbsorbAuras(Spell.Category category, Spell.School school, float rawValue) {
		// TODO: Perhaps shift this calculation to the Aura script
		float result = rawValue;

		List<AbsorbDamage> absAuras = buffs.OfType<AbsorbDamage>().ToList(); //TODO: Re-evaluate this, since buffs is now List<AuraStack>
		for (int i=0; i<absAuras.Count; i++) {
			// Check the categories and schools the Aura absorbs
			foreach (Spell.Category testCategory in absAuras[i].affectedCategories) {
				foreach (Spell.School testSchool in absAuras[i].affectedSchools) {
					// if they match the incoming damages types exactly, reduce the damage by the amount and vice versa
					if (testCategory == category && testSchool == school) {
						result = Mathf.Clamp(result, 0, result -= absAuras[i].GetAbsorbAmount());
						absAuras[i].DepleteOutput(rawValue);
						//Debug.Log (absAuras[i].GetName()+ " matches, returning: " + result);
						return result;
					}
				}
			}
		}
		Debug.Log ("No matches, returning: " + result);
		return result;
	}
示例#2
0
	// Functions to edit incoming/outgoing damage/healing dictionaries
	public void EditIncomingDamageMods(Spell.Category category, Spell.School school, float percent) {
		incomingDamageMods[(int)category, (int)school] += percent;
	}
示例#3
0
	public void EditOutgoingHealingMods(Spell.Category category, Spell.School school, float percent) {
		outgoingHealingMods[(int)category, (int)school] += percent;
	}
示例#4
0
	public float GetIncomingDamageMod(Spell.Category category, Spell.School school) {
		return incomingDamageMods[(int)category, (int)school];
	}