Aura.Channel.Scripting.Scripts.ItemScript.Poison C# (CSharp) Метод

Poison() приватный Метод

Handles potion poisoning.
The stages and the toxicity in general are based on information from the Wiki and in-game obsvervation.
private Poison ( Creature creature, double life, double mana, double stamina, double toxicity ) : void
creature Aura.Channel.World.Entities.Creature
life double Amount of life healed.
mana double Amount of mana healed.
stamina double Amount of stamina healed.
toxicity double Toxicity to apply.
Результат void
		private void Poison(Creature creature, double life, double mana, double stamina, double toxicity)
		{
			var beforeStage = GetToxicityStage(creature.Toxic);

			// Increase toxicity based on healed points
			creature.Toxic -= (float)(life * toxicity);
			creature.Toxic -= (float)(mana * toxicity);
			creature.Toxic -= (float)(stamina * toxicity);

			var stage = GetToxicityStage(creature.Toxic);

			// Stage change messages
			// http://wiki.mabinogiworld.com/view/Potion_Poisoning#Stages_of_Potion_Poisoning
			if (stage != beforeStage)
			{
				switch (stage)
				{
					case ToxicityStage.Stage1: Send.Notice(creature, L("It feels like the potion works better than before.")); break;
					case ToxicityStage.Stage2: Send.Notice(creature, L("This potion is effective!")); break;
					case ToxicityStage.Stage3: Send.Notice(creature, L("This potion is clearly effective, but it feels weird somehow.")); break;
					case ToxicityStage.Stage4: Send.Notice(creature, L("The potion has some side effects.")); break;
					case ToxicityStage.Stage5: Send.Notice(creature, L("The potion worked as it should, but it had some bad side-effects too.")); break;
					case ToxicityStage.Stage6: Send.Notice(creature, L("Anymore of this potion is dangerous!")); break;
				}
			}

			// Decrease stats if toxicity becomes too great
			if (stage >= ToxicityStage.Stage1)
			{
				if (life > 0)
				{
					creature.ToxicInt -= 1;
					creature.ToxicWill -= 1;
				}

				if (mana > 0)
				{
					creature.ToxicStr -= 1;
				}

				if (stamina > 0)
				{
					creature.ToxicWill -= 1;
				}
			}
		}