Example #1
0
        // Function from file: dominator.dm
        public void healthcheck(dynamic damage = null)
        {
            string iconname = null;
            EffectSystem_SparkSpread sparks = null;

            iconname = "dominator";

            if (Lang13.Bool(this.gang))
            {
                iconname += "-" + this.gang.color;
                this.SetLuminosity(3);
            }
            sparks       = new EffectSystem_SparkSpread();
            this.health -= Convert.ToDouble(damage);

            if (this.health > this.maxhealth / 2)
            {
                if (Rand13.PercentChance(Convert.ToInt32(damage * 2)))
                {
                    sparks.set_up(5, 1, this);
                    sparks.start();
                }
            }
            else if (this.operating >= 0)
            {
                sparks.set_up(5, 1, this);
                sparks.start();
                this.overlays.Add("damage");
            }

            if (this.operating != -1)
            {
                if (this.health <= 0)
                {
                    this.set_broken();
                }
                else
                {
                    this.icon_state = iconname;
                }
            }

            if (this.health <= -100)
            {
                new Obj_Item_Stack_Sheet_Plasteel(this.loc);
                GlobalFuncs.qdel(this);
            }
            return;
        }
Example #2
0
        // Function from file: chameleonproj.dm
        public void disrupt(bool?delete_dummy = null)
        {
            delete_dummy = delete_dummy ?? true;

            dynamic M = null;
            EffectSystem_SparkSpread spark_system = null;


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

                    M.WriteMsg("<span class='danger'>Your chameleon-projector deactivates.</span>");
                }
                spark_system = new EffectSystem_SparkSpread();
                spark_system.set_up(5, 0, this);
                spark_system.attach(this);
                spark_system.start();
                this.eject_all();

                if (delete_dummy == true)
                {
                    GlobalFuncs.qdel(this.active_dummy);
                }
                this.active_dummy = null;
                this.can_use      = false;
                Task13.Schedule(50, (Task13.Closure)(() => {
                    this.can_use = true;
                    return;
                }));
            }
            return;
        }
Example #3
0
        // Function from file: medbot.dm
        public override void explode(  )
        {
            dynamic Tsec = null;
            EffectSystem_SparkSpread s = null;

            this.on = 0;
            this.visible_message("<span class='boldannounce'>" + this + " blows apart!</span>");
            Tsec = GlobalFuncs.get_turf(this);
            new Obj_Item_Weapon_Storage_Firstaid(Tsec);
            new Obj_Item_Device_Assembly_ProxSensor(Tsec);
            new Obj_Item_Device_Healthanalyzer(Tsec);

            if (Lang13.Bool(this.reagent_glass))
            {
                this.reagent_glass.loc = Tsec;
                this.reagent_glass     = null;
            }

            if (Rand13.PercentChance(50))
            {
                new Obj_Item_RobotParts_LArm(Tsec);
            }
            s = new EffectSystem_SparkSpread();
            s.set_up(3, 1, this);
            s.start();
            base.explode();
            return;
        }
Example #4
0
        // Function from file: mulebot.dm
        public override void explode(  )
        {
            dynamic Tsec = null;
            EffectSystem_SparkSpread s = null;

            this.visible_message("<span class='boldannounce'>" + this + " blows apart!</span>");
            Tsec = GlobalFuncs.get_turf(this);
            new Obj_Item_Device_Assembly_ProxSensor(Tsec);
            new Obj_Item_Stack_Rods(Tsec);
            new Obj_Item_Stack_Rods(Tsec);
            new Obj_Item_Stack_CableCoil_Cut(Tsec);

            if (Lang13.Bool(this.cell))
            {
                this.cell.loc = Tsec;
                this.cell.update_icon();
                this.cell = null;
            }
            s = new EffectSystem_SparkSpread();
            s.set_up(3, 1, this);
            s.start();
            new Obj_Effect_Decal_Cleanable_Oil(this.loc);
            base.explode();
            return;
        }
Example #5
0
        // Function from file: wildwest.dm
        public override bool Bumped(dynamic AM = null)
        {
            dynamic O = null;
            EffectSystem_SparkSpread s = null;


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

            if (AM is Mob_Living_Carbon_Human && Convert.ToInt32(AM.stat) != 2 && Lang13.Bool(AM.ckey))
            {
                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(this.loc, Game13.view)))
                {
                    O = _a;
                }
                this.visible_message("<span class='warning'>" + AM + " triggered the " + this + "!</span>");
                this.triggered = true;
                s = new EffectSystem_SparkSpread();
                s.set_up(3, 1, this);
                s.start();
                GlobalFuncs.explosion(AM, 1, 0, 0, 0);
                GlobalFuncs.qdel(this);
            }
            return(false);
        }
Example #6
0
        // Function from file: equipment_locker.dm
        public override bool ex_act(double?severity = null, dynamic target = null)
        {
            EffectSystem_SparkSpread s = null;

            s = new EffectSystem_SparkSpread();
            s.set_up(5, 1, this);
            s.start();

            if (severity == 1)
            {
                if (Rand13.PercentChance(50))
                {
                    this.empty_content();
                    GlobalFuncs.qdel(this);
                }
            }
            else if (severity == 2)
            {
                if (Rand13.PercentChance(25))
                {
                    this.empty_content();
                    GlobalFuncs.qdel(this);
                }
            }
            return(false);
        }
Example #7
0
        // Function from file: hardsuit.dm
        public override bool hit_reaction(Mob_Living_Carbon owner = null, string attack_text = null, int?final_block_chance = null, dynamic damage = null, int?attack_type = null)
        {
            EffectSystem_SparkSpread s = null;


            if (this.current_charges > 0)
            {
                s = new EffectSystem_SparkSpread();
                s.set_up(2, 1, this);
                s.start();
                owner.visible_message("<span class='danger'>" + owner + "'s shields deflect " + attack_text + " in a shower of sparks!</span>");
                this.current_charges--;
                this.recharge_cooldown = Game13.time + this.recharge_delay;
                GlobalVars.SSobj.processing.Or(this);

                if (this.current_charges <= 0)
                {
                    owner.visible_message("" + owner + "'s shield overloads!");
                    this.shield_state = "broken";
                    owner.update_inv_wear_suit();
                }
                return(true);
            }
            return(false);
        }
        // Function from file: antag_spawner.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            ByTable nuke_candidates = null;
            dynamic C = null;
            EffectSystem_SparkSpread S = null;


            if (!this.check_usability(user))
            {
                return(null);
            }
            nuke_candidates = GlobalFuncs.get_candidates("operative", 3000, "operative");

            if (nuke_candidates.len > 0)
            {
                this.used = true;
                C         = Rand13.PickFromTable(nuke_candidates);
                this.spawn_antag(C, GlobalFuncs.get_turf(this.loc), "syndieborg");
                S = new EffectSystem_SparkSpread();
                S.set_up(4, 1, this);
                S.start();
                GlobalFuncs.qdel(this);
            }
            else
            {
                user.WriteMsg("<span class='warning'>Unable to connect to Syndicate command. Please wait and try again later or use the teleporter on your uplink to get your points refunded.</span>");
            }
            return(null);
        }
Example #9
0
        // Function from file: lighting.dm
        public void broken(bool?skip_sound_and_sparks = null)
        {
            skip_sound_and_sparks = skip_sound_and_sparks ?? false;

            EffectSystem_SparkSpread s = null;


            if (this.status == 1)
            {
                return;
            }

            if (!(skip_sound_and_sparks == true))
            {
                if (this.status == 0 || this.status == 3)
                {
                    GlobalFuncs.playsound(this.loc, "sound/effects/Glasshit.ogg", 75, 1);
                }

                if (this.on)
                {
                    s = new EffectSystem_SparkSpread();
                    s.set_up(3, 1, this);
                    s.start();
                }
            }
            this.status = 2;
            this.update();
            return;
        }
Example #10
0
        // Function from file: secbot.dm
        public override void explode(  )
        {
            dynamic Tsec = null;
            Obj_Item_Weapon_SecbotAssembly Sa = null;
            EffectSystem_SparkSpread       s  = null;

            Map13.WalkTowards(this, 0, 0, 0);
            this.visible_message("<span class='boldannounce'>" + this + " blows apart!</span>");
            Tsec          = GlobalFuncs.get_turf(this);
            Sa            = new Obj_Item_Weapon_SecbotAssembly(Tsec);
            Sa.build_step = 1;
            Sa.overlays.Add("hs_hole");
            Sa.created_name = this.name;
            new Obj_Item_Device_Assembly_ProxSensor(Tsec);
            new Obj_Item_Weapon_Melee_Baton(Tsec);

            if (Rand13.PercentChance(50))
            {
                new Obj_Item_RobotParts_LArm(Tsec);
            }
            s = new EffectSystem_SparkSpread();
            s.set_up(3, 1, this);
            s.start();
            new Obj_Effect_Decal_Cleanable_Oil(this.loc);
            base.explode();
            return;
        }
Example #11
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;
        }
        // Function from file: pyrotechnics.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            dynamic location           = null;
            EffectSystem_SparkSpread s = null;
            Mob_Living_Carbon        C = null;

            location = GlobalFuncs.get_turf(holder.my_atom);
            s        = new EffectSystem_SparkSpread();
            s.set_up(2, 1, location);
            s.start();

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_hearers_in_view((created_volume ?? 0) / 10, location), typeof(Mob_Living_Carbon)))
            {
                C = _a;


                if (C.flash_eyes())
                {
                    if (Map13.GetDistance(C, location) < 4)
                    {
                        C.Weaken(5);
                    }
                    else
                    {
                        C.Stun(5);
                    }
                }
            }
            return;
        }
Example #13
0
        // Function from file: energy.dm
        public override dynamic on_hit(Ent_Static target = null, double?blocked = null, dynamic hit_zone = null)
        {
            blocked = blocked ?? 0;

            dynamic _default = null;

            EffectSystem_SparkSpread sparks = null;
            Ent_Static C = null;

            _default = base.on_hit(target, blocked, (object)(hit_zone));

            if (!(target is Mob) || (blocked ?? 0) >= 2)
            {
                sparks = new EffectSystem_SparkSpread();
                sparks.set_up(1, 1, this);
                sparks.start();
            }
            else if (target is Mob_Living_Carbon)
            {
                C = target;

                if (Lang13.Bool(((dynamic)C).dna) && ((Dna)((dynamic)C).dna).check_mutation("Hulk") != 0)
                {
                    ((dynamic)C).say(Rand13.Pick(new object [] { ";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" }));
                }
                else if (Lang13.Bool(((dynamic)C).status_flags & 2))
                {
                    Task13.Schedule(5, (Task13.Closure)(() => {
                        ((dynamic)C).do_jitter_animation(this.jitter);
                        return;
                    }));
                }
            }
            return(_default);
        }
Example #14
0
        // Function from file: godhand.dm
        public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null)
        {
            dynamic M        = null;
            dynamic C_target = null;
            dynamic B        = null;
            EffectSystem_SparkSpread sparks = null;


            if (!(proximity_flag == true) || target == user || !(target is Mob) || !(user is Mob_Living_Carbon) || Lang13.Bool(user.lying) || Lang13.Bool(user.handcuffed))
            {
                return(false);
            }
            M = target;

            if (M is Mob_Living_Carbon_Human || M is Mob_Living_Carbon_Monkey)
            {
                C_target = M;
                B        = ((Mob)C_target).getorgan(typeof(Obj_Item_Organ_Internal_Brain));

                if (Lang13.Bool(B))
                {
                    B.loc = GlobalFuncs.get_turf(C_target);
                    ((Obj_Item_Organ_Internal_Brain)B).transfer_identity(C_target);
                    C_target.internal_organs.Remove(B);
                }
            }
            sparks = new EffectSystem_SparkSpread();
            sparks.set_up(4, 0, M.loc);
            sparks.start();
            ((Mob)M).gib();
            base.afterattack((object)(target), (object)(user), proximity_flag, click_parameters);
            return(false);
        }
Example #15
0
        // Function from file: airalarm.dm
        public bool shock(dynamic user = null, int prb = 0)
        {
            EffectSystem_SparkSpread s = null;


            if ((this.stat & 2) != 0)
            {
                return(false);
            }

            if (!Rand13.PercentChance(prb))
            {
                return(false);
            }
            s = new EffectSystem_SparkSpread();
            s.set_up(5, 1, this);
            s.start();

            if (Lang13.Bool(GlobalFuncs.electrocute_mob(user, GlobalFuncs.get_area(this), this)))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #16
0
        // Function from file: energy.dm
        public override void on_range(  )
        {
            EffectSystem_SparkSpread sparks = null;

            sparks = new EffectSystem_SparkSpread();
            sparks.set_up(1, 1, this);
            sparks.start();
            base.on_range();
            return;
        }
Example #17
0
        // Function from file: hivebot.dm
        public override bool death(bool?gibbed = null, bool?toast = null)
        {
            EffectSystem_SparkSpread s = null;

            s = new EffectSystem_SparkSpread();
            s.set_up(3, 1, this);
            s.start();
            base.death(true, toast);
            return(false);
        }
Example #18
0
        // Function from file: poddoor.dm
        public override bool ex_act(double?severity = null, dynamic target = null)
        {
            EffectSystem_SparkSpread s  = null;
            EffectSystem_SparkSpread s2 = null;
            EffectSystem_SparkSpread s3 = null;


            if (target == this)
            {
                GlobalFuncs.qdel(this);
                return(false);
            }

            switch ((int?)(severity))
            {
            case 1:

                if (Rand13.PercentChance(80))
                {
                    GlobalFuncs.qdel(this);
                }
                else
                {
                    s = new EffectSystem_SparkSpread();
                    s.set_up(2, 1, this);
                    s.start();
                }
                break;

            case 2:

                if (Rand13.PercentChance(20))
                {
                    GlobalFuncs.qdel(this);
                }
                else
                {
                    s2 = new EffectSystem_SparkSpread();
                    s2.set_up(2, 1, this);
                    s2.start();
                }
                break;

            case 3:

                if (Rand13.PercentChance(80))
                {
                    s3 = new EffectSystem_SparkSpread();
                    s3.set_up(2, 1, this);
                    s3.start();
                }
                break;
            }
            return(false);
        }
Example #19
0
        // Function from file: abduction_gear.dm
        public override bool dropped(dynamic user = null)
        {
            EffectSystem_SparkSpread S = null;

            ((Ent_Static)user).visible_message("<span class='danger'>" + user + "'s " + this + " break in a discharge of energy!</span>", "<span class='userdanger'>" + user + "'s " + this + " break in a discharge of energy!</span>");
            S = new EffectSystem_SparkSpread();
            S.set_up(4, 0, user.loc);
            S.start();
            GlobalFuncs.qdel(this);
            return(false);
        }
Example #20
0
        // Function from file: ninjaDrainAct.dm
        public override dynamic ninjadrain_act(Obj_Item_Clothing_Suit_Space_SpaceNinja S = null, Ent_Static H = null, Obj_Item_Clothing_Gloves_SpaceNinja G = null)
        {
            dynamic _default = null;

            bool   maxcapacity = false;
            double drain       = 0;
            EffectSystem_SparkSpread spark_system = null;


            if (!(S != null) || !(H != null) || !(G != null))
            {
                return("INVALID");
            }
            maxcapacity = false;
            drain       = 0;
            _default    = 0;

            if (this.charge != 0)
            {
                spark_system = new EffectSystem_SparkSpread();
                spark_system.set_up(5, 0, this.loc);

                while (G.candrain && this.charge > 0 && !maxcapacity)
                {
                    drain = Rand13.Int(G.mindrain, G.maxdrain);

                    if (this.charge < drain)
                    {
                        drain = this.charge;
                    }

                    if (Convert.ToDouble(S.cell.charge + drain) > (S.cell.maxcharge ?? 0))
                    {
                        drain       = (S.cell.maxcharge ?? 0) - Convert.ToDouble(S.cell.charge);
                        maxcapacity = true;
                    }

                    if (GlobalFuncs.do_after(H, 10, null, this))
                    {
                        spark_system.start();
                        GlobalFuncs.playsound(this.loc, "sparks", 50, 1);
                        this.charge   -= drain;
                        S.cell.charge += drain;
                        _default      += drain;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            return(_default);
        }
Example #21
0
        // Function from file: toys.dm
        public void pop_burst(  )
        {
            EffectSystem_SparkSpread s = null;

            s = new EffectSystem_SparkSpread();
            s.set_up(3, 1, this);
            s.start();
            new Obj_Effect_Decal_Cleanable_Ash(this.loc);
            this.visible_message("<span class='warning'>The " + this.name + " explodes!</span>", "<span class='italics'>You hear a snap!</span>");
            GlobalFuncs.playsound(this, "sound/effects/snap.ogg", 50, 1);
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: equipment_locker.dm
        public override bool ex_act(double?severity = null, dynamic target = null)
        {
            EffectSystem_SparkSpread s = null;

            s = new EffectSystem_SparkSpread();
            s.set_up(5, 1, this);
            s.start();

            if (Rand13.PercentChance(((int)(50 / (severity ?? 0)))) && (severity ?? 0) < 3)
            {
                GlobalFuncs.qdel(this);
            }
            return(false);
        }
Example #23
0
        // Function from file: microwave.dm
        public void broke(  )
        {
            EffectSystem_SparkSpread s = null;

            s = new EffectSystem_SparkSpread();
            s.set_up(2, 1, this);
            s.start();
            this.icon_state = "mwb";
            this.visible_message("<span class='warning'>The microwave breaks!</span>");
            this.broken    = 2;
            this.flags     = null;
            this.operating = false;
            this.updateUsrDialog();
            return;
        }
Example #24
0
        // Function from file: slotmachine.dm
        public override bool emag_act(dynamic user = null)
        {
            EffectSystem_SparkSpread spark_system = null;


            if (!Lang13.Bool(this.emagged))
            {
                this.emagged = 1;
                spark_system = new EffectSystem_SparkSpread();
                spark_system.set_up(4, 0, this.loc);
                spark_system.start();
                GlobalFuncs.playsound(this.loc, "sparks", 50, 1);
            }
            return(false);
        }
Example #25
0
        // Function from file: telepad.dm
        public override bool emag_act(dynamic user = null)
        {
            EffectSystem_SparkSpread s = null;


            if (!this.emagged)
            {
                this.emagged = true;
                s            = new EffectSystem_SparkSpread();
                s.set_up(5, 1, this);
                s.start();
                user.WriteMsg("<span class='caution'>You emag the RCS. Click on it to toggle between modes.</span>");
            }
            return(false);
        }
Example #26
0
        // Function from file: pad.dm
        public void MobToLoc(Ent_Static place = null, dynamic target = null)
        {
            Obj_Effect_TeleportAbductor F = null;
            EffectSystem_SparkSpread    S = 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);
            ((Ent_Dynamic)target).forceMove(place);
            GlobalFuncs.anim(target.loc, target, "icons/mob/mob.dmi", null, "uncloak", null, Convert.ToInt32(target.dir));
            return;
        }
        // Function from file: handcuffs.dm
        public Obj_Item_Weapon_Restraints_Legcuffs_Beartrap_Energy(dynamic loc = null) : base((object)(loc))
        {
            EffectSystem_SparkSpread sparks = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            Task13.Schedule(100, (Task13.Closure)(() => {
                if (!(this.loc is Mob))
                {
                    sparks = new EffectSystem_SparkSpread();
                    sparks.set_up(1, 1, this);
                    sparks.start();
                    GlobalFuncs.qdel(this);
                }
                return;
            }));
            return;
        }
Example #28
0
        // Function from file: holo_effect.dm
        public override dynamic activate(Obj_Machinery_Computer_Holodeck HC = null)
        {
            dynamic T = null;
            EffectSystem_SparkSpread s = null;

            T = GlobalFuncs.get_turf(this);

            if (Lang13.Bool(T))
            {
                s = new EffectSystem_SparkSpread();
                s.set_up(3, 1, T);
                s.start();
                T.temperature = 5000;
                ((Tile)T).hotspot_expose(50000, 50000, true);
            }
            return(null);
        }
Example #29
0
        // Function from file: telesci_computer.dm
        public void sparks(  )
        {
            EffectSystem_SparkSpread s = null;


            if (this.telepad != null)
            {
                s = new EffectSystem_SparkSpread();
                s.set_up(5, 1, GlobalFuncs.get_turf(this.telepad));
                s.start();
            }
            else
            {
                return;
            }
            return;
        }
Example #30
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);
        }