DRObjects.Items.Archetypes.Local.Potion.ThrowUpon C# (CSharp) Method

ThrowUpon() public method

The effect to apply when the potion is thrown upon the actors. Also handles learnign (for those which give an effect) and feedback
public ThrowUpon ( Actor attacker, List actors ) : ActionFeedback[]
attacker Actor
actors List
return ActionFeedback[]
        public ActionFeedback[] ThrowUpon(Actor attacker, List<Actor> actors)
        {
            List<ActionFeedback> feedback = new List<ActionFeedback>();

            switch (this.PotionType)
            {
                case Enums.PotionType.AGILITY:
                    foreach (var actor in actors)
                    {
                        Effect effect = new Effect();
                        effect.Actor = actor;
                        effect.EffectAmount = 1;
                        effect.MinutesLeft = 2;
                        effect.Name = EffectName.AGIL;

                        if (actor.IsPlayerCharacter)
                        {
                            effect.EffectDisappeared = new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The effect wears off");
                        }

                        feedback.Add(new ReceiveEffectFeedback() { Effect = effect });
                    }

                    feedback.Add(new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The victims of the splash look faster somehow"));
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);

                    return feedback.ToArray();
                case Enums.PotionType.BLEEDING:
                    foreach (var actor in actors)
                    {
                        actor.Anatomy.BloodLoss = 2;
                    }
                    feedback.Add(new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Metal shards spray over the area"));
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);
                    return feedback.ToArray();
                case Enums.PotionType.BLINDING:
                    foreach (var actor in actors)
                    {
                        Effect effect = new Effect();
                        effect.Actor = actor;
                        effect.EffectAmount = 5;
                        effect.MinutesLeft = 3;
                        effect.Name = EffectName.BLIND;

                        if (actor.IsPlayerCharacter)
                        {
                            effect.EffectDisappeared = new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "You can see again");
                        }

                        feedback.Add(new ReceiveEffectFeedback(effect));

                    }
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);
                    feedback.Add(new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "There is a blinding flash of light"));
                    return feedback.ToArray();
                case Enums.PotionType.BRAWN:
                    foreach (var actor in actors)
                    {
                        Effect effect = new Effect();
                        effect.Actor = actor;
                        effect.EffectAmount = 1;
                        effect.MinutesLeft = 2;
                        effect.Name = EffectName.BRAWN;

                        if (actor.IsPlayerCharacter)
                        {
                            effect.EffectDisappeared = new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The effect wears off");
                        }

                        feedback.Add(new ReceiveEffectFeedback() { Effect = effect });
                    }

                    feedback.Add(new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The victims of the splash look stronger somehow"));
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);

                    return feedback.ToArray();
                case Enums.PotionType.CHARISMA:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Nothing happens") };
                case Enums.PotionType.DEFENCE:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Nothing happens") };
                case Enums.PotionType.DEFENSIVE_KNOWLEDGE:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Nothing happens") };
                case Enums.PotionType.FEEDING:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "There is a delicious smell") };
                case Enums.PotionType.FIRE:
                    foreach (var actor in actors)
                    {
                        actor.Anatomy.Chest -= 2;
                        actor.Anatomy.Head -= 1;
                    }
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The potion explodes in flames") };
                case Enums.PotionType.HEALING:
                    foreach (var actor in actors)
                    {
                        Effect effect = new Effect();
                        effect.Actor = actor;
                        effect.EffectAmount = 2;
                        effect.MinutesLeft = 0;
                        effect.Name = EffectName.HEAL;

                        feedback.Add(new ReceiveEffectFeedback() { Effect = effect });
                    }

                    feedback.Add(new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The victims of the splash look healthier"));
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);

                    return feedback.ToArray();
                case Enums.PotionType.ICE:
                    foreach (var actor in actors)
                    {
                        actor.Anatomy.Chest -= 1;
                        actor.Anatomy.Head -= 1;
                        actor.Anatomy.Legs -= 1;
                    }
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The potion explodes in shards of ice") };
                case Enums.PotionType.INTELLIGENCE:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Nothing happens") };
                case Enums.PotionType.OFFENSIVE_KNOWLEDGE:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Nothing happens") };
                case Enums.PotionType.PARALYSIS:
                    foreach (var actor in actors)
                    {
                        actor.Anatomy.StunAmount += 2;
                    }
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The victims seem to have trouble moving") };
                case Enums.PotionType.PERCEPTION:
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "Nothing happens") };
                case Enums.PotionType.POISON:
                    foreach (var actor in actors)
                    {
                        actor.Anatomy.Chest -= 3;
                    }
                    this.IsIdentified = true;
                    attacker.Knowledge.LearnToIdentify(this.PotionType);
                    return new ActionFeedback[] { new LogFeedback(InterfaceSpriteName.POTION_ICON, Color.Blue, "The potion vaporises into a thick green cloud") };
                default:
                    throw new NotImplementedException("Code for " + this.PotionType + " not implemented");
            }
        }