Beispiel #1
0
 public override bool FireEvent(Event E)
 {
     if (E.ID == "EndTurn" && this.Duration > 0)
     {
         if (this.Duration > 1 && this.Object.IsPlayer() && this.Duration != 9999)
         {
             Effect.AddPlayerMessage("You will phase back out in " + Grammar.Cardinal(this.Duration - 1) + " " + (this.Duration - 1 != 1 ? "turns" : "turn") + ".");
         }
         if (this.Duration != 9999)
         {
             --this.Duration;
         }
     }
     return(base.FireEvent(E));
 }
Beispiel #2
0
 public override bool Apply(GameObject Object)
 {
     if (Object.IsPlayer())
     {
         Popup.Show("The clouds part in your mind and a ray of clarity strikes through.");
     }
     if (Object.IsPlayer())
     {
         WasPlayer = true;
         Precognition.Save();
     }
     else
     {
         WasPlayer = false;
         SensePsychicEffect sensePsychicEffect = SensePsychic.SensePsychicFromPlayer(Object);
         if (sensePsychicEffect != null)
         {
             Effect.AddPlayerMessage("You sense a subtle psychic disturbance.");
         }
     }
     HitpointsAtSave   = Object.hitpoints;
     TemperatureAtSave = Object.pPhysics.Temperature;
     return(true);
 }
 public override bool FireEvent(Event E)
 {
     if (E.ID == "IsMobile")
     {
         if (Duration > 0)
         {
             return(false);
         }
     }
     else if (E.ID == "EndTurn")
     {
         if (DestroyOnBreak != null && DestroyOnBreak.IsInvalid())
         {
             DestroyOnBreak = null;
         }
         Duration--;
     }
     else if (E.ID == "LeaveCell" || E.ID == "BeginAttack")
     {
         if (E.HasParameter("Teleporting"))
         {
             Duration = 0;
         }
         else if (Duration > 0)
         {
             if (Object.MakeSave("Strength", SaveTarget - Object.GetIntProperty("Stable"), null, null, "Web Restraint"))
             {
                 if (Object.IsPlayer())
                 {
                     Effect.AddPlayerMessage("&gYou break free!");
                 }
                 Object.RemoveEffect(this);
             }
             else
             {
                 if (Object.IsPlayer())
                 {
                     Effect.AddPlayerMessage("You are " + Text + "&y!");
                 }
                 if (!E.HasParameter("Dragging") && !E.HasParameter("Forced"))
                 {
                     Object.UseEnergy(1000);
                 }
                 if (E.ID == "LeaveCell")
                 {
                     return(false);
                 }
             }
         }
     }
     else if (E.ID == "CanChangeMovementMode" || E.ID == "CanChangeBodyPosition")
     {
         if (Duration > 0)
         {
             if (E.GetIntParameter("ShowMessage", 0) > 0 && Object.IsPlayer())
             {
                 Popup.Show("You are " + Text + "&y!");
             }
             return(false);
         }
     }
     else if ((E.ID == "MovementModeChanged" || E.ID == "BodyPositionChanged") && Duration > 0)
     {
         Object.RemoveEffect(this);
     }
     return(base.FireEvent(E));
 }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "IsMobile")
            {
                // AddPlayerMessage("IsMobile Works.");
                if (base.Duration > 0)
                {
                    return(true);
                }
            }

            else if (E.ID == "BeginTakeAction")
            {
                // AddPlayerMessage("BeginTakeAction Works.");
                if (this.turns > 0)
                {
                    int effectiveSaveTarget = this.GetEffectiveSaveTarget();
                    if (Object.MakeSave("Strength", effectiveSaveTarget, null, null, "Molting"))
                    {
                        Object.RemoveEffect(this);
                    }
                }
                this.turns++;
            }

            else if (E.ID == "LeaveCell")
            {
                // AddPlayerMessage("LeaveCell Works.");
                if (base.Duration > 0 && !E.HasParameter("Teleporting") && !E.HasParameter("Dragging") && !E.HasParameter("Forced"))
                {
                    if (base.Object.IsPlayer())
                    {
                        Popup.Show("You cannot move, you are molting.");
                    }
                    return(false);
                }
            }

            else if (E.ID == "EndTurn")
            {
                // AddPlayerMessage("EndTurn Works.");
                if (base.Duration > 0)
                {
                    Effect.AddPlayerMessage("You are molting.");
                }
                else
                {
                    Object.RemoveEffect(this);
                }
            }

            else if (E.ID == "CanChangeMovementMode")
            {
                // AddPlayerMessage("CanChangeMovementMode Works.");
                if (this.Duration > 0 && E.GetIntParameter("Involuntary", 0) <= 0)
                {
                    if (E.GetIntParameter("ShowMessage", 0) > 0 && Object.IsPlayer())
                    {
                        Popup.Show("You are molting.", true);
                    }
                    return(false);
                }
            }

            else if (E.ID == "MovementModeChanged")
            {
                // AddPlayerMessage("MovementModeChanged Works.");
                Object.RemoveEffect(this);
            }

            return(base.FireEvent(E));
        }