⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maincanvas.java.bak

📁 超精典手机版Call of Duty(使命的召唤)
💻 BAK
📖 第 1 页 / 共 5 页
字号:
                int int5 = 0;
                for(int k5 = (SPECIAL_GFX_W[int3] >> 4) - 1; k5 >= 0; k5--)
                {
                    for(int i6 = (SPECIAL_GFX_H[int3] >> 4) - 1; i6 >= 0; i6--)
                    {
                        int int6;
                        for(int6 = 0; int6 < int5; int6++)
                        {
                            if(aint0[int6] != MapData[i3 + i6][j2 + k5])
                                continue;
                            MapData[i3 + i6][j2 + k5] = aint1[int6];
                            break;
                        }

                        if(int6 == int5)
                        {
                            aint0[int5] = MapData[i3 + i6][j2 + k5];
                            aint1[int5] = int2;
                            int5++;
                            vector3.addElement(vector3.elementAt(MapData[i3 + i6][j2 + k5]));
                            vector4.addElement(new Integer(int4));
                            if(int4 == 5)
                                vector5.addElement(new Integer(-1));
                            else
                                vector5.addElement(new Integer(int1));
                            MapData[i3 + i6][j2 + k5] = int2;
                            int2++;
                        }
                    }

                }

                if(int3 != 9)
                {
                    specialX[int1] = j2 << 4;
                    specialY[int1] = i3 << 4;
                    specialType[int1] = int3;
                    specialDamage[int1] = 2;
                    int1++;
                }
            }
        }

        TileTextureData = new int[int2];
        TileBlockData = new int[int2];
        TileSpecialData = new int[int2];
        for(int l5 = 0; l5 < int2; l5++)
        {
            TileTextureData[l5] = (int)((Integer)vector3.elementAt(l5)).intValue();
            TileBlockData[l5] = (int)((Integer)vector4.elementAt(l5)).intValue();
            TileSpecialData[l5] = (int)((Integer)vector5.elementAt(l5)).intValue();
        }

        if(int1 > 0)
        {
            specialArrayStart = 0;
            specialArrayNext[int1 - 1] = -1;
            specialArrayPrevious[0] = -1;
            if(int1 > 1)
            {
                for(int j6 = int1 - 2; j6 >= 0; j6--)
                {
                    specialArrayNext[j6] = (int)(j6 + 1);
                    specialArrayPrevious[j6 + 1] = (int)j6;
                }

            }
        } else
        {
            specialArrayStart = -1;
        }
        playerAimX[0] = playerAimX[1] = playerAimY[0] = playerAimY[1] = -1;
        int k6 = Math.min(playerY[currentPlayer] + 16 + 55, 2048);
        screenImageTop = k6 - height;
        k6 = (k6 + 15 >> 4) << 4;
        screenSplit = k6 - screenImageHeight;
        screenImageDiscontinuity = screenImageHeight;
        int l6 = k6 >> 4;
        int i7 = screenImageHeight >> 4;
        for(int j7 = i7 - 1; j7 >= 0; j7--)
        {
            l6--;
            for(int k7 = 10; k7 >= 0; k7--)
            {
                screenImageGraphics.setClip(k7 << 4, j7 << 4, 16, 16);
                int int7 = TileTextureData[MapData[l6][k7]];
                if(int7 == 26)
                    screenImageGraphics.drawImage(tilesImage, k7 - 0 << 4, j7 << 4, 20);
                else
                if(int7 == 28)
                {
                    screenImageGraphics.setColor(0);
                    screenImageGraphics.fillRect(k7 << 4, j7 << 4, 16, 16);
                }
                screenImageGraphics.drawImage(tilesImage, k7 - int7 << 4, j7 << 4, 20);
            }

        }

    }

    public final void pause()
    {
        cod.notifyPaused();
    }

    private final void readRecords()
    {
        try
        {
            RecordStore recordstore = RecordStore.openRecordStore("cod", false);
            byte aint0[] = recordstore.getRecord(1);
            recordstore.closeRecordStore();
            missionNumberMax = aint0[0];
            soundOn = aint0[1] > 0;
            for(int i = 0; i <= missionNumberMax; i++)
            {
                missionTime[i] = 0;
                for(int j = 0; j < 4; j++)
                    missionTime[i] = (missionTime[i] << 8) + (aint0[2 + 4 * i + j] & 0xff);

            }

        }
        catch(RecordStoreNotFoundException recordstorenotfoundexception)
        {
            writeRecords();
        }
        catch(Exception exception) { }
    }

    private final void writeRecords()
    {
        try
        {
            byte aint0[] = new byte[4 * missionNumberMax + 6];
            aint0[0] = missionNumberMax;
            aint0[1] = (byte)(soundOn ? 1 : 0);
            for(int i = 0; i <= missionNumberMax; i++)
            {
                for(int j = 0; j < 4; j++)
                    aint0[2 + 4 * i + j] = (byte)(missionTime[i] >>> (3 - j) * 8 & 0xff);

            }

            RecordStore recordstore = RecordStore.openRecordStore("cod", true);
            if(recordstore.getNumRecords() == 0)
                recordstore.addRecord(aint0, 0, aint0.length);
            else
                recordstore.setRecord(1, aint0, 0, aint0.length);
            recordstore.closeRecordStore();
        }
        catch(Exception exception) { }
    }

    private void PlaySound(int i)
    {
        if(soundOn)
            try
            {
                sound = new Sound(soundWAV, 5);
                sound.play(i);
            }
            catch(Exception exception)
            {
                System.out.println("Error starting sound - " + exception);
            }
    }

    private void StopSound()
    {
        if(soundOn)
            try
            {
                sound.stop();
                sound.release();
                sound = null;
            }
            catch(Exception exception)
            {
                System.out.println("Error stopping sound - " + exception);
            }
    }

    public final void exitGame()
    {
        cod.exit();
    }

    public final void paint(Graphics g)
    {
        if(screenType == 2)
        {
            g.drawImage(screenImage, -screenImageLeft, screenSplit - screenImageTop, 20);
            g.drawImage(screenImage, -screenImageLeft, screenSplit - screenImageTop - screenImageHeight, 20);
            int int0 = specialArrayStart;
            boolean flag = true;
            for(; int0 >= 0; int0 = specialArrayNext[int0])
            {
                int int5 = specialType[int0];
                if(int5 < 0)
                {
                    int5 = (int)(-1 - int5);
                    int j2 = (specialY[int0] - screenImageTop) + CRATER_DRAW_Y[int5];
                    if(j2 < height && j2 + CRATER_GFX_H[int5] >= 0)
                    {
                        flag = false;
                        g.setClip(specialX[int0] - screenImageLeft, j2, CRATER_GFX_W[int5], CRATER_GFX_H[int5]);
                        g.drawImage(craterImage, specialX[int0] - screenImageLeft - CRATER_GFX_X[int5], j2 - CRATER_GFX_Y[int5], 20);
                        if(Math.abs(random.nextInt()) % 40 < 1)
                            StartSmoke(specialX[int0] + Math.abs(random.nextInt()) % CRATER_GFX_W[int5], j2 + screenImageTop + Math.abs(random.nextInt()) % CRATER_GFX_H[int5]);
                    }
                } else
                if(int5 != 4)
                {
                    g.setClip(specialX[int0] - screenImageLeft, specialY[int0] - screenImageTop, SPECIAL_GFX_W[int5], SPECIAL_GFX_H[int5]);
                    if(int5 == 8)
                        g.drawImage(specialImage, specialX[int0] - screenImageLeft - ((frameCount & 0x1) << 4) - 48, specialY[int0] - screenImageTop - 48, 20);
                    else
                        g.drawImage(specialImage, specialX[int0] - screenImageLeft - SPECIAL_GFX_X[int5], specialY[int0] - screenImageTop - SPECIAL_GFX_Y[int5], 20);
                }
            }

            if(flag && Math.abs(random.nextInt()) % 40 < 1)
                StartSmoke(Math.abs(random.nextInt()) % width, screenImageTop + Math.abs(random.nextInt()) % height);
            for(int0 = projectileArrayUsedStart; int0 >= 0; int0 = projectileArrayNext[int0])
                switch(projectileType[int0])
                {
                case 99: // 'c'
                    int i = projectileX[int0] - screenImageLeft;
                    int k2 = projectileY[int0] - screenImageTop;
                    int int7 = projectileDirection[int0];
                    g.setClip(i - bulletClipDeltaX[int7], k2 - bulletClipDeltaY[int7], bulletClipWidth[int7], bulletClipHeight[int7]);
                    g.drawImage(specialImage, i - bulletImageDeltaX[int7], k2 - bulletImageDeltaY[int7], 20);
                    RedrawSceneryAbove(g, projectileX[int0] - bulletClipDeltaX[int7], projectileY[int0] - bulletClipDeltaY[int7], bulletClipWidth[int7], bulletClipHeight[int7], (int)-1);
                    break;

                case 2: // '\002'
                    int j = projectileX[int0] - screenImageLeft - 8;
                    int l2 = projectileY[int0] - screenImageTop - 8;
                    g.setClip(j, l2, 16, 16);
                    g.drawImage(specialImage, j - ((frameCount & 0x1) << 4) - 48, l2 - 32, 20);
                    break;
                }

            squareMax = 0;
            int0 = playerArrayStart;
            Image image = unitImage;
            if(int0 == opponentArrayStart)
                image = enemyImage;
            while(int0 >= 0) 
            {
                int i3 = playerY[int0];
                if(i3 <= screenImageTop + height && i3 + 16 >= screenImageTop)
                {
                    int k = playerX[int0];
                    g.setClip(k - screenImageLeft, i3 - screenImageTop, 16, 16);
                    if(playerHealth[int0] < 0)
                    {
                        int int8 = (int)(-playerHealth[int0]);
                        if((int8 & 0x1) == 1)
                        {
                            int8 = (int)(int8 >> 1 & 0x7);
                            if(int8 > 3)
                                int8++;
                            g.drawImage(image, k - screenImageLeft - 16, i3 - screenImageTop - (int8 << 4), 20);
                        }
                    } else
                    {
                        g.drawImage(image, k - screenImageLeft - (playerMoving[int0] ? (frameCount >> 1) << 4 : 16), i3 - screenImageTop - (playerDirection[int0] << 4), 20);
                    }
                    RedrawSceneryAbove(g, k, i3, 15, 15, int0);
                    if(TileBlockData[MapData[i3 + 8 >> 4][k + 8 >> 4]] == 3)
                    {
                        g.setClip(k - screenImageLeft, (i3 - screenImageTop) + 10, 16, 6);
                        g.drawImage(screenImage, -screenImageLeft, screenSplit - screenImageTop, 20);
                        g.drawImage(screenImage, -screenImageLeft, screenSplit - screenImageTop - screenImageHeight, 20);
                    }
                }
                int0 = playerArrayNext[int0];
                if(int0 == opponentArrayStart)
                    image = enemyImage;
            }
            for(int int9 = 0; int9 < squareMax; int9++)
            {
                g.setClip((squareCol[int9] << 4) - screenImageLeft, (squareRow[int9] << 4) - screenImageTop, 16, 16);
                int int1 = squarePlayer[int9];
                if(int1 < 3)
                    g.setColor(65280);
                else
                    g.setColor(0xff0000);
                g.fillRect((playerX[int1] - screenImageLeft) + 5, (playerY[int1] - screenImageTop) + 5, 6, 6);
            }

            for(int int2 = specialArrayExplodableStart; int2 >= 0; int2 = specialArrayNext[int2])
            {
                int int6 = specialType[int2];
                if(int6 == 4)
                {
                    g.setClip(specialX[int2] - screenImageLeft, specialY[int2] - screenImageTop, SPECIAL_GFX_W[int6], SPECIAL_GFX_H[int6]);
                    g.drawImage(specialImage, specialX[int2] - screenImageLeft - SPECIAL_GFX_X[int6], specialY[int2] - screenImageTop - SPECIAL_GFX_Y[int6], 20);
                }
            }

            for(int int3 = projectileArrayUsedStart; int3 >= 0; int3 = projectileArrayNext[int3])
                switch(projectileType[int3])
                {
                default:
                    break;

                case 0: // '\0'
                    int l = projectileX[int3] - screenImageLeft - 3;
                    int j3 = projectileY[int3] - screenImageTop - 5;
                    g.setClip(l, j3, 7, 10);
                    g.drawImage(specialImage, l - 1 - 64, j3, 20);
                    break;

                case 1: // '\001'
                    int i1 = projectileX[int3] - screenImageLeft - 2;
                    int k3 = projectileY[int3] - screenImageTop - 2;
                    g.setClip(i1, k3, 5, 5);
                    g.drawImage(specialImage, i1 - 74, k3 - 15, 20);
                    break;

                case 10: // '\n'
                    int j1 = projectileX[int3] - screenImageLeft - 16;
                    int l3 = projectileY[int3] - screenImageTop - 16;
                    g.setClip(j1, l3, 32, 32);
                    g.drawImage(explosionImage, j1 - (projectileTime[int3] << 5), l3, 20);
                    break;

                case 11: // '\013'
                    int k1 = projectileX[int3] - screenImageLeft - 16;
                    int i4 = projectileY[int3] - screenImageTop - 16;
                    g.setClip(k1, i4, 32, 32);
                    int k5 = (projectileTime[int3] >> 1) - 3;
                    if(k5 < 0)
                        k5 = -k5;
                    g.drawImage(smokeImage, k1 - (k5 << 5), i4, 20);
                    break;
                }

            for(int int4 = playerArrayStart; int4 != opponentArrayStart; int4 = playerArrayNext[int4])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -