コード例 #1
0
 // Function from file: runes.dm
 public Obj_Effect_Rune_Malformed(dynamic loc = null) : base((object)(loc))
 {
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     this.icon_state = "" + Rand13.Int(1, 6);
     this.color      = String13.ColorCode(Rand13.Int(0, 255), Rand13.Int(0, 255), Rand13.Int(0, 255));
     return;
 }
コード例 #2
0
ファイル: Icon.cs プロジェクト: Somnium13/SS13
        // Function from file: icons.dm
        public void ColorTone(string tone = null)
        {
            ByTable TONE  = null;
            double  gray  = 0;
            Icon    upper = null;

            this.GrayScale();
            TONE  = GlobalFuncs.ReadRGB(tone);
            gray  = Num13.Round(Convert.ToDouble(TONE[1] * 0.3 + TONE[2] * 0.81 + TONE[3] * 0.01), 1);
            upper = (255 - gray != 0 ? new Icon(this) : null);

            if (gray != 0)
            {
                this.MapColors(255 / gray, 0, 0, 0, 255 / gray, 0, 0, 0, 255 / gray, false, 0, 0);
                this.Blend(tone, 2);
            }
            else
            {
                this.SetIntensity(0);
            }

            if (255 - gray != 0)
            {
                upper.Blend(String13.ColorCode(((int)(gray)), ((int)(gray)), ((int)(gray))), 1);
                upper.MapColors((255 - Convert.ToDouble(TONE[1])) / (255 - gray), 0, 0, 0, 0, (255 - Convert.ToDouble(TONE[2])) / (255 - gray), 0, 0, 0, false, (255 - Convert.ToDouble(TONE[3])) / (255 - gray), 0, 0, 0, 0, 0, 0, 0, 0, 1);
                this.Blend(upper, 0);
            }
            return;
        }
コード例 #3
0
        // Function from file: he_pipes.dm
        public override int?process(dynamic seconds = null)
        {
            GasMixture pipe_air   = null;
            double     h_r        = 0;
            double     h_g        = 0;
            double     h_b        = 0;
            dynamic    scale      = null;
            int        heat_limit = 0;


            if (!(this.parent != null))
            {
                return(null);
            }
            pipe_air = this.return_air();

            if (Lang13.Bool(pipe_air.temperature) && (Convert.ToDouble(this.icon_temperature) > 500 || Convert.ToDouble(pipe_air.temperature) > 500))
            {
                if (Math.Abs(Convert.ToDouble(pipe_air.temperature - this.icon_temperature)) > 10)
                {
                    this.icon_temperature = pipe_air.temperature;
                    h_r = GlobalFuncs.heat2colour_r(this.icon_temperature);
                    h_g = GlobalFuncs.heat2colour_g(this.icon_temperature);
                    h_b = GlobalFuncs.heat2colour_b(this.icon_temperature);

                    if (Convert.ToDouble(this.icon_temperature) < 2000)
                    {
                        scale = (this.icon_temperature - 500) / 1500;
                        h_r   = (h_r - 64) * Convert.ToDouble(scale) + 64;
                        h_g   = (h_g - 64) * Convert.ToDouble(scale) + 64;
                        h_b   = (h_b - 64) * Convert.ToDouble(scale) + 64;
                    }
                    Icon13.Animate(new ByTable().Set(1, this).Set("color", String13.ColorCode(((int)(h_r)), ((int)(h_g)), ((int)(h_b)))).Set("time", 20).Set("easing", 1));
                }
            }

            if (Lang13.Bool(this.buckled_mob))
            {
                heat_limit = 1000;

                if (Convert.ToDouble(pipe_air.temperature) > heat_limit + 1)
                {
                    this.buckled_mob.apply_damage(Math.Log(Convert.ToDouble(pipe_air.temperature - heat_limit)) * 4, "fire", "chest");
                }
            }
            return(null);
        }
コード例 #4
0
        // Function from file: mushroom.dm
        public Mob_Living_SimpleAnimal_Hostile_Mushroom(dynamic loc = null) : base((object)(loc))
        {
            string cap_color = null;

            this.melee_damage_lower += Rand13.Int(3, 5);
            this.melee_damage_upper += Rand13.Int(10, 20);
            this.maxHealth          += Rand13.Int(40, 60);
            this.move_to_delay       = Rand13.Int(3, 11);
            cap_color             = String13.ColorCode(Rand13.Int(0, 255), Rand13.Int(0, 255), Rand13.Int(0, 255));
            this.cap_living       = new Image("icons/mob/animal.dmi", null, "mushroom_cap");
            this.cap_dead         = new Image("icons/mob/animal.dmi", null, "mushroom_cap_dead");
            this.cap_living.color = cap_color;
            this.cap_dead.color   = cap_color;
            this.UpdateMushroomCap();
            this.health       = this.maxHealth;
            this.deathmessage = "" + this + " fainted.";
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            return;
        }
コード例 #5
0
        // Function from file: customizables.dm
        public void mix_filling_color(dynamic S = null)
        {
            ByTable rgbcolor    = null;
            ByTable customcolor = null;
            ByTable ingcolor    = null;


            if (this.ingredients.len == 1)
            {
                this.filling_color = S.filling_color;
            }
            else
            {
                rgbcolor           = new ByTable(new object [] { 0, 0, 0, 0 });
                customcolor        = GlobalFuncs.GetColors(this.filling_color);
                ingcolor           = GlobalFuncs.GetColors(S.filling_color);
                rgbcolor[1]        = (customcolor[1] + ingcolor[1]) / 2;
                rgbcolor[2]        = (customcolor[2] + ingcolor[2]) / 2;
                rgbcolor[3]        = (customcolor[3] + ingcolor[3]) / 2;
                rgbcolor[4]        = (customcolor[4] + ingcolor[4]) / 2;
                this.filling_color = String13.ColorCode(Convert.ToInt32(rgbcolor[1]), Convert.ToInt32(rgbcolor[2]), Convert.ToInt32(rgbcolor[3]), Convert.ToInt32(rgbcolor[4]));
            }
            return;
        }
コード例 #6
0
 // Function from file: butterfly.dm
 public Mob_Living_SimpleAnimal_Butterfly(dynamic loc = null) : base((object)(loc))
 {
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     this.color = String13.ColorCode(Rand13.Int(0, 255), Rand13.Int(0, 255), Rand13.Int(0, 255));
     return;
 }
コード例 #7
0
 // Function from file: dispenser.dm
 public string random_color(  )
 {
     return(String13.ColorCode(Rand13.Int(0, 255), Rand13.Int(0, 255), Rand13.Int(0, 255)));
 }
コード例 #8
0
        // Function from file: overview.dm
        public void drawmap(Mob user = null)
        {
            int        icx         = 0;
            int        icy         = 0;
            int        xoff        = 0;
            int        yoff        = 0;
            int?       icount      = null;
            ByTable    imap        = null;
            int?       i           = null;
            int?       wx          = null;
            int?       wy          = null;
            Tile       T           = null;
            string     colour      = null;
            bool       sense       = false;
            GasMixture environment = null;
            double     turf_total  = 0;
            double     t1          = 0;
            Ent_Static AM          = null;
            Ent_Static A           = null;
            int        red         = 0;
            int        green       = 0;
            int        blue        = 0;
            int        ix          = 0;
            int        iy          = 0;
            double?    rx          = null;
            double?    ry          = null;
            Icon       I           = null;
            int?       i2          = null;
            Obj_Screen H           = null;
            dynamic    I2          = null;

            icx    = Num13.Floor(Game13.map_size_x / 16) + 1;
            icy    = Num13.Floor(Game13.map_size_y / 16) + 1;
            xoff   = Num13.Floor(icx * 16 - Game13.map_size_x - 2);
            yoff   = Num13.Floor(icy * 16 - Game13.map_size_y - 2);
            icount = icx * icy;
            imap   = new ByTable();
            i      = null;
            i      = 0;

            while ((i ?? 0) < (icount ?? 0))
            {
                imap.Add(new Icon("icons/misc/imap.dmi", "blank"));
                i++;
            }
            wx = null;
            wx = 1;

            while ((wx ?? 0) <= Game13.map_size_x)
            {
                wy = null;
                wy = 1;

                while ((wy ?? 0) <= Game13.map_size_y)
                {
                    T      = Map13.GetTile(wx ?? 0, wy ?? 0, this.z);
                    colour = null;

                    if (!(T != null))
                    {
                        colour = "#000000";
                    }
                    else
                    {
                        sense = true;

                        switch ((string)("" + T.type))
                        {
                        case "/turf/space":
                            colour = "#0a0a0a";
                            sense  = false;
                            break;

                        case "/turf/simulated/floor":
                        case "/turf/simulated/floor/engine":
                            environment = T.return_air();
                            turf_total  = environment.total_moles();
                            t1          = turf_total / 103.98379516601562 * 175;

                            if (t1 <= 100)
                            {
                                colour = String13.ColorCode(0, 0, ((int)(t1 * 2.41)));
                            }
                            else
                            {
                                t1     = Num13.MinInt(100, ((int)(t1 - 100)));
                                colour = String13.ColorCode(((int)(t1 * 2.41)), ((int)(t1 * 2.41)), 255);
                            }
                            break;

                        case "/turf/simulated/wall":
                            colour = "#606060";
                            break;

                        case "/turf/simulated/wall/r_wall":
                            colour = "#806060";
                            break;

                        default:
                            colour = "#002800";
                            break;
                        }

                        if (sense)
                        {
                            foreach (dynamic _b in Lang13.Enumerate(T.contents, typeof(Ent_Static)))
                            {
                                AM = _b;


                                if (AM is Obj_Machinery_Door && !(AM is Obj_Machinery_Door_Window))
                                {
                                    if (AM.density)
                                    {
                                        colour = "#0060c0";
                                    }
                                    else
                                    {
                                        colour = "#60c080";
                                    }
                                }

                                if (AM is Obj_Machinery_Airalarm)
                                {
                                    colour = "#00ff00";

                                    if (AM.icon_state == "alarm:1")
                                    {
                                        colour = "#ffff00";
                                    }
                                }

                                if (AM is Mob)
                                {
                                    if (Lang13.Bool(((dynamic)AM).client))
                                    {
                                        colour = "#ff0000";
                                    }
                                    else
                                    {
                                        colour = "#ff8080";
                                    }
                                }
                            }
                        }
                        A = T.loc;

                        if (Lang13.Bool(((dynamic)A).fire))
                        {
                            red    = GlobalFuncs.getr(colour);
                            green  = GlobalFuncs.getg(colour);
                            blue   = GlobalFuncs.getb(colour);
                            green  = Num13.MinInt(255, green + 40);
                            blue   = Num13.MinInt(255, blue + 40);
                            colour = String13.ColorCode(red, green, blue);
                        }
                    }
                    ix = Num13.Floor(((wx ?? 0) * 2 + xoff) / 32);
                    iy = Num13.Floor(((wy ?? 0) * 2 + yoff) / 32);
                    rx = ((wx ?? 0) * 2 + xoff) % 32 + 1;
                    ry = ((wy ?? 0) * 2 + yoff) % 32 + 1;
                    I  = imap[ix + icx * iy + 1];
                    I.DrawBox(colour, rx, ry, rx, ry);
                    wy++;
                }
                wx++;
            }
            user.clearmap();
            user.mapobjs = new ByTable();
            i2           = null;
            i2           = 0;

            while ((i2 ?? 0) < (icount ?? 0))
            {
                H            = new Obj_Screen();
                H.screen_loc = "" + ((i2 ?? 0) % icx + 5) + "," + (Num13.Floor((i2 ?? 0) / icx) + 6);
                H.name       = (i2 == 0 ? "maprefresh" : "map");
                I2           = imap[(i2 ?? 0) + 1];
                H.icon       = I2;
                GlobalFuncs.qdel(I2);
                H.layer = 25;
                Task13.User.mapobjs.Add(H);
                i2++;
            }
            user.client.screen.Add(user.mapobjs);
            this.close(user);
            return;
        }