// Function from file: pyrotechnics.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            dynamic location           = null;
            EffectSystem_SparkSpread s = null;
            Mob_Living_Carbon        C = null;

            location = GlobalFuncs.get_turf(holder.my_atom);
            s        = new EffectSystem_SparkSpread();
            s.set_up(2, 1, location);
            s.start();

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_hearers_in_view((created_volume ?? 0) / 10, location), typeof(Mob_Living_Carbon)))
            {
                C = _a;


                if (C.flash_eyes())
                {
                    if (Map13.GetDistance(C, location) < 4)
                    {
                        C.Weaken(5);
                    }
                    else
                    {
                        C.Stun(5);
                    }
                }
            }
            return;
        }
        // Function from file: slime_extracts.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            dynamic           borks = null;
            Mob_Living_Carbon M     = null;
            int?    i      = null;
            dynamic chosen = null;
            dynamic B      = null;
            int?    j      = null;

            GlobalFuncs.feedback_add_details("slime_cores_used", "" + this.type);
            borks = Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers_Food_Drinks)) - typeof(Obj_Item_Weapon_ReagentContainers_Food_Drinks);
            GlobalFuncs.playsound(GlobalFuncs.get_turf(holder.my_atom), "sound/effects/phasein.ogg", 100, 1);

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(null, GlobalFuncs.get_turf(holder.my_atom)), typeof(Mob_Living_Carbon)))
            {
                M = _a;

                M.flash_eyes();
            }
            i = null;
            i = 1;

            while ((i ?? 0) <= Rand13.Int(1, 2) + 4)
            {
                chosen = Rand13.PickFromTable(borks);
                B      = Lang13.Call(chosen);

                if (Lang13.Bool(B))
                {
                    B.loc = GlobalFuncs.get_turf(holder.my_atom);

                    if (Rand13.PercentChance(50))
                    {
                        j = null;
                        j = 1;

                        while ((j ?? 0) <= Rand13.Int(1, 3))
                        {
                            Map13.Step(B, Convert.ToInt32(Rand13.Pick(new object [] { GlobalVars.NORTH, GlobalVars.SOUTH, GlobalVars.EAST, GlobalVars.WEST })));
                            j++;
                        }
                    }
                }
                i++;
            }
            return;
        }
Esempio n. 3
0
        // Function from file: spawnergrenade.dm
        public override void prime(  )
        {
            dynamic           T = null;
            Mob_Living_Carbon C = null;
            int?    i           = null;
            dynamic x           = null;
            int?    j           = null;

            this.update_mob();

            if (this.spawner_type != null && Lang13.Bool(this.deliveryamt))
            {
                T = GlobalFuncs.get_turf(this);
                GlobalFuncs.playsound(T, "sound/effects/phasein.ogg", 100, 1);

                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(null, T), typeof(Mob_Living_Carbon)))
                {
                    C = _a;

                    C.flash_eyes();
                }
                i = null;
                i = 1;

                while ((i ?? 0) <= (this.deliveryamt ?? 0))
                {
                    x     = Lang13.Call(this.spawner_type);
                    x.loc = T;

                    if (Rand13.PercentChance(50))
                    {
                        j = null;
                        j = 1;

                        while ((j ?? 0) <= Rand13.Int(1, 3))
                        {
                            Map13.Step(x, Convert.ToInt32(Rand13.Pick(new object [] { GlobalVars.NORTH, GlobalVars.SOUTH, GlobalVars.EAST, GlobalVars.WEST })));
                            j++;
                        }
                    }
                    i++;
                }
            }
            GlobalFuncs.qdel(this);
            return;
        }
Esempio n. 4
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            Mob_Living_Carbon C = null;

            this.visible_message("<span class='warning'>" + this + " emits a blinding red flash!</span>");

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(null, this), typeof(Mob_Living_Carbon)))
            {
                C = _a;


                if (!GlobalFuncs.iscultist(C) && !Lang13.Bool(C.null_rod_check()))
                {
                    C.WriteMsg("<span class='cultlarge'>You feel oily shadows cover your senses.</span>");
                    C.adjustEarDamage(0, 50);
                    C.flash_eyes(1, true);
                    C.adjust_blurriness(50);
                    C.adjust_blindness(20);
                    C.silent += 10;
                }
            }
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: anomaly_bluespace.dm
        public override void end(  )
        {
            dynamic T        = null;
            dynamic chosen   = null;
            ByTable possible = null;
            Obj_Item_Device_Radio_Beacon W = null;
            dynamic           FROM         = null;
            dynamic           TO           = null;
            ByTable           flashers     = null;
            Mob_Living_Carbon C            = null;
            double            y_distance   = 0;
            double            x_distance   = 0;
            Ent_Dynamic       A            = null;
            Tile        newloc             = null;
            Ent_Dynamic M          = null;
            Obj         blueeffect = null;


            if (this.newAnomaly.loc != null)
            {
                T = GlobalFuncs.safepick(GlobalFuncs.get_area_turfs(this.impact_area));

                if (Lang13.Bool(T))
                {
                    possible = new ByTable();

                    foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Device_Radio_Beacon)))
                    {
                        W = _a;

                        possible.Add(W);
                    }

                    if (possible.len > 0)
                    {
                        chosen = Rand13.PickFromTable(possible);
                    }

                    if (Lang13.Bool(chosen))
                    {
                        FROM = T;
                        TO   = GlobalFuncs.get_turf(chosen);
                        GlobalFuncs.playsound(TO, "sound/effects/phasein.ogg", 100, 1);
                        GlobalFuncs.priority_announce("Massive bluespace translocation detected.", "Anomaly Alert");
                        flashers = new ByTable();

                        foreach (dynamic _b in Lang13.Enumerate(Map13.FetchViewers(null, TO), typeof(Mob_Living_Carbon)))
                        {
                            C = _b;


                            if (C.flash_eyes())
                            {
                                flashers.Add(C);
                            }
                        }
                        y_distance = Convert.ToDouble(TO.y - FROM.y);
                        x_distance = Convert.ToDouble(TO.x - FROM.x);

                        foreach (dynamic _c in Lang13.Enumerate(GlobalFuncs.ultra_range(12, FROM), typeof(Ent_Dynamic)))
                        {
                            A = _c;


                            if (A is Obj_Item_Device_Radio_Beacon)
                            {
                                continue;
                            }

                            if (Lang13.Bool(A.anchored))
                            {
                                continue;
                            }
                            newloc = Map13.GetTile(((int)(A.x + x_distance)), ((int)(A.y + y_distance)), Convert.ToInt32(TO.z));

                            if (!A.Move(newloc) && newloc != null)
                            {
                                A.loc = newloc;
                            }
                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (A is Mob && !flashers.Contains(A))
                                {
                                    M = A;

                                    if (Lang13.Bool(((dynamic)M).client))
                                    {
                                        blueeffect                  = new Obj(this);
                                        blueeffect.screen_loc       = "WEST,SOUTH to EAST,NORTH";
                                        blueeffect.icon             = "icons/effects/effects.dmi";
                                        blueeffect.icon_state       = "shieldsparkles";
                                        blueeffect.layer            = 17;
                                        blueeffect.mouse_opacity    = 0;
                                        ((dynamic)M).client.screen += blueeffect;
                                        Task13.Sleep(20);
                                        ((dynamic)M).client.screen -= blueeffect;
                                        GlobalFuncs.qdel(blueeffect);
                                    }
                                }
                                return;
                            }));
                        }
                    }
                    GlobalFuncs.qdel(this.newAnomaly);
                }
            }
            return;
        }
Esempio n. 6
0
        // Function from file: recipes.dm
        public void chemical_mob_spawn(Reagents holder = null, int?amount_to_spawn = null, string reaction_name = null, string mob_faction = null)
        {
            mob_faction = mob_faction ?? "chemicalsummon";

            dynamic           T       = null;
            dynamic           SA      = null;
            dynamic           A       = null;
            dynamic           T2      = null;
            dynamic           my_area = null;
            string            message = null;
            dynamic           M       = null;
            Mob_Living_Carbon C       = null;
            int?    i      = null;
            dynamic chosen = null;
            dynamic C2     = null;
            int?    j      = null;


            if (holder != null && Lang13.Bool(holder.my_atom))
            {
                if (GlobalVars.chemical_mob_spawn_meancritters.len <= 0 || GlobalVars.chemical_mob_spawn_nicecritters.len <= 0)
                {
                    foreach (dynamic _b in Lang13.Enumerate(Lang13.GetTypes(typeof(Mob_Living_SimpleAnimal))))
                    {
                        T = _b;

                        SA = T;

                        dynamic _a = Lang13.Initial(SA, "gold_core_spawnable");                           // Was a switch-case, sorry for the mess.
                        if (_a == 1)
                        {
                            GlobalVars.chemical_mob_spawn_meancritters.Add(T);
                        }
                        else if (_a == 2)
                        {
                            GlobalVars.chemical_mob_spawn_nicecritters.Add(T);
                        }
                    }
                }
                A        = holder.my_atom;
                T2       = GlobalFuncs.get_turf(A);
                my_area  = GlobalFuncs.get_area(T2);
                message  = "A " + reaction_name + " reaction has occured in " + my_area.name + ". (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=" + T2.x + ";Y=" + T2.y + ";Z=" + T2.z + "'>JMP</A>)";
                message += new Txt(" (<A HREF='?_src_=vars;Vars=").Ref(A).str("'>VV</A>)").ToString();
                M        = GlobalFuncs.get(A, typeof(Mob));

                if (Lang13.Bool(M))
                {
                    message += new Txt(" - Carried By: ").item(GlobalFuncs.key_name_admin(M)).str("(<A HREF='?_src_=holder;adminmoreinfo=").Ref(M).str("'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(M).str("'>FLW</A>)").ToString();
                }
                else
                {
                    message += " - Last Fingerprint: " + (Lang13.Bool(A.fingerprintslast) ? A.fingerprintslast : "N/A");
                }
                GlobalFuncs.message_admins(message);
                GlobalFuncs.playsound(GlobalFuncs.get_turf(holder.my_atom), "sound/effects/phasein.ogg", 100, 1);

                foreach (dynamic _c in Lang13.Enumerate(Map13.FetchViewers(null, GlobalFuncs.get_turf(holder.my_atom)), typeof(Mob_Living_Carbon)))
                {
                    C = _c;

                    C.flash_eyes();
                }
                i = null;
                i = 1;

                while ((i ?? 0) <= (amount_to_spawn ?? 0))
                {
                    chosen = null;

                    if (reaction_name == "Friendly Gold Slime")
                    {
                        chosen = Rand13.PickFromTable(GlobalVars.chemical_mob_spawn_nicecritters);
                    }
                    else
                    {
                        chosen = Rand13.PickFromTable(GlobalVars.chemical_mob_spawn_meancritters);
                    }
                    C2          = Lang13.Call(chosen);
                    C2.faction |= mob_faction;
                    C2.loc      = GlobalFuncs.get_turf(holder.my_atom);

                    if (Rand13.PercentChance(50))
                    {
                        j = null;
                        j = 1;

                        while ((j ?? 0) <= Rand13.Int(1, 3))
                        {
                            Map13.Step(C2, Convert.ToInt32(Rand13.Pick(new object [] { GlobalVars.NORTH, GlobalVars.SOUTH, GlobalVars.EAST, GlobalVars.WEST })));
                            j++;
                        }
                    }
                    i++;
                }
            }
            return;
        }
        // Function from file: slime_extracts.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            ByTable           blocked = null;
            dynamic           borks   = null;
            Mob_Living_Carbon C       = null;
            int?    i      = null;
            dynamic chosen = null;
            dynamic B      = null;
            int?    j      = null;

            GlobalFuncs.feedback_add_details("slime_cores_used", "" + this.type);
            blocked = new ByTable(new object [] {
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Store_Bread),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Breadslice),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Store_Cake),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Cakeslice),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Store),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pie),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Kebab),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizza),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizzaslice),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Salad),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Meat),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Meat_Slab),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Soup),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Grown),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Grown_Mushroom)
            });
            blocked.Or(Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable)));
            borks = Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks)) - blocked;
            GlobalFuncs.playsound(GlobalFuncs.get_turf(holder.my_atom), "sound/effects/phasein.ogg", 100, 1);

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(null, GlobalFuncs.get_turf(holder.my_atom)), typeof(Mob_Living_Carbon)))
            {
                C = _a;

                C.flash_eyes();
            }
            i = null;
            i = 1;

            while ((i ?? 0) <= Rand13.Int(1, 2) + 4)
            {
                chosen = Rand13.PickFromTable(borks);
                B      = Lang13.Call(chosen);

                if (Lang13.Bool(B))
                {
                    B.loc = GlobalFuncs.get_turf(holder.my_atom);

                    if (Rand13.PercentChance(50))
                    {
                        j = null;
                        j = 1;

                        while ((j ?? 0) <= Rand13.Int(1, 3))
                        {
                            Map13.Step(B, Convert.ToInt32(Rand13.Pick(new object [] { GlobalVars.NORTH, GlobalVars.SOUTH, GlobalVars.EAST, GlobalVars.WEST })));
                            j++;
                        }
                    }
                }
                i++;
            }
            return;
        }