コード例 #1
0
ファイル: Gang.cs プロジェクト: Somnium13/SS13
        // Function from file: gang_datum.dm
        public Gang(dynamic loc = null, dynamic gangname = null)
        {
            if (!(GlobalVars.gang_colors_pool.len != 0))
            {
                GlobalFuncs.message_admins("WARNING: Maximum number of gangs have been exceeded!");
                throw new Exception("Maximum number of gangs has been exceeded");
                return;
            }
            else
            {
                this.color = Rand13.PickFromTable(GlobalVars.gang_colors_pool);
                GlobalVars.gang_colors_pool.Remove(this.color);

                dynamic _a = this.color;                 // Was a switch-case, sorry for the mess.
                if (_a == "red")
                {
                    this.color_hex = "#DA0000";
                }
                else if (_a == "orange")
                {
                    this.color_hex = "#FF9300";
                }
                else if (_a == "yellow")
                {
                    this.color_hex = "#FFF200";
                }
                else if (_a == "green")
                {
                    this.color_hex = "#A8E61D";
                }
                else if (_a == "blue")
                {
                    this.color_hex = "#00B7EF";
                }
                else if (_a == "purple")
                {
                    this.color_hex = "#DA00FF";
                }
            }
            this.name = (Lang13.Bool(gangname) ? gangname : Rand13.PickFromTable(GlobalVars.gang_name_pool));
            GlobalVars.gang_name_pool.Remove(this.name);
            this.ganghud = new AtomHud_Antag();
            GlobalFuncs.log_game("The " + this.name + " Gang has been created. Their gang color is " + this.color + ".");
            return;
        }
コード例 #2
0
        // Function from file: alien.dm
        public override bool handle_automated_action(  )
        {
            if (!base.handle_automated_action())
            {
                return(false);
            }
            this.plant_cooldown--;

            if (this.AIStatus == 2)
            {
                if (!this.plants_off && Rand13.PercentChance(10) && Convert.ToDouble(this.plant_cooldown) <= 0)
                {
                    this.plant_cooldown = Lang13.Initial(this, "plant_cooldown");
                    this.SpreadPlants();
                }
            }
            return(false);
        }
コード例 #3
0
        // Function from file: door.dm
        public override bool ex_act(double?severity = null, dynamic target = null)
        {
            EffectSystem_SparkSpread s = null;


            if (severity == 3)
            {
                if (Rand13.PercentChance(80))
                {
                    s = new EffectSystem_SparkSpread();
                    s.set_up(2, 1, this);
                    s.start();
                }
                return(false);
            }
            base.ex_act(severity, (object)(target));
            return(false);
        }
コード例 #4
0
        // Function from file: augments_eyes.dm
        public override double emp_act(int severity = 0)
        {
            if (!Lang13.Bool(this.owner))
            {
                return(0);
            }

            if (severity > 1)
            {
                if (Rand13.PercentChance(severity * 10))
                {
                    return(0);
                }
            }
            this.owner.WriteMsg("<span class='warning'>Static obfuscates your vision!</span>");
            ((Mob_Living)this.owner).flash_eyes(null, null, null, true);
            return(0);
        }
コード例 #5
0
        // Function from file: telecrystalconsoles.dm
        public Obj_Machinery_Computer_Telecrystals_Uplinker(dynamic location = null, dynamic C = null) : base((object)(location), (object)(C))
        {
            dynamic ID = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            if (GlobalVars.possible_uplinker_IDs.len != 0)
            {
                ID = Rand13.PickFromTable(GlobalVars.possible_uplinker_IDs);
                GlobalVars.possible_uplinker_IDs.Remove(ID);
                this.name = "" + this.name + " " + ID;
            }
            else
            {
                this.name = "" + this.name + " " + Rand13.Int(1, 999);
            }
            return;
        }
コード例 #6
0
        // Function from file: martial.dm
        public override bool harm_act(dynamic A = null, Mob_Living D = null)
        {
            dynamic G = null;

            D.grabbedby(A, true);
            G = ((Mob)A).get_active_hand();

            if (Lang13.Bool(G) && Rand13.PercentChance(50))
            {
                G.state = 2;
                D.visible_message("<span class='danger'>" + A + " has " + D + " in a clinch!</span>", "<span class='userdanger'>" + A + " has " + D + " in a clinch!</span>");
            }
            else
            {
                D.visible_message("<span class='danger'>" + A + " fails to get " + D + " in a clinch!</span>", "<span class='userdanger'>" + A + " fails to get " + D + " in a clinch!</span>");
            }
            return(true);
        }
コード例 #7
0
        // Function from file: faithless.dm
        public override bool AttackingTarget(  )
        {
            dynamic C = null;

            base.AttackingTarget();

            if (this.target is Mob_Living_Carbon)
            {
                C = this.target;

                if (Rand13.PercentChance(12))
                {
                    ((Mob)C).Weaken(3);
                    ((Ent_Static)C).visible_message(new Txt("<span class='danger'>").The(this).item().str(" knocks down ").the(C).item().str("!</span>").ToString(), new Txt("<span class='userdanger'>").The(this).item().str(" knocks you down!</span>").ToString());
                }
            }
            return(false);
        }
コード例 #8
0
        // Function from file: monkey.dm
        public override bool attack_larva(Mob_Living_Carbon_Alien_Larva user = null)
        {
            int damage = 0;


            if (base.attack_larva(user))
            {
                damage = Rand13.Int(1, 3);

                if (this.stat != 2)
                {
                    user.amount_grown = Num13.MinInt(user.amount_grown + damage, user.max_grown);
                    this.adjustBruteLoss(damage);
                    this.updatehealth();
                }
            }
            return(false);
        }
コード例 #9
0
        // Function from file: simple_animal.dm
        public override bool attack_slime(Mob_Living_SimpleAnimal_Slime user = null)
        {
            double damage = 0;


            if (base.attack_slime(user))
            {
                damage = Rand13.Int(15, 25);

                if (user.is_adult)
                {
                    damage = Rand13.Int(20, 35);
                }
                this.attack_threshold_check(damage);
                return(true);
            }
            return(false);
        }
コード例 #10
0
        // Function from file: shivering.dm
        public override void Activate(Disease_Advance A = null)
        {
            dynamic M = null;

            base.Activate(A);

            if (Rand13.PercentChance(GlobalVars.SYMPTOM_ACTIVATION_PROB))
            {
                M = A.affected_mob;
                M.WriteMsg("<span class='warning'>" + Rand13.Pick(new object [] { "You feel cold.", "You start shivering." }) + "</span>");

                if (Convert.ToDouble(M.bodytemperature) < 260.41)
                {
                    M.bodytemperature = Num13.MinInt(Convert.ToInt32(M.bodytemperature - (A.stage ?? 0) * 20), ((int)(261.41)));
                }
            }
            return;
        }
コード例 #11
0
        // Function from file: walls.dm
        public override bool attack_hulk(Mob_Living_Carbon_Human hulk = null, bool?do_attack_animation = null)
        {
            base.attack_hulk(hulk, true);

            if (Rand13.PercentChance(this.hardness))
            {
                GlobalFuncs.playsound(this, "sound/effects/meteorimpact.ogg", 100, 1);
                hulk.WriteMsg("<span class='notice'>You smash through the wall.</span>");
                hulk.say(Rand13.Pick(new object [] { ";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" }));
                this.dismantle_wall(true);
            }
            else
            {
                GlobalFuncs.playsound(this, "sound/effects/bang.ogg", 50, 1);
                hulk.WriteMsg("<span class='notice'>You punch the wall.</span>");
            }
            return(true);
        }
コード例 #12
0
        // Function from file: grille.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            ((Mob)a).changeNext_move(8);
            ((Ent_Dynamic)a).do_attack_animation(this);
            GlobalFuncs.playsound(this.loc, "sound/effects/grillehit.ogg", 80, 1);
            ((Ent_Static)a).visible_message("<span class='warning'>" + a + " hits " + this + ".</span>", "<span class='danger'>You hit " + this + ".</span>", "<span class='italics'>You hear twisting metal.</span>");

            if (this.shock(a, 70))
            {
                return(null);
            }
            else
            {
                this.health -= Rand13.Int(1, 2);
            }
            this.healthcheck();
            return(null);
        }
コード例 #13
0
        // Function from file: floor.dm
        public override void burn_tile(  )
        {
            if (this.broken || this.burnt)
            {
                return;
            }

            if (this.burnt_states.len != 0)
            {
                this.icon_state = Rand13.PickFromTable(this.burnt_states);
            }
            else
            {
                this.icon_state = Rand13.PickFromTable(this.broken_states);
            }
            this.burnt = true;
            return;
        }
コード例 #14
0
        // Function from file: tables_racks.dm
        public override bool attack_hulk(Mob_Living_Carbon_Human hulk = null, bool?do_attack_animation = null)
        {
            base.attack_hulk(hulk, true);

            if (Rand13.PercentChance(75))
            {
                GlobalFuncs.playsound(this, "sound/effects/meteorimpact.ogg", 100, 1);
                hulk.WriteMsg("<span class='notice'>You kick " + this + " into pieces.</span>");
                hulk.say(Rand13.Pick(new object [] { ";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" }));
                this.table_destroy(1);
            }
            else
            {
                GlobalFuncs.playsound(this, "sound/effects/bang.ogg", 50, 1);
                hulk.WriteMsg("<span class='notice'>You kick " + this + ".</span>");
            }
            return(true);
        }
コード例 #15
0
        // Function from file: snacks.dm
        public virtual void update_overlays(dynamic S = null)
        {
            Image I = null;

            this.overlays.Cut();
            I = new Image(this.icon, "" + Lang13.Initial(this, "icon_state") + "_filling");

            if (S.filling_color == "#FFFFFF")
            {
                I.color = Rand13.Pick(new object [] { "#FF0000", "#0000FF", "#008000", "#FFFF00" });
            }
            else
            {
                I.color = S.filling_color;
            }
            this.overlays.Add(I);
            return;
        }
コード例 #16
0
        // Function from file: advance.dm
        public void AddSymptom(dynamic S = null)
        {
            if (this.HasSymptom(S))
            {
                return;
            }

            if (this.symptoms.len < Rand13.Int(-1, 1) + 5)
            {
                this.symptoms.Add(S);
            }
            else
            {
                this.RemoveSymptom(Rand13.PickFromTable(this.symptoms));
                this.symptoms.Add(S);
            }
            return;
        }
コード例 #17
0
        // Function from file: monkey.dm
        public override bool attack_slime(Mob_Living_SimpleAnimal_Slime user = null)
        {
            int damage = 0;


            if (base.attack_slime(user))
            {
                damage = Rand13.Int(5, 35);

                if (user.is_adult)
                {
                    damage = Rand13.Int(20, 40);
                }
                this.adjustBruteLoss(damage);
                this.updatehealth();
            }
            return(false);
        }
コード例 #18
0
        // Function from file: simple_animal.dm
        public override bool attack_larva(Mob_Living_Carbon_Alien_Larva user = null)
        {
            double damage = 0;


            if (base.attack_larva(user))
            {
                damage = Rand13.Int(5, 10);

                if (this.stat != 2)
                {
                    user.amount_grown = Num13.MinInt(((int)(user.amount_grown + damage)), user.max_grown);
                    this.attack_threshold_check(damage);
                }
                return(true);
            }
            return(false);
        }
コード例 #19
0
        // Function from file: drink_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            M.dizziness  = Num13.MaxInt(0, M.dizziness - 2);
            M.drowsyness = Num13.MaxInt(0, M.drowsyness - 1);
            ((Mob)M).AdjustSleeping(-2);

            if (Lang13.Bool(((Mob_Living)M).getToxLoss()) && Rand13.PercentChance(20))
            {
                ((Mob_Living)M).adjustToxLoss(-1);
            }

            if (Convert.ToDouble(M.bodytemperature) > 310)
            {
                M.bodytemperature = Num13.MaxInt(310, Convert.ToInt32(M.bodytemperature - 7.5));
            }
            base.on_mob_life((object)(M));
            return(false);
        }
コード例 #20
0
        // Function from file: simple_animal.dm
        public override string say_quote(dynamic input = null, dynamic spans = null)
        {
            string  ending = null;
            dynamic emote  = null;

            ending = String13.SubStr(input, Lang13.Length(input), 0);

            if (this.speak_emote != null && this.speak_emote.len != 0 && ending != "?" && ending != "!")
            {
                emote = Rand13.PickFromTable(this.speak_emote);

                if (Lang13.Bool(emote))
                {
                    return("" + emote + ", \"" + input + "\"");
                }
            }
            return(base.say_quote((object)(input), (object)(spans)));
        }
コード例 #21
0
        // Function from file: musician.dm
        public Obj_Structure_Piano(dynamic loc = null) : base((object)(loc))
        {
            this.song = new Song("piano", this);

            if (Rand13.PercentChance(50))
            {
                this.name       = "space minimoog";
                this.desc       = "This is a minimoog, like a space piano, but more spacey!";
                this.icon_state = "minimoog";
            }
            else
            {
                this.name       = "space piano";
                this.desc       = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't.";
                this.icon_state = "piano";
            }
            return;
        }
コード例 #22
0
        // Function from file: toolbox.dm
        public Obj_Item_Weapon_Storage_Toolbox_Emergency(dynamic loc = null) : base((object)(loc))
        {
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            new Obj_Item_Weapon_Crowbar_Red(this);
            new Obj_Item_Weapon_Weldingtool_Mini(this);
            new Obj_Item_Weapon_Extinguisher_Mini(this);

            if (Rand13.PercentChance(50))
            {
                new Obj_Item_Device_Flashlight(this);
            }
            else
            {
                new Obj_Item_Device_Flashlight_Flare(this);
            }
            new Obj_Item_Device_Radio_Off(this);
            return;
        }
コード例 #23
0
        // Function from file: Hallucination.dm
        public void Eat(dynamic OldLoc = null, dynamic Dir = null)
        {
            int target_dist = 0;

            target_dist = Map13.GetDistance(this, this.target);

            if (target_dist <= 3)
            {
                ((dynamic)this.target).hal_screwyhud = 1;
                ((dynamic)this.target).SetSleeping(20);
                Task13.Schedule(Rand13.Int(50, 100), (Task13.Closure)(() => {
                    ((dynamic)this.target).hal_screwyhud = 0;
                    ((dynamic)this.target).SetSleeping(0);
                    return;
                }));
            }
            return;
        }
コード例 #24
0
        // Function from file: shieldgen.dm
        public override double emp_act(int severity = 0)
        {
            switch ((int)(severity))
            {
            case 1:
                GlobalFuncs.qdel(this);
                break;

            case 2:

                if (Rand13.PercentChance(50))
                {
                    GlobalFuncs.qdel(this);
                }
                break;
            }
            return(0);
        }
コード例 #25
0
        // Function from file: effects_foam.dm
        public override bool attack_slime(Mob_Living_SimpleAnimal_Slime user = null)
        {
            user.changeNext_move(8);
            user.do_attack_animation(this);

            if (!user.is_adult)
            {
                this.attack_hand(user);
                return(false);
            }

            if (Rand13.PercentChance(75 - this.metal * 25))
            {
                user.visible_message("<span class='danger'>" + user + " smashes through the foamed metal!</span>", "<span class='danger'>You smash through the metal foam wall!</span>");
                GlobalFuncs.qdel(this);
            }
            return(false);
        }
コード例 #26
0
        // Function from file: stationCollision.dm
        public Obj_Item_Weapon_Gun_Projectile_Shotgun_ScPump(dynamic loc = null) : base((object)(loc))
        {
            dynamic ammo = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            foreach (dynamic _a in Lang13.Enumerate(this.magazine.stored_ammo))
            {
                ammo = _a;


                if (Rand13.PercentChance(95))
                {
                    this.magazine.stored_ammo.Remove(ammo);
                }
            }
            return;
        }
コード例 #27
0
        // Function from file: suit_storage_unit.dm
        public bool shock(dynamic user = null, int prb = 0)
        {
            EffectSystem_SparkSpread s = null;


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

                if (Lang13.Bool(GlobalFuncs.electrocute_mob(user, this, this)))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #28
0
ファイル: Mutation_Human.cs プロジェクト: Somnium13/SS13
        // Function from file: mutations.dm
        public dynamic check_block(Mob_Living_Carbon owner = null)
        {
            dynamic _default = null;


            if (this.check_block_string(owner.dna.struc_enzymes))
            {
                if (Rand13.PercentChance(this.get_chance))
                {
                    _default = this.on_acquiring(owner);
                }
            }
            else
            {
                _default = this.on_losing(owner);
            }
            return(_default);
        }
コード例 #29
0
ファイル: Mob_Camera_God.cs プロジェクト: Somnium13/SS13
        public void disaster(  )
        {
            dynamic _event = null;


            if (!this.ability_cost(300, false, true))
            {
                return;
            }
            _event = Rand13.Pick(new object [] { typeof(RoundEvent_MeteorWave), typeof(RoundEvent_CommunicationsBlackout), typeof(RoundEvent_RadiationStorm), typeof(RoundEvent_CarpMigration), typeof(RoundEvent_Spacevine), typeof(RoundEvent_VentClog), typeof(RoundEvent_Wormholes) });

            if (Lang13.Bool(_event))
            {
                Lang13.Call(_event);
                this.add_faith(-300);
            }
            return;
        }
コード例 #30
0
ファイル: Mutation_Human.cs プロジェクト: Somnium13/SS13
        // Function from file: mutations.dm
        public string set_se(dynamic se_string = null, bool?on = null)
        {
            on = on ?? true;

            string before    = null;
            string injection = null;
            string after     = null;


            if (!Lang13.Bool(se_string) || Lang13.Length(se_string) < 57)
            {
                return(null);
            }
            before    = String13.SubStr(se_string, 1, (this.dna_block - 1) * 3 + 1);
            injection = GlobalFuncs.num2hex((on == true ? Rand13.Int(this.lowest_value, 4095) : Rand13.Int(0, this.lowest_value - 1)), 3);
            after     = String13.SubStr(se_string, this.dna_block * 3 + 1, 0);
            return(before + injection + after);
        }