예제 #1
0
        // Function from file: uplink_item.dm
        public override dynamic spawn_item(dynamic loc = null, Obj_Item_Device_Uplink U = null)
        {
            ByTable uplink_items         = null;
            double  crate_value          = 0;
            Obj_Structure_Closet_Crate C = null;
            dynamic category             = null;
            dynamic item = null;
            dynamic I    = null;

            uplink_items = GlobalFuncs.get_uplink_items();
            crate_value  = 50;
            C            = new Obj_Structure_Closet_Crate(loc);

            while (crate_value != 0)
            {
                category = Rand13.PickFromTable(uplink_items);
                item     = Rand13.PickFromTable(uplink_items[category]);
                I        = uplink_items[category][item];

                if (!Lang13.Bool(I.surplus) || Rand13.PercentChance(((int)(100 - Convert.ToDouble(I.surplus)))))
                {
                    continue;
                }

                if (crate_value < Convert.ToDouble(I.cost))
                {
                    continue;
                }
                crate_value -= Convert.ToDouble(I.cost);
                Lang13.Call(I.item, C);
                U.purchase_log += new Txt("<big>").icon(I.item).str("</big>").ToString();
            }
            return(C);
        }
예제 #2
0
        // Function from file: mimic.dm
        public override bool death(bool?gibbed = null, bool?toast = null)
        {
            Obj_Structure_Closet_Crate C = null;
            Obj O = null;

            C = new Obj_Structure_Closet_Crate(GlobalFuncs.get_turf(this));

            foreach (dynamic _a in Lang13.Enumerate(this, typeof(Obj)))
            {
                O = _a;

                O.loc = C;
            }
            base.death(gibbed, toast);
            return(false);
        }