Ejemplo n.º 1
0
    // Token: 0x060008C7 RID: 2247 RVA: 0x0007F904 File Offset: 0x0007DB04
    public static void paintOutTilemap(mGraphics g)
    {
        if (GameCanvas.lowGraphic)
        {
            return;
        }
        int num = 0;

        for (int i = GameScr.gssx; i < GameScr.gssxe; i++)
        {
            for (int j = GameScr.gssy; j < GameScr.gssye; j++)
            {
                num++;
                if ((TileMap.tileTypeAt(i, j) & 64) == 64)
                {
                    Image arg;
                    if (TileMap.tileID == 5)
                    {
                        arg = TileMap.imgWaterlowN;
                    }
                    else if (TileMap.tileID == 8)
                    {
                        arg = TileMap.imgWaterlowN2;
                    }
                    else
                    {
                        arg = TileMap.imgWaterflow;
                    }
                    if (!TileMap.isWaterEff())
                    {
                        g.drawRegion(arg, 0, 0, 24, 24, 0, i * (int)TileMap.size, j * (int)TileMap.size - 1, 0);
                        g.drawRegion(arg, 0, 0, 24, 24, 0, i * (int)TileMap.size, j * (int)TileMap.size - 3, 0);
                    }
                    g.drawRegion(arg, 0, (GameCanvas.gameTick % 8 >> 2) * 24, 24, 24, 0, i * (int)TileMap.size, j * (int)TileMap.size - 12, 0);
                    if (TileMap.yWater == 0 && TileMap.isWaterEff())
                    {
                        TileMap.yWater = j * (int)TileMap.size - 12;
                        int color = 16777215;
                        if (GameCanvas.typeBg == 2)
                        {
                            color = 10871287;
                        }
                        else if (GameCanvas.typeBg == 4)
                        {
                            color = 8111470;
                        }
                        else if (GameCanvas.typeBg == 7)
                        {
                            color = 5693125;
                        }
                        BackgroudEffect.addWater(color, TileMap.yWater + 15);
                    }
                }
            }
        }
        BackgroudEffect.paintWaterAll(g);
    }
    // Token: 0x06000222 RID: 546 RVA: 0x00011B18 File Offset: 0x0000FD18
    public void update()
    {
        switch (this.typeEff)
        {
        case 0:
        case 12:
            for (int i = 0; i < this.sum; i++)
            {
                if (i % 3 != 0 && this.typeEff != 12 && TileMap.tileTypeAt(this.x[i], this.y[i] - GameCanvas.transY, 2))
                {
                    this.activeEff[i] = true;
                }
                if (i % 3 == 0 && this.y[i] > GameCanvas.h + GameScr.cmy)
                {
                    this.x[i] = Res.random(-10, GameCanvas.w + 300) + GameScr.cmx;
                    this.y[i] = Res.random(-100, 0) + GameScr.cmy;
                }
                if (!this.activeEff[i])
                {
                    this.y[i] += this.vy[i];
                    this.x[i] += this.vx[i];
                }
                if (this.activeEff[i])
                {
                    this.t[i]++;
                    if (this.t[i] > 2)
                    {
                        this.frame[i]++;
                        this.t[i] = 0;
                        if (this.frame[i] > 1)
                        {
                            this.frame[i]     = 0;
                            this.activeEff[i] = false;
                            this.x[i]         = Res.random(-10, GameCanvas.w + 300) + GameScr.cmx;
                            this.y[i]         = Res.random(-100, 0) + GameScr.cmy;
                        }
                    }
                }
            }
            return;

        case 1:
        case 2:
        case 5:
        case 6:
        case 7:
        case 11:
            for (int j = 0; j < this.sum; j++)
            {
                if (j % 3 != 0 && TileMap.tileTypeAt(this.x[j], this.y[j] + ((TileMap.tileID != 15) ? 0 : 10), 2))
                {
                    this.activeEff[j] = true;
                }
                if (j % 3 == 0 && this.y[j] > TileMap.pxh)
                {
                    this.x[j] = Res.random(-10, TileMap.pxw + 50);
                    this.y[j] = Res.random(-50, 0);
                }
                if (!this.activeEff[j])
                {
                    for (int k = 0; k < Teleport.vTeleport.size(); k++)
                    {
                        Teleport teleport = (Teleport)Teleport.vTeleport.elementAt(k);
                        if (teleport != null && teleport.paintFire && this.x[j] < teleport.x + 80 && this.x[j] > teleport.x - 80 && this.y[j] < teleport.y + 80 && this.y[j] > teleport.y - 80)
                        {
                            this.x[j] += ((this.x[j] >= teleport.x) ? 10 : -10);
                        }
                    }
                    this.y[j] += this.vy[j];
                    this.x[j] += this.vx[j];
                    this.t[j]++;
                    int num = (this.typeEff != 11) ? 4 : 3;
                    if (this.t[j] > ((this.typeEff == 2) ? 4 : 2))
                    {
                        this.frame[j]++;
                        this.t[j] = 0;
                        if (this.frame[j] > num - 1)
                        {
                            this.frame[j] = 0;
                        }
                    }
                }
                else
                {
                    this.t[j]++;
                    if (this.t[j] == 100)
                    {
                        this.t[j]         = 0;
                        this.x[j]         = Res.random(-10, TileMap.pxw + 50);
                        this.y[j]         = Res.random(-50, 0);
                        this.activeEff[j] = false;
                    }
                }
            }
            return;

        case 3:
            break;

        case 4:
            for (int l = 0; l < this.sum; l++)
            {
                this.t[l]++;
                if (this.t[l] > 10)
                {
                    this.tick[l]++;
                    this.t[l] = 0;
                    if (this.tick[l] > 5)
                    {
                        this.tick[l] = 0;
                    }
                    this.frame[l] = this.dem[this.tick[l]];
                }
            }
            return;

        case 8:
            this.tFire++;
            if (this.tFire == 3)
            {
                this.tFire = 0;
                this.frameFire++;
                if (this.frameFire > 1)
                {
                    this.frameFire = 0;
                }
            }
            if (GameCanvas.gameTick % this.tStart == 0)
            {
                this.isFly = true;
            }
            if (this.isFly)
            {
                if (this.way == 1)
                {
                    this.xShip += this.speed;
                    if (this.xShip > TileMap.pxw + 50)
                    {
                        this.reloadShip();
                        return;
                    }
                }
                else if (this.way == 2)
                {
                    this.xShip -= this.speed;
                    if (this.xShip < -50)
                    {
                        this.reloadShip();
                        return;
                    }
                }
                else if (this.way == 3)
                {
                    this.yShip += this.speed;
                    if (this.yShip > TileMap.pxh + 50)
                    {
                        this.reloadShip();
                        return;
                    }
                }
                else if (this.way == 4)
                {
                    this.yShip -= this.speed;
                    if (this.yShip < -50)
                    {
                        this.reloadShip();
                        return;
                    }
                }
            }
            break;

        case 9:
            for (int m = 0; m < this.num; m++)
            {
                this.x[m] -= this.vx[m];
                if (this.x[m] < -this.vx[m])
                {
                    BackgroudEffect.wP[m] = Res.abs(Res.random(1, 3));
                    this.vx[m]            = BackgroudEffect.wP[m];
                    this.x[m]             = GameCanvas.w + this.vx[m];
                }
            }
            return;

        case 10:
            for (int n = 0; n < this.num; n++)
            {
                this.x[n] -= this.vx[n];
                if (this.x[n] < -this.vx[n] + GameScr.cmx)
                {
                    this.x[n] = GameCanvas.w + this.vx[n] + GameScr.cmx;
                }
            }
            return;

        case 13:
            BackgroudEffect.updateCloud2();
            return;

        case 14:
            BackgroudEffect.updateFog();
            break;

        default:
            return;
        }
    }