Exemple #1
0
        // Function from file: portable_turret.dm
        public void popUp(  )
        {
            if (this.disabled)
            {
                return;
            }

            if (this.raising || this.raised)
            {
                return;
            }

            if ((this.stat & 1) != 0)
            {
                return;
            }
            this.invisibility = 0;
            this.raising      = true;

            if (this.cover != null)
            {
                Icon13.Flick("popup", this.cover);
            }
            Task13.Sleep(10);
            this.raising = false;

            if (this.cover != null)
            {
                this.cover.icon_state = "openTurretCover";
            }
            this.raised = true;
            this.layer  = 4;
            return;
        }
Exemple #2
0
        // Function from file: portable_turret.dm
        public void popDown(  )
        {
            if (this.disabled)
            {
                return;
            }

            if (this.raising || !this.raised)
            {
                return;
            }

            if ((this.stat & 1) != 0)
            {
                return;
            }
            this.layer   = 3;
            this.raising = true;

            if (this.cover != null)
            {
                Icon13.Flick("popdown", this.cover);
            }
            Task13.Sleep(10);
            this.raising = false;

            if (this.cover != null)
            {
                this.cover.icon_state = "turretCover";
            }
            this.raised       = false;
            this.invisibility = 2;
            this.icon_state   = "" + this.base_icon_state + this.off_state;
            return;
        }
Exemple #3
0
 // Function from file: construct_spells.dm
 public override void jaunt_disappear(Dynamic_Overlay animation = null, Mob_Living target = null)
 {
     animation.icon_state = "phase_shift";
     animation.dir        = target.dir;
     Icon13.Flick("phase_shift", animation);
     return;
 }
Exemple #4
0
        // Function from file: pad.dm
        public void PadToLoc(Ent_Static place = null)
        {
            Obj_Effect_TeleportAbductor F = null;
            EffectSystem_SparkSpread    S = null;
            Mob_Living target             = null;

            F = new Obj_Effect_TeleportAbductor(place);
            S = new EffectSystem_SparkSpread();
            S.set_up(10, 0, place);
            S.start();
            Task13.Sleep(80);
            GlobalFuncs.qdel(F);
            Icon13.Flick("alien-pad", this);

            foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Mob_Living)))
            {
                target = _a;

                target.forceMove(place);
                Task13.Schedule(0, (Task13.Closure)(() => {
                    GlobalFuncs.anim(target.loc, target, "icons/mob/mob.dmi", null, "uncloak", null, target.dir);
                    return;
                }));
            }
            return;
        }
Exemple #5
0
        // Function from file: poddoor.dm
        public override bool close(int?surpress_send = null)
        {
            surpress_send = surpress_send ?? 0;


            if (this.operating)
            {
                return(false);
            }

            if (this.density)
            {
                return(false);
            }

            if (!Lang13.Bool(surpress_send) && (this.stat & 2) != 0)
            {
                return(false);
            }
            this.operating = true;
            Icon13.Flick("closing", this);
            this.icon_state = "closed";
            this.SetOpacity(1);
            Task13.Sleep(5);
            this.density = true;
            Task13.Sleep(5);
            this.air_update_turf(true);
            this.update_freelook_sight();
            Task13.Sleep(5);
            this.crush();
            Task13.Sleep(5);
            this.operating = false;
            return(false);
        }
Exemple #6
0
        // Function from file: tgstation.dme
        public void place_poster(dynamic P = null, dynamic user = null)
        {
            int stuff_on_wall           = 0;
            Obj O                       = null;
            Obj_Structure_Sign_Poster D = null;
            Ent_Static temp_loc         = null;


            if (!(P.resulting_poster != null))
            {
                return;
            }
            stuff_on_wall = 0;

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


                if (O is Obj_Structure_Sign_Poster)
                {
                    user.WriteMsg("<span class='warning'>The wall is far too cluttered to place a poster!</span>");
                    return;
                }
                stuff_on_wall++;

                if (stuff_on_wall == 3)
                {
                    user.WriteMsg("<span class='warning'>The wall is far too cluttered to place a poster!</span>");
                    return;
                }
            }
            user.WriteMsg("<span class='notice'>You start placing the poster on the wall...</span>");
            D        = P.resulting_poster;
            temp_loc = user.loc;
            Icon13.Flick("poster_being_set", D);
            D.loc      = this;
            D.official = Lang13.BoolNullable(P.official);
            GlobalFuncs.qdel(P);
            GlobalFuncs.playsound(D.loc, "sound/items/poster_being_created.ogg", 100, 1);

            if (GlobalFuncs.do_after(user, D.placespeed, null, this))
            {
                if (!(D != null))
                {
                    return;
                }

                if (this is Tile_Simulated_Wall && Lang13.Bool(user) && user.loc == temp_loc)
                {
                    user.WriteMsg("<span class='notice'>You place the poster!</span>");
                }
                else
                {
                    D.roll_and_drop(temp_loc, D.official);
                }
                return;
            }
            return;
        }
Exemple #7
0
        // Function from file: factory.dm
        public override bool Be_Pulsed(  )
        {
            bool _default = false;

            Mob_Living_SimpleAnimal_Hostile_Blob_Blobspore BS = null;

            _default = base.Be_Pulsed();

            if (this.spores.len >= this.max_spores)
            {
                return(_default);
            }

            if (this.spore_delay > Game13.time)
            {
                return(_default);
            }
            Icon13.Flick("blob_factory_glow", this);
            this.spore_delay = Game13.time + 100;
            BS = new Mob_Living_SimpleAnimal_Hostile_Blob_Blobspore(this.loc, this);

            if (this.overmind != null)
            {
                BS.overmind = this.overmind;
                BS.update_icons();
                this.overmind.blob_mobs.Add(BS);
            }
            return(_default);
        }
        // Function from file: simple_animal.dm
        public override dynamic gib(dynamic animation = null)
        {
            animation = animation ?? 0;

            dynamic path = null;
            int?    i    = null;


            if (Lang13.Bool(this.icon_gib))
            {
                Icon13.Flick(this.icon_gib, this);
            }

            if (this.butcher_results != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(this.butcher_results))
                {
                    path = _a;

                    i = null;
                    i = 1;

                    while ((i ?? 0) <= Convert.ToDouble(this.butcher_results[path]))
                    {
                        Lang13.Call(path, this.loc);
                        i++;
                    }
                }
            }
            base.gib((object)(animation));
            return(null);
        }
        // Function from file: mineral_doors.dm
        public void Open(  )
        {
            this.isSwitchingStates = true;
            GlobalFuncs.playsound(this.loc, this.openSound, 100, 1);
            Icon13.Flick("" + this.mineralType + "opening", this);
            Task13.Sleep(10);
            this.density = false;
            this.opacity = false;
            this.state   = true;
            this.air_update_turf(true);
            this.update_icon();
            this.isSwitchingStates = false;

            if (this.close_delay != -1)
            {
                Task13.Schedule(this.close_delay, (Task13.Closure)(() => {
                    if (!this.isSwitchingStates && this.state)
                    {
                        this.Close();
                    }
                    return;
                }));
            }
            return;
        }
        // Function from file: igniter.dm
        public bool ignite(  )
        {
            Ent_Static location = null;


            if (!Lang13.Bool(this.powered()))
            {
                return(false);
            }

            if (this.disable || this.last_spark != 0 && Game13.time < this.last_spark + 50)
            {
                return(false);
            }
            Icon13.Flick("" + this.base_state + "-spark", this);
            this.spark_system.start();
            this.last_spark = Game13.time;
            this.f_use_power(1000);
            location = this.loc;

            if (location is Tile)
            {
                ((dynamic)location).hotspot_expose(1000, 500, 1);
            }
            return(true);
        }
        // Function from file: tgstation.dme
        public void Dispense(Type item = null, int?cost = null)
        {
            cost = cost ?? 1;


            if (this.experiment != null && (this.experiment.points ?? 0) >= (cost ?? 0))
            {
                this.experiment.points -= cost ?? 0;
                this.say("Incoming supply!");

                if (this.pad != null)
                {
                    Icon13.Flick("alien-pad", this.pad);
                    Lang13.Call(item, this.pad.loc);
                }
                else
                {
                    Lang13.Call(item, this.loc);
                }
            }
            else
            {
                this.say("Insufficent data!");
            }
            return;
        }
Exemple #12
0
        // Function from file: disposal-structures.dm
        public void expel(Obj_Structure_Disposalholder H = null)
        {
            dynamic     T  = null;
            Ent_Dynamic AM = null;

            T = GlobalFuncs.get_turf(this);
            Icon13.Flick("outlet-open", this);

            if (this.start_eject + 30 < Game13.time)
            {
                this.start_eject = Game13.time;
                GlobalFuncs.playsound(this, "sound/machines/warning-buzzer.ogg", 50, 0, 0);
                Task13.Sleep(20);
                GlobalFuncs.playsound(this, "sound/machines/hiss.ogg", 50, 0, 0);
            }
            else
            {
                Task13.Sleep(20);
            }

            if (H != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(H, typeof(Ent_Dynamic)))
                {
                    AM = _a;

                    AM.forceMove(T);
                    AM.pipe_eject(this.dir);
                    AM.throw_at_fast(this.target, this.eject_range, 1);
                }
                H.vent_gas(T);
                GlobalFuncs.qdel(H);
            }
            return;
        }
Exemple #13
0
        // Function from file: ores_coins.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic    coinflip = null;
            Ent_Static oldloc   = null;


            if (this.cooldown < Game13.time - 15)
            {
                if (this.string_attached == true)
                {
                    user.WriteMsg("<span class='warning'>The coin won't flip very well with something attached!</span>");
                    return(null);
                }
                coinflip      = Rand13.PickFromTable(this.sideslist);
                this.cooldown = Game13.time;
                Icon13.Flick("coin_" + this.cmineral + "_flip", this);
                this.icon_state = "coin_" + this.cmineral + "_" + coinflip;
                GlobalFuncs.playsound(user.loc, "sound/items/coinflip.ogg", 50, 1);
                oldloc = this.loc;
                Task13.Sleep(15);

                if (this.loc == oldloc && Lang13.Bool(user) && !((Mob)user).incapacitated())
                {
                    ((Ent_Static)user).visible_message("" + user + " has flipped " + this + ". It lands on " + coinflip + ".", "<span class='notice'>You flip " + this + ". It lands on " + coinflip + ".</span>", "<span class='italics'>You hear the clattering of loose change.</span>");
                }
            }
            return(null);
        }
Exemple #14
0
        // Function from file: mass_driver.dm
        public void drive(dynamic amount = null)
        {
            int         O_limit = 0;
            dynamic     target  = null;
            Ent_Dynamic O       = null;


            if ((this.stat & 3) != 0)
            {
                return;
            }
            this.f_use_power(500);
            target = GlobalFuncs.get_edge_target_turf(this, this.dir);

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


                if (!Lang13.Bool(O.anchored) || O is Obj_Mecha)
                {
                    O_limit++;

                    if (O_limit >= 20)
                    {
                        this.audible_message("<span class='notice'>" + this + " lets out a screech, it doesn't seem to be able to handle the load.</span>");
                        break;
                    }
                    this.f_use_power(500);
                    O.throw_at_fast(target, this.drive_range * (this.power ?? 0), this.power);
                }
            }
            Icon13.Flick("mass_driver1", this);
            return;
        }
        // Function from file: mineral_doors.dm
        public virtual void Close(  )
        {
            dynamic    T = null;
            Mob_Living L = null;

            T = GlobalFuncs.get_turf(this);

            foreach (dynamic _a in Lang13.Enumerate(T, typeof(Mob_Living)))
            {
                L = _a;

                return;
            }
            this.isSwitchingStates = true;
            GlobalFuncs.playsound(this.loc, this.closeSound, 100, 1);
            Icon13.Flick("" + this.mineralType + "closing", this);
            Task13.Sleep(10);
            this.density = true;
            this.opacity = true;
            this.state   = false;
            this.air_update_turf(true);
            this.update_icon();
            this.isSwitchingStates = false;
            return;
        }
Exemple #16
0
        // Function from file: door.dm
        public virtual void do_animate(string animation = null)
        {
            switch ((string)(animation))
            {
            case "opening":

                if (this.p_open)
                {
                    Icon13.Flick("o_doorc0", this);
                }
                else
                {
                    Icon13.Flick("doorc0", this);
                }
                break;

            case "closing":

                if (this.p_open)
                {
                    Icon13.Flick("o_doorc1", this);
                }
                else
                {
                    Icon13.Flick("doorc1", this);
                }
                break;

            case "deny":
                Icon13.Flick("door_deny", this);
                break;
            }
            return;
        }
Exemple #17
0
 // Function from file: pad.dm
 public void Retrieve(dynamic target = null)
 {
     Icon13.Flick("alien-pad", this);
     Task13.Schedule(0, (Task13.Closure)(() => {
         GlobalFuncs.anim(target.loc, target, "icons/mob/mob.dmi", null, "uncloak", null, Convert.ToInt32(target.dir));
         return;
     }));
     this.Warp(target);
     return;
 }
Exemple #18
0
 // Function from file: nuke_tools.dm
 public override int?process(dynamic seconds = null)
 {
     if (this.cooldown < Game13.time - 60)
     {
         this.cooldown = Game13.time;
         Icon13.Flick("plutonium_core_pulse", this);
         GlobalFuncs.radiation_pulse(GlobalFuncs.get_turf(this), 1, 4, 40, true);
     }
     return(null);
 }
Exemple #19
0
 // Function from file: bins.dm
 public void do_animate(  )
 {
     GlobalFuncs.playsound(this.loc, this.open_sound, 15, 1, -3);
     Icon13.Flick("animate_largebins", this);
     Task13.Schedule(13, (Task13.Closure)(() => {
         GlobalFuncs.playsound(this.loc, this.close_sound, 15, 1, -3);
         this.update_icon();
         return;
     }));
     return;
 }
Exemple #20
0
 // Function from file: narsie.dm
 public void narsie_spawn_animation(  )
 {
     this.icon      = "icons/obj/narsie_spawn_anim.dmi";
     this.dir       = ((int)(GlobalVars.SOUTH));
     this.move_self = false;
     Icon13.Flick("narsie_spawn_anim", this);
     Task13.Sleep(11);
     this.move_self = true;
     this.icon      = Lang13.Initial(this, "icon");
     return;
 }
Exemple #21
0
        // Function from file: airlock_control.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            Signal signal = null;

            signal = new Signal();
            signal.transmission_method = 1;
            signal.data["tag"]         = this.master_tag;
            signal.data["command"]     = "cycle";
            this.radio_connection.post_signal(this, signal, GlobalVars.RADIO_AIRLOCK, 5);
            Icon13.Flick("airlock_sensor_cycle", this);
            return(null);
        }
        // Function from file: valve.dm
        public override void update_icon_nopipes(bool?animation = null)
        {
            animation = animation ?? false;

            this.normalize_dir();

            if (animation == true)
            {
                Icon13.Flick("" + this.valve_type + "valve_" + this.open + !this.open, this);
            }
            this.icon_state = "" + this.valve_type + "valve_" + (this.open ? "on" : "off");
            return;
        }
Exemple #23
0
        // Function from file: coil.dm
        public override void tesla_act(double power = 0)
        {
            double power_produced = 0;

            this.being_shocked = true;
            power_produced     = power / this.power_loss;
            this.add_avail(power_produced * this.input_power_multiplier);
            Icon13.Flick("coilhit", this);
            GlobalFuncs.playsound(this.loc, "sound/magic/LightningShock.ogg", 100, 1, 5);
            GlobalFuncs.tesla_zap(this, 5, power_produced);
            GlobalFuncs.addtimer(this, "reset_shocked", 10);
            return;
        }
Exemple #24
0
 // Function from file: overlays.dm
 public Obj_Effect_Overlay_Temp(dynamic loc = null) : base((object)(loc))
 {
     if (this.randomdir)
     {
         this.dir = Convert.ToInt32(Rand13.PickFromTable(GlobalVars.cardinal));
     }
     Icon13.Flick("" + this.icon_state, this);
     Task13.Schedule(this.duration, (Task13.Closure)(() => {
         GlobalFuncs.qdel(this);
         return;
     }));
     return;
 }
Exemple #25
0
 // Function from file: windowdoor.dm
 public override bool emag_act(dynamic user = null)
 {
     if (!this.operating && this.density && !Lang13.Bool(this.emagged))
     {
         this.operating = true;
         Icon13.Flick("" + this.base_state + "spark", this);
         Task13.Sleep(6);
         this.operating = false;
         this.desc     += "<BR><span class='warning'>Its access panel is smoking slightly.</span>";
         this.open();
         this.emagged = 1;
     }
     return(false);
 }
Exemple #26
0
        // Function from file: firedoor.dm
        public override void do_animate(string animation = null)
        {
            switch ((string)(animation))
            {
            case "opening":
                Icon13.Flick("door_opening", this);
                break;

            case "closing":
                Icon13.Flick("door_closing", this);
                break;
            }
            return;
        }
Exemple #27
0
        // Function from file: flash.dm
        public void cyborg_flash_animation(dynamic user = null)
        {
            Dynamic_Overlay animation = null;

            animation            = new Dynamic_Overlay(user.loc);
            animation.layer      = Convert.ToDouble(user.layer + 1);
            animation.icon_state = "blank";
            animation.icon       = "icons/mob/mob.dmi";
            animation.master     = user;
            Icon13.Flick("blspell", animation);
            Task13.Sleep(5);
            GlobalFuncs.qdel(animation);
            return;
        }
Exemple #28
0
        // Function from file: windowdoor.dm
        public override bool open(int?surpress_send = null)
        {
            surpress_send = surpress_send ?? 0;


            if (this.operating)
            {
                return(false);
            }

            if (!(GlobalVars.ticker != null) || !Lang13.Bool(GlobalVars.ticker.mode))
            {
                return(false);
            }

            if (!Lang13.Bool(surpress_send))
            {
                if (!this.hasPower())
                {
                    return(false);
                }
            }

            if ((surpress_send ?? 0) < 2)
            {
                if (Lang13.Bool(this.emagged))
                {
                    return(false);
                }
            }

            if (!this.operating)
            {
                this.operating = true;
            }
            Icon13.Flick("" + this.base_state + "opening", this);
            GlobalFuncs.playsound(this.loc, "sound/machines/windowdoor.ogg", 100, 1);
            this.icon_state = "" + this.base_state + "open";
            Task13.Sleep(10);
            this.density = false;
            this.air_update_turf(true);
            this.update_freelook_sight();

            if (this.operating)
            {
                this.operating = false;
            }
            return(true);
        }
Exemple #29
0
        // Function from file: soulstone.dm
        public void init_shade(Obj_Item_Device_Soulstone C = null, dynamic T = null, dynamic U = null, bool?vic = null)
        {
            vic = vic ?? false;

            Dynamic_Overlay animation       = null;
            Mob_Living_SimpleAnimal_Shade S = null;

            new Obj_Effect_Decal_Remains_Human(T.loc);
            T.invisibility       = 101;
            animation            = new Dynamic_Overlay(T.loc);
            animation.icon_state = "blank";
            animation.icon       = "icons/mob/mob.dmi";
            animation.master     = T;
            Icon13.Flick("dust-h", animation);
            GlobalFuncs.qdel(animation);
            S               = new Mob_Living_SimpleAnimal_Shade(T.loc);
            S.loc           = C;
            S.status_flags |= 4096;
            S.canmove       = false;
            S.name          = "Shade of " + T.real_name;
            S.real_name     = "Shade of " + T.real_name;
            S.key           = T.key;
            S.faction      |= new Txt().Ref(U).ToString();

            if (GlobalFuncs.iscultist(U))
            {
                ((GameMode)GlobalVars.ticker.mode).add_cultist(S.mind);
            }
            S.__CallVerb("Cancel Camera View");
            C.icon_state = "soulstone2";
            C.name       = "Soul Stone: " + S.real_name;

            if (GlobalFuncs.iswizard(U) || this.usability)
            {
                S.WriteMsg("Your soul has been captured! You are now bound to " + U.real_name + "'s will. Help them succeed in their goals at all costs.");
            }
            else if (GlobalFuncs.iscultist(U))
            {
                S.WriteMsg("Your soul has been captured! You are now bound to the cult's will. Help them succeed in their goals at all costs.");
            }
            C.imprinted = "" + S.name;

            if (vic == true)
            {
                U.WriteMsg("<span class='info'><b>Capture successful!</b>:</span> " + T.real_name + "'s soul has been ripped from their body and stored within the soul stone.");
                U.WriteMsg("The soulstone has been imprinted with " + S.real_name + "'s mind, it will no longer react to other souls.");
            }
            return;
        }
        // Function from file: flasher.dm
        public bool flash(  )
        {
            Mob_Living L = null;


            if (!Lang13.Bool(this.powered()) || !Lang13.Bool(this.bulb))
            {
                return(false);
            }

            if (this.bulb.crit_fail || this.last_flash != 0 && Game13.time < this.last_flash + 150)
            {
                return(false);
            }

            if (!((Obj_Item_Device_Assembly_Flash)this.bulb).flash_recharge(30))
            {
                this.power_change();
                return(false);
            }
            this.bulb.times_used++;
            GlobalFuncs.playsound(this.loc, "sound/weapons/flash.ogg", 100, 1);
            Icon13.Flick("" + this.base_state + "_flash", this);
            this.last_flash = Game13.time;
            this.f_use_power(1000);

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


                if (Map13.GetDistance(this, L) > this.range)
                {
                    continue;
                }

                if (L.flash_eyes(null, null, true))
                {
                    L.Weaken(this.strength);

                    if (L.weakeyes)
                    {
                        L.Weaken(this.strength * 1.5);
                        L.visible_message("<span class='disarm'><b>" + L + "</b> gasps and shields their eyes!</span>");
                    }
                }
            }
            return(true);
        }