Пример #1
0
 public override bool HandleEvent(ObjectEnteredCellEvent E)
 {
     if (E.Object == ParentObject && E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)) && !ParentObject.HasEffect("Dissolving") && !ParentObject.HasEffect("Flying"))
     {
         ParentObject.ApplyEffect(new Dissolving(1, ParentObject), ParentObject);
         ParentObject.TakeDamage(ref Damage, null, "{{green|Dissolved into visceral soup.}}", null, null, null, Message: "from salt diffusion!");
         IsDissolving = true;
     }
     else if (IsDissolving == true && (E.Object == ParentObject && E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint))))
     {
         this.Duration += 2;
         Damage        += 1;
         ParentObject.TakeDamage(ref Damage, null, "{{green|Dissolved into visceral soup.}}", null, null, null, Message: "from salt diffusion!");
     }
     else if ((IsDissolving == true && E.Object == ParentObject && (!E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)))))
     {
         this.Duration -= 1;
         ParentObject.TakeDamage(ref Damage, null, "{{green|Dissolved into visceral soup.}}", null, null, null, Message: "from salt diffusion!");
     }
     if (Duration <= 0)
     {
         IsDissolving = false;
         if (ParentObject.HasEffect("Dissolving"))
         {
             ParentObject.RemoveEffect("Dissolving");
             Damage = 2;
         }
     }
     return(base.HandleEvent(E));
 }
        public override void ObjectEnteredCell(LiquidVolume Liquid, ObjectEnteredCellEvent E)
        {
            var go = E.Object;

            if (Liquid.IsOpenVolume() && go.HasPart("Body"))
            {
                go.Move(E.Direction, true, EnergyCost: 0);
                go.ParticleText("!", 'B', false, 1.5f, -8f);

                IPart.XDidYToZ(
                    what: go,
                    verb: "slip",
                    preposition: "on",
                    obj: Liquid.ParentObject,
                    terminalPunctuation: "!"
                    );
            }
        }
Пример #3
0
        public override bool HandleEvent(ObjectEnteredCellEvent E)
        {
            if (E.Object != ParentObject && E.Object.HasPart("Combat") && !E.Object.IsPlayer())
            {
                if (Owner != null)
                {
                    int OwnersLevel = Owner.Statistics["Level"].BaseValue;

                    if (!E.Object.MakeSave("Ego", 20 + (OwnersLevel / 2), Owner, null, "Willpower"))
                    {
                        E.Object.ApplyEffect(new Terrified(10, ParentObject, true));
                    }
                    if (!E.Object.MakeSave("Ego", 15 + (OwnersLevel / 2), Owner, null, "Willpower"))
                    {
                        if (!E.Object.MakeSave("Ego", 15 + (OwnersLevel / 2), Owner, null, "Willpower"))
                        {
                            E.Object.pBrain.Goals.Clear();
                            E.Object.pBrain.MaxKillRadius /= 2;
                            E.Object.pBrain.MinKillRadius /= 2;
                            E.Object.pBrain.PushGoal(new WanderRandomly());
                        }
                        else if (!E.Object.MakeSave("Ego", 10 + (OwnersLevel / 2), Owner, null, "Willpower"))
                        {
                            E.Object.pBrain.Goals.Clear();
                            E.Object.pBrain.MaxKillRadius /= 2;
                            E.Object.pBrain.MinKillRadius /= 2;
                            E.Object.pBrain.PushGoal(new Wait(10));
                        }
                        else if (!E.Object.MakeSave("Ego", 5 + (OwnersLevel / 2), Owner, null, "Willpower"))
                        {
                            E.Object.pBrain.MaxKillRadius /= 2;
                            E.Object.pBrain.MinKillRadius /= 2;
                        }
                        else

                        {
                            E.Object.pBrain.Goals.Clear();
                        }
                    }
                }
                else
                {
                    if (!E.Object.MakeSave("Ego", 20, null, null, "Willpower"))
                    {
                        E.Object.ApplyEffect(new Terrified(10, ParentObject, true));
                    }
                    if (!E.Object.MakeSave("Ego", 15, null, null, "Willpower"))
                    {
                        if (Stat.Random(1, 100) <= 30)
                        {
                            E.Object.pBrain.Goals.Clear();
                            E.Object.pBrain.MaxKillRadius /= 2;
                            E.Object.pBrain.MinKillRadius /= 2;
                            E.Object.pBrain.PushGoal(new WanderRandomly());
                        }
                        else if (Stat.Random(1, 100) <= 60)
                        {
                            E.Object.pBrain.Goals.Clear();
                            E.Object.pBrain.MaxKillRadius /= 2;
                            E.Object.pBrain.MinKillRadius /= 2;
                            E.Object.pBrain.PushGoal(new Wait(10));
                        }
                        else if (Stat.Random(1, 100) <= 100)
                        {
                            E.Object.pBrain.MaxKillRadius /= 2;
                            E.Object.pBrain.MinKillRadius /= 2;
                        }
                    }
                }
            }

            return(base.HandleEvent(E));
        }