Ejemplo n.º 1
0
        // Function from file: medical_tools.dm
        public bool load_syringe(dynamic S = null)
        {
            Obj_Structure      D  = null;
            Obj_Machinery_Door D2 = null;


            if (this.syringes.len < this.max_syringes)
            {
                if (Map13.GetDistance(this, S) >= 2)
                {
                    this.occupant_message("The syringe is too far away.");
                    return(false);
                }

                foreach (dynamic _a in Lang13.Enumerate(S.loc, typeof(Obj_Structure)))
                {
                    D = _a;


                    if (!D.CanPass(S, this.loc))
                    {
                        this.occupant_message("Unable to load syringe.");
                        return(false);
                    }
                }

                foreach (dynamic _b in Lang13.Enumerate(S.loc, typeof(Obj_Machinery_Door)))
                {
                    D2 = _b;


                    if (!D2.CanPass(S, this.loc))
                    {
                        this.occupant_message("Unable to load syringe.");
                        return(false);
                    }
                }
                ((Reagents)S.reagents).trans_to(this, S.reagents.total_volume);
                ((Ent_Dynamic)S).forceMove(this);
                this.syringes.Add(S);
                this.occupant_message("Syringe loaded.");
                this.update_equip_info();
                return(true);
            }
            this.occupant_message("The " + this + " syringe chamber is full.");
            return(false);
        }
Ejemplo n.º 2
0
        // Function from file: floor.dm
        public override bool is_shielded(  )
        {
            Obj_Structure A = null;


            foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Structure)))
            {
                A = _a;


                if (A.level == 3)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
        // Function from file: weather_types.dm
        public override void storm_act(Mob_Living L = null)
        {
            dynamic       F = null;
            Obj_Structure O = null;

            F = GlobalFuncs.get_turf(L);

            foreach (dynamic _a in Lang13.Enumerate(F.contents, typeof(Obj_Structure)))
            {
                O = _a;


                if ((O.level ?? 0) > Convert.ToDouble(F.level) && !(O is Obj_Structure_Window))
                {
                    return;
                }
            }
            L.adjustFireLoss(3);
            return;
        }
Ejemplo n.º 4
0
        // Function from file: walls.dm
        public void dismantle_wall(bool?devastated = null, bool?explode = null)
        {
            devastated = devastated ?? false;
            explode    = explode ?? false;

            Obj_Structure newgirder = null;
            Obj           O         = null;
            Obj           P         = null;


            if (devastated == true)
            {
                this.devastate_wall();
            }
            else
            {
                GlobalFuncs.playsound(this, "sound/items/welder.ogg", 100, 1);
                newgirder = this.break_wall();
                this.transfer_fingerprints_to(newgirder);
            }

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


                if (O is Obj_Structure_Sign_Poster)
                {
                    P = O;
                    ((Obj_Structure_Sign_Poster)P).roll_and_drop(this);
                }
                else
                {
                    O.loc = this;
                }
            }
            this.ChangeTurf(typeof(Tile_Simulated_Floor_Plating));
            return;
        }
        public void Wrap(  )
        {
            ByTable    choices         = null;
            Mob_Living L               = null;
            Obj        O               = null;
            Obj_Effect_Spider_Cocoon C = null;
            bool          large_cocoon = false;
            Obj_Item      I            = null;
            Obj_Structure S            = null;
            Obj_Machinery M            = null;
            Mob_Living    L2           = null;


            if (this.stat == 2)
            {
                return;
            }

            if (!Lang13.Bool(this.cocoon_target))
            {
                choices = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInView(this, 1), typeof(Mob_Living)))
                {
                    L = _a;


                    if (L == this)
                    {
                        continue;
                    }

                    if (this.Adjacent(L))
                    {
                        choices.Add(L);
                    }
                }

                foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj)))
                {
                    O = _b;


                    if (this.Adjacent(O))
                    {
                        choices.Add(O);
                    }
                }
                this.cocoon_target = Interface13.Input(this, "What do you wish to cocoon?", null, null, null | choices, InputType.Any);
            }

            if (Lang13.Bool(this.cocoon_target) && this.busy != 4)
            {
                this.busy = 4;
                this.visible_message(new Txt("<span class='notice'>").the(this).item().str(" begins to secrete a sticky substance around ").the(this.cocoon_target).item().str(".</span>").ToString());
                this.stop_automated_movement = true;
                Map13.Walk(this, 0, 0);

                if (GlobalFuncs.do_after(this, 50, null, this))
                {
                    if (this.busy == 4)
                    {
                        if (Lang13.Bool(this.cocoon_target) && this.cocoon_target.loc is Tile && Map13.GetDistance(this, this.cocoon_target) <= 1)
                        {
                            C            = new Obj_Effect_Spider_Cocoon(this.cocoon_target.loc);
                            large_cocoon = false;
                            C.pixel_x    = Convert.ToInt32(this.cocoon_target.pixel_x);
                            C.pixel_y    = Convert.ToInt32(this.cocoon_target.pixel_y);

                            foreach (dynamic _c in Lang13.Enumerate(C.loc, typeof(Obj_Item)))
                            {
                                I = _c;

                                I.loc = C;
                            }

                            foreach (dynamic _d in Lang13.Enumerate(C.loc, typeof(Obj_Structure)))
                            {
                                S = _d;


                                if (!Lang13.Bool(S.anchored))
                                {
                                    S.loc        = C;
                                    large_cocoon = true;
                                }
                            }

                            foreach (dynamic _e in Lang13.Enumerate(C.loc, typeof(Obj_Machinery)))
                            {
                                M = _e;


                                if (!Lang13.Bool(M.anchored))
                                {
                                    M.loc        = C;
                                    large_cocoon = true;
                                }
                            }

                            foreach (dynamic _f in Lang13.Enumerate(C.loc, typeof(Mob_Living)))
                            {
                                L2 = _f;


                                if (L2 is Mob_Living_SimpleAnimal_Hostile_Poison_GiantSpider)
                                {
                                    continue;
                                }
                                large_cocoon = true;
                                L2.loc       = C;
                                C.pixel_x    = L2.pixel_x;
                                C.pixel_y    = L2.pixel_y;
                                this.fed++;
                                this.visible_message(new Txt("<span class='danger'>").the(this).item().str(" sticks a proboscis into ").the(L2).item().str(" and sucks a viscous substance out.</span>").ToString());
                                break;
                            }

                            if (large_cocoon)
                            {
                                C.icon_state = Rand13.Pick(new object [] { "cocoon_large1", "cocoon_large2", "cocoon_large3" });
                            }
                        }
                    }
                }
                this.cocoon_target           = null;
                this.busy                    = 0;
                this.stop_automated_movement = false;
            }
            return;
        }
Ejemplo n.º 6
0
        // Function from file: computer_funcs.dm
        public void load_program(dynamic A = null, bool?force = null, bool?delay = null)
        {
            force = force ?? false;
            delay = delay ?? false;

            Obj_Effect_HolodeckEffect HE    = null;
            dynamic                   item  = null;
            Obj_Machinery             M     = null;
            Obj_Structure             S     = null;
            ByTable                   added = null;
            Obj_Effect_HolodeckEffect HE2   = null;
            dynamic                   x     = null;
            Obj_Machinery             M2    = null;
            Obj_Structure             S2    = null;


            if (this.stat != 0)
            {
                A     = this.offline_program;
                force = true;
                delay = false;
            }

            if (this.program == A)
            {
                return;
            }

            if (Game13.time < this.last_change + (this.damaged ? 500 : 0) + 25 && !(force == true))
            {
                if (delay == true)
                {
                    Task13.Sleep(25);
                }
                else
                {
                    if (Game13.time < this.last_change + 15)
                    {
                        return;
                    }

                    if (Map13.GetDistance(Task13.User, this) <= 3)
                    {
                        Task13.User.WriteMsg("<span class='warning'>ERROR. Recalibrating projection apparatus.</span>");
                        return;
                    }
                }
            }
            this.last_change = Game13.time;
            this.active      = A != this.offline_program;
            this.use_power   = (this.active == true ?1:0) + 1;

            foreach (dynamic _a in Lang13.Enumerate(this.effects, typeof(Obj_Effect_HolodeckEffect)))
            {
                HE = _a;

                HE.deactivate(this);
            }

            foreach (dynamic _b in Lang13.Enumerate(this.spawned))
            {
                item = _b;

                this.derez(item, null, force);
            }
            this.program = A;
            this.spawned = ((Zone)A).copy_contents_to(this.linked, true, !Lang13.Bool(this.emagged));

            foreach (dynamic _c in Lang13.Enumerate(this.spawned, typeof(Obj_Machinery)))
            {
                M = _c;

                M.flags |= 128;
            }

            foreach (dynamic _d in Lang13.Enumerate(this.spawned, typeof(Obj_Structure)))
            {
                S = _d;

                S.flags |= 128;
            }
            this.effects = new ByTable();
            Task13.Schedule(30, (Task13.Closure)(() => {
                added = new ByTable();

                foreach (dynamic _e in Lang13.Enumerate(this.spawned, typeof(Obj_Effect_HolodeckEffect)))
                {
                    HE2 = _e;

                    this.effects.Add(HE2);
                    this.spawned -= HE2;
                    x             = HE2.activate(this);

                    if (x is Ent_Static || x is ByTable)
                    {
                        this.spawned += x;
                        added.Add(x);
                    }
                }

                foreach (dynamic _f in Lang13.Enumerate(added, typeof(Obj_Machinery)))
                {
                    M2 = _f;

                    M2.flags |= 128;
                }

                foreach (dynamic _g in Lang13.Enumerate(added, typeof(Obj_Structure)))
                {
                    S2 = _g;

                    S2.flags |= 128;
                }
                return;
            }));
            return;
        }