示例#1
0
        // Function from file: step_triggers.dm
        public override bool Trigger(Ent_Dynamic A = null)
        {
            Tile dest = null;
            EffectSystem_SparkSpread s  = null;
            EffectSystem_SparkSpread s2 = null;
            EffectSystem_SmokeSpread s3 = null;
            EffectSystem_SmokeSpread s4 = null;

            dest = Map13.GetTile(this.locationx, this.locationy, this.z);
            A.Move(dest);

            if (this.entersparks)
            {
                s = new EffectSystem_SparkSpread();
                s.set_up(4, 1, this);
                s.start();
            }

            if (this.exitsparks)
            {
                s2 = new EffectSystem_SparkSpread();
                s2.set_up(4, 1, dest);
                s2.start();
            }

            if (this.entersmoke)
            {
                s3 = new EffectSystem_SmokeSpread();
                s3.set_up(4, 1, this, 0);
                s3.start();
            }

            if (this.exitsmoke)
            {
                s4 = new EffectSystem_SmokeSpread();
                s4.set_up(4, 1, dest, 0);
                s4.start();
            }
            this.uses--;

            if (this.uses == 0)
            {
                GlobalFuncs.qdel(this);
            }
            return(false);
        }
        // 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;
        }