コード例 #1
0
        // Function from file: glowshroom.dm
        public override dynamic acid_act(int acidpwr = 0, double?toxpwr = null, double?acid_volume = null)
        {
            Obj_Effect_Decal_Cleanable_MoltenItem I = null;

            this.visible_message("<span class='danger'>" + this + " melts away!</span>");
            I      = new Obj_Effect_Decal_Cleanable_MoltenItem(GlobalFuncs.get_turf(this));
            I.desc = new Txt("Looks like this was ").a(this).item().str(" some time ago.").ToString();
            GlobalFuncs.qdel(this);
            return(null);
        }
コード例 #2
0
        // Function from file: items.dm
        public override dynamic acid_act(int acidpwr = 0, double?toxpwr = null, double?acid_volume = null)
        {
            dynamic _default = null;

            double  meltingpwr        = 0;
            double  melting_threshold = 0;
            dynamic V = null;
            dynamic T = null;
            Obj_Effect_Decal_Cleanable_MoltenItem I = null;
            Obj_Item S            = null;
            dynamic  armour_value = null;

            _default = 1;

            if (this.unacidable)
            {
                return(_default);
            }
            meltingpwr        = (toxpwr ?? 0) * acidpwr;
            melting_threshold = 100;

            if (meltingpwr <= melting_threshold)
            {
                return(_default);
            }

            foreach (dynamic _a in Lang13.Enumerate(this.armor))
            {
                V = _a;


                if (Convert.ToDouble(this.armor[V]) > 0)
                {
                    _default--;
                    break;
                }
            }

            if (Lang13.Bool(_default) && Rand13.PercentChance(Num13.MinInt(((int)(meltingpwr / 10)), 90)))
            {
                T = GlobalFuncs.get_turf(this);

                if (Lang13.Bool(T))
                {
                    I         = new Obj_Effect_Decal_Cleanable_MoltenItem(T);
                    I.pixel_x = Rand13.Int(-16, 16);
                    I.pixel_y = Rand13.Int(-16, 16);
                    I.desc    = new Txt("Looks like this was ").a(this).item().str(" some time ago.").ToString();
                }

                if (this is Obj_Item_Weapon_Storage)
                {
                    S = this;
                    ((dynamic)S).do_quick_empty();
                }
                GlobalFuncs.qdel(this);
            }
            else
            {
                foreach (dynamic _b in Lang13.Enumerate(this.armor))
                {
                    armour_value = _b;

                    this.armor[armour_value] = Num13.MaxInt(Convert.ToInt32(this.armor[armour_value] - Num13.MinInt(acidpwr, ((int)(meltingpwr / 10)))), 0);
                }

                if (!(String13.FindIgnoreCase(this.desc, "it looks slightly melted...", 1, 0) != 0))
                {
                    this.desc += " it looks slightly melted...";
                }
            }
            return(_default);
        }