Exemple #1
0
        // Function from file: backpack.dm
        public override bool handle_item_insertion(dynamic W = null, bool?prevent_warning = null, dynamic user = null)
        {
            prevent_warning = prevent_warning ?? false;

            string          safety  = null;
            Obj_Singularity singulo = null;


            if (W is Obj_Item_Weapon_Storage_Backpack_Holding && !W.crit_fail)
            {
                safety = Interface13.Alert(user, "You feel this may not be the best idea.", "Put in " + this.name + "?", "Proceed", "Abort");

                if (safety == "Abort" || !(Map13.GetDistance(this, user) <= 1) || !(this != null) || !Lang13.Bool(W) || ((Mob)user).incapacitated())
                {
                    return(false);
                }
                this.investigate_log("has become a singularity. Caused by " + user.key, "singulo");
                user.WriteMsg("<span class='danger'>The Bluespace interfaces of the two devices catastrophically malfunction!</span>");
                GlobalFuncs.qdel(W);
                singulo        = new Obj_Singularity(GlobalFuncs.get_turf(this));
                singulo.energy = 300;
                GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(user) + " detonated a bag of holding");
                GlobalFuncs.log_game("" + GlobalFuncs.key_name(user) + " detonated a bag of holding");
                GlobalFuncs.qdel(this);
                singulo.process();
                return(false);
            }
            base.handle_item_insertion((object)(W), prevent_warning, (object)(user));
            return(false);
        }
Exemple #2
0
        // Function from file: singularity.dm
        public virtual void eat(  )
        {
            ByTable         L    = null;
            Ent_Static      X    = null;
            int?            dist = null;
            Obj_Singularity S    = null;

            L = ((this.grav_pull ?? 0) > 8 ? GlobalFuncs.ultra_range(this.grav_pull, this, true) : Map13.FetchInRangeExcludeThis(this, this.grav_pull));

            foreach (dynamic _a in Lang13.Enumerate(L, typeof(Ent_Static)))
            {
                X = _a;

                dist = Map13.GetDistance(X, this);
                S    = this;

                if ((dist ?? 0) > (this.consume_range ?? 0))
                {
                    X.singularity_pull(S, this.current_size);
                }
                else if ((dist ?? 0) <= (this.consume_range ?? 0))
                {
                    this.consume(X);
                }
            }
            return;
        }
        // Function from file: syndicatebeacon.dm
        public void Activate(dynamic user = null)
        {
            Obj_Singularity singulo = null;


            if (Convert.ToDouble(this.surplus()) < 1500)
            {
                if (Lang13.Bool(user))
                {
                    user.WriteMsg("<span class='notice'>The connected wire doesn't have enough current.</span>");
                }
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Singularity)))
            {
                singulo = _a;


                if (singulo.z == this.z)
                {
                    singulo.target = this;
                }
            }
            this.icon_state = "" + this.icontype + "1";
            this.active     = true;
            GlobalVars.machines.Or(this);

            if (Lang13.Bool(user))
            {
                user.WriteMsg("<span class='notice'>You activate the beacon.</span>");
            }
            return;
        }
Exemple #4
0
        // Function from file: turf.dm
        public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
        {
            Obj O = null;


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


                    if (O.level != 1)
                    {
                        continue;
                    }

                    if (O.invisibility == 101)
                    {
                        O.singularity_act();
                    }
                }
            }
            this.ChangeTurf(this.baseturf);
            return(2);
        }
Exemple #5
0
 // Function from file: window.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 9)
     {
         this.spawnfragments();
     }
     return;
 }
Exemple #6
0
 // Function from file: lattice.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 7)
     {
         this.Deconstruct();
     }
     return;
 }
Exemple #7
0
        // Function from file: backpack.dm
        public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
        {
            int dist = 0;

            dist = Num13.MaxInt((current_size ?? 0) - 2, 1);
            GlobalFuncs.explosion(this.loc, dist, dist * 2, dist * 4);
            return(0);
        }
Exemple #8
0
 // Function from file: objs.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if (!Lang13.Bool(this.anchored) || (current_size ?? 0) >= 9)
     {
         Map13.StepTowardsSimple(this, S);
     }
     return;
 }
        // Function from file: cult_structures.dm
        public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
        {
            dynamic target = null;

            target = GlobalFuncs.get_edge_target_turf(this, Map13.GetDistance(this, S));
            S.throw_at(target, 5, 1);
            return(0);
        }
Exemple #10
0
 // Function from file: meter.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 9)
     {
         new Obj_Item_PipeMeter(this.loc);
         GlobalFuncs.qdel(this);
     }
     return;
 }
Exemple #11
0
        // Function from file: objs.dm
        public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
        {
            this.ex_act(1);

            if (this != null && this.gc_destroyed == null)
            {
                GlobalFuncs.qdel(this);
            }
            return(2);
        }
Exemple #12
0
        // Function from file: singularity.dm
        public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
        {
            double gain = 0;
            int    dist = 0;

            gain = (this.energy ?? 0) / 2;
            dist = Num13.MaxInt((this.current_size ?? 0) - 2, 1);
            GlobalFuncs.explosion(this.loc, dist, dist * 2, dist * 4);
            GlobalFuncs.qdel(this);
            return(gain);
        }
Exemple #13
0
 // Function from file: spacevine.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 9)
     {
         if (Rand13.PercentChance(50))
         {
             this.ChangeTurf(this.baseturf);
         }
     }
     return;
 }
Exemple #14
0
 // Function from file: walls_reinforced.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 9)
     {
         if (Rand13.PercentChance(30))
         {
             this.dismantle_wall();
         }
     }
     return;
 }
Exemple #15
0
 // Function from file: items.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 7)
     {
         this.throw_at_fast(S, 14, 3, null, false);
     }
     else
     {
         base.singularity_pull(S, current_size);
     }
     return;
 }
 // Function from file: reflector.dm
 public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
 {
     if (this.admin)
     {
         return(0);
     }
     else
     {
         base.singularity_act(current_size, S);
     }
     return(0);
 }
 // Function from file: plating.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     if ((current_size ?? 0) >= 9)
     {
         if (Lang13.Bool(this.builtin_tile))
         {
             if (Rand13.PercentChance(30))
             {
                 this.builtin_tile.loc = this;
                 this.make_plating();
             }
         }
         else if (Rand13.PercentChance(30))
         {
             this.ReplaceWithLattice();
         }
     }
     return;
 }
Exemple #18
0
        // Function from file: supermatter.dm
        public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
        {
            int     gain = 0;
            dynamic M    = null;

            gain = 100;
            this.investigate_log("Supermatter shard consumed by singularity.", "singulo");
            GlobalFuncs.message_admins("Singularity has consumed a supermatter shard and can now become stage six.");
            this.visible_message("<span class='userdanger'>" + this + " is consumed by the singularity!</span>");

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.mob_list))
            {
                M = _a;

                M.WriteMsg("sound/effects/supermatter.ogg");
                M.WriteMsg("<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>");
            }
            GlobalFuncs.qdel(this);
            return(gain);
        }
        // Function from file: syndicatebeacon.dm
        public void Deactivate(dynamic user = null)
        {
            Obj_Singularity singulo = null;


            foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Singularity)))
            {
                singulo = _a;


                if (singulo.target == this)
                {
                    singulo.target = null;
                }
            }
            this.icon_state = "" + this.icontype + "0";
            this.active     = false;

            if (Lang13.Bool(user))
            {
                user.WriteMsg("<span class='notice'>You deactivate the beacon.</span>");
            }
            return;
        }
Exemple #20
0
 // Function from file: overlays.dm
 public override double singularity_act(int?current_size = null, Obj_Singularity S = null)
 {
     return(0);
 }
Exemple #21
0
 // Function from file: overlays.dm
 public override void singularity_pull(Obj_Singularity S = null, int?current_size = null)
 {
     return;
 }
        // Function from file: camera_bug.dm
        public string camera_report(  )
        {
            string          dat   = null;
            ByTable         seen  = null;
            ByTable         names = null;
            Obj_Singularity S     = null;
            int             stage = 0;
            Obj_Mecha       M     = null;
            Mob_Living      M2    = null;

            dat = "";

            if (Lang13.Bool(this.current) && ((Obj_Machinery_Camera)this.current).can_use())
            {
                seen  = ((Obj_Machinery_Camera)this.current).can_see();
                names = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(seen, typeof(Obj_Singularity)))
                {
                    S = _a;


                    if (names.Contains(S.name))
                    {
                        names[S.name]++;
                        dat += "" + S.name + " (" + names[S.name] + ")";
                    }
                    else
                    {
                        names[S.name] = 1;
                        dat          += "" + S.name;
                    }
                    stage = Num13.Floor((S.current_size ?? 0) / 2) + 1;
                    dat  += " (Stage " + stage + ")";
                    dat  += new Txt(" <a href='?").Ref(this).str(";track=").Ref(S).str("'>[Track]</a><br>").ToString();
                }

                foreach (dynamic _b in Lang13.Enumerate(seen, typeof(Obj_Mecha)))
                {
                    M = _b;


                    if (names.Contains(M.name))
                    {
                        names[M.name]++;
                        dat += "" + M.name + " (" + names[M.name] + ")";
                    }
                    else
                    {
                        names[M.name] = 1;
                        dat          += "" + M.name;
                    }
                    dat += new Txt(" <a href='?").Ref(this).str(";track=").Ref(M).str("'>[Track]</a><br>").ToString();
                }

                foreach (dynamic _c in Lang13.Enumerate(seen, typeof(Mob_Living)))
                {
                    M2 = _c;


                    if (names.Contains(M2.name))
                    {
                        names[M2.name]++;
                        dat += "" + M2.name + " (" + names[M2.name] + ")";
                    }
                    else
                    {
                        names[M2.name] = 1;
                        dat           += "" + M2.name;
                    }

                    if (M2.buckled != null && !Lang13.Bool(M2.lying))
                    {
                        dat += " (Sitting)";
                    }

                    if (Lang13.Bool(M2.lying))
                    {
                        dat += " (Laying down)";
                    }
                    dat += new Txt(" <a href='?").Ref(this).str(";track=").Ref(M2).str("'>[Track]</a><br>").ToString();
                }

                if (Lang13.Length(dat) == 0)
                {
                    dat += "No motion detected.";
                }
                return(dat);
            }
            else
            {
                return("Camera Offline<br>");
            }
        }
Exemple #23
0
        // Function from file: field_generator.dm
        public void cleanup(  )
        {
            Obj_Machinery_Field_Containment F  = null;
            Obj_Machinery_Field_Generator   FG = null;
            bool            temp = false;
            Obj_Singularity O    = null;

            this.clean_up = true;

            foreach (dynamic _a in Lang13.Enumerate(this.fields, typeof(Obj_Machinery_Field_Containment)))
            {
                F = _a;


                if (F == null)
                {
                    continue;
                }
                GlobalFuncs.qdel(F);
            }
            this.fields = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(this.connected_gens, typeof(Obj_Machinery_Field_Generator)))
            {
                FG = _b;


                if (FG == null)
                {
                    continue;
                }
                FG.connected_gens.Remove(this);

                if (!FG.clean_up)
                {
                    FG.cleanup();
                }
                this.connected_gens.Remove(FG);
            }
            this.connected_gens = new ByTable();
            this.clean_up       = false;
            this.update_icon();
            Task13.Schedule(1, (Task13.Closure)(() => {
                temp = true;

                foreach (dynamic _c in Lang13.Enumerate(typeof(Game13), typeof(Obj_Singularity)))
                {
                    O = _c;


                    if (O.last_warning != 0 && temp)
                    {
                        if (Game13.time - O.last_warning > 50)
                        {
                            temp = false;
                            GlobalFuncs.message_admins("A singulo exists and a containment field has failed.");
                            this.investigate_log("has <font color='red'>failed</font> whilst a singulo exists.", "singulo");
                        }
                    }
                    O.last_warning = Game13.time;
                }
                return;
            }));
            return;
        }