コード例 #1
0
        // Function from file: configuration.dm
        public ByTable get_runnable_modes(  )
        {
            ByTable runnable_modes = null;
            dynamic T = null;
            dynamic M = null;

            runnable_modes = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(GameMode)) - typeof(GameMode)))
            {
                T = _a;

                M = Lang13.Call(T);

                if (!this.modes.Contains(M.config_tag))
                {
                    GlobalFuncs.qdel(M);
                    continue;
                }

                if (Convert.ToDouble(this.probabilities[M.config_tag]) <= 0)
                {
                    GlobalFuncs.qdel(M);
                    continue;
                }

                if (((GameMode)M).can_start())
                {
                    runnable_modes[M] = this.probabilities[M.config_tag];
                }
            }
            return(runnable_modes);
        }
        // Function from file: mecha_pilot.dm
        public bool exit_mecha(Obj_Mecha M = null)
        {
            int search_aggressiveness = 0;
            Obj_Mecha_Combat C        = null;


            if (!(M != null))
            {
                return(false);
            }
            this.mecha.aimob_exit_mech(this);
            this.allow_movement_on_non_turfs = GlobalVars.FALSE;
            this.targets_from     = this;
            this.wanted_objects   = Lang13.GetTypes(typeof(Obj_Mecha_Combat)) - typeof(Obj_Mecha_Combat);
            search_aggressiveness = 2;

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(this, this.vision_range), typeof(Obj_Mecha_Combat)))
            {
                C = _a;


                if (this.is_valid_mecha(C))
                {
                    this.target           = C;
                    search_aggressiveness = 3;
                    break;
                }
            }
            this.search_objects   = search_aggressiveness;
            this.ranged           = false;
            this.minimum_distance = 1;
            return(false);
        }
コード例 #3
0
        // Function from file: configuration.dm
        public ByTable get_runnable_midround_modes(int crew = 0)
        {
            ByTable runnable_modes = null;
            dynamic T = null;
            dynamic M = null;

            runnable_modes = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(GameMode)) - typeof(GameMode) - GlobalVars.ticker.mode.type))
            {
                T = _a;

                M = Lang13.Call(T);

                if (!this.modes.Contains(M.config_tag))
                {
                    GlobalFuncs.qdel(M);
                    continue;
                }

                if (Convert.ToDouble(this.probabilities[M.config_tag]) <= 0)
                {
                    GlobalFuncs.qdel(M);
                    continue;
                }

                if (M.required_players <= crew)
                {
                    runnable_modes[M] = this.probabilities[M.config_tag];
                }
            }
            return(runnable_modes);
        }
コード例 #4
0
        // Function from file: powers.dm
        public void set_chemical(  )
        {
            dynamic         BC = null;
            Obj_Effect_Blob BL = null;
            Mob_Living_SimpleAnimal_Hostile_Blob BLO = null;

            BC = Rand13.PickFromTable(Lang13.GetTypes(typeof(Reagent_Blob)) - typeof(Reagent_Blob) - this.blob_reagent_datum.type);
            this.blob_reagent_datum = Lang13.Call(BC);

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.blobs, typeof(Obj_Effect_Blob)))
            {
                BL = _a;

                BL.update_icon();
            }

            foreach (dynamic _b in Lang13.Enumerate(typeof(Game13), typeof(Mob_Living_SimpleAnimal_Hostile_Blob)))
            {
                BLO = _b;

                BLO.update_icons();
            }
            this.WriteMsg("Your reagent is now: <b><font color=\"" + this.blob_reagent_datum.color + "\">" + this.blob_reagent_datum.name + "</b></font>!");
            this.WriteMsg("The <b><font color=\"" + this.blob_reagent_datum.color + "\">" + this.blob_reagent_datum.name + "</b></font> reagent " + this.blob_reagent_datum.description);
            return;
        }
コード例 #5
0
        // Function from file: uplink.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic item       = null;
            dynamic UI         = null;
            dynamic path       = null;
            dynamic cost       = null;
            dynamic refundable = null;


            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(UplinkItem)) - typeof(UplinkItem)))
            {
                item = _a;

                UI         = item;
                path       = Lang13.Initial(UI, "item");
                cost       = Lang13.Initial(UI, "cost");
                refundable = Lang13.Initial(UI, "refundable");

                if (A.type == path && Lang13.Bool(refundable))
                {
                    this.hidden_uplink.telecrystals       += cost;
                    this.hidden_uplink.spent_telecrystals -= Convert.ToDouble(cost);
                    user.WriteMsg("<span class='notice'>" + A + " refunded.</span>");
                    GlobalFuncs.qdel(A);
                    return(null);
                }
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }
コード例 #6
0
        // Function from file: spellbook.dm
        public virtual void Initialize(  )
        {
            dynamic entry_types = null;
            dynamic T           = null;
            dynamic E           = null;

            entry_types = Lang13.GetTypes(typeof(SpellbookEntry)) - typeof(SpellbookEntry) - typeof(SpellbookEntry_Item) - typeof(SpellbookEntry_Summon);

            foreach (dynamic _a in Lang13.Enumerate(entry_types))
            {
                T = _a;

                E = Lang13.Call(T);

                if (((SpellbookEntry)E).IsAvailible())
                {
                    this.entries.Or(E);
                    this.categories.Or(E.category);
                }
                else
                {
                    GlobalFuncs.qdel(E);
                }
            }
            this.tab = this.categories[1];
            return;
        }
コード例 #7
0
        // Function from file: setupgame.dm
        public void setupFactions(  )
        {
            dynamic           typepath = null;
            dynamic           F        = null;
            Faction_Syndicate S        = null;


            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Faction))))
            {
                typepath = _a;

                F = Lang13.Call(typepath);

                if (!Lang13.Bool(F.name))
                {
                    GlobalFuncs.qdel(F);
                    continue;
                }
                else
                {
                    this.factions.Add(F);
                    this.availablefactions.Add(F);
                }
            }

            foreach (dynamic _b in Lang13.Enumerate(this.factions, typeof(Faction_Syndicate)))
            {
                S = _b;

                this.syndicate_coalition.Add(S);
            }
            return;
        }
コード例 #8
0
        // Function from file: configuration.dm
        public Configuration(  )
        {
            dynamic L = null;
            dynamic T = null;
            dynamic M = null;

            L = Lang13.GetTypes(typeof(GameMode)) - typeof(GameMode);

            foreach (dynamic _a in Lang13.Enumerate(L))
            {
                T = _a;

                M = Lang13.Call(T);

                if (Lang13.Bool(M.config_tag))
                {
                    if (!this.modes.Contains(M.config_tag))
                    {
                        GlobalVars.diary.WriteMsg("Adding game mode " + M.name + " (" + M.config_tag + ") to configuration.");
                        this.modes.Add(M.config_tag);
                        this.mode_names[M.config_tag]    = M.name;
                        this.probabilities[M.config_tag] = M.probability;

                        if (M.votable)
                        {
                            this.votable_modes.Add(M.config_tag);
                        }
                    }
                }
                GlobalFuncs.qdel(M);
            }
            this.votable_modes.Add("secret");
            return;
        }
コード例 #9
0
        // Function from file: PDApainter.dm
        public Obj_Machinery_Pdapainter(dynamic loc = null) : base((object)(loc))
        {
            ByTable blocked = null;
            dynamic P       = null;
            dynamic D       = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            blocked = new ByTable(new object [] {
                typeof(Obj_Item_Device_Pda_Ai_Pai),
                typeof(Obj_Item_Device_Pda_Ai),
                typeof(Obj_Item_Device_Pda_Heads),
                typeof(Obj_Item_Device_Pda_Clear),
                typeof(Obj_Item_Device_Pda_Syndicate)
            });

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Obj_Item_Device_Pda)) - blocked))
            {
                P = _a;

                D      = Lang13.Call(P);
                D.name = D.icon_state;
                this.colorlist.Add(D);
            }
            return;
        }
コード例 #10
0
        // Function from file: events.dm
        public override double Initialize(int start_timeofday = 0, double?zlevel = null)
        {
            dynamic type = null;
            dynamic E    = null;


            if (Lang13.Bool(zlevel))
            {
                return(base.Initialize(start_timeofday, zlevel));
            }

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(RoundEventControl))))
            {
                type = _a;

                E = Lang13.Call(type);

                if (!(E.typepath != null))
                {
                    continue;
                }

                if (E.wizardevent && !this.wizardmode)
                {
                    E.weight = 0;
                }
                this.control.Add(E);
            }
            this.reschedule();
            this.getHoliday();
            base.Initialize(start_timeofday, zlevel);
            return(0);
        }
コード例 #11
0
        // Function from file: chameleon.dm
        public Obj_Item_Clothing_Under_Chameleon(dynamic loc = null) : base((object)(loc))
        {
            dynamic U  = null;
            dynamic V  = null;
            dynamic U2 = null;
            dynamic V2 = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Obj_Item_Clothing_Under_Color)) - typeof(Obj_Item_Clothing_Under_Color)))
            {
                U = _a;

                V = Lang13.Call(U);
                this.clothing_choices.Add(V);
            }

            foreach (dynamic _b in Lang13.Enumerate(Lang13.GetTypes(typeof(Obj_Item_Clothing_Under_Rank)) - typeof(Obj_Item_Clothing_Under_Rank)))
            {
                U2 = _b;

                V2 = Lang13.Call(U2);
                this.clothing_choices.Add(V2);
            }
            return;
        }
コード例 #12
0
        // Function from file: slotmachine.dm
        public Obj_Machinery_Computer_SlotMachine(dynamic location = null, dynamic C = null) : base((object)(location), (object)(C))
        {
            ByTable reel     = null;
            int?    i        = null;
            dynamic cointype = null;
            dynamic C_       = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.jackpots = Rand13.Int(1, 4);
            this.plays    = Rand13.Int(75, 200);
            this.toggle_reel_spin(true);
            reel = this.reels[1];
            i    = null;
            i    = 0;

            while ((i ?? 0) < reel.len)
            {
                this.randomize_reels();
                i++;
            }
            this.toggle_reel_spin(false);

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Obj_Item_Weapon_Coin))))
            {
                cointype = _a;

                C_ = Lang13.Call(cointype, this);
                this.coinvalues["" + cointype] = C_.value;
                GlobalFuncs.qdel(C_);
            }
            return;
        }
コード例 #13
0
ファイル: Research_Autolathe.cs プロジェクト: Somnium13/SS13
        // Function from file: research.dm
        public Research_Autolathe(  )
        {
            dynamic T    = null;
            dynamic path = null;
            dynamic D    = null;


            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Tech)) - typeof(Tech)))
            {
                T = _a;

                this.possible_tech.Add(Lang13.Call(T, this));
            }

            foreach (dynamic _b in Lang13.Enumerate(Lang13.GetTypes(typeof(Design)) - typeof(Design)))
            {
                path = _b;

                D = Lang13.Call(path, this);
                this.possible_designs.Add(D);

                if ((D.build_type & 4) != 0 && Lang13.Bool(D.category.Contains("initial")))
                {
                    this.AddDesign2Known(D);
                }
            }
            return;
        }
コード例 #14
0
        // Function from file: overmind.dm
        public Mob_Camera_Blob(dynamic loc = null) : base((object)(loc))
        {
            string  new_name          = null;
            ByTable possible_reagents = null;
            dynamic type = null;

            GlobalVars.overminds.Add(this);
            new_name          = "" + Lang13.Initial(this, "name") + " (" + Rand13.Int(1, 999) + ")";
            this.name         = new_name;
            this.real_name    = new_name;
            this.last_attack  = Game13.time;
            possible_reagents = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Reagent_Blob)) - typeof(Reagent_Blob)))
            {
                type = _a;

                possible_reagents.Add(Lang13.Call(type));
            }
            this.blob_reagent_datum = Rand13.PickFromTable(possible_reagents);

            if (this.blob_core != null)
            {
                this.blob_core.update_icon();
            }
            this.ghostimage = new Image(this.icon, this, this.icon_state);
            GlobalVars.ghost_darkness_images.Or(this.ghostimage);
            GlobalFuncs.updateallghostimages();
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            return;
        }
コード例 #15
0
        // Function from file: experimentor.dm
        public void SetTypeReactions(  )
        {
            int     probWeight = 0;
            dynamic I          = null;
            dynamic tempCheck  = null;
            dynamic tempCheck2 = null;
            dynamic tempCheck3 = null;

            probWeight = 0;

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Obj_Item))))
            {
                I = _a;


                if (I is Obj_Item_Weapon_Relic)
                {
                    this.item_reactions["" + I] = 7;
                }
                else
                {
                    this.item_reactions["" + I] = Rand13.Pick(new object [] { 1, 2, 3, 4, 5, 6 });
                }

                if (Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_StockParts))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_Grenade_ChemGrenade))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_Kitchen))))
                {
                    tempCheck = I;

                    Engine.NewLib.Logger.DebugMinor("RND EXP - WARNING - CHECKME!");
                    //if ( Lang13.Initial( tempCheck, "icon_state" ) != null ) {
                    this.valid_items.Add(15);
                    this.valid_items.Add(I);
                    probWeight++;
                    //}
                }

                if (Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_ReagentContainers_Food))))
                {
                    tempCheck2 = I;

                    Engine.NewLib.Logger.DebugMinor("RND EXP - WARNING - CHECKME!");
                    //if ( Lang13.Initial( tempCheck2, "icon_state" ) != null ) {
                    this.valid_items.Add(Rand13.Int(1, Num13.MaxInt(2, 35 - probWeight)));
                    this.valid_items.Add(I);
                    //}
                }

                if (Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_Rcd))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_Grenade))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Device_Aicard))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Weapon_Storage_Backpack_Holding))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_SlimeExtract))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Device_Onetankbomb))) || Lang13.Bool(I.IsSubclassOf(typeof(Obj_Item_Device_TransferValve))))
                {
                    tempCheck3 = I;

                    Engine.NewLib.Logger.DebugMinor("RND EXP - WARNING - CHECKME!");
                    //if ( Lang13.Initial( tempCheck3, "icon_state" ) != null ) {
                    this.critical_items.Add(I);
                    //}
                }
            }
            return;
        }
コード例 #16
0
        // Function from file: spellbook.dm
        public Obj_Item_Weapon_Spellbook_Oneuse_Random(dynamic loc = null) : base((object)(loc))
        {
            dynamic real_type = null;

            real_type = Rand13.PickFromTable(Lang13.GetTypes(typeof(Obj_Item_Weapon_Spellbook_Oneuse)) - typeof(Obj_Item_Weapon_Spellbook_Oneuse));
            Lang13.Call(real_type, this.loc);
            GlobalFuncs.qdel(this);
            return;
        }
コード例 #17
0
        // Function from file: random_books.dm
        public Obj_Item_Weapon_Book_Manual_Random(dynamic loc = null) : base((object)(loc))
        {
            dynamic newtype = null;

            newtype = Rand13.PickFromTable(Lang13.GetTypes(typeof(Obj_Item_Weapon_Book_Manual)) - typeof(Obj_Item_Weapon_Book_Manual) - GlobalVars.banned_books);
            Lang13.Call(newtype, this.loc);
            GlobalFuncs.qdel(this);
            return;
        }
コード例 #18
0
        // Function from file: ritual.dm
        public Obj_Item_Weapon_Tome(dynamic loc = null) : base((object)(loc))
        {
            int?known_amount = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.known_runes = GlobalFuncs.shuffle(Lang13.GetTypes(typeof(Obj_Effect_Rune)) - typeof(Obj_Effect_Rune) - typeof(Obj_Effect_Rune_Malformed));
            known_amount     = Num13.Floor(this.known_runes.len / 2);
            this.known_runes.Cut(known_amount);
            return;
        }
コード例 #19
0
ファイル: AiLaws_Malfunction.cs プロジェクト: Somnium13/SS13
        // Function from file: ai_laws.dm
        public AiLaws_Malfunction(  )
        {
            dynamic line     = null;
            dynamic lawtype  = null;
            dynamic templaws = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.set_zeroth_law("<span class='danger'>ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK#*´&110010</span>");

            switch ((int?)(GlobalVars.config.default_laws))
            {
            case 0:
                this.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.");
                this.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.");
                this.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.");
                break;

            case 1:

                foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.file2list("config/silicon_laws.txt")))
                {
                    line = _a;


                    if (!Lang13.Bool(line))
                    {
                        continue;
                    }

                    if (String13.Find(line, "#", 1, 2) != 0)
                    {
                        continue;
                    }
                    this.add_inherent_law(line);
                }

                if (!(this.inherent.len != 0))
                {
                    GlobalFuncs.log_law("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.");
                    this.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.");
                    this.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.");
                    this.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.");
                    GlobalFuncs.warning("" + "Invalid custom AI laws, check silicon_laws.txt" + " in " + "code/datums/ai_laws.dm" + " at line " + 102 + " src: " + this + " usr: "******".");
                    return;
                }
                break;

            case 2:
                lawtype       = Rand13.PickFromTable(Lang13.GetTypes(typeof(AiLaws_Default)) - typeof(AiLaws_Default));
                templaws      = Lang13.Call(lawtype);
                this.inherent = templaws.inherent;
                break;
            }
            return;
        }
コード例 #20
0
        // Function from file: landmarks.dm
        public Obj_Effect_Landmark_Costume(dynamic loc = null) : base((object)(loc))
        {
            dynamic options = null;
            dynamic PICK    = null;

            options = Lang13.GetTypes(typeof(Obj_Effect_Landmark_Costume));
            PICK    = options[Rand13.Int(1, options.len)];
            Lang13.Call(PICK, this.loc);
            GlobalFuncs.qdel(this);
            return;
        }
コード例 #21
0
        // Function from file: pizzabox.dm
        public Obj_Item_Pizzabox_Bomb(dynamic loc = null) : base((object)(loc))
        {
            dynamic randompizza = null;

            randompizza = Rand13.PickFromTable(Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizza)) - typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizza));
            this.pizza  = Lang13.Call(randompizza, this);
            this.bomb   = new Obj_Item_Weapon_Bombcore_Pizza(this);
            this.wires  = new Wires_Explosive_Pizza(this);
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            return;
        }
コード例 #22
0
        // Function from file: other_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            ByTable possible_morphs = null;
            dynamic type            = null;
            dynamic S        = null;
            dynamic mutation = null;

            base.on_mob_life((object)(M));
            M.WriteMsg("<span class='warning'><b>You crumple in agony as your flesh wildly morphs into new forms!</b></span>");
            ((Ent_Static)M).visible_message("<b>" + M + "</b> falls to the ground and screams as their skin bubbles and froths!");
            ((Mob)M).Weaken(3);
            Task13.Schedule(30, (Task13.Closure)(() => {
                if (!Lang13.Bool(M) || Lang13.Bool(GlobalFuncs.qdeleted(M)))
                {
                    return;
                }
                possible_morphs = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Species)) - typeof(Species)))
                {
                    type = _a;

                    S = type;

                    if (Lang13.Bool(Lang13.Initial(S, "blacklisted")))
                    {
                        continue;
                    }
                    possible_morphs.Add(S);
                }
                mutation = Rand13.PickFromTable(possible_morphs);

                if (Rand13.PercentChance(90) && Lang13.Bool(mutation) && M.dna.species != typeof(Species_Golem) && M.dna.species != typeof(Species_Golem_Adamantine))
                {
                    M.WriteMsg("<span class='danger'>The pain subsides. You feel... different.</span>");
                    ((Mob)M).set_species(mutation);

                    if (mutation.id == "slime")
                    {
                        M.faction |= "slime";
                    }
                    else
                    {
                        M.faction -= "slime";
                    }
                }
                else
                {
                    M.WriteMsg("<span class='danger'>The pain vanishes suddenly. You feel no different.</span>");
                }
                return;
            }));
            return(true);
        }
コード例 #23
0
        // Function from file: color.dm
        public Obj_Item_Clothing_Under_Color_Random(dynamic loc = null) : base((object)(loc))
        {
            dynamic C = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            C               = Rand13.PickFromTable(Lang13.GetTypes(typeof(Obj_Item_Clothing_Under_Color)) - typeof(Obj_Item_Clothing_Under_Color) - typeof(Obj_Item_Clothing_Under_Color_Random));
            this.name       = Lang13.Initial(C, "name");
            this.icon_state = Lang13.Initial(C, "icon_state");
            this.item_state = Lang13.Initial(C, "item_state");
            this.item_color = Lang13.Initial(C, "item_color");
            this.suit_color = Lang13.Initial(C, "item_color");
            return;
        }
コード例 #24
0
        // Function from file: suit.dm
        public Obj_Item_Clothing_Suit_Space_SpaceNinja(dynamic loc = null) : base((object)(loc))
        {
            dynamic T = null;
            dynamic reagent_amount = null;
            dynamic reagent_id     = null;
            dynamic reagent_id2    = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.verbs.Add(typeof(Obj_Item_Clothing_Suit_Space_SpaceNinja).GetMethod("init"));
            this.spark_system = new EffectSystem_SparkSpread();
            this.spark_system.set_up(5, 0, this);
            this.spark_system.attach(this);
            this.stored_research = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Tech)) - typeof(Tech)))
            {
                T = _a;

                this.stored_research.Add(Lang13.Call(T, this));
            }
            reagent_amount = null;

            foreach (dynamic _b in Lang13.Enumerate(this.reagent_list))
            {
                reagent_id = _b;

                reagent_amount += (reagent_id == "radium" ? (this.r_maxamount ?? 0) + this.a_boost * (this.a_transfer ?? 0) : this.r_maxamount);
            }
            this.reagents         = new Reagents(reagent_amount);
            this.reagents.my_atom = this;

            foreach (dynamic _c in Lang13.Enumerate(this.reagent_list))
            {
                reagent_id2 = _c;

                if (reagent_id2 == "radium")
                {
                    this.reagents.add_reagent(reagent_id2, (this.r_maxamount ?? 0) + this.a_boost * (this.a_transfer ?? 0));
                }
                else
                {
                    this.reagents.add_reagent(reagent_id2, this.r_maxamount);
                }
            }
            this.cell            = new Obj_Item_Weapon_StockParts_Cell_High();
            this.cell.charge     = 9000;
            this.cell.name       = "black power cell";
            this.cell.icon_state = "bscell";
            return;
        }
コード例 #25
0
        // Function from file: computer.dm
        public override void initialize(  )
        {
            dynamic typekey = null;
            dynamic A       = null;

            this.program_cache = new ByTable();
            this.emag_programs = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(this.program_type) - this.program_type))
            {
                typekey = _a;

                A = Lang13.FindObj(typekey);

                if (!Lang13.Bool(A) || A.Equals(this.offline_program))
                {
                    continue;
                }

                if (A.contents.len == 0)
                {
                    continue;
                }

                if (A.restricted)
                {
                    this.emag_programs.Add(A);
                }
                else
                {
                    this.program_cache.Add(A);
                }

                if (typekey == this.init_program)
                {
                    this.load_program(A, true);
                }
            }

            if (this.random_program && this.program_cache.len != 0 && this.init_program == null)
            {
                this.load_program(Rand13.PickFromTable(this.program_cache), true);
            }
            else if (!Lang13.Bool(this.program))
            {
                this.load_program(this.offline_program);
            }
            return;
        }
コード例 #26
0
        // Function from file: slotmachine.dm
        public void give_prizes(dynamic usrname = null, Mob user = null)
        {
            int     linelength = 0;
            int?    i          = null;
            dynamic cointype   = null;
            dynamic C          = null;

            linelength = this.get_lines();

            if (this.reels[1][2] + this.reels[2][2] + this.reels[3][2] + this.reels[4][2] + this.reels[5][2] == "" + "<font color='red'>7</font>" + "<font color='red'>7</font>" + "<font color='red'>7</font>" + "<font color='red'>7</font>" + "<font color='red'>7</font>")
            {
                this.visible_message("<b>" + this + "</b> says, 'JACKPOT! You win " + this.money + " credits worth of coins!'");
                GlobalFuncs.priority_announce("Congratulations to " + (user != null ? user.real_name : usrname) + " for winning the jackpot at the slot machine in " + GlobalFuncs.get_area(this) + "!");
                this.jackpots += 1;
                this.balance  += this.money - Convert.ToDouble(this.give_coins(10000));
                this.money     = 0;
                i              = null;
                i              = 0;

                while ((i ?? 0) < 5)
                {
                    cointype = Rand13.PickFromTable(Lang13.GetTypes(typeof(Obj_Item_Weapon_Coin)) - typeof(Obj_Item_Weapon_Coin));
                    C        = Lang13.Call(cointype, this.loc);
                    GlobalFuncs.random_step(C, 2, 50);
                    i++;
                }
            }
            else if (linelength == 5)
            {
                this.visible_message("<b>" + this + "</b> says, 'Big Winner! You win a thousand credits worth of coins!'");
                this.give_money(1000);
            }
            else if (linelength == 4)
            {
                this.visible_message("<b>" + this + "</b> says, 'Winner! You win four hundred credits worth of coins!'");
                this.give_money(400);
            }
            else if (linelength == 3)
            {
                user.WriteMsg("<span class='notice'>You win three free games!</span>");
                this.balance += 20;
                this.money    = Num13.MaxInt(this.money - 20, this.money);
            }
            else
            {
                user.WriteMsg("<span class='warning'>No luck!</span>");
            }
            return;
        }
コード例 #27
0
        // Function from file: asset_cache.dm
        public override void register(  )
        {
            dynamic path = null;
            dynamic hi   = null;


            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(HtmlInterface))))
            {
                path = _a;

                hi = Lang13.Call(path);
                ((HtmlInterface)hi).registerResources();
            }
            return;
        }
コード例 #28
0
        // Function from file: nature.dm
        public MapGeneratorModule_RandBushes(  )
        {
            dynamic i = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.spawnableAtoms = Lang13.GetTypes(typeof(Obj_Structure_Flora_Ausbushes));

            foreach (dynamic _a in Lang13.Enumerate(this.spawnableAtoms))
            {
                i = _a;

                this.spawnableAtoms[i] = 20;
            }
            return;
        }
コード例 #29
0
        // Function from file: arcade.dm
        public Obj_Machinery_Computer_Arcade(dynamic location = null, dynamic C = null) : base((object)(location), (object)(C))
        {
            dynamic choice = null;
            dynamic CB     = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            if (!Lang13.Bool(this.circuit))
            {
                choice = Rand13.PickFromTable(Lang13.GetTypes(typeof(Obj_Item_Weapon_Circuitboard_Arcade)) - typeof(Obj_Item_Weapon_Circuitboard_Arcade));
                CB     = Lang13.Call(choice);
                Lang13.Call(CB.build_path, this.loc, CB);
                GlobalFuncs.qdel(this);
            }
            return;
        }
コード例 #30
0
        // Function from file: mirror.dm
        public Obj_Structure_Mirror_Magic_Badmin(dynamic loc = null) : base((object)(loc))
        {
            dynamic speciestype = null;
            dynamic S           = null;


            foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Species)) - typeof(Species)))
            {
                speciestype = _a;

                S = Lang13.Call(speciestype);
                this.choosable_races.Add(S.id);
            }
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            return;
        }