public void CheckInterruptAutoExplore() { if (bIdentified && GameObject.validate(ref Listener) && Listener.IsPlayer() && AutoAct.IsInterruptable() && !AutoAct.IsGathering() && Listener.IsRelevantHostile(base.Object)) { IComponent <GameObject> .AddPlayerMessage(Listener.GenerateSpotMessage(base.Object, null, "sense")); AutoAct.Interrupt(); } }
public override bool HandleEvent(ObjectEnteringCellEvent E) { if (E.Object == ParentObject && E.Object.IsPlayer() && E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)) && !ParentObject.HasEffect("Dissolving")) { if (Popup.ShowYesNo("This liquid is harmful to you, continue") != 0) { return(base.HandleEvent(E)); } AutoAct.Interrupt(); AddPlayerMessage("This liquid is harmful to you."); } return(base.HandleEvent(E)); }
public override bool FireEvent(Event E) { //... if (E.ID == "BeginMove") { Cell Cell = E.GetParameter("DestinationCell") as Cell; if (Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)) && !ParentObject.HasEffect("Dissolving") && ParentObject.IsPlayer()) { if (Popup.ShowYesNo("This liquid is harmful to you, continue") != 0) { AutoAct.Interrupt(); return(false); } else { } } } //... return(base.FireEvent(E)); }