示例#1
0
        // Function from file: items.dm
        public override double examine(dynamic user = null)
        {
            string  size     = null;
            string  pronoun  = null;
            string  msg      = null;
            ByTable techlvls = null;
            dynamic T        = null;
            dynamic mat      = null;

            base.examine((object)(user));

            dynamic _a = this.w_class;             // Was a switch-case, sorry for the mess.

            if (_a == 1)
            {
                size = "tiny";
            }
            else if (_a == 2)
            {
                size = "small";
            }
            else if (_a == 3)
            {
                size = "normal-sized";
            }
            else if (_a == 4)
            {
                size = "bulky";
            }
            else if (_a == 5)
            {
                size = "huge";
            }
            else if (_a == 6)
            {
                size = "gigantic";
            }
            pronoun = null;

            if (this.gender == GlobalVars.PLURAL)
            {
                pronoun = "They are";
            }
            else
            {
                pronoun = "It is";
            }
            user.WriteMsg("" + pronoun + " a " + size + " item.");

            if (user.research_scanner)
            {
                msg = "*--------* <BR>";

                if (Lang13.Bool(this.origin_tech))
                {
                    msg     += "<span class='notice'>Testing potentials:</span><BR>";
                    techlvls = String13.ParseUrlParams(this.origin_tech);

                    foreach (dynamic _b in Lang13.Enumerate(techlvls))
                    {
                        T = _b;

                        msg += "Tech: " + GlobalFuncs.CallTechName(T) + " | magnitude: " + techlvls[T] + " <BR>";
                    }
                    msg += "Research reliability: " + this.reliability + "% <BR>";

                    if (this.crit_fail)
                    {
                        msg += "<span class='danger'>Critical failure detected in subject!</span><BR>";
                    }
                }
                else
                {
                    msg += "<span class='danger'>No tech origins detected.</span><BR>";
                }

                if (this.materials.len != 0)
                {
                    msg += "<span class='notice'>Extractable materials:<BR>";

                    foreach (dynamic _c in Lang13.Enumerate(this.materials))
                    {
                        mat = _c;

                        msg += "" + GlobalFuncs.CallMaterialName(mat) + "<BR>";
                    }
                }
                else
                {
                    msg += "<span class='danger'>No extractable materials detected.</span><BR>";
                }
                msg += "*--------*";
                user.WriteMsg(msg);
            }
            return(0);
        }