private void OnMorgueExamined(EntityUid uid, MorgueEntityStorageComponent component, ExaminedEvent args)
        {
            if (!TryComp <AppearanceComponent>(uid, out var appearance))
            {
                return;
            }

            if (args.IsInDetailsRange)
            {
                if (appearance.TryGetData(MorgueVisuals.HasSoul, out bool hasSoul) && hasSoul)
                {
                    args.PushMarkup(Loc.GetString("morgue-entity-storage-component-on-examine-details-body-has-soul"));
                }
                else if (appearance.TryGetData(MorgueVisuals.HasMob, out bool hasMob) && hasMob)
                {
                    args.PushMarkup(Loc.GetString("morgue-entity-storage-component-on-examine-details-body-has-no-soul"));
                }
                else if (appearance.TryGetData(MorgueVisuals.HasContents, out bool hasContents) && hasContents)
                {
                    args.PushMarkup(Loc.GetString("morgue-entity-storage-component-on-examine-details-has-contents"));
                }
                else
                {
                    args.PushMarkup(Loc.GetString("morgue-entity-storage-component-on-examine-details-empty"));
                }
            }
        }
        private void OnExamine(EntityUid uid, NodeContainerComponent component, ExaminedEvent args)
        {
            if (!component.Examinable || !args.IsInDetailsRange)
            {
                return;
            }

            foreach (var node in component.Nodes.Values)
            {
                if (node == null)
                {
                    continue;
                }
                switch (node.NodeGroupID)
                {
                case NodeGroupID.HVPower:
                    args.PushMarkup(
                        Loc.GetString("node-container-component-on-examine-details-hvpower"));
                    break;

                case NodeGroupID.MVPower:
                    args.PushMarkup(
                        Loc.GetString("node-container-component-on-examine-details-mvpower"));
                    break;

                case NodeGroupID.Apc:
                    args.PushMarkup(
                        Loc.GetString("node-container-component-on-examine-details-apc"));
                    break;
                }
            }
        }
        private void OnExamined(EntityUid uid, PaperLabelComponent comp, ExaminedEvent args)
        {
            if (comp.LabelSlot.Item is not {
                Valid : true
            } item)
            {
                return;
            }

            if (!args.IsInDetailsRange)
            {
                args.PushMarkup(Loc.GetString("comp-paper-label-has-label-cant-read"));
                return;
            }

            if (!EntityManager.TryGetComponent(item, out PaperComponent paper))
            {
                // Assuming yaml has the correct entity whitelist, this should not happen.
                return;
            }

            if (string.IsNullOrWhiteSpace(paper.Content))
            {
                args.PushMarkup(Loc.GetString("comp-paper-label-has-label-blank"));
                return;
            }

            args.PushMarkup(Loc.GetString("comp-paper-label-has-label"));
            var text = paper.Content;

            args.PushMarkup(text.TrimEnd());
        }
Example #4
0
 private void OnExamined(EntityUid uid, DroneComponent component, ExaminedEvent args)
 {
     if (TryComp <MindComponent>(uid, out var mind) && mind.HasMind)
     {
         args.PushMarkup(Loc.GetString("drone-active"));
     }
     else
     {
         args.PushMarkup(Loc.GetString("drone-dormant"));
     }
 }
Example #5
0
 public bool DoExamine(ExaminedEvent args)
 {
     args.PushMarkup(Loc.GetString(Value
         ? "construction-examine-condition-all-wires-cut"
         : "construction-examine-condition-all-wires-intact"));
     return(true);
 }
        private void OnExamined(EntityUid uid, HeadsetComponent component, ExaminedEvent args)
        {
            if (!args.IsInDetailsRange)
            {
                return;
            }
            // args.PushMarkup(Loc.GetString("examine-radio-frequency", ("frequency", component.BroadcastFrequency)));
            args.PushMarkup(Loc.GetString("examine-headset"));

            foreach (var id in component.Channels)
            {
                if (id == "Common")
                {
                    continue;
                }

                var proto = _protoManager.Index <RadioChannelPrototype>(id);
                args.PushMarkup(Loc.GetString("examine-headset-channel",
                                              ("color", proto.Color),
                                              ("key", proto.KeyCode),
                                              ("id", proto.Name),
                                              ("freq", proto.Frequency)));
            }

            args.PushMarkup(Loc.GetString("examine-headset-chat-prefix", ("prefix", ";")));
        }
 /// <summary>
 /// Triggers while trying to examine an activator to see if it's used
 /// </summary>
 private void OnCreatorExamine(EntityUid uid, GuardianCreatorComponent component, ExaminedEvent args)
 {
     if (component.Used)
     {
         args.PushMarkup(Loc.GetString("guardian-activator-empty-examine"));
     }
 }
        private void OnExamine(EntityUid uid, RCDComponent component, ExaminedEvent args)
        {
            var msg = Loc.GetString("rcd-component-examine-detail-count",
                                    ("mode", component.Mode), ("ammoCount", component.CurrentAmmo));

            args.PushMarkup(msg);
        }
Example #9
0
        private void OnExamine(EntityUid uid, SuitSensorComponent component, ExaminedEvent args)
        {
            if (!args.IsInDetailsRange)
            {
                return;
            }

            string msg;

            switch (component.Mode)
            {
            case SuitSensorMode.SensorOff:
                msg = "suit-sensor-examine-off";
                break;

            case SuitSensorMode.SensorBinary:
                msg = "suit-sensor-examine-binary";
                break;

            case SuitSensorMode.SensorVitals:
                msg = "suit-sensor-examine-vitals";
                break;

            case SuitSensorMode.SensorCords:
                msg = "suit-sensor-examine-cords";
                break;

            default:
                return;
            }

            args.PushMarkup(Loc.GetString(msg));
        }
 private void OnExamined(EntityUid uid, PerishableComponent component, ExaminedEvent args)
 {
     if (component.Rotting)
     {
         args.PushMarkup(Loc.GetString("miasma-rotting"));
     }
 }
        private void OnMachineBoardExamined(EntityUid uid, MachineBoardComponent component, ExaminedEvent args)
        {
            if (!args.IsInDetailsRange)
            {
                return;
            }
            args.PushMarkup(Loc.GetString("machine-board-component-on-examine-label"));
            foreach (var(part, amount) in component.Requirements)
            {
                args.PushMarkup(Loc.GetString("machine-board-component-required-element-entry-text",
                                              ("amount", amount),
                                              ("requiredElement", Loc.GetString(part.ToString()))));
            }

            foreach (var(material, amount) in component.MaterialRequirements)
            {
                args.PushMarkup(Loc.GetString("machine-board-component-required-element-entry-text",
                                              ("amount", amount),
                                              ("requiredElement", Loc.GetString(material.Name))));
            }

            foreach (var(_, info) in component.ComponentRequirements)
            {
                args.PushMarkup(Loc.GetString("machine-board-component-required-element-entry-text",
                                              ("amount", info.Amount),
                                              ("requiredElement", Loc.GetString(info.ExamineName))));
            }

            foreach (var(_, info) in component.TagRequirements)
            {
                args.PushMarkup(Loc.GetString("machine-board-component-required-element-entry-text",
                                              ("amount", info.Amount),
                                              ("requiredElement", Loc.GetString(info.ExamineName))));
            }
        }
        private void OnExamined(EntityUid uid, StunbatonComponent comp, ExaminedEvent args)
        {
            var msg = comp.Activated
                ? Loc.GetString("comp-stunbaton-examined-on")
                : Loc.GetString("comp-stunbaton-examined-off");

            args.PushMarkup(msg);
        }
Example #13
0
        public bool DoExamine(ExaminedEvent args)
        {
            var entity = args.Examined;

            switch (Anchored)
            {
            case true when !entity.Transform.Anchored:
                args.PushMarkup("First, anchor it.");
                return(true);

            case false when entity.Transform.Anchored:
                args.PushMarkup("First, unanchor it.");
                return(true);
            }

            return(false);
        }
Example #14
0
        private void OnGhostExamine(EntityUid uid, GhostComponent component, ExaminedEvent args)
        {
            var timeSinceDeath = _gameTiming.RealTime.Subtract(component.TimeOfDeath);
            var deathTimeInfo  = timeSinceDeath.Minutes > 0
                ? Loc.GetString("comp-ghost-examine-time-minutes", ("minutes", timeSinceDeath.Minutes))
                : Loc.GetString("comp-ghost-examine-time-seconds", ("seconds", timeSinceDeath.Seconds));

            args.PushMarkup(deathTimeInfo);
        }
 private void OnExamined(EntityUid uid, PAIComponent component, ExaminedEvent args)
 {
     if (args.IsInDetailsRange)
     {
         if (EntityManager.TryGetComponent <MindComponent>(uid, out var mind) && mind.HasMind)
         {
             args.PushMarkup(Loc.GetString("pai-system-pai-installed"));
         }
         else if (EntityManager.HasComponent <GhostTakeoverAvailableComponent>(uid))
         {
             args.PushMarkup(Loc.GetString("pai-system-still-searching"));
         }
         else
         {
             args.PushMarkup(Loc.GetString("pai-system-off"));
         }
     }
 }
Example #16
0
        public bool DoExamine(ExaminedEvent args)
        {
            var entity = args.Examined;

            var anchored = IoCManager.Resolve <IEntityManager>().GetComponent <TransformComponent>(entity).Anchored;

            switch (Anchored)
            {
            case true when !anchored:
                args.PushMarkup(Loc.GetString("construction-examine-condition-entity-anchored"));
                return(true);

            case false when anchored:
                args.PushMarkup(Loc.GetString("construction-examine-condition-entity-unanchored"));
                return(true);
            }

            return(false);
        }
        public bool DoExamine(ExaminedEvent args)
        {
            if (string.IsNullOrEmpty(ExamineText))
            {
                return(false);
            }

            args.PushMarkup(Loc.GetString(ExamineText));
            return(true);
        }
 private void OnExamined(EntityUid uid, GasTankComponent component, ExaminedEvent args)
 {
     if (args.IsInDetailsRange)
     {
         args.PushMarkup(Loc.GetString("comp-gas-tank-examine", ("pressure", Math.Round(component.Air?.Pressure ?? 0))));
     }
     if (component.IsConnected)
     {
         args.PushMarkup(Loc.GetString("comp-gas-tank-connected"));
     }
 }
        public bool DoExamine(ExaminedEvent args)
        {
            args.PushMarkup(Loc.GetString("construction-examine-condition-any-conditions"));

            foreach (var condition in Conditions)
            {
                condition.DoExamine(args);
            }

            return(true);
        }
 private void OnExamine(EntityUid uid, ToiletComponent component, ExaminedEvent args)
 {
     if (args.IsInDetailsRange && component.LidOpen)
     {
         if (_secretStash.HasItemInside(uid))
         {
             var msg = Loc.GetString("toilet-component-on-examine-found-hidden-item");
             args.PushMarkup(msg);
         }
     }
 }
Example #21
0
    private void OnExamine(EntityUid uid, CrematoriumComponent component, ExaminedEvent args)
    {
        if (!TryComp <AppearanceComponent>(uid, out var appearance))
        {
            return;
        }

        if (appearance.TryGetData(CrematoriumVisuals.Burning, out bool isBurning) && isBurning)
        {
            args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-is-burning", ("owner", uid)));
        }
        if (appearance.TryGetData(StorageVisuals.HasContents, out bool hasContents) && hasContents)
        {
            args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-has-contents"));
        }
        else
        {
            args.PushMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-empty"));
        }
    }
        private void OnExamine(EntityUid uid, EmagComponent component, ExaminedEvent args)
        {
            float timeRemaining = component.RechargeTime - component.Accumulator;

            args.PushMarkup(Loc.GetString("emag-charges-remaining", ("charges", component.Charges)));
            if (component.Charges == component.MaxCharges)
            {
                args.PushMarkup(Loc.GetString("emag-max-charges"));
                return;
            }
            args.PushMarkup(Loc.GetString("emag-recharging", ("seconds", Math.Round(timeRemaining))));
        }
        public bool DoExamine(ExaminedEvent args)
        {
            var entity = args.Examined;

            if (!entity.TryGetComponent(out WiresComponent? wires))
            {
                return(false);
            }

            switch (Open)
            {
            case true when !wires.IsPanelOpen:
                args.PushMarkup(Loc.GetString("construction-condition-wire-panel-open"));
                return(true);

            case false when wires.IsPanelOpen:
                args.PushMarkup(Loc.GetString("construction-condition-wire-panel-close"));
                return(true);
            }

            return(false);
        }
Example #24
0
        private void OnExamined(EntityUid uid, StunbatonComponent comp, ExaminedEvent args)
        {
            var msg = comp.Activated
                ? Loc.GetString("comp-stunbaton-examined-on")
                : Loc.GetString("comp-stunbaton-examined-off");

            args.PushMarkup(msg);
            if (TryComp <BatteryComponent>(uid, out var battery))
            {
                args.PushMarkup(Loc.GetString("stunbaton-component-on-examine-charge",
                                              ("charge", (int)((battery.CurrentCharge / battery.MaxCharge) * 100))));
            }
        }
Example #25
0
    private void OnExamined(EntityUid uid, RechargeBasicEntityAmmoComponent component, ExaminedEvent args)
    {
        if (!TryComp <BasicEntityAmmoProviderComponent>(uid, out var ammo) ||
            ammo.Count == ammo.Capacity)
        {
            args.PushMarkup(Loc.GetString("recharge-basic-entity-ammo-full"));
            return;
        }

        var timeLeft = component.NextRechargeTime - component.AccumulatedFrameTime;

        args.PushMarkup(Loc.GetString("recharge-basic-entity-ammo-can-recharge", ("seconds", Math.Round(timeLeft, 1))));
    }
Example #26
0
        public bool DoExamine(ExaminedEvent args)
        {
            var entMan = IoCManager.Resolve <IEntityManager>();
            var entity = args.Examined;

            if (!entMan.TryGetComponent(entity, out LockComponent? lockcomp))
            {
                return(false);
            }

            switch (IsLocked)
            {
            case true when !lockcomp.Locked:
                args.PushMarkup(Loc.GetString("construction-examine-condition-lock"));
                return(true);

            case false when lockcomp.Locked:
                args.PushMarkup(Loc.GetString("construction-examine-condition-unlock"));
                return(true);
            }

            return(false);
        }
Example #27
0
 private void OnExamine(EntityUid uid, GasVentPumpComponent component, ExaminedEvent args)
 {
     if (!TryComp <GasVentPumpComponent>(uid, out var pumpComponent))
     {
         return;
     }
     if (args.IsInDetailsRange)
     {
         if (pumpComponent.UnderPressureLockout)
         {
             args.PushMarkup(Loc.GetString("gas-vent-pump-uvlo"));
         }
     }
 }
        private void OnExamined(EntityUid uid, GasPressurePumpComponent pump, ExaminedEvent args)
        {
            if (!pump.Owner.Transform.Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
            {
                return;
            }

            if (Loc.TryGetString("gas-pressure-pump-system-examined", out var str,
                                 ("statusColor", "lightblue"), // TODO: change with pressure?
                                 ("pressure", pump.TargetPressure)
                                 ))
            {
                args.PushMarkup(str);
            }
        }
        private void OnExamined(EntityUid uid, ForensicPadComponent component, ExaminedEvent args)
        {
            if (!args.IsInDetailsRange)
            {
                return;
            }

            if (!component.Used)
            {
                args.PushMarkup(Loc.GetString("forensic-pad-unused"));
                return;
            }

            args.PushMarkup(Loc.GetString("forensic-pad-sample", ("sample", component.Sample)));
        }
        private void OnExamined(EntityUid uid, GasVolumePumpComponent pump, ExaminedEvent args)
        {
            if (!EntityManager.GetComponent <TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
            {
                return;
            }

            if (Loc.TryGetString("gas-volume-pump-system-examined", out var str,
                                 ("statusColor", "lightblue"), // TODO: change with volume?
                                 ("rate", pump.TransferRate)
                                 ))
            {
                args.PushMarkup(str);
            }
        }