Esempio n. 1
0
 public override void Remove(GameObject Object)
 {
     if (Object.IsPlayer() && WasPlayer && Popup.ShowYesNo("Your premonition is about to run out. Would you like to return to the start of your vision?") == DialogResult.Yes)
     {
         Precognition.Load();
     }
 }
Esempio n. 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);
 }
Esempio n. 3
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "BeforeDie")
            {
                if (Duration > 0)
                {
                    if (ActivatedSegment == XRLCore.Core.Game.Segments)
                    {
                        Object.hitpoints = HitpointsAtSave;
                        if (Object.pPhysics != null)
                        {
                            Object.pPhysics.Temperature = TemperatureAtSave;
                        }
                        return(false);
                    }
                    if (Object.IsPlayer())
                    {
                        if (WasPlayer)
                        {
                            if (Popup.ShowYesNo("You sense your imminent demise, would you like to return to the start of your vision?") == DialogResult.Yes)
                            {
                                Precognition.Load();
                                ActivatedSegment = XRLCore.Core.Game.Segments;
                                return(false);
                            }
                        }
                    }
                    else if (!Object.IsOriginalPlayerBody() && Object.FireEvent("CheckRealityDistortionUsability"))
                    {
                        Duration = 0;
                        if (Object.Statistics.ContainsKey("Hitpoints"))
                        {
                            ActivatedSegment = XRLCore.Core.Game.Segments;
                            Object.hitpoints = HitpointsAtSave;
                            if (Object.pPhysics != null)
                            {
                                Object.pPhysics.Temperature = TemperatureAtSave;
                            }
                            Object.DilationSplat();
                            string     verb  = "swim";
                            string     extra = "before your eyes";
                            string     terminalPunctuation = "!";
                            GameObject @object             = Object;
                            DidX(verb, extra, terminalPunctuation, false, null, @object);
                            return(false);
                        }
                    }
                }
            }
            else if (E.ID == "BeginTakeAction")
            {
                if (Duration > 0 && Object.CurrentCell != null)
                {
                    Duration--;
                    if (Duration <= 0)
                    {
                        if (Object.IsPlayer())
                        {
                            Popup.Show("Your mind clouds over once again.");
                        }
                    }
                }
            }

            return(base.FireEvent(E));
        }