using System;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using DarkTonic.MasterAudio;
using Pathfinding;
using PixelCrushers.DialogueSystem;
using UnityEngine;

// Token: 0x02000029 RID: 41
public class Effects : MonoBehaviour
{
	// Token: 0x0600069A RID: 1690 RVA: 0x000880E6 File Offset: 0x000862E6
	private void Start()
	{
	}

	// Token: 0x0600069B RID: 1691 RVA: 0x000880E8 File Offset: 0x000862E8
	public void IncreaseTimeToFull()
	{
		this.effectStartTime = (int)Links.x.gameplay.seconds;
	}

	// Token: 0x0600069C RID: 1692 RVA: 0x00088100 File Offset: 0x00086300
	public void UpdateEffectTime()
	{
		if (this.ready && !this.resetHeal)
		{
			if (this.waitingToReturnObject > 0)
			{
				this.waitingToReturnObject++;
				if (this.waitingToReturnObject >= 4)
				{
					this.DestroyAfterHealedParticle();
					return;
				}
			}
			if (this.overTimeCount > 0 && !Records.x.pocketPause)
			{
				int num = Mathf.RoundToInt(this.overallTime / (float)this.overTimeTotal);
				if ((int)Links.x.gameplay.seconds > num + this.effectStartTime)
				{
					this.Inflicted(false);
					this.effectStartTime = (int)Links.x.gameplay.seconds;
				}
			}
			if (this.overallTime > 0f && this.waitingToReturnObject == 0 && this.overTimeCount <= 0)
			{
				bool flag = false;
				if (!this.interactive)
				{
					flag = this.target.dead;
					if (!flag)
					{
						flag = this.target.stunned;
					}
					if (this.target.party)
					{
						flag = false;
					}
				}
				this.currentTime = Links.x.gameplay.seconds;
				int num2 = this.effectStartTime + this.timeToWait - (int)this.currentTime;
				if (num2 < 0)
				{
					num2 *= -1;
				}
				num2 = (int)Records.x.ShowSeconds(num2);
				if ((int)this.currentTime > this.timeToWait + this.effectStartTime || flag)
				{
					if (this.interactive)
					{
						this.Healed(false, true);
					}
					else
					{
						this.Healed(this.target.dead, true);
					}
				}
			}
			if (this.effect._WhileOnTile && this.tileEffect == null)
			{
				Character character = this.target;
				Debug.Log(((character != null) ? character.ToString() : null) + " healing because tile effect is gone");
				this.Healed(false, true);
			}
			if (this.effect._StunTime > 0f && ((float)((int)Links.x.gameplay.seconds) > this.effect._StunTime + (float)this.effectStartTime || this.target.dead))
			{
				this.removedStun = true;
				this.target.stats.AddStun(-1);
				if (this.target.stats.Stun() <= 0)
				{
					this.target.stats.SetStun(0);
					this.target.GetUp();
				}
			}
		}
	}

	// Token: 0x0600069D RID: 1693 RVA: 0x00088358 File Offset: 0x00086558
	public void UpdateEffectDurability(float amt)
	{
		if (this.maxDurability == 0f)
		{
			this.maxDurability = this.durability;
		}
		this.durability -= amt;
		if (this.effect._Name.Contains("Vine"))
		{
			MasterAudio.PlaySound3DAtVector3AndForget("Skills", this.target.tr.position, 0.8f, new float?(1f), 0f, this.effect._Sound, null);
		}
		if (this.effect._Name.Contains("Cocoon"))
		{
			MasterAudio.PlaySound3DAtVector3AndForget("Vine", this.target.tr.position, 0.8f, new float?(1f), 0f, "", null);
			for (int i = 0; i < this.pooledEffects.Count; i++)
			{
				if (this.pooledEffects[i])
				{
					this.pooledEffects[i].GetComponent<SetSpellMaterial>().Set(this.durability, this.maxDurability);
				}
			}
			if (this.tileEffect)
			{
				this.tileEffect.SetSpellMaterial(this.durability, this.maxDurability);
			}
		}
		if (this.durability <= 0f)
		{
			this.Healed(this.target.dead, true);
		}
	}

	// Token: 0x0600069E RID: 1694 RVA: 0x000884CC File Offset: 0x000866CC
	private void AddRecord()
	{
		if (this.recordEffects)
		{
			if (this.foundOne)
			{
				this.str.Append("<color ");
				this.str.Append(Links.x.characterSheet.hoverColor);
				this.str.Append(">");
				this.str.Append(", </color>");
			}
			this.foundOne = true;
		}
	}

	// Token: 0x0600069F RID: 1695 RVA: 0x00088540 File Offset: 0x00086740
	public string Set(bool healed)
	{
		if (this.source)
		{
			this.sourcePosition = this.source.tr.position;
		}
		if (!healed && this.effect._Name != "PukeSpores" && !this.effect._Script.Contains("AmplifyWound") && this.target)
		{
			float amplifyEffects = this.target.stats.GetAmplifyEffects();
			if (amplifyEffects > 0f && !this.effect._IsBuff)
			{
				this.sourceLevel += amplifyEffects;
				this.str.Clear();
				if (!this.target.npc)
				{
					this.str.Append(Links.x.gameFeed.GetPartyColorText(this.target));
				}
				this.str.Append(this.target.stats.GetName());
				if (!this.target.npc)
				{
					this.str.Append("</color>");
				}
				this.str.Append("'s ");
				this.str.Append(this.effect._DisplayName);
				this.str.Append(" amplified");
				Links.x.gameFeed.AddFeed(this.str.ToString());
			}
		}
		int num = 0;
		if (this.jewelrySlot > 0 || this.effect._IsIntercession)
		{
			num = 1;
		}
		this.str.Clear();
		if (!this.interactive && (this.target.party || !this.fromLoad))
		{
			this.recordEffects = true;
		}
		if (this.effect == null)
		{
			Debug.Log("Effect is null " + this.effectName);
		}
		this.foundOne = false;
		this.overallTime = this.effect._OverallTime;
		if (!healed && !this.resetHeal && (this.effect._FX > 0 || this.effect._Stun > 0 || this.effect._Confuse > 0 || this.effect._Flee > 0 || this.effect._MoveSpeed != 0f || this.effect._ActionTime != 0f) && this.target)
		{
			if (this.interactive)
			{
				GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(this.effect._FX);
				this.pooledEffects.Add(pooledGameObject);
				pooledGameObject.transform.position = this.targetInteractive.transform.position + new Vector3(0f, 1.3f + this.effect._FXOffset, 0f);
				pooledGameObject.SetActive(true);
			}
			else
			{
				if (this.effect._Stun > 0 && !this.effect._NoIcon)
				{
					this.target.AddEffect(40, "");
				}
				if (this.effect._Confuse > 0 && !this.effect._NoIcon)
				{
					this.target.AddEffect(44, "");
				}
				if (this.effect._Flee > 0 && !this.effect._NoIcon)
				{
					this.target.AddEffect(44, "");
				}
				if (this.effect._MoveSpeed != 0f && !this.effect._NoIcon)
				{
					if (this.effect._MoveSpeed > 0f)
					{
						this.target.AddEffect(46, "");
					}
					else
					{
						this.target.AddEffect(48, "");
					}
				}
				if (this.effect._FX > 0 && (!this.target.stats.HasEffect(this.effectName) || this.effect._FX == 92))
				{
					if (this.effect._FXType == "Head" && this.effect._FX != 92 && this.effect._FX != 98 && this.effect._FX != 44 && this.effect._FX != 113)
					{
						GameObject gameObject = this.target.AddEffect(this.effect._FX, "");
						if (gameObject)
						{
							this.pooledEffects.Add(gameObject);
						}
					}
					else if (this.effect._FXType == "Head" && (this.effect._FX == 92 || this.effect._FX == 98 || this.effect._FX == 44 || this.effect._FX == 113))
					{
						GameObject pooledGameObject2 = Links.x.cellar.GetPooledGameObject(this.effect._FX);
						if (pooledGameObject2)
						{
							this.pooledEffects.Add(pooledGameObject2);
							if (this.effect._FX == 98 || this.effect._FX == 44)
							{
								pooledGameObject2.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
							}
							pooledGameObject2.transform.position = this.target.body.GetNeck().position + new Vector3(0f, this.effect._FXOffset, 0f);
							pooledGameObject2.transform.localRotation = Quaternion.Euler(Vector3.zero);
							if (this.effect._FX == 98 || this.effect._FX == 44 || this.effect._FX == 113)
							{
								pooledGameObject2.transform.SetParent(this.target.body.GetNeck(), true);
							}
							if (this.effect._FX == 113)
							{
								this.target.body.GatherRenderers(false);
							}
							pooledGameObject2.SetActive(true);
						}
					}
					else if (this.effect._FXType == "Tile")
					{
						GameObject pooledGameObject3 = Links.x.cellar.GetPooledGameObject(this.effect._FX);
						if (pooledGameObject3)
						{
							this.pooledEffects.Add(pooledGameObject3);
							pooledGameObject3.transform.position = this.target.tr.position + new Vector3(0f, 1.3f + this.effect._FXOffset, 0f);
							pooledGameObject3.transform.parent = this.target.tr;
							pooledGameObject3.SetActive(true);
							this.effectAnimator = pooledGameObject3.GetComponent<HannahAnimator>();
						}
					}
					else if (this.effect._FXType == "InTile")
					{
						GameObject pooledGameObject4 = Links.x.cellar.GetPooledGameObject(this.effect._FX);
						if (pooledGameObject4)
						{
							this.pooledEffects.Add(pooledGameObject4);
							pooledGameObject4.transform.position = this.target.tr.position + new Vector3(0f, -0.25f + this.effect._FXOffset, 0f);
							if (this.effect._StuckInPlace == 0)
							{
								pooledGameObject4.transform.parent = this.target.tr;
							}
							pooledGameObject4.SetActive(true);
							this.effectAnimator = pooledGameObject4.GetComponent<HannahAnimator>();
						}
					}
					else
					{
						GameObject pooledGameObject5 = Links.x.cellar.GetPooledGameObject(this.effect._FX);
						if (pooledGameObject5)
						{
							this.pooledEffects.Add(pooledGameObject5);
							pooledGameObject5.transform.position = this.target.tr.position;
							pooledGameObject5.SetActive(true);
						}
					}
				}
				if (this.effectAnimator)
				{
					this.effectAnimator.Play("Start");
				}
			}
		}
		if (this.overTimeCount == this.overTimeTotal || !this.effect._OverTime || healed)
		{
			if (this.effect._Knockback > 0f)
			{
				if (!this.fromLoad && !healed && !this.interactive && !this.resetHeal && this.target.isHit && this.target.hitTime > 0f)
				{
					float num2 = (this.effect._Knockback + this.sourceLevel) * 8f;
					this.target.hitTime += num2;
					if (Records.x.editor)
					{
						Debug.Log("Knockback time increased by " + num2.ToString());
					}
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Knocked back");
				}
			}
			if (this.effect._TerrainReq != "")
			{
				this.terrainDependent = true;
			}
			if (this.effect._Stun > 0 && !this.interactive)
			{
				if (healed && !this.resetHeal)
				{
					if (!this.removedStun)
					{
						this.target.stats.AddStun(-1);
						if (this.target.stats.GetStatusCount(this, "Stun") <= 0 || this.target.stats.Stun() <= 0)
						{
							this.target.stats.SetStun(0);
							this.target.GetUp();
						}
					}
					if (this.effect._Name == "Stunned" && this.target.party)
					{
						this.target.EndStun();
					}
				}
				else
				{
					this.target.stats.AddStun(1);
					if (!this.target.downed)
					{
						float num3 = this.overallTime;
						if (this.effect._StunTime > 0f)
						{
							num3 = this.effect._StunTime;
						}
						if (this.target.stats.reduceStun > 0f)
						{
							num3 *= 1f - this.target.stats.reduceStun / 100f;
						}
						this.target.Fall((int)num3);
					}
				}
				if (this.recordEffects && this.effect._StunTime <= 0f)
				{
					this.AddRecord();
					this.str.Append("Stunned");
				}
				this.Icon("Stunned", healed, 1);
			}
			if (this.effect._AddActionTime != 0f)
			{
				if (this.recordEffects)
				{
					this.AddRecord();
					if (this.effect._AddActionTime > 0f)
					{
						this.str.Append("Stall Action Time");
					}
					else
					{
						this.str.Append("Bump Action Time");
					}
				}
				float num4 = this.effect._AddActionTime;
				float num5 = Records.x.GetPotencyAdd("AddActionTime", this.sourceLevel, num);
				if (this.effect._AddActionTime < 0f)
				{
					num5 *= -1f;
				}
				num4 += num5;
				string[] array = new string[7];
				int num6 = 0;
				Character character = this.target;
				array[num6] = ((character != null) ? character.ToString() : null);
				array[1] = " add action time ";
				array[2] = num4.ToString();
				array[3] = " ";
				array[4] = this.effect._AddActionTime.ToString();
				array[5] = " ";
				array[6] = num5.ToString();
				Debug.Log(string.Concat(array));
				if (this.effect._AddActionTime < 0f)
				{
					this.Icon("ActionTimeUp", healed, 1);
				}
				else
				{
					this.Icon("ActionTimeDown", healed, 1);
				}
				if (!healed)
				{
					this.target.UpdateAtkTime(num4);
				}
			}
			if (this.effect._Confuse > 0 && !this.interactive)
			{
				if (healed)
				{
					this.target.stats.AddConfuse(-1);
				}
				else
				{
					this.target.stats.AddConfuse(1);
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Confused");
				}
				if (this.target.stats.Confuse() > 0 && !healed)
				{
					if (this.target.actions)
					{
						this.target.actions.Interrupt();
					}
					GraphNode graphNode;
					if (this.source)
					{
						graphNode = this.source.node;
					}
					else
					{
						graphNode = this.target.node;
					}
					this.target.Flee(graphNode, false, Links.x.gameplay.seconds, this.effect._OverallTime);
				}
				int statusCount = this.target.stats.GetStatusCount(this, "Confuse");
				if (healed && (statusCount <= 0 || this.target.stats.Confuse() <= 0) && !this.resetHeal)
				{
					if (statusCount <= 0)
					{
						this.target.stats.confuse = 0;
					}
					this.target.EndFleeFromEffect();
				}
				this.Icon("Confused", healed, 1);
			}
			if (this.effect._StuckInPlace > 0 && !this.interactive)
			{
				if (healed)
				{
					this.target.stats.AddStuck(-1);
				}
				else
				{
					this.target.stats.AddStuck(1);
				}
				if (healed && (this.target.stats.GetStatusCount(this, "Stuck") <= 0 || this.target.stats.Stuck() <= 0))
				{
					this.target.stats.stuck = 0;
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Stuck");
				}
				this.Icon("Stuck", healed, 1);
			}
			if (this.effect._Script == "Float" && !this.interactive)
			{
				if (healed)
				{
					this.target.stats.AddFloating(-1);
				}
				else
				{
					this.target.stats.AddFloating(1);
				}
				if (this.target.stats.Floating() > 0)
				{
					this.target.body.bodyOffset = new Vector3(0f, 1.5f, 0f);
					this.target.body.SetGrounderState(false);
				}
				else if (this.target.stats.Floating() <= 0 && !this.resetHeal)
				{
					this.target.body.bodyOffset = new Vector3(0f, 0f, 0f);
					this.target.body.SetGrounderState(true);
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Floating a half-pole off the ground");
				}
				this.Icon("Float", healed, 1);
			}
			if (this.effect._Flee > 0 && !this.interactive)
			{
				if (healed)
				{
					this.target.stats.AddFlee(-1);
				}
				else
				{
					this.target.stats.AddFlee(1);
				}
				if (this.target.stats.GetStatusCount(this, "Flee") <= 0 && healed)
				{
					this.target.stats.flee = 0;
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Fleeing");
				}
				this.Icon("Fleeing", healed, 1);
			}
			if (this.effect._Invisible > 0f && !this.interactive)
			{
				if (healed)
				{
					this.target.stats.AddInvisible(-1);
				}
				else
				{
					this.target.stats.AddInvisible(1);
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Invisibility");
				}
			}
			if (this.effect._Charming > 0f && !this.interactive)
			{
				float num7 = Records.x.GetPotencyAdd("Charming", this.sourceLevel, num);
				if (this.effect._Charming < 0f)
				{
					num7 *= -1f;
				}
				float num8 = this.effect._Charming + num7;
				if (num8 > 0f)
				{
					this.Icon("CharmingUp", healed, 1);
				}
				else
				{
					this.Icon("CharmingDown", healed, 1);
				}
				if (healed)
				{
					num8 *= -1f;
				}
				this.target.stats.AddCharming((int)num8);
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num8 > 0f)
					{
						this.str.Append("Charming +");
					}
					else
					{
						this.str.Append("Charming ");
					}
					this.str.Append(num8);
				}
			}
			if (this.effect._NimbleFingers != 0f && !this.interactive)
			{
				float num9 = Records.x.GetPotencyAdd("NimbleFingers", this.sourceLevel, num);
				if (this.effect._NimbleFingers < 0f)
				{
					num9 *= -1f;
				}
				float num10 = this.effect._NimbleFingers + num9;
				if (num10 > 0f)
				{
					this.Icon("NimbleUp", healed, 1);
				}
				else
				{
					this.Icon("NimbleDown", healed, 1);
				}
				if (healed)
				{
					num10 *= -1f;
				}
				this.target.stats.AddNimbleFingers((int)num10);
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num10 > 0f)
					{
						this.str.Append("Nimble Fingers +");
					}
					else
					{
						this.str.Append("Nimble Fingers ");
					}
					this.str.Append(num10);
				}
			}
			if (this.effect._Silent != 0f && !this.interactive)
			{
				if (healed)
				{
					this.target.stats.AddSilent(-1);
				}
				else
				{
					this.target.stats.AddSilent(1);
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Silent");
				}
				this.Icon("Silent", healed, 1);
			}
			if (this.effect._Deaf != 0f && !this.interactive)
			{
				float num11 = Records.x.GetPotencyAdd("SightHearing", this.sourceLevel, num);
				if (this.effect._Deaf < 0f)
				{
					num11 *= -1f;
				}
				float num12 = this.effect._Deaf + num11;
				if (num12 > 0f)
				{
					this.Icon("Deaf", healed, 1);
				}
				else
				{
					this.Icon("Deaf", healed, 1);
				}
				if (healed)
				{
					num12 *= -1f;
				}
				this.target.stats.AddDeaf(num12);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Hearing");
				}
			}
			if (this.effect._Blind != 0f && !this.interactive)
			{
				float num13 = Records.x.GetPotencyAdd("SightHearing", this.sourceLevel, num);
				if (this.effect._Blind < 0f)
				{
					num13 *= -1f;
				}
				float num14 = this.effect._Blind + num13;
				if (num14 > 0f)
				{
					this.Icon("Blind", healed, 1);
				}
				else
				{
					this.Icon("Blind", healed, 1);
				}
				if (healed)
				{
					num14 *= -1f;
				}
				this.target.stats.AddBlind(num14);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Vision");
				}
			}
			if (this.effect._ReduceArmor != 0f && !this.interactive)
			{
				float num15 = Records.x.GetPotencyAdd("ReduceArmor", this.sourceLevel, num);
				if (this.effect._ReduceArmor < 0f)
				{
					num15 *= -1f;
				}
				float num16 = this.effect._ReduceArmor + num15;
				if (healed)
				{
					num16 *= -1f;
				}
				if (num == 0)
				{
					if (num16 > 0f)
					{
						num16 = Mathf.Ceil(num16);
					}
					else
					{
						num16 = Mathf.Floor(num16);
					}
				}
				else
				{
					num16 = Mathf.Round(num16);
				}
				this.target.UpdateArmor((int)num16);
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num16 > 0f)
					{
						this.str.Append("Armor Durability -");
					}
					else
					{
						this.str.Append("Armor Durability +");
					}
					this.str.Append(num16);
				}
			}
			if (this.effect._ReduceEqArmor != 0f && !this.interactive)
			{
				float num17 = Records.x.GetPotencyAdd("ReduceEqArmor", this.sourceLevel, num);
				if (this.effect._ReduceEqArmor < 0f)
				{
					num17 *= -1f;
				}
				float num18 = this.effect._ReduceEqArmor + num17;
				if (healed)
				{
					num18 *= -1f;
				}
				this.target.stats.AddEqArmorReduction(num18);
				if (!healed)
				{
					if (this.target.stamina && this.target.stamina.hasArmor)
					{
						if (num18 < 0f)
						{
							this.target.stamina.BuffArmor();
						}
						else
						{
							this.target.stamina.DebuffArmor();
						}
					}
				}
				else if (this.target.stamina && this.target.stamina.hasArmor)
				{
					if (num18 < 0f)
					{
						this.target.stamina.RemoveArmorBuff();
					}
					else
					{
						this.target.stamina.RemoveArmorDebuff();
					}
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num18 > 0f)
					{
						num18 *= -1f;
						this.str.Append("Soften Armor ");
					}
					else
					{
						this.str.Append("Harden Armor ");
					}
					this.str.Append(num18);
				}
			}
			if (this.effect._AddStamina != 0f && !this.interactive && !healed)
			{
				float num19 = Records.x.GetPotencyAdd("Stamina", this.sourceLevel, num);
				if (this.effect._AddStamina < 0f)
				{
					num19 *= -1f;
				}
				float num20 = this.effect._AddStamina + num19;
				if (healed)
				{
					num20 *= -1f;
				}
				if (!healed)
				{
					this.target.stats.AddStamina(num20);
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num20 < 0f)
					{
						this.str.Append("Stamina ");
					}
					else
					{
						this.str.Append("Stamina +");
					}
					this.str.Append(num20);
				}
			}
			if (this.effect._ReduceStun != 0f && !this.interactive)
			{
				float num21 = Records.x.GetPotencyAdd("ReduceStun", this.sourceLevel, num);
				if (this.effect._ReduceStun < 0f)
				{
					num21 *= -1f;
				}
				float num22 = this.effect._ReduceStun + num21;
				if (healed)
				{
					num22 *= -1f;
				}
				this.target.stats.AddReduceStun(num22);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append(Mathf.RoundToInt(num22));
					this.str.Append("% Stun Reduction");
				}
			}
			if (this.effect._ActionTime > 0f && !this.interactive)
			{
				float num23 = Records.x.GetPotencyAdd("ActionTime", this.sourceLevel, num);
				if (this.effect._ActionTime < 0f)
				{
					num23 *= -1f;
				}
				float num24 = this.effect._ActionTime + num23;
				if (num24 > 0f)
				{
					this.Icon("ActionTimeUp", healed, 1);
				}
				else
				{
					this.Icon("ActionTimeDown", healed, 1);
				}
				if (healed)
				{
					num24 *= -1f;
				}
				this.target.stats.AddActionTimeMod(num24 * -1f);
				if (this.target.mainSelected)
				{
					Links.x.hudControl.UpdateAttackTimeMods();
				}
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num24 > 0f)
					{
						this.str.Append("Action Speed -");
						this.str.Append(Mathf.Round(num24 * 10f) / 10f);
					}
					else
					{
						this.str.Append("Action Time +");
						this.str.Append(Mathf.Round(num24 * -1f * 10f) / 10f);
					}
				}
			}
			if (this.effect._MoveSpeed != 0f && !this.interactive)
			{
				float num25 = Records.x.GetPotencyAdd("MoveSpeed", this.sourceLevel, num);
				if (this.effect._MoveSpeed < 0f)
				{
					num25 *= -3f;
				}
				float num26 = this.effect._MoveSpeed + num25;
				if (num26 > 0f)
				{
					this.Icon("MoveSpeedUp", healed, 1);
				}
				else
				{
					this.Icon("MoveSpeedDown", healed, 1);
				}
				if (healed)
				{
					num26 *= -1f;
				}
				this.target.stats.AddMoveSpeedMod(num26);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Move Speed ");
					if (num26 > 0f)
					{
						this.str.Append("increased ");
					}
					else
					{
						this.str.Append("reduced ");
					}
					this.str.Append(Mathf.Round(Mathf.Abs(num26) * 10f));
					this.str.Append("%");
				}
			}
			if (this.effect._StrFlat != 0f && !this.interactive)
			{
				float num27 = Records.x.GetPotencyAdd("Stats", this.sourceLevel, num);
				if (this.effect._StrFlat < 0f)
				{
					num27 *= -1f;
				}
				float num28 = this.effect._StrFlat + num27;
				if (num == 0)
				{
					if (num28 > 0f)
					{
						num28 = Mathf.Ceil(num28);
					}
					else
					{
						num28 = Mathf.Floor(num28);
					}
				}
				else
				{
					num28 = Mathf.Round(num28);
				}
				int arrowsForStat = this.GetArrowsForStat("Strength", num28);
				if (num28 > 0f)
				{
					this.Icon("StrUp", healed, arrowsForStat);
				}
				else
				{
					this.Icon("StrDown", healed, arrowsForStat);
				}
				if (healed)
				{
					num28 *= -1f;
				}
				this.target.stats.AddStrengthMod(num28);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Strength ");
					if (num28 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num28);
				}
			}
			if (this.effect._StrDC != 0f && !this.interactive)
			{
				float potencyAdd = Records.x.GetPotencyAdd("StatsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(0, (int)this.effect._StrDC, (int)this.effect._StrDS + (int)potencyAdd, healed);
				int arrowsForStat2 = this.GetArrowsForStat("Strength", (float)this.GetDiceModifierAverage((int)this.effect._StrDC, (int)this.effect._StrDS + (int)potencyAdd));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Strength dice ");
					if (this.effect._StrDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._StrDC);
					this.str.Append("d");
					this.str.Append(this.effect._StrDS);
				}
				if (this.effect._StrDC > 0f)
				{
					this.Icon("StrUp", healed, arrowsForStat2);
				}
				else
				{
					this.Icon("StrDown", healed, arrowsForStat2);
				}
			}
			if (this.effect._DexFlat != 0f && !this.interactive)
			{
				float num29 = Records.x.GetPotencyAdd("Stats", this.sourceLevel, num);
				if (this.effect._DexFlat < 0f)
				{
					num29 *= -1f;
				}
				float num30 = this.effect._DexFlat + num29;
				if (num == 0)
				{
					if (num30 > 0f)
					{
						num30 = Mathf.Ceil(num30);
					}
					else
					{
						num30 = Mathf.Floor(num30);
					}
				}
				else
				{
					num30 = Mathf.Round(num30);
				}
				int arrowsForStat3 = this.GetArrowsForStat("Dexterity", num30);
				if (num30 > 0f)
				{
					this.Icon("DexUp", healed, arrowsForStat3);
				}
				else
				{
					this.Icon("DexDown", healed, arrowsForStat3);
				}
				if (healed)
				{
					num30 *= -1f;
				}
				this.target.stats.AddDexterityMod(num30);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Dexterity ");
					if (num30 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num30);
				}
			}
			if (this.effect._DexDC != 0f && !this.interactive)
			{
				float potencyAdd2 = Records.x.GetPotencyAdd("StatsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(4, (int)this.effect._DexDC, (int)this.effect._DexDS + (int)potencyAdd2, healed);
				int arrowsForStat4 = this.GetArrowsForStat("Dexterity", (float)this.GetDiceModifierAverage((int)this.effect._DexDC, (int)this.effect._DexDS + (int)potencyAdd2));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Dexterity dice ");
					if (this.effect._DexDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._DexDC);
					this.str.Append("d");
					this.str.Append(this.effect._DexDS);
				}
				if (this.effect._DexDC > 0f)
				{
					this.Icon("DexUp", healed, arrowsForStat4);
				}
				else
				{
					this.Icon("DexDown", healed, arrowsForStat4);
				}
			}
			if (this.effect._AglFlat != 0f && !this.interactive)
			{
				float num31 = Records.x.GetPotencyAdd("Stats", this.sourceLevel, num);
				if (this.effect._AglFlat < 0f)
				{
					num31 *= -1f;
				}
				float num32 = this.effect._AglFlat + num31;
				if (num == 0)
				{
					if (num32 > 0f)
					{
						num32 = Mathf.Ceil(num32);
					}
					else
					{
						num32 = Mathf.Floor(num32);
					}
				}
				else
				{
					num32 = Mathf.Round(num32);
				}
				int arrowsForStat5 = this.GetArrowsForStat("Agility", num32);
				if (num32 > 0f)
				{
					this.Icon("AglUp", healed, arrowsForStat5);
				}
				else
				{
					this.Icon("AglDown", healed, arrowsForStat5);
				}
				if (healed)
				{
					num32 *= -1f;
				}
				this.target.stats.AddAgilityMod(num32);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Agility ");
					if (num32 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num32);
				}
			}
			if (this.effect._AglDC != 0f && !this.interactive)
			{
				float potencyAdd3 = Records.x.GetPotencyAdd("StatsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(1, (int)this.effect._AglDC, (int)this.effect._AglDS + (int)potencyAdd3, healed);
				int arrowsForStat6 = this.GetArrowsForStat("Agility", (float)this.GetDiceModifierAverage((int)this.effect._AglDC, (int)this.effect._AglDS + (int)potencyAdd3));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Strength dice ");
					if (this.effect._AglDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._AglDC);
					this.str.Append("d");
					this.str.Append(this.effect._AglDS);
				}
				if (this.effect._AglDC > 0f)
				{
					this.Icon("AglUp", healed, arrowsForStat6);
				}
				else
				{
					this.Icon("AglDown", healed, arrowsForStat6);
				}
			}
			if (this.effect._AurFlat != 0f && !this.interactive)
			{
				float num33 = Records.x.GetPotencyAdd("Stats", this.sourceLevel, num);
				if (this.effect._AurFlat < 0f)
				{
					num33 *= -1f;
				}
				float num34 = this.effect._AurFlat + num33;
				if (num == 0)
				{
					if (num34 > 0f)
					{
						num34 = Mathf.Ceil(num34);
					}
					else
					{
						num34 = Mathf.Floor(num34);
					}
				}
				else
				{
					num34 = Mathf.Round(num34);
				}
				int arrowsForStat7 = this.GetArrowsForStat("Aura", num34);
				if (num34 > 0f)
				{
					this.Icon("AurUp", healed, arrowsForStat7);
				}
				else
				{
					this.Icon("AurDown", healed, arrowsForStat7);
				}
				if (healed)
				{
					num34 *= -1f;
				}
				this.target.stats.AddAuraMod(num34);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Aura ");
					if (num34 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num34);
				}
			}
			if (this.effect._AurDC != 0f && !this.interactive)
			{
				float potencyAdd4 = Records.x.GetPotencyAdd("StatsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(2, (int)this.effect._AurDC, (int)this.effect._AurDS + (int)potencyAdd4, healed);
				int arrowsForStat8 = this.GetArrowsForStat("Aura", (float)this.GetDiceModifierAverage((int)this.effect._AurDC, (int)this.effect._AurDS + (int)potencyAdd4));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Aura dice ");
					if (this.effect._AurDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._AurDC);
					this.str.Append("d");
					this.str.Append(this.effect._AurDS);
				}
				if (this.effect._AurDC > 0f)
				{
					this.Icon("AurUp", healed, arrowsForStat8);
				}
				else
				{
					this.Icon("AurDown", healed, arrowsForStat8);
				}
			}
			if (this.effect._PagFlat != 0f && !this.interactive && !this.target.stats.semizenMagic)
			{
				float num35 = Records.x.GetPotencyAdd("Stats", this.sourceLevel, num);
				if (this.effect._PagFlat < 0f)
				{
					num35 *= -1f;
				}
				float num36 = this.effect._PagFlat + num35;
				if (num == 0)
				{
					if (num36 > 0f)
					{
						num36 = Mathf.Ceil(num36);
					}
					else
					{
						num36 = Mathf.Floor(num36);
					}
				}
				else
				{
					num36 = Mathf.Round(num36);
				}
				int arrowsForStat9 = this.GetArrowsForStat("Pagan", num36);
				if (num36 > 0f)
				{
					this.Icon("PagUp", healed, arrowsForStat9);
				}
				else
				{
					this.Icon("PagDown", healed, arrowsForStat9);
				}
				if (healed)
				{
					num36 *= -1f;
				}
				this.target.stats.AddPaganMod(num36);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Pagan ");
					if (num36 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num36);
				}
			}
			if (this.effect._PagDC != 0f && !this.interactive)
			{
				float potencyAdd5 = Records.x.GetPotencyAdd("StatsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(3, (int)this.effect._PagDC, (int)this.effect._PagDS + (int)potencyAdd5, healed);
				int arrowsForStat10 = this.GetArrowsForStat("Pagan", (float)this.GetDiceModifierAverage((int)this.effect._PagDC, (int)this.effect._PagDS + (int)potencyAdd5));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Pagan dice ");
					if (this.effect._PagDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._PagDC);
					this.str.Append("d");
					this.str.Append(this.effect._PagDS);
				}
				if (this.effect._PagDC > 0f)
				{
					this.Icon("PagUp", healed, arrowsForStat10);
				}
				else
				{
					this.Icon("PagDown", healed, arrowsForStat10);
				}
			}
			if (this.effect._SenFlat != 0f && !this.interactive)
			{
				float num37 = Records.x.GetPotencyAdd("Stats", this.sourceLevel, num);
				if (this.effect._SenFlat < 0f)
				{
					num37 *= -1f;
				}
				float num38 = this.effect._SenFlat + num37;
				if (num == 0)
				{
					if (num38 > 0f)
					{
						num38 = Mathf.Ceil(num38);
					}
					else
					{
						num38 = Mathf.Floor(num38);
					}
				}
				else
				{
					num38 = Mathf.Round(num38);
				}
				int arrowsForStat11 = this.GetArrowsForStat("Sensory", num38);
				if (num38 > 0f)
				{
					this.Icon("SenUp", healed, arrowsForStat11);
				}
				else
				{
					this.Icon("SenDown", healed, arrowsForStat11);
				}
				if (healed)
				{
					num38 *= -1f;
				}
				this.target.stats.AddSensoryMod(num38);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Sensory ");
					if (num38 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num38);
				}
			}
			if (this.effect._SenDC != 0f && !this.interactive)
			{
				float potencyAdd6 = Records.x.GetPotencyAdd("StatsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(5, (int)this.effect._SenDC, (int)this.effect._SenDS + (int)potencyAdd6, healed);
				int arrowsForStat12 = this.GetArrowsForStat("Sensory", (float)this.GetDiceModifierAverage((int)this.effect._SenDC, (int)this.effect._SenDS + (int)potencyAdd6));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Strength dice ");
					if (this.effect._SenDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._SenDC);
					this.str.Append("d");
					this.str.Append(this.effect._SenDS);
				}
				if (this.effect._SenDC > 0f)
				{
					this.Icon("SenUp", healed, arrowsForStat12);
				}
				else
				{
					this.Icon("SenDown", healed, arrowsForStat12);
				}
			}
			if (this.effect._DmgFlat != 0f && !this.interactive)
			{
				float num39 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._DmgFlat < 0f)
				{
					num39 *= -1f;
				}
				float num40 = this.effect._DmgFlat + num39;
				if (num == 0)
				{
					if (num40 > 0f)
					{
						num40 = Mathf.Ceil(num40);
					}
					else
					{
						num40 = Mathf.Floor(num40);
					}
				}
				else
				{
					num40 = Mathf.Round(num40);
				}
				int arrowsForMod = this.GetArrowsForMod("Severity", num40);
				if (num40 > 0f)
				{
					this.Icon("SeverityUp", healed, arrowsForMod);
				}
				else
				{
					this.Icon("SeverityDown", healed, arrowsForMod);
				}
				if (healed)
				{
					num40 *= -1f;
				}
				this.target.stats.AddDmgMod(num40);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Damage ");
					if (num40 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(Mathf.Round(num40));
				}
			}
			if (this.effect._DmgDC != 0f && !this.interactive)
			{
				float potencyAdd7 = Records.x.GetPotencyAdd("ModsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(6, (int)this.effect._DmgDC, (int)this.effect._DmgDS + (int)potencyAdd7, healed);
				int arrowsForMod2 = this.GetArrowsForMod("Severity", (float)this.GetDiceModifierAverage((int)this.effect._DmgDC, (int)this.effect._DmgDS + (int)potencyAdd7));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Damage dice ");
					if (this.effect._DmgDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._DmgDC);
					this.str.Append("d");
					this.str.Append(this.effect._DmgDS);
				}
				if (this.effect._DmgDC > 0f)
				{
					this.Icon("SeverityUp", healed, arrowsForMod2);
				}
				else
				{
					this.Icon("SeverityDown", healed, arrowsForMod2);
				}
			}
			if (this.effect._MPotencyFlat != 0f && !this.interactive)
			{
				float num41 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._MPotencyFlat < 0f)
				{
					num41 *= -1f;
				}
				float num42 = this.effect._MPotencyFlat + num41;
				if (num == 0)
				{
					if (num42 > 0f)
					{
						num42 = Mathf.Ceil(num42);
					}
					else
					{
						num42 = Mathf.Floor(num42);
					}
				}
				else
				{
					num42 = Mathf.Round(num42);
				}
				int arrowsForMod3 = this.GetArrowsForMod("PaganSeverity", num42);
				if (num42 > 0f)
				{
					this.Icon("PaganSeverityUp", healed, arrowsForMod3);
				}
				else
				{
					this.Icon("PaganSeverityDown", healed, arrowsForMod3);
				}
				if (healed)
				{
					num42 *= -1f;
				}
				this.target.stats.AddPaganDmgMod(num42);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Pagan Potency ");
					if (num42 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num42);
				}
			}
			if (this.effect._MPotencyDC != 0f && !this.interactive)
			{
				float potencyAdd8 = Records.x.GetPotencyAdd("ModsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(7, (int)this.effect._MPotencyDC, (int)this.effect._MPotencyDS + (int)potencyAdd8, healed);
				int arrowsForMod4 = this.GetArrowsForMod("PaganSeverity", (float)this.GetDiceModifierAverage((int)this.effect._MPotencyDC, (int)this.effect._MPotencyDS + (int)potencyAdd8));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Pagan Potency dice ");
					if (this.effect._MPotencyDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._MPotencyDC);
					this.str.Append("d");
					this.str.Append(this.effect._MPotencyDS);
				}
				if (this.effect._MPotencyDC > 0f)
				{
					this.Icon("PaganSeverityUp", healed, arrowsForMod4);
				}
				else
				{
					this.Icon("PaganSeverityDown", healed, arrowsForMod4);
				}
			}
			if (this.effect._HitFlat != 0f && !this.interactive)
			{
				float num43 = Records.x.GetPotencyAdd("HitChance", this.sourceLevel, num);
				if (this.effect._HitFlat < 0f)
				{
					num43 *= -1f;
				}
				float num44 = this.effect._HitFlat + num43;
				num44 = Mathf.Round(num44 * 10f) * 0.1f;
				int arrowsForMod5 = this.GetArrowsForMod("HitChance", num44);
				if (num44 > 0f)
				{
					this.Icon("HitChanceUp", healed, arrowsForMod5);
				}
				else
				{
					this.Icon("HitChanceDown", healed, arrowsForMod5);
				}
				if (healed)
				{
					num44 *= -1f;
				}
				this.target.stats.AddHitMod(num44);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Hit Chance ");
					if (num44 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(Mathf.Round(num44));
				}
			}
			if (this.effect._HitDC != 0f && !this.interactive)
			{
				float potencyAdd9 = Records.x.GetPotencyAdd("ModsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(8, (int)this.effect._HitDC, (int)this.effect._HitDS + (int)potencyAdd9, healed);
				int arrowsForMod6 = this.GetArrowsForMod("HitChance", (float)this.GetDiceModifierAverage((int)this.effect._HitDC, (int)this.effect._HitDS + (int)potencyAdd9));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Hit Chance dice ");
					if (this.effect._HitDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._HitDC);
					this.str.Append("d");
					this.str.Append(this.effect._HitDS);
				}
				if (this.effect._HitDC > 0f)
				{
					this.Icon("HitChanceUp", healed, arrowsForMod6);
				}
				else
				{
					this.Icon("HitChanceDown", healed, arrowsForMod6);
				}
			}
			if (this.effect._MHitFlat != 0f && !this.interactive)
			{
				float num45 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._MHitFlat < 0f)
				{
					num45 *= -1f;
				}
				float num46 = this.effect._MHitFlat + num45;
				num46 = Mathf.Round(num46 * 10f) * 0.1f;
				if (num46 > 0f)
				{
					this.Icon("HitChanceUp", healed, 1);
				}
				else
				{
					this.Icon("HitChanceDown", healed, 1);
				}
				if (healed)
				{
					num46 *= -1f;
				}
				this.target.stats.AddPaganHitMod(num46);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Pagan Hit Chance ");
					if (num46 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num46);
				}
			}
			if (this.effect._MHitDC != 0f && !this.interactive)
			{
				float potencyAdd10 = Records.x.GetPotencyAdd("ModsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(9, (int)this.effect._MHitDC, (int)this.effect._MHitDS + (int)potencyAdd10, healed);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Pagan Hit Chance dice ");
					if (this.effect._MHitDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._MHitDC);
					this.str.Append("d");
					this.str.Append(this.effect._MHitDS);
				}
				if (this.effect._MHitDC > 0f)
				{
					this.Icon("HitChanceUp", healed, 1);
				}
				else
				{
					this.Icon("HitChanceDown", healed, 1);
				}
			}
			if (this.effect._EvadeFlat != 0f && !this.interactive)
			{
				float num47 = Records.x.GetPotencyAdd("EvadeChance", this.sourceLevel, num);
				if (this.effect._EvadeFlat < 0f)
				{
					num47 *= -1f;
				}
				float num48 = this.R2(this.effect._EvadeFlat + num47);
				num48 = Mathf.Round(num48 * 10f) * 0.1f;
				int arrowsForMod7 = this.GetArrowsForMod("Evasion", num48);
				if (num48 > 0f)
				{
					this.Icon("EvasionChanceUp", healed, arrowsForMod7);
				}
				else
				{
					this.Icon("EvasionChanceDown", healed, arrowsForMod7);
				}
				if (healed)
				{
					num48 *= -1f;
				}
				this.target.stats.AddEvadeMod(num48);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Evade Chance ");
					if (num48 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(Mathf.Round(num48));
				}
			}
			if (this.effect._EvadeDC != 0f && !this.interactive)
			{
				float potencyAdd11 = Records.x.GetPotencyAdd("ModsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(10, (int)this.effect._EvadeDC, (int)this.effect._EvadeDS + (int)potencyAdd11, healed);
				int arrowsForMod8 = this.GetArrowsForMod("Evasion", (float)this.GetDiceModifierAverage((int)this.effect._EvadeDC, (int)this.effect._EvadeDS + (int)potencyAdd11));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Evade Chance dice ");
					if (this.effect._EvadeDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._EvadeDC);
					this.str.Append("d");
					this.str.Append(this.effect._EvadeDS);
				}
				if (this.effect._EvadeDC > 0f)
				{
					this.Icon("EvasionChanceUp", healed, arrowsForMod8);
				}
				else
				{
					this.Icon("EvasionChanceDown", healed, arrowsForMod8);
				}
			}
			if (this.effect._BlockFlat != 0f && !this.interactive)
			{
				float num49 = Records.x.GetPotencyAdd("BlockChance", this.sourceLevel, num);
				if (this.effect._BlockFlat < 0f)
				{
					num49 *= -1f;
				}
				float num50 = this.effect._BlockFlat + num49;
				num50 = Mathf.Round(num50 * 10f) * 0.1f;
				int arrowsForMod9 = this.GetArrowsForMod("BlockChance", num50);
				if (num50 > 0f)
				{
					this.Icon("BlockChanceUp", healed, arrowsForMod9);
				}
				else
				{
					this.Icon("BlockChanceDown", healed, arrowsForMod9);
				}
				if (healed)
				{
					num50 *= -1f;
				}
				this.target.stats.AddBlockMod(num50);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Block Chance ");
					if (num50 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(Mathf.Round(num50));
				}
			}
			if (this.effect._BlockDC != 0f && !this.interactive)
			{
				float potencyAdd12 = Records.x.GetPotencyAdd("ModsDice", this.sourceLevel, num);
				this.target.stats.UpdateDiceModifiers(10, (int)this.effect._BlockDC, (int)this.effect._BlockDS + (int)potencyAdd12, healed);
				int arrowsForMod10 = this.GetArrowsForMod("BlockChance", (float)this.GetDiceModifierAverage((int)this.effect._BlockDC, (int)this.effect._BlockDS + (int)potencyAdd12));
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Block Chance dice ");
					if (this.effect._BlockDC > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(this.effect._BlockDC);
					this.str.Append("d");
					this.str.Append(this.effect._BlockDS);
				}
				if (this.effect._BlockDC > 0f)
				{
					this.Icon("BlockChanceUp", healed, arrowsForMod10);
				}
				else
				{
					this.Icon("BlockChanceDown", healed, arrowsForMod10);
				}
			}
			if (this.effect._MusicResistance != 0f && !this.interactive)
			{
				float num51 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._MusicResistance < 0f)
				{
					num51 *= -1f;
				}
				float num52 = this.effect._MusicResistance + num51;
				if (num == 0)
				{
					if (num52 > 0f)
					{
						num52 = Mathf.Ceil(num52);
					}
					else
					{
						num52 = Mathf.Floor(num52);
					}
				}
				else
				{
					num52 = Mathf.Round(num52);
				}
				int arrowsForMod11 = this.GetArrowsForMod("MusicResist", num52);
				if (num52 > 0f)
				{
					this.Icon("MusicResistUp", healed, arrowsForMod11);
				}
				else
				{
					this.Icon("MusicResistDown", healed, arrowsForMod11);
				}
				if (healed)
				{
					num52 *= -1f;
				}
				this.target.stats.AddMusicResist(num52);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Resist Pagan Vine Spells ");
					if (num52 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num52);
				}
			}
			if (this.effect._Artistry > 0f && !this.interactive)
			{
				float num53 = Records.x.GetPotencyAdd("Artistry", this.sourceLevel, num);
				if (this.effect._Artistry < 0f)
				{
					num53 *= -1f;
				}
				float num54 = this.effect._Artistry + num53;
				int arrowsForMod12 = this.GetArrowsForMod("Artistry", num54);
				if (num54 > 0f)
				{
					this.Icon("ArtistryUp", healed, arrowsForMod12);
				}
				else
				{
					this.Icon("ArtistryDown", healed, arrowsForMod12);
				}
				if (healed)
				{
					num54 *= -1f;
				}
				this.target.stats.AddArtistry((int)num54);
				if (this.recordEffects)
				{
					this.AddRecord();
					if (num54 > 0f)
					{
						this.str.Append("Artistry +");
					}
					else
					{
						this.str.Append("Artistry ");
					}
					this.str.Append(num54);
				}
			}
			if (this.effect._PaganResistVines != 0f && !this.interactive)
			{
				float num55 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._PaganResistVines < 0f)
				{
					num55 *= -1f;
				}
				float num56 = this.effect._PaganResistVines + num55;
				if (num == 0)
				{
					if (num56 > 0f)
					{
						num56 = Mathf.Ceil(num56);
					}
					else
					{
						num56 = Mathf.Floor(num56);
					}
				}
				else
				{
					num56 = Mathf.Round(num56);
				}
				int arrowsForMod13 = this.GetArrowsForMod("PaganResistVines", num56);
				if (num56 > 0f)
				{
					this.Icon("PaganResistUp", healed, arrowsForMod13);
				}
				else
				{
					this.Icon("PaganResistDown", healed, arrowsForMod13);
				}
				if (healed)
				{
					num56 *= -1f;
				}
				this.target.stats.AddPaganResist(num56, "Vines");
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Resist Pagan Vine Spells ");
					if (num56 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num56);
				}
			}
			if (this.effect._PaganResistSpores != 0f && !this.interactive)
			{
				float num57 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._PaganResistSpores < 0f)
				{
					num57 *= -1f;
				}
				float num58 = this.effect._PaganResistSpores + num57;
				if (num == 0)
				{
					if (num58 > 0f)
					{
						num58 = Mathf.Ceil(num58);
					}
					else
					{
						num58 = Mathf.Floor(num58);
					}
				}
				else
				{
					num58 = Mathf.Round(num58);
				}
				int arrowsForMod14 = this.GetArrowsForMod("PaganResistSpores", num58);
				if (num58 > 0f)
				{
					this.Icon("PaganResistUp", healed, arrowsForMod14);
				}
				else
				{
					this.Icon("PaganResistDown", healed, arrowsForMod14);
				}
				if (healed)
				{
					num58 *= -1f;
				}
				this.target.stats.AddPaganResist(num58, "Spores");
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Resist Pagan Spore Spells ");
					if (num58 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num58);
				}
			}
			if (this.effect._PaganResistFauna != 0f && !this.interactive)
			{
				float num59 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._PaganResistFauna < 0f)
				{
					num59 *= -1f;
				}
				float num60 = this.effect._PaganResistFauna + num59;
				if (num == 0)
				{
					if (num60 > 0f)
					{
						num60 = Mathf.Ceil(num60);
					}
					else
					{
						num60 = Mathf.Floor(num60);
					}
				}
				else
				{
					num60 = Mathf.Round(num60);
				}
				int arrowsForMod15 = this.GetArrowsForMod("PaganResistFauna", num60);
				if (num60 > 0f)
				{
					this.Icon("PaganResistUp", healed, arrowsForMod15);
				}
				else
				{
					this.Icon("PaganResistDown", healed, arrowsForMod15);
				}
				if (healed)
				{
					num60 *= -1f;
				}
				this.target.stats.AddPaganResist(num60, "Fauna");
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Resist Pagan Vine Spells ");
					if (num60 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num60);
				}
			}
			if (this.effect._Balance != 0f && !this.interactive)
			{
				float num61 = Records.x.GetPotencyAdd("FlatMods", this.sourceLevel, num);
				if (this.effect._Balance < 0f)
				{
					num61 *= -1f;
				}
				float num62 = this.effect._Balance + num61;
				num62 = Mathf.Round(num62 * 10f) * 0.1f;
				if (num62 > 0f)
				{
					this.Icon("BalanceUp", healed, 1);
				}
				else
				{
					this.Icon("BalanceDown", healed, 1);
				}
				if (healed)
				{
					num62 *= -1f;
				}
				this.target.stats.AddBalanceMod(num62);
				if (this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Balance ");
					if (num62 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num62);
				}
			}
			if (this.effect._SpiritAbsorption != 0f && !this.interactive)
			{
				float num63 = Records.x.GetPotencyAdd("SpiritAbsorb", this.sourceLevel, num);
				if (this.effect._SpiritAbsorption < 0f)
				{
					num63 *= -1f;
				}
				float num64 = this.effect._SpiritAbsorption + num63;
				num64 = Mathf.Round(num64 * 10f) * 0.1f;
				if (num64 > 0f)
				{
					this.Icon("SpiritAbsorptionUp", healed, 1);
				}
				else
				{
					this.Icon("SpiritAbsorptionDown", healed, 1);
				}
				if (healed)
				{
					num64 *= -1f;
				}
				if (!healed)
				{
					this.target.stats.AddSpiritAbsorption(num64);
					if (this.recordEffects)
					{
						this.AddRecord();
						this.str.Append("Spirit Absorption");
						if (num64 > 0f)
						{
							this.str.Append("+");
						}
						this.str.Append(num64);
					}
				}
			}
			if (this.effect._RallySpeed != 0f && !this.interactive)
			{
				float num65 = Records.x.GetPotencyAdd("RallySpeed", this.sourceLevel, num);
				if (this.effect._RallySpeed < 0f)
				{
					num65 *= -1f;
				}
				float num66 = this.effect._RallySpeed + num65;
				if (healed)
				{
					num66 *= -1f;
				}
				num66 = Mathf.Round(num66 * 100f) * 0.01f;
				Links.x.fellowship.rallySpeed += num66;
				if (!healed && this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Rally Speed ");
					if (num66 > 0f)
					{
						this.str.Append("+");
					}
					this.str.Append(num66);
				}
				if ((double)Links.x.fellowship.rallySpeed > 0.01)
				{
					Links.x.hudControl.RallyBuffToggle(true);
				}
				else
				{
					Links.x.hudControl.RallyBuffToggle(false);
				}
			}
			if (this.effect._StaminaSpeed != 0f && !this.interactive)
			{
				float num67 = Records.x.GetPotencyAdd("StaminaSpeed", this.sourceLevel, num);
				if (this.effect._StaminaSpeed < 0f)
				{
					num67 *= -1f;
				}
				float num68 = this.effect._StaminaSpeed + num67;
				if (num68 > 0f)
				{
					this.Icon("StaminaRegenUp", healed, 1);
				}
				else
				{
					this.Icon("StaminaRegenDown", healed, 1);
				}
				if (healed)
				{
					num68 *= -1f;
				}
				this.target.stats.AddStamimaSpeed(num68);
				num68 = Mathf.Round(num68 * 10f) / 10f;
				if (this.target.stamina)
				{
					if (this.target.stats.staminaRegenMod >= 0f)
					{
						this.target.stamina.RemoveStaminaDebuff();
					}
					else
					{
						this.target.stamina.DebuffStamina();
					}
				}
				else if (this.target.party && this.target.portrait)
				{
					this.target.portrait.SetStaminaBuff();
				}
				if (!healed && this.recordEffects)
				{
					this.AddRecord();
					if (this.effect._StaminaSpeed % 1f != 0f)
					{
						this.str.Append("Stamina Regeneration Speed x");
					}
					else
					{
						this.str.Append("Fatigue Recovery Speed x");
					}
					this.str.Append(num68);
				}
			}
			if (this.effect._StaminaReduceMult != 0f && !this.interactive)
			{
				float num69 = Records.x.GetPotencyAdd("StaminaReduce", this.sourceLevel, num);
				if (this.effect._StaminaReduceMult < 0f)
				{
					num69 *= -1f;
				}
				float num70 = this.effect._StaminaReduceMult + num69;
				if (num70 > 0f)
				{
					this.Icon("StaminaRegenUp", healed, 1);
				}
				else
				{
					this.Icon("StaminaRegenDown", healed, 1);
				}
				if (healed)
				{
					num70 *= -1f;
				}
				this.target.stats.AddStamimaReductionMultipler(num70);
				num70 = Mathf.Round(num70 * 10f) / 10f;
				if (!healed && this.recordEffects)
				{
					this.AddRecord();
					this.str.Append("Extra Fatigue x ");
					this.str.Append(num70);
				}
			}
			if (this.effect._RallyFill != 0f && !this.interactive)
			{
				float num71 = this.effect._FatigueMax;
				if (healed)
				{
					num71 *= -1f;
				}
				if (!healed)
				{
					if (this.effect._RallyFill >= 1f)
					{
						float rallyInterval = Links.x.hudControl.rallyInterval;
						float num72 = rallyInterval;
						if (Links.x.fellowship.rally + Links.x.fellowship.rallyBoost + rallyInterval > rallyInterval * 3f)
						{
							num72 = rallyInterval * 3f - (Links.x.fellowship.rally + Links.x.fellowship.rallyBoost);
						}
						Links.x.fellowship.rallyBoost += num72;
						Links.x.hudControl.SetRallyBars();
					}
					if (this.effect._RallyFill == 2f)
					{
						float rallyInterval2 = Links.x.hudControl.rallyInterval;
						float num73 = rallyInterval2;
						if (Links.x.fellowship.rally + Links.x.fellowship.rallyBoost + rallyInterval2 > rallyInterval2 * 3f)
						{
							num73 = rallyInterval2 * 3f - (Links.x.fellowship.rally + Links.x.fellowship.rallyBoost);
						}
						Links.x.fellowship.rallyBoost += num73;
						Links.x.hudControl.SetRallyBars();
					}
				}
			}
		}
		if (this.effect._Spirit != 0f && !healed && !this.interactive && ((this.effect._OverTime && !Records.x.pocketPause) || !this.effect._OverTime || Links.x.combat.inRally))
		{
			float num74 = Records.x.GetPotencyAdd("Spirit", this.sourceLevel, num);
			if (this.effect._Spirit < 0f)
			{
				num74 *= -1f;
			}
			float num75 = this.effect._Spirit + num74;
			if (healed)
			{
				num75 *= -1f;
			}
			if (num == 0)
			{
				if (num75 > 0f)
				{
					num75 = Mathf.Ceil(num75);
				}
				else
				{
					num75 = Mathf.Floor(num75);
				}
			}
			else
			{
				num75 = Mathf.Round(num75);
			}
			if (this.effect._OverTime)
			{
				float num76 = this.effect._Spirit + num74;
				if (num75 > 0f)
				{
					num75 = (float)Mathf.RoundToInt(num75 / (float)this.overTimeTotal);
					float num77 = this.savedSpiritTotal;
					this.savedSpiritTotal += num75;
					if (this.savedSpiritTotal >= num76)
					{
						num75 = num76 - num77;
					}
				}
				else
				{
					this.overTimeTotal = 3;
					num75 = (float)Mathf.RoundToInt(num75 / (float)this.overTimeTotal);
					float num78 = this.savedSpiritTotal;
					this.savedSpiritTotal += num75;
					if (this.savedSpiritTotal <= num76)
					{
						num75 = num76 - num78;
					}
				}
			}
			this.target.stats.AddSpirit(Mathf.RoundToInt(num75));
			if (this.recordEffects)
			{
				this.AddRecord();
				this.str.Append("Spirit ");
				if (num75 > 0f)
				{
					this.str.Append("+");
				}
				this.str.Append(num75);
			}
			if (!healed && this.effect._Permanent && !this.effect._Name.Contains("HealthSpiritStamina"))
			{
				MasterAudio.PlaySoundAndForget("Potion", 0.8f, new float?(1f), 0f, "", null);
			}
		}
		if (this.effect._HealthMax != 0f && !this.interactive)
		{
			float num79 = Records.x.GetPotencyAdd("Health", this.sourceLevel, num);
			if (this.effect._HealthMax < 0f)
			{
				num79 *= -1f;
			}
			float num80 = this.effect._HealthMax + num79;
			if (healed)
			{
				num80 *= -1f;
			}
			this.target.stats.AddHealthMax(Mathf.RoundToInt(num80));
			if (this.effect._Name.Contains("Ghost") || this.effect._Name.Contains("Circle"))
			{
				if (num80 > 0f)
				{
					this.Icon("Ghost", healed, 1);
				}
				else
				{
					this.Icon("Ghost", healed, 1);
				}
				if (!healed)
				{
					this.target.AddEffect(85, "");
				}
				else
				{
					this.target.RemoveEffect(85, "", true);
				}
			}
			else
			{
				if (num80 > 0f)
				{
					this.target.stats.AddHealth(Mathf.RoundToInt(num80));
				}
				if (num80 > 0f)
				{
					this.Icon("MaxHealthUp", healed, 1);
				}
				else
				{
					this.Icon("MaxHealthDown", healed, 1);
				}
			}
			if (!healed && this.recordEffects)
			{
				this.AddRecord();
				this.str.Append("Max Health");
				if (num80 > 0f)
				{
					this.str.Append("+");
				}
				this.str.Append(Mathf.Round(num80));
			}
		}
		if ((this.healthOverride != 0f || this.effect._Health != 0f) && !healed)
		{
			float num81 = Records.x.GetPotencyAdd("Health", this.sourceLevel, num);
			if (this.effect._Health < 0f)
			{
				num81 *= -1f;
			}
			float num82 = this.effect._Health + num81;
			if (healed)
			{
				num82 *= -1f;
			}
			if (this.healthOverride != 0f)
			{
				num82 = this.healthOverride;
			}
			if (num == 0)
			{
				if (num82 > 0f)
				{
					num82 = Mathf.Ceil(num82);
				}
				else
				{
					num82 = Mathf.Floor(num82);
				}
			}
			else
			{
				num82 = Mathf.Round(num82);
			}
			if (this.effect._OverTime)
			{
				float num83 = this.effect._Health + num81;
				if (this.healthOverride != 0f)
				{
					num83 = this.healthOverride;
				}
				if (num82 > 0f)
				{
					num82 = (float)Mathf.RoundToInt(num82 / (float)this.overTimeTotal);
					float num84 = this.savedHealthTotal;
					this.savedHealthTotal += num82;
					if (this.savedHealthTotal >= num83)
					{
						num82 = num83 - num84;
					}
				}
				else
				{
					this.overTimeTotal = 3;
					if (this.overTimeCount == this.overTimeTotal && Mathf.Abs(num82) < (float)this.overTimeTotal)
					{
						this.overTimeCount = 0;
					}
					else
					{
						num82 = (float)Mathf.RoundToInt(num82 / (float)this.overTimeTotal);
						float num85 = this.savedHealthTotal;
						this.savedHealthTotal += num82;
						if (this.savedHealthTotal <= num83)
						{
							num82 = num83 - num85;
						}
					}
				}
			}
			float num86 = 0f;
			if (num82 < 0f)
			{
				bool flag = false;
				bool flag2 = false;
				if (this.ability != null && !this.effect._Name.Contains("Frog") && !this.effect._Name.Contains("Poison"))
				{
					flag2 = this.ability._IsSpell;
				}
				if (this.effect._Name.Contains("Impact") || flag2)
				{
					flag = true;
				}
				if (this.effect._OverTime)
				{
					flag = false;
				}
				if (flag && this.target)
				{
					num86 = this.target.stats.ArmorNumber(false, true) / 2f;
					num86 /= 10f;
					num86 = this.target.stats.R1(num86 + this.target.stats.ArmorPaganAura(1) / 100f);
					num86 = 1f - num86;
					num82 *= num86;
				}
			}
			if (num82 != 0f)
			{
				if (num == 0)
				{
					if (num82 > 0f)
					{
						num82 = Mathf.Ceil(num82);
					}
					else
					{
						num82 = Mathf.Floor(num82);
					}
				}
				else
				{
					num82 = Mathf.Round(num82);
				}
				if (!this.interactive)
				{
					float num87 = this.target.stats.AddPotionBoosts();
					if (num82 > 0f)
					{
						this.target.stats.AddHealth((int)num82 + (int)num87);
					}
					this.AddRecord();
				}
				if (!healed)
				{
					if (num82 > 0f)
					{
						if (this.jewelrySlot <= 0 && !this.effect._IsIntercession)
						{
							if (this.effect._Name.Contains("HealthSpiritStamina"))
							{
								MasterAudio.PlaySoundAndForget("Interactives", 0.8f, new float?(1f), 0f, "Eating", null);
							}
							else if (this.effect._Name.Contains("Health") || this.effect._Name.Contains("Berry"))
							{
								MasterAudio.PlaySoundAndForget("Potion", 0.8f, new float?(1f), 0f, "", null);
							}
						}
					}
					else
					{
						bool flag3 = false;
						if (this.target && this.target.npc)
						{
							flag3 = true;
						}
						bool flag4 = false;
						if (this.source && this.target)
						{
							flag4 = Records.x.IsTextLeft(this.source, this.target);
						}
						Animator animator;
						if (this.interactive || flag3)
						{
							bool flag5 = false;
							if (this.source && this.source.mainSelected)
							{
								flag5 = true;
							}
							if (!this.interactive && flag5)
							{
								animator = Links.x.cellar.GetAnimatedText("PocketDmg", (num82 * -1f).ToString(), flag4);
							}
							else
							{
								animator = Links.x.cellar.GetAnimatedText("NPCDmg", (num82 * -1f).ToString(), flag4);
							}
						}
						else
						{
							animator = Links.x.cellar.GetAnimatedText("PartyDmg", (num82 * -1f).ToString(), flag4);
						}
						if ((this.effect._Name.Contains("Frog") || this.effect._Name.Contains("Poison")) && this.target)
						{
							this.target.body.StartBlink(0.25f);
						}
						if (this.interactive)
						{
							animator.gameObject.transform.position = this.targetInteractive.transform.position + new Vector3(Random.Range(0f, 0.1f), Random.Range(0.5f, 1.1f), 0f);
						}
						else
						{
							animator.gameObject.transform.position = this.target.body.HeadPosition(0f) + new Vector3(Random.Range(0f, 1f), Random.Range(2f, 3f), 0f);
						}
						animator.gameObject.SetActive(true);
						if (this.interactive)
						{
							Breakable.BreakableEffectRequired breakableEffectRequired = Breakable.BreakableEffectRequired.Damage;
							if (this.chestTarget)
							{
								breakableEffectRequired = this.chestTarget.chest.effectRequired;
							}
							if (this.doorTarget)
							{
								breakableEffectRequired = this.doorTarget.door.effectRequired;
							}
							if (this.breakableTarget)
							{
								breakableEffectRequired = this.breakableTarget.breakable.effectRequired;
							}
							if (this.effect._InteractiveType.Contains(breakableEffectRequired.ToString()))
							{
								if (this.chestTarget)
								{
									this.chestTarget.currentHealth += Mathf.RoundToInt(num82);
									if (this.chestTarget.currentHealth <= 0)
									{
										this.chestTarget.ClickToBreak(this.source, false);
									}
									this.chestTarget.AlertOwner(true, this.source);
								}
								if (this.doorTarget)
								{
									this.doorTarget.currentHealth += Mathf.RoundToInt(num82);
									if (this.doorTarget.currentHealth <= 0)
									{
										this.doorTarget.ClickToBreak(this.source, false);
									}
									this.doorTarget.AlertOwner(true, this.source);
								}
								if (this.breakableTarget)
								{
									this.breakableTarget.currentHealth += Mathf.RoundToInt(num82);
									if (this.breakableTarget.currentHealth <= 0)
									{
										this.breakableTarget.ClickToBreak(this.source, false, false);
									}
								}
							}
							else
							{
								StringFast stringFast = new StringFast(32);
								stringFast.Clear();
								stringFast.Append(this.effect._DisplayName);
								stringFast.Append(" has no effect");
								Links.x.gameFeed.AddFeed(stringFast.ToString());
							}
						}
						else if (this.target)
						{
							StringFast stringFast2 = new StringFast(32);
							stringFast2.Clear();
							if (!this.target.npc)
							{
								stringFast2.Append(Links.x.gameFeed.GetPartyColorText(this.target));
							}
							stringFast2.Append(this.target.stats.GetName());
							if (!this.target.npc)
							{
								stringFast2.Append("</color>");
							}
							stringFast2.Append(" lost ");
							stringFast2.Append(Mathf.Round(num82 * -1f));
							stringFast2.Append(" health from ");
							stringFast2.Append(this.effect._DisplayName);
							if (num86 > 0f)
							{
								stringFast2.Append(" (armor blocked ");
								stringFast2.Append(Mathf.Round((1f - num86) * 100f));
								stringFast2.Append("%)");
							}
							if (!Records.x.miniGame)
							{
								Links.x.gameFeed.AddFeed(stringFast2.ToString());
							}
							if (this.source)
							{
								if (this.effect._Name.Contains("Explode"))
								{
									this.source.AddDamage(this.target, num82 * -1f, true, true, true, "Bounce", 0f, 0f);
								}
								else if (this.source.npc && this.target.npc)
								{
									this.source.AddDamage(this.target, num82 * -1f, true, this.interrupt, true, "Small Bounce", 0f, 0f);
								}
								else
								{
									this.source.AddDamage(this.target, num82 * -1f, true, this.interrupt, true, "None", 0f, 0f);
								}
							}
						}
					}
				}
			}
		}
		if (this.effect._Script != "" && !this.interactive)
		{
			if (this.effect._Script == "PukeSpore" || this.effect._Script.Contains("AmplifyWounds"))
			{
				if (this.effect._Script.Contains("AmplifyWounds"))
				{
					if (this.effect._Script.Contains("1"))
					{
						this.sourceLevel = 1f;
					}
					else
					{
						this.sourceLevel = 2f;
					}
				}
				if (healed)
				{
					this.target.stats.ChangeAilmentMultiplier(this.sourceLevel, false, healed);
				}
				else
				{
					this.target.stats.ChangeAilmentMultiplier(this.sourceLevel, false, healed);
				}
				this.AddRecord();
				if (this.recordEffects)
				{
					this.str.Append("Increase existing ailments");
				}
			}
			this.effect._Script == "BoneSpikes";
			if (this.effect._Script == "VineCocoon")
			{
				if (this.maxDurability == 0f)
				{
					this.maxDurability = this.durability;
				}
				this.AddRecord();
				if (this.recordEffects)
				{
					this.str.Append("In a shield of a vines with a durability of ");
					this.str.Append(this.durability);
				}
			}
			if (this.effect._Script == "AttractionSpore")
			{
				if (!healed)
				{
					this.target.StartFleeAroundPoint(this.tileEffect.startNode);
				}
				else
				{
					this.target.EndFleeAroundPoint();
				}
				this.AddRecord();
				if (this.recordEffects)
				{
					this.str.Append("Attracted to a enemy-selected location");
				}
				this.Icon("Compelled", healed, 1);
				if (!healed)
				{
					GameObject gameObject2 = this.target.AddEffect(44, "");
					if (gameObject2)
					{
						this.pooledEffects.Add(gameObject2);
					}
				}
			}
			if (this.effect._Script == "SkillsDown")
			{
				float num88 = (float)this.effect._Level;
				float potencyAdd13 = Records.x.GetPotencyAdd("SkillsDown", this.sourceLevel, num);
				num88 += potencyAdd13;
				num88 *= -1f;
				this.Icon("SkillsDown", healed, 1);
				if (!healed)
				{
					this.target.stats.ReduceAllSkills(num88);
				}
				else
				{
					this.target.stats.ReduceAllSkills(num88 * -1f);
				}
				this.AddRecord();
				if (this.recordEffects)
				{
					this.str.Append("Reduce all skills");
				}
			}
		}
		if (!healed && !this.resetHeal)
		{
			if (this.effect._Sound != "" && !this.fromLoad)
			{
				if (!this.interactive)
				{
					MasterAudio.PlaySound3DAtVector3AndForget("Skills", this.target.tr.position, 0.8f, new float?(1f), 0f, this.effect._Sound, null);
				}
				else
				{
					MasterAudio.PlaySound3DAtVector3AndForget("Skills", this.targetInteractive.transform.position, 0.8f, new float?(1f), 0f, this.effect._Sound, null);
				}
			}
			if (this.overallTime == 0f && !this.effect._WhileOnTile)
			{
				this.RemoveEffect();
			}
			else if (this.overallTime == -1f)
			{
				this.overallTime = 0f;
			}
			else
			{
				this.effectStartTime = (int)Links.x.gameplay.seconds;
				if (this.overallTime > 0f)
				{
					this.timeToWait = (int)this.overallTime;
				}
				if (this.effect._IsSong)
				{
					this.overallTime += (float)Mathf.RoundToInt(Records.x.GetPotencyAdd("Time", this.sourceLevel, num));
				}
				if (this.overrideDuration > 0f)
				{
					this.timeToWait = (int)this.overrideDuration;
				}
			}
			this.ready = true;
		}
		if (this.effect._RemoveAilments && !this.interactive && !this.resetHeal)
		{
			if (!healed)
			{
				this.target.stats.RemoveAllAilments();
				return "Status effects removed";
			}
			if (this.recordEffects)
			{
				this.AddRecord();
				this.str.Append("Remove harmful ailments");
			}
		}
		string text = "";
		if (this.recordEffects)
		{
			this.displayEffects = this.str.ToString();
			text = this.displayEffects;
			if (this.target.party && this.displayEffects != null)
			{
				string text2 = Regex.Replace(this.displayEffects, ", ", "\n");
				this.displayEffects = text2;
			}
			if (text != null && text.Length > 10 && text.Substring(text.Length - 10) == ", </color>")
			{
				text = text.Substring(0, text.Length - 10) + "</color>";
			}
			if (this.target.party && Links.x.characterSheet.open)
			{
				Links.x.characterSheet.SetupStatusIcons();
			}
		}
		if (this.effect._OverTime && !this.resetHeal)
		{
			this.overTimeCount--;
			if (this.overTimeCount <= 0 && !healed && this.overallTime <= 1f)
			{
				this.Healed(false, true);
			}
			else if (this.target && this.target.party && this.recordEffects)
			{
				this.displayEffects += "\nEffects are granted over a period of time";
			}
		}
		if (healed && this.target && this.target.party && Links.x.characterSheet.open)
		{
			Links.x.characterSheet.SetupStatusIcons();
		}
		if (this.effect._Name.Contains("Resting") && !healed)
		{
			this.target.resting = true;
		}
		if (this.effect._Name.Contains("Quest") && !this.resetHeal)
		{
			this.RunQuestCode(this.effect._Name, healed);
		}
		if (this.effect._Name.Contains("EquipItem") && !this.resetHeal)
		{
			this.RunEqiupItemCode(healed);
		}
		return text;
	}

	// Token: 0x060006A0 RID: 1696 RVA: 0x0008DDD4 File Offset: 0x0008BFD4
	private void Icon(string n, bool healing, int arrows)
	{
		if (this.interactive)
		{
			return;
		}
		if (!this.effect._ShowInStatus)
		{
			return;
		}
		if (this.effect._NoIcon)
		{
			return;
		}
		if (!this.target.npc && this.target.portrait)
		{
			if (!healing)
			{
				this.target.portrait.AddEffect(n, this);
				this.iconNames.Add(n);
			}
			else
			{
				this.target.portrait.RemoveEffect(this);
			}
		}
		if (this.source == this.target && ((this.effect._IsIntercession && this.effect._OverallTime < 1f) || this.jewelrySlot > 0))
		{
			return;
		}
		if (n != "Stunned" && !this.resetHeal)
		{
			bool flag = false;
			if (n.Contains("Severity"))
			{
				flag = true;
			}
			if (n.Contains("HitChance"))
			{
				flag = true;
			}
			if (n.Contains("Pag"))
			{
				flag = true;
			}
			if (n.Contains("Agl"))
			{
				flag = true;
			}
			if (n.Contains("Str"))
			{
				flag = true;
			}
			if (n.Contains("Aur"))
			{
				flag = true;
			}
			if (n.Contains("Dex"))
			{
				flag = true;
			}
			if (n.Contains("Sen"))
			{
				flag = true;
			}
			if (n.Contains("Evasion"))
			{
				flag = true;
			}
			if (n.Contains("Block"))
			{
				flag = true;
			}
			if (n.Contains("Resist"))
			{
				flag = true;
			}
			if (n.Contains("Silent"))
			{
				flag = true;
			}
			if (n.Contains("Skills"))
			{
				flag = true;
			}
			if (n.Contains("ActionTime"))
			{
				flag = true;
			}
			if (n.Contains("Stuck"))
			{
				flag = true;
			}
			if (flag)
			{
				if (!healing)
				{
					this.target.CreateStatusRing(this, n, arrows);
					return;
				}
				this.target.HealStatusRing(this, n);
			}
		}
	}

	// Token: 0x060006A1 RID: 1697 RVA: 0x0008DFB8 File Offset: 0x0008C1B8
	public void ChangeAilmentMultiplier(float amt, bool isBuff, bool healing)
	{
		if (this.interactive)
		{
			return;
		}
		if (isBuff && !this.effect._IsBuff)
		{
			return;
		}
		if (!isBuff && this.effect._IsBuff)
		{
			return;
		}
		if (this.effect._Script == "PukeSpore" || this.effect._Script.Contains("AmplifyWounds"))
		{
			return;
		}
		this.str.Clear();
		if (!this.target.npc)
		{
			this.str.Append(Links.x.gameFeed.GetPartyColorText(this.target));
		}
		this.str.Append(this.target.stats.GetName());
		if (!this.target.npc)
		{
			this.str.Append("</color>");
		}
		this.str.Append("'s ");
		this.str.Append(this.effect._DisplayName);
		this.str.Append(" amplified");
		Links.x.gameFeed.AddFeed(this.str.ToString());
		this.resetHeal = true;
		this.Set(true);
		if (!healing)
		{
			this.sourceLevel += amt;
		}
		this.Set(false);
		this.resetHeal = false;
	}

	// Token: 0x060006A2 RID: 1698 RVA: 0x0008E118 File Offset: 0x0008C318
	public string Inflicted(bool fromTile)
	{
		if (!this)
		{
			return "";
		}
		string text = "";
		base.enabled = false;
		this.effect = Links.x.library.GetEffectRow(this.effectName);
		this.ability = Links.x.library.GetAbilityRow(this.effectName);
		if (this.ability != null)
		{
			this.hasAbility = true;
		}
		if (this.effect != null)
		{
			if (this.effect._OverTime && this.effectStartTime == 0)
			{
				this.effectStartTime = (int)Links.x.gameplay.seconds;
				this.overTimeCount = 5;
				this.overTimeTotal = 5;
				if (this.effect._Health < 0f || this.effect._Name.Contains("Dart"))
				{
					this.overTimeCount = 3;
					this.overTimeTotal = 3;
				}
			}
			if (this.fromLoad)
			{
				if (this.effect._Permanent)
				{
					Object.Destroy(this);
					return text;
				}
			}
			else if (this.target && !this.effect._CanStack && this.target.stats.HasEffect(this.effect._Name))
			{
				if (Records.x.editor)
				{
					string text2 = "Found duplicate effect ";
					string name = this.effect._Name;
					string text3 = " for ";
					Character character = this.target;
					Debug.Log(text2 + name + text3 + ((character != null) ? character.ToString() : null));
				}
				this.target.stats.HealEffectExcept(this.effect._Name, this);
			}
			if (this.target && !this.fromLoad)
			{
				if (this.target.isBoro)
				{
					return "";
				}
				if (this.target.stats.GetExistingEffect("HealingSpores") && this.effect._Name != "HealingSpores" && !this.effect._IsBuff)
				{
					string text4 = "Found healing spores for ";
					Character character2 = this.target;
					Debug.Log(text4 + ((character2 != null) ? character2.ToString() : null));
					Object.Destroy(this);
					return text;
				}
			}
			if (this.targetInteractive)
			{
				this.interactive = true;
				this.breakableTarget = this.targetInteractive.GetComponent<BreakableActions>();
				this.chestTarget = this.targetInteractive.GetComponent<ChestActions>();
				this.doorTarget = this.targetInteractive.GetComponent<DoorActions>();
			}
			string text5 = "";
			if (!this.effectIsActive)
			{
				text5 = this.Set(false);
			}
			this.inflicted = true;
			this.effectIsActive = true;
			if (!this.fromLoad)
			{
				if (!this.interactive)
				{
					this.target.stats.AddEffect(this, 0, this.sourceLevel);
					if (this.effect._ShowInStatus && this.jewelrySlot == 0)
					{
						bool flag = true;
						if (this.ability != null && (this.ability._ShowText == "" || this.ability._ShowText == "-"))
						{
							flag = false;
						}
						if (this.effect._Name.Contains("Dart"))
						{
							flag = false;
						}
						if (this.effect._NoIcon)
						{
							flag = false;
						}
						if (flag)
						{
							this.str.Clear();
							if (!fromTile)
							{
								if (!this.target.npc)
								{
									this.str.Append(Links.x.gameFeed.GetPartyColorText(this.target));
								}
								this.str.Append(this.target.stats.GetName());
								if (!this.target.npc)
								{
									this.str.Append("</color>");
								}
								this.str.Append(": ");
								if (this.ability != null)
								{
									this.str.Append(this.ability._DisplayName);
								}
								else
								{
									this.str.Append(this.effect._DisplayName);
								}
							}
							if (Records.x.showRulesetInfo && text5 != "")
							{
								if (!fromTile)
								{
									this.str.Append(" <color #857C6C>... ");
								}
								this.str.Append(text5);
								if (this.effect._OverallTime > 0f && !this.effect._Permanent)
								{
									int num = this.effectStartTime + this.timeToWait - (int)Links.x.gameplay.seconds;
									num = (int)Mathf.Ceil(Records.x.ShowSeconds(num));
									if (text5 != "")
									{
										this.str.Append("</color>");
									}
									this.str.Append(" for ");
									if ((float)num < 60f)
									{
										this.str.Append(num);
										if ((float)num != 1f)
										{
											this.str.Append(" seconds");
										}
										else
										{
											this.str.Append(" second");
										}
									}
									else
									{
										float num2 = (float)num / 60f;
										num2 = Mathf.Round(num2);
										this.str.Append(num2);
										if (num2 != 1f)
										{
											this.str.Append(" minutes");
										}
										else
										{
											this.str.Append(" minute");
										}
									}
								}
								if (!fromTile)
								{
									this.str.Append("</color>");
								}
							}
							if (fromTile)
							{
								text = this.str.ToString();
							}
							else
							{
								Links.x.gameFeed.AddFeed(this.str.ToString());
							}
						}
					}
				}
				else if (!fromTile)
				{
					bool showInStatus = this.effect._ShowInStatus;
				}
			}
			if (this.target && this.terrainDependent)
			{
				this.target.stats.CheckTerrainAbilities(this.target.terrain);
			}
			return text;
		}
		if (Records.x.editor)
		{
			Debug.Log("Effect is empty " + ((this != null) ? this.ToString() : null));
		}
		this.RemoveEffect();
		return text;
	}

	// Token: 0x060006A3 RID: 1699 RVA: 0x0008E730 File Offset: 0x0008C930
	public void Healed(bool dead, bool doRemove)
	{
		if (this.effect == null)
		{
			return;
		}
		if (this.target && this.target.party)
		{
			dead = false;
		}
		if (!this.interactive && (!dead || !this.target.npc))
		{
			this.target.stats.UpdateStats();
		}
		if (!this.inflicted)
		{
			return;
		}
		this.healingEffect = true;
		if (!this.effect._Permanent && this.effectIsActive)
		{
			this.Set(true);
		}
		this.effectIsActive = false;
		if (doRemove && !this.interactive)
		{
			this.target.stats.RemoveEffect(this, this.effect._Name);
			this.target.stats.SaveEffects();
		}
		this.ReturnPooledEffects();
		if (!dead && (this.effect._OverallTime > 1f || this.effect._WhileOnTile || this.effectAnimator) && !this.interactive)
		{
			if (this.tileEffect && !this.interactive && !this.effect._WhileOnTile)
			{
				this.tileEffect.RemoveCharacterEffect(this.target, this);
			}
			if (!this.interactive && !this.effect._Permanent && !this.effect._Name.Contains("Elixir"))
			{
				if (this.effect._IsBuff)
				{
					this.healedObject = Links.x.cellar.GetPooledGameObject(15);
				}
				else
				{
					this.healedObject = Links.x.cellar.GetPooledGameObject(15);
				}
				if (this.healedObject && this.target)
				{
					this.healedObject.transform.position = this.target.body.HeadPosition(0f);
					this.healedObject.SetActive(true);
				}
			}
			if (this.effectAnimator)
			{
				this.healedObject = this.effectAnimator.gameObject;
				this.effectAnimator.Play("End");
			}
			this.waitingToReturnObject = 1;
			if (this.target && !this.effect._Permanent)
			{
				MasterAudio.PlaySound3DAtVector3AndForget("Effect Removed", this.target.tr.position, 1f, new float?(1f), 0f, null, null);
			}
		}
		else
		{
			if (this.effectAnimator)
			{
				this.healedObject = this.effectAnimator.gameObject;
				this.effectAnimator.Play("End");
			}
			Links.x.cellar.ReturnEffects(this);
			this.ReturnPooledEffects();
			Object.Destroy(this);
		}
		this.inflicted = false;
	}

	// Token: 0x060006A4 RID: 1700 RVA: 0x0008EA10 File Offset: 0x0008CC10
	public void DestroyAfterHealedParticle()
	{
		Links.x.cellar.ReturnEffects(this);
		if (this.healedObject && !this.effectAnimator)
		{
			this.healedObject.SetActive(false);
		}
		if (this.effectAnimator)
		{
			this.ReturnPooledEffects();
		}
		Object.Destroy(this);
	}

	// Token: 0x060006A5 RID: 1701 RVA: 0x0008EA6C File Offset: 0x0008CC6C
	public void ReturnPooledEffects()
	{
		for (int i = 0; i < this.pooledEffects.Count; i++)
		{
			if (this.pooledEffects[i])
			{
				this.pooledEffects[i].transform.parent = Links.x.cellar.tr;
				Links.x.cellar.ReturnPooledGameObject(this.effect._FX, this.pooledEffects[i]);
				if (this.pooledEffects[i].activeSelf)
				{
					this.pooledEffects[i].SetActive(false);
				}
				if (this.effect._FXType == "Head")
				{
					this.target.RemoveEffect(this.effect._FX, "", false);
				}
			}
		}
		this.pooledEffects.Clear();
		if (this.effect != null)
		{
			if (this.effect._Stun > 0 && !this.effect._NoIcon && this.target)
			{
				this.target.RemoveEffect(40, "", true);
			}
			if ((this.effect._Confuse > 0 || this.effect._Script == "AttractionSpore") && !this.effect._NoIcon && this.target)
			{
				this.target.RemoveEffect(44, "", true);
			}
			if (this.effect._Flee > 0 && !this.effect._NoIcon && this.target)
			{
				this.target.RemoveEffect(44, "", true);
			}
			if (this.effect._MoveSpeed != 0f && !this.effect._NoIcon && this.target)
			{
				if (this.effect._MoveSpeed > 0f)
				{
					this.target.RemoveEffect(46, "", true);
					return;
				}
				this.target.RemoveEffect(48, "", true);
			}
		}
	}

	// Token: 0x060006A6 RID: 1702 RVA: 0x0008EC94 File Offset: 0x0008CE94
	public void RemoveEffect()
	{
		this.ReturnPooledEffects();
		if (!this.interactive)
		{
			if (this.effect != null)
			{
				this.target.stats.RemoveEffect(this, this.effect._Name);
			}
			else
			{
				this.target.stats.RemoveEffect(this, "");
			}
			this.target.stats.SaveEffects();
		}
		Links.x.cellar.ReturnEffects(this);
		if (this.healedObject)
		{
			this.healedObject.SetActive(false);
		}
		Object.Destroy(this);
	}

	// Token: 0x060006A7 RID: 1703 RVA: 0x0008ED2C File Offset: 0x0008CF2C
	public void RunQuestCode(string n, bool healed)
	{
		if (n == "QuestTimerChanterC6")
		{
			Debug.Log(n + " " + healed.ToString());
			if (!healed)
			{
				Library.Inventory invRowFromName = Links.x.library.GetInvRowFromName("GhostScrollCirclet");
				int num = this.target.HasItem(invRowFromName._ID);
				if (this.fromLoad || num == -1)
				{
					this.target.GiveItem(invRowFromName._ID, 1, Vector3.zero, Vector3.zero, new Vector4(0f, 0f, 0f, 0f), false);
					num = this.target.HasItem(invRowFromName._ID);
				}
				this.target.EquipNPC(num / 2, 8);
				int num2 = 0;
				if (QuestLog.GetQuestState("C6_SickGuardA") == QuestState.Active || QuestLog.GetQuestState("C6_SickGuardA") == QuestState.Success)
				{
					num2++;
				}
				if (QuestLog.GetQuestState("C6_SickGuardB") == QuestState.Active || QuestLog.GetQuestState("C6_SickGuardB") == QuestState.Success)
				{
					num2++;
				}
				if (QuestLog.GetQuestState("C6_SickGuardC") == QuestState.Active || QuestLog.GetQuestState("C6_SickGuardC") == QuestState.Success)
				{
					num2++;
				}
				Debug.Log(string.Concat(new string[]
				{
					num2.ToString(),
					" ",
					QuestLog.GetQuestState("C6_SickGuardA").ToString(),
					" ",
					QuestLog.GetQuestState("C6_SickGuardB").ToString(),
					" ",
					QuestLog.GetQuestState("C6_SickGuardC").ToString()
				}));
				if (QuestLog.GetQuestState("C6_Chanter") == QuestState.Active && num2 >= 3)
				{
					QuestLog.SetQuestState("C6_Chanter", QuestState.ActivePart2);
				}
				if (QuestLog.GetQuestState("C6_Chanter") == QuestState.Unassigned && num2 >= 3)
				{
					QuestLog.SetQuestState("C6_Chanter", QuestState.ActivePart3);
				}
				if (QuestLog.GetQuestState("C6_Chanter") == QuestState.Discussed && num2 >= 3)
				{
					QuestLog.SetQuestState("C6_Chanter", QuestState.ActivePart3);
				}
			}
			else
			{
				Library.Inventory invRowFromName2 = Links.x.library.GetInvRowFromName("GhostScrollCirclet");
				this.target.RemoveItem(invRowFromName2._ID, 1);
				this.target.UnequipNPC(8);
				if (this.target.stats.HasEffectAndCure("Resting"))
				{
					Links.x.gameFeed.AddFeed(invRowFromName2._DisplayName + " has cured " + this.target.stats.GetName());
				}
				string text = "C6_SickGuardA";
				if (this.target.stats.xmlName.Contains("SickB"))
				{
					text = "C6_SickGuardB";
				}
				if (this.target.stats.xmlName.Contains("SickC"))
				{
					text = "C6_SickGuardC";
				}
				QuestLog.SetQuestState(text, QuestState.Success);
				this.target.creatures.GetPoints(true, true);
				this.target.resting = false;
				this.target.GetUp();
				int num3 = DialogueLua.GetVariable("C6_SickGuardsHealed").asInt;
				num3++;
				DialogueLua.SetVariable("C6_SickGuardsHealed", num3);
				if (num3 >= 3 && (QuestLog.GetQuestState("C6_Chanter") == QuestState.ActivePart2 || QuestLog.GetQuestState("C6_Chanter") == QuestState.Active))
				{
					QuestLog.SetQuestState("C6_Chanter", QuestState.ReturnToNPC);
				}
			}
		}
		if (n == "QuestTimerBlessedC5")
		{
			Debug.Log(n + " " + healed.ToString());
			if (!healed)
			{
				Library.Inventory invRowFromName3 = Links.x.library.GetInvRowFromName("BlessedCirclet");
				int num4 = this.target.HasItem(invRowFromName3._ID);
				if (this.fromLoad || num4 == -1)
				{
					this.target.GiveItem(invRowFromName3._ID, 1, Vector3.zero, Vector3.zero, new Vector4(0f, 0f, 0f, 0f), false);
					num4 = this.target.HasItem(invRowFromName3._ID);
				}
				this.target.EquipNPC(num4 / 2, 8);
				return;
			}
			Library.Inventory invRowFromName4 = Links.x.library.GetInvRowFromName("BlessedCirclet");
			if (this.target.stats.HasEffectAndCure("RestingFood"))
			{
				Links.x.gameFeed.AddFeed(invRowFromName4._DisplayName + " has cured " + this.target.stats.GetName());
			}
			QuestLog.SetQuestState("C5_Blessed", QuestState.Complete);
			this.target.creatures.GetPoints(true, true);
		}
	}

	// Token: 0x060006A8 RID: 1704 RVA: 0x0008F1D4 File Offset: 0x0008D3D4
	private void RunEqiupItemCode(bool healed)
	{
		string text = "EquipItem";
		string text2 = "";
		int num = this.effect._Name.IndexOf(text);
		if (num != -1)
		{
			text2 = this.effect._Name.Substring(num + text.Length);
		}
		if (healed)
		{
			Library.Inventory invRowFromName = Links.x.library.GetInvRowFromName(text2);
			this.target.RemoveItem(invRowFromName._ID, 1);
			this.target.UnequipNPC(invRowFromName._EquipSlotID);
			return;
		}
		Library.Inventory invRowFromName2 = Links.x.library.GetInvRowFromName(text2);
		int num2 = this.target.HasItem(invRowFromName2._ID);
		if (this.fromLoad || num2 == -1)
		{
			this.target.GiveItem(invRowFromName2._ID, 1, Vector3.zero, Vector3.zero, new Vector4(0f, 0f, 0f, 0f), false);
			num2 = this.target.HasItem(invRowFromName2._ID);
		}
		this.target.EquipNPC(num2 / 2, invRowFromName2._EquipSlotID);
	}

	// Token: 0x060006A9 RID: 1705 RVA: 0x0008F2EA File Offset: 0x0008D4EA
	public float R2(float x)
	{
		return Mathf.Round(x * 100f) / 100f;
	}

	// Token: 0x060006AA RID: 1706 RVA: 0x0008F2FE File Offset: 0x0008D4FE
	private IEnumerator KnockbackRoutine()
	{
		yield return new WaitForSeconds(0.1f);
		Quaternion quaternion = Quaternion.LookRotation(this.target.currentPosition - this.source.currentPosition);
		float num = -1f;
		if (Random.Range(0, 2) == 0)
		{
			num = 1f;
		}
		Vector3 vector = this.target.currentPosition + quaternion * Vector3.right * Records.x.nodeSize * num;
		this.target.Knockback(vector, 1, false, false, false);
		yield break;
	}

	// Token: 0x060006AB RID: 1707 RVA: 0x0008F310 File Offset: 0x0008D510
	private int GetArrowsForStat(string s, float added)
	{
		if (this.healingEffect)
		{
			return 1;
		}
		int num2;
		float num = this.target.stats.Stat(s, false, out num2);
		if (added < 0f)
		{
			added *= -1f;
		}
		float num3 = (num + added) / num;
		num3 -= 1f;
		if (num3 < 1f)
		{
			return 1;
		}
		if (num3 >= 1f && num3 < 2f)
		{
			return 2;
		}
		if (num3 >= 2f)
		{
			return 3;
		}
		return 1;
	}

	// Token: 0x060006AC RID: 1708 RVA: 0x0008F384 File Offset: 0x0008D584
	private int GetArrowsForMod(string s, float added)
	{
		if (this.healingEffect)
		{
			return 1;
		}
		float num = 0f;
		if (s == "Severity")
		{
			this.target.stats.DamageRollString(this.target.stats.GetCurrentHand(), out num);
		}
		if (s == "PaganSeverity")
		{
			num = this.target.stats.PaganRollString();
		}
		if (s == "HitChance")
		{
			num = this.target.stats.WeaponHitChance(true, this.target.stats.GetCurrentHand());
		}
		if (s == "Evasion")
		{
			float num2;
			num = this.target.stats.EvasionChance(true, 0f, out num2);
		}
		if (s == "BlockChance")
		{
			float num3 = 0f;
			bool flag = false;
			bool flag2 = false;
			if (this.target.GetInvNum(2) > 1 && Links.x.library.GetInvRowByIndex(this.target.GetInvNum(2))._Tag == "Shield")
			{
				flag2 = true;
			}
			float num4;
			float num5;
			this.target.stats.EvadeArmorTotal(out num4, out num3, out num5, false, flag2);
			if (num3 > -1f)
			{
				flag = true;
			}
			float num6;
			float num7;
			this.target.stats.BlockTotal(out num6, out num, out num7, false, flag);
		}
		if (s.Contains("PaganResist"))
		{
			float num8;
			float num9;
			num = this.target.stats.PaganResistance(true, "", out num8, out num9);
		}
		if (s.Contains("MusicResist"))
		{
			float num10;
			num = this.target.stats.InstrumentResistance(true, out num10);
		}
		if (s == "Artistry")
		{
			num = this.target.stats.MusicPowerString();
		}
		if (added < 0f)
		{
			added *= -1f;
		}
		float num11 = (num + added) / num;
		num11 -= 1f;
		if (num11 < 1f)
		{
			return 1;
		}
		if (num11 >= 1f && num11 < 2f)
		{
			return 2;
		}
		if (num11 >= 2f)
		{
			return 3;
		}
		return 1;
	}

	// Token: 0x060006AD RID: 1709 RVA: 0x0008F588 File Offset: 0x0008D788
	private int GetDiceModifierAverage(int diceCount, int diceSides)
	{
		int num = diceCount;
		if (num < 0)
		{
			num *= -1;
		}
		int num2 = Records.x.GetRollMean(num, diceSides);
		if (diceCount < 0)
		{
			num2 *= -1;
		}
		return num2;
	}

	// Token: 0x04000959 RID: 2393
	[Header("SETUP")]
	public Character target;

	// Token: 0x0400095A RID: 2394
	public Character source;

	// Token: 0x0400095B RID: 2395
	public GameObject targetInteractive;

	// Token: 0x0400095C RID: 2396
	public Vector3 sourcePosition;

	// Token: 0x0400095D RID: 2397
	public bool inflicted;

	// Token: 0x0400095E RID: 2398
	public bool ready;

	// Token: 0x0400095F RID: 2399
	public float sourceLevel;

	// Token: 0x04000960 RID: 2400
	private bool interactive;

	// Token: 0x04000961 RID: 2401
	private ChestActions chestTarget;

	// Token: 0x04000962 RID: 2402
	private DoorActions doorTarget;

	// Token: 0x04000963 RID: 2403
	private BreakableActions breakableTarget;

	// Token: 0x04000964 RID: 2404
	[Header("SAVE/LOAD")]
	public bool fromLoad;

	// Token: 0x04000965 RID: 2405
	[Header("DATA")]
	public string effectName;

	// Token: 0x04000966 RID: 2406
	public Library.Effects effect;

	// Token: 0x04000967 RID: 2407
	public List<GameObject> pooledEffects = new List<GameObject>();

	// Token: 0x04000968 RID: 2408
	public TileEffects tileEffect;

	// Token: 0x04000969 RID: 2409
	public Library.Abilities ability;

	// Token: 0x0400096A RID: 2410
	public string displayEffects;

	// Token: 0x0400096B RID: 2411
	private bool recordEffects;

	// Token: 0x0400096C RID: 2412
	private bool foundOne;

	// Token: 0x0400096D RID: 2413
	public float overrideDuration;

	// Token: 0x0400096E RID: 2414
	public float songDuration;

	// Token: 0x0400096F RID: 2415
	public int jewelrySlot;

	// Token: 0x04000970 RID: 2416
	public bool resetHeal;

	// Token: 0x04000971 RID: 2417
	public bool hasAbility;

	// Token: 0x04000972 RID: 2418
	public float healthOverride;

	// Token: 0x04000973 RID: 2419
	public List<string> iconNames = new List<string>();

	// Token: 0x04000974 RID: 2420
	[Header("PROGRESS")]
	public int timeToWait;

	// Token: 0x04000975 RID: 2421
	public float currentTime;

	// Token: 0x04000976 RID: 2422
	public int turnsToWait;

	// Token: 0x04000977 RID: 2423
	public float overallTime;

	// Token: 0x04000978 RID: 2424
	public int effectStartTime;

	// Token: 0x04000979 RID: 2425
	public bool removeAtSceneSwitch;

	// Token: 0x0400097A RID: 2426
	public bool whileOnTile;

	// Token: 0x0400097B RID: 2427
	private GameObject healedObject;

	// Token: 0x0400097C RID: 2428
	public int waitingToReturnObject;

	// Token: 0x0400097D RID: 2429
	private StringFast str = new StringFast(64);

	// Token: 0x0400097E RID: 2430
	private bool removedStun;

	// Token: 0x0400097F RID: 2431
	private float savedHealthTotal;

	// Token: 0x04000980 RID: 2432
	private float savedSpiritTotal;

	// Token: 0x04000981 RID: 2433
	public int overTimeCount;

	// Token: 0x04000982 RID: 2434
	private int overTimeTotal = 5;

	// Token: 0x04000983 RID: 2435
	public float durability;

	// Token: 0x04000984 RID: 2436
	private float maxDurability;

	// Token: 0x04000985 RID: 2437
	private HannahAnimator effectAnimator;

	// Token: 0x04000986 RID: 2438
	public bool interrupt;

	// Token: 0x04000987 RID: 2439
	public bool healingEffect;

	// Token: 0x04000988 RID: 2440
	public bool effectIsActive;

	// Token: 0x04000989 RID: 2441
	public bool terrainDependent;
}
