Beispiel #1
0
        // Function from file: special.dm
        public void create_portal(Obj_Item_Projectile_Beam_Wormhole W = null)
        {
            Obj_Effect_Portal P = null;

            P           = new Obj_Effect_Portal(GlobalFuncs.get_turf(W), null, this);
            P.precision = 0;

            if (W.name == "bluespace beam")
            {
                GlobalFuncs.qdel(this.blue);
                this.blue = P;
            }
            else
            {
                GlobalFuncs.qdel(this.orange);
                P.icon_state = "portal1";
                this.orange  = P;
            }

            if (this.orange != null && this.blue != null)
            {
                this.blue.target   = GlobalFuncs.get_turf(this.orange);
                this.orange.target = GlobalFuncs.get_turf(this.blue);
            }
            return;
        }
Beispiel #2
0
        // Function from file: special.dm
        public void portal_destroyed(dynamic P = null)
        {
            if (P.icon_state == "portal")
            {
                this.blue = null;

                if (this.orange != null)
                {
                    this.orange.target = null;
                }
            }
            else
            {
                this.orange = null;

                if (this.blue != null)
                {
                    this.blue.target = null;
                }
            }
            return;
        }
Beispiel #3
0
        // Function from file: teleportation.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic current_location = null;
            ByTable L = null;
            Obj_Machinery_Computer_Teleporter com = null;
            ByTable           turfs = null;
            dynamic           T     = null;
            dynamic           t1    = null;
            dynamic           T2    = null;
            Obj_Effect_Portal P     = null;

            current_location = GlobalFuncs.get_turf(user);

            if (!Lang13.Bool(current_location) || Convert.ToInt32(current_location.z) == 2 || Convert.ToDouble(current_location.z) >= 7 || !(user.loc is Tile))
            {
                user.WriteMsg(new Txt("<span class='notice'>").The(this).item().str(" is malfunctioning.</span>").ToString());
                return(null);
            }
            L = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Teleporter)))
            {
                com = _a;


                if (Lang13.Bool(com.target))
                {
                    if (Lang13.Bool(com.power_station) && Lang13.Bool(com.power_station.teleporter_hub) && Lang13.Bool(com.power_station.engaged))
                    {
                        L["" + GlobalFuncs.get_area(com.target) + " (Active)"] = com.target;
                    }
                    else
                    {
                        L["" + GlobalFuncs.get_area(com.target) + " (Inactive)"] = com.target;
                    }
                }
            }
            turfs = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.ultra_range(10, null, true)))
            {
                T = _b;


                if (Convert.ToDouble(T.x) > Game13.map_size_x - 8 || Convert.ToDouble(T.x) < 8)
                {
                    continue;
                }

                if (Convert.ToDouble(T.y) > Game13.map_size_y - 8 || Convert.ToDouble(T.y) < 8)
                {
                    continue;
                }
                turfs.Add(T);
            }

            if (turfs.len != 0)
            {
                L["None (Dangerous)"] = Rand13.PickFromTable(turfs);
            }
            t1 = Interface13.Input(user, "Please select a teleporter to lock in on.", "Hand Teleporter", null, L, InputType.Any);

            if (((Mob)user).get_active_hand() != this || ((Mob)user).incapacitated())
            {
                return(null);
            }

            if (this.active_portals >= 3)
            {
                user.show_message(new Txt("<span class='notice'>").The(this).item().str(" is recharging!</span>").ToString());
                return(null);
            }
            T2 = L[t1];
            user.show_message("<span class='notice'>Locked In.</span>", 2);
            P = new Obj_Effect_Portal(GlobalFuncs.get_turf(this), T2, this);
            GlobalFuncs.try_move_adjacent(P);
            this.active_portals++;
            this.add_fingerprint(user);
            return(null);
        }
        public override bool f_action(dynamic target = null)
        {
            ByTable           theareas    = null;
            dynamic           thearea     = null;
            ByTable           L           = null;
            dynamic           pos         = null;
            dynamic           T           = null;
            bool              clear       = false;
            Obj               O           = null;
            dynamic           target_turf = null;
            Obj_Effect_Portal P           = null;
            dynamic           T2          = null;


            if (!this.action_checks(target) || this.loc.z == 2)
            {
                return(false);
            }
            theareas = GlobalFuncs.get_areas_in_range(100, this.chassis);

            if (!(theareas.len != 0))
            {
                return(false);
            }
            thearea = Rand13.PickFromTable(theareas);
            L       = new ByTable();
            pos     = GlobalFuncs.get_turf(this);

            foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type)))
            {
                T = _b;


                if (!T.density && pos.z == T.z)
                {
                    clear = true;

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


                        if (O.density)
                        {
                            clear = false;
                            break;
                        }
                    }

                    if (clear)
                    {
                        L.Add(T);
                    }
                }
            }

            if (!(L.len != 0))
            {
                return(false);
            }
            target_turf = Rand13.PickFromTable(L);

            if (!Lang13.Bool(target_turf))
            {
                return(false);
            }
            P            = new Obj_Effect_Portal(GlobalFuncs.get_turf(target));
            P.target     = target_turf;
            P.creator    = null;
            P.icon       = "icons/obj/objects.dmi";
            P.icon_state = "anom";
            P.name       = "wormhole";
            T2           = GlobalFuncs.get_turf(target);
            GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(this.chassis.occupant, ((dynamic)this.chassis.occupant).client)).str("(<A HREF='?_src_=holder;adminmoreinfo=").Ref(this.chassis.occupant).str("'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(this.chassis.occupant).str("'>FLW</A>) used a Wormhole Generator in (").item(T2.x).str(",").item(T2.y).str(",").item(T2.z).str(" - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(T2.x).str(";Y=").item(T2.y).str(";Z=").item(T2.z).str("'>JMP</a>)").ToString());
            GlobalFuncs.log_game("" + GlobalFuncs.key_name(this.chassis.occupant) + " used a Wormhole Generator in (" + T2.x + "," + T2.y + "," + T2.z + ")");
            Task13.Source = null;
            Task13.Schedule(Rand13.Int(150, 300), (Task13.Closure)(() => {
                GlobalFuncs.qdel(P);
                return;
            }));
            return(true);
        }