private void RetractSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            performer.PopupMessage(performer, Loc.GetString("Retract the skin..."));

            // TODO do_after: Delay
            _skinRetracted = true;
        }
        private void OpenSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            performer.PopupMessage(Loc.GetString("Cut open the skin..."));

            // TODO do_after: Delay
            _skinOpened = true;
        }
        private void ClampVesselsSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            performer.PopupMessage(performer, Loc.GetString("Clamp the vessels..."));

            // TODO do_after: Delay
            _vesselsClamped = true;
        }
Ejemplo n.º 4
0
        private void LoosenOrganSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            if (Parent == null)
            {
                return;
            }
            if (Parent.Mechanisms.Count <= 0)
            {
                return;
            }

            var toSend = new List <IMechanism>();

            foreach (var mechanism in Parent.Mechanisms)
            {
                if (!_disconnectedOrgans.Contains(mechanism))
                {
                    toSend.Add(mechanism);
                }
            }

            if (toSend.Count > 0)
            {
                surgeon.RequestMechanism(toSend, LoosenOrganSurgeryCallback);
            }
        }
 protected void CautizerizeIncisionSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
 {
     performer.PopupMessage(performer, Loc.GetString("Cauterize the incision..."));
     //Delay?
     _skinOpened     = false;
     _vesselsClamped = false;
     _skinRetracted  = false;
 }
 public void LoosenOrganSurgeryCallback(Mechanism target, IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
 {
     if (target != null && _parent.Mechanisms.Contains(target))
     {
         performer.PopupMessage(performer, Loc.GetString("Loosen the organ..."));
         //Delay?
         _disconnectedOrgans.Add(target);
     }
 }
        private void CauterizeIncisionSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            performer.PopupMessage(Loc.GetString("Cauterize the incision..."));

            // TODO do_after: Delay
            _skinOpened     = false;
            _vesselsClamped = false;
            _skinRetracted  = false;
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     Attempts to perform surgery of the given <see cref="SurgeryType"/>. Returns whether the operation was successful.
        /// </summary>
        /// <param name="surgeryType">The <see cref="SurgeryType"/> used for this surgery.</param>
        /// <param name="performer">The entity performing the surgery.</param>
        public bool PerformSurgery(SurgeryType surgeryType, IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            SurgeryAction step = GetSurgeryStep(surgeryType);

            if (step == null)
            {
                return(false);
            }
            step(container, surgeon, performer);
            return(true);
        }
Ejemplo n.º 9
0
        private void ClampVesselsSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            if (Parent == null)
            {
                return;
            }

            performer.PopupMessage(Loc.GetString("Clamp the vessels..."));

            // TODO BODY do_after: Delay
            _vesselsClamped = true;
        }
        protected void RemoveBodyPartSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            if (!(container is BodyManagerComponent)) //This surgery requires a DroppedBodyPartComponent.
            {
                return;
            }
            BodyManagerComponent bmTarget = (BodyManagerComponent)container;

            performer.PopupMessage(performer, Loc.GetString("Saw off the limb!"));
            //Delay?
            bmTarget.DisconnectBodyPart(_parent, true);
        }
Ejemplo n.º 11
0
        private void RetractSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            if (Parent == null)
            {
                return;
            }

            performer.PopupMessage(Loc.GetString("Retract the skin..."));

            // TODO BODY do_after: Delay
            _skinRetracted = true;
        }
Ejemplo n.º 12
0
        private void LoosenOrganSurgeryCallback(IMechanism?target, IBodyPartContainer container, ISurgeon surgeon,
                                                IEntity performer)
        {
            if (Parent == null || target == null || !Parent.Mechanisms.Contains(target))
            {
                return;
            }

            performer.PopupMessage(Loc.GetString("Loosen the organ..."));

            // TODO BODY do_after: Delay
            _disconnectedOrgans.Add(target);
        }
Ejemplo n.º 13
0
        private void RemoveOrganSurgeryCallback(IMechanism?target, IBodyPartContainer container, ISurgeon surgeon,
                                                IEntity performer)
        {
            if (Parent == null || target == null || !Parent.Mechanisms.Contains(target))
            {
                return;
            }

            performer.PopupMessage(Loc.GetString("Remove the organ..."));

            // TODO BODY do_after: Delay
            Parent.RemoveMechanism(target, performer.Transform.Coordinates);
            _disconnectedOrgans.Remove(target);
        }
        private void RemoveOrganSurgeryCallback(IMechanism target, IBodyPartContainer container, ISurgeon surgeon,
                                                IEntity performer)
        {
            if (target == null || !Parent.Mechanisms.Contains(target))
            {
                return;
            }

            performer.PopupMessage(Loc.GetString("Remove the organ..."));

            // TODO do_after: Delay
            Parent.TryDropMechanism(performer, target, out _);
            _disconnectedOrgans.Remove(target);
        }
        private void RemoveBodyPartSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            // This surgery requires a DroppedBodyPartComponent.
            if (!(container is BodyManagerComponent))
            {
                return;
            }

            var bmTarget = (BodyManagerComponent)container;

            performer.PopupMessage(performer, Loc.GetString("Saw off the limb!"));

            // TODO do_after: Delay
            bmTarget.DisconnectBodyPart(Parent, true);
        }
 protected void RemoveOrganSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
 {
     if (_disconnectedOrgans.Count <= 0)
     {
         return;
     }
     if (_disconnectedOrgans.Count == 1)
     {
         RemoveOrganSurgeryCallback(_disconnectedOrgans[0], container, surgeon, performer);
     }
     else
     {
         surgeon.RequestMechanism(_disconnectedOrgans, RemoveOrganSurgeryCallback);
     }
 }
Ejemplo n.º 17
0
        private void RemoveBodyPartSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            if (Parent == null)
            {
                return;
            }
            if (!(container is IBody body))
            {
                return;
            }

            performer.PopupMessage(Loc.GetString("Saw off the limb!"));

            // TODO BODY do_after: Delay
            body.RemovePart(Parent, true);
        }
        protected void LoosenOrganSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
        {
            if (_parent.Mechanisms.Count <= 0)
            {
                return;
            }
            List <Mechanism> toSend = new List <Mechanism>();

            foreach (Mechanism mechanism in _parent.Mechanisms)
            {
                if (!_disconnectedOrgans.Contains(mechanism))
                {
                    toSend.Add(mechanism);
                }
            }
            if (toSend.Count > 0)
            {
                surgeon.RequestMechanism(toSend, LoosenOrganSurgeryCallback);
            }
        }
Ejemplo n.º 19
0
 /// <summary>
 ///     Attempts to perform surgery on this BodyPart with the given tool. Returns false if there was an error, true if successful.
 /// </summary>
 public bool AttemptSurgery(SurgeryType toolType, IBodyPartContainer target, ISurgeon surgeon, IEntity performer)
 {
     return(_surgeryData.PerformSurgery(toolType, target, surgeon, performer));
 }
 protected void ClampVesselsSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
 {
     performer.PopupMessage(performer, Loc.GetString("Clamp the vessels..."));
     //Delay?
     _vesselsClamped = true;
 }
 protected void RetractSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
 {
     performer.PopupMessage(performer, Loc.GetString("Retract the skin..."));
     //Delay?
     _skinRetracted = true;
 }