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

📄 screen.java

📁 手机上的SLG游戏
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                                        phase = 1;
                                }

                        } else{

                                try{
                                        Thread.sleep(500);
                                } catch( Exception e ){
                                        System.out.println(e);
                                }

                        }

                        if( phase == 1 ){
                                setEvent();
                                ch_p = 0;
                                if( status[28] == 0 ){
                                        status[28] = Math.abs( rand.nextInt() % 6 ) + 1;
                                        //status[28] = 1;
                                }
                                //save_status(1);
                        }

                        // Event_Set
                        if( phase == 1 ){

                                phase = 2;

                                drawMapBack();
                                g.unlock(true);
                                g.lock();

                                try{
                                        Thread.sleep(300);
                                } catch( Exception e ){
                                        System.out.println(e);
                                }

                        // 僒僀僐儘偑怳傜傟偨
                        } else if( phase == 2 ){

                                // 僶僀僽儗乕僔儑儞僗僞乕僩
                                if( status[15] == 1 ){
                                       // PhoneSystem.setAttribute(
                                               // PhoneSystem.DEV_VIBRATOR,
                                               // PhoneSystem.ATTR_VIBRATOR_ON );
                                }
                                drawMapBack();

                                if( status[10] == 3 || status[10] == 4 ){
                                        drawWaku( 0, 0, 120, 65,
                                            "决定掷出的骰子" );
                                }

                                g.unlock(true);
                                g.lock();

                                temp_int = 0;

                                // 傾僀僥儉僠僃僢僋(僄儔償僃乕儖)
                                if( status[10] == 3 || status[10] == 4 ){

                                        try{
                                                Thread.sleep(2000);
                                        } catch( Exception e ){
                                                System.out.println(e);
                                        }

                                        drawMapBack();
                                        g.unlock(true);
                                        g.lock();

                                        temp_int = wait_action();

                                        // 弌栚寛掕
                                        if( ( ( 1<<EZDisplay.KEY_1 ) & temp_int ) != 0 ){
                                                temp_int = 1;
                                        } else if( ( ( 1<<EZDisplay.KEY_2 ) & temp_int ) != 0 ){
                                                temp_int = 2;
                                        } else if( ( ( 1<<EZDisplay.KEY_3 ) & temp_int ) != 0 ){
                                                temp_int = 3;
                                        } else if( ( ( 1<<EZDisplay.KEY_4 ) & temp_int ) != 0 ){
                                                temp_int = 4;
                                        } else if( ( ( 1<<EZDisplay.KEY_5 ) & temp_int ) != 0 ){
                                                temp_int = 5;
                                        } else if( ( ( 1<<EZDisplay.KEY_6 ) & temp_int ) != 0 ){
                                                temp_int = 6;
                                        } else{
                                                temp_int = 0;
                                        }

                                        if( status[10] == 4 && Math.abs( rand.nextInt() % 2 ) == 0 ){
                                                temp_int = 0;
                                                drawWaku( 0, 60, 110, 25, "失败了.." );
                                                g.unlock(true);
                                                try{
                                                        Thread.sleep(1000);
                                                } catch( Exception e ){
                                                        System.out.println(e);
                                                }
                                                g.lock();
                                        } else{
                                                drawWaku( 0, 60, 110, 25, "成功了!" );
                                                g.unlock(true);
                                                try{
                                                        Thread.sleep(1000);
                                                } catch( Exception e ){
                                                        System.out.println(e);
                                                }
                                                g.lock();
                                        }

                                        status[10] = 0;

                                }

                                for( int i = 10; i >= 0; i-- ){

                                        // 僒僀僐儘偑夞偭偰傞
                                        sai = image_sai[ sai_st - 1 ];

                                        sai_st++;
                                        if( sai_st == 4 ){
                                                sai_st = 1;
                                        }

                                        if( i == 0 ){

                                                // 弌栚昞帵
                                                if( status[28] != 0 ){
                                                        sai_num = status[28];
                                                } else{
                                                        //sai_num = Math.abs( rand.nextInt() % 6 ) + 1;
                                                        sai_num = status[28];
                                                        //status[28] = sai_num;
                                                }
                                                if( temp_int != 0 ){
                                                        sai_num = temp_int;
                                                }
                                                sai = get_image( sai_num + 26 );
                                                g.drawImage( get_image( status[7] + 15 ), 0, 0 );
                                                g.drawImage( sai, 10, 20 );

                                                // 弌栚傪攝楍偵墴偟崬傓
                                                System.arraycopy( deme, 0, deme, 1, 2 );
                                                deme[0] = sai_num;

                                        } else{

                                                // 僑乕僗僩傪徚偡
                                                // 攚宨昤幨
                                                g.drawImage( get_image( status[7] + 15 ), 0, 0 );
                                                g.drawImage( sai, 10, 20 );

                                        }

                                        g.unlock(true);

                                        try{
                                                Thread.sleep(100);
                                        } catch( Exception e ){
                                                System.out.println(e);
                                        }

                                        g.lock();

                                }

                                // 僶僀僽儗乕僔儑儞僗僩僢僾
                                if( status[15] == 1 ){
                                        ///PhoneSystem.setAttribute(
                                                //PhoneSystem.DEV_VIBRATOR,
                                                //PhoneSystem.ATTR_VIBRATOR_OFF );
                                }

                                try{
                                        Thread.sleep(500);
                                } catch( Exception e ){
                                        System.out.println(e);
                                }

                                // 僉儍儔堏摦
                                for( int j = sai_num; j >= 1; j-- ){

                                        ch_p++;

                                        // 巆傝儅僗偺尭嶼
                                        status[5]--;

                                        // HP偺尭嶼(尗幰偺忨丄埥偄偼揤嬻偱偼尭傜側偄)
                                        if( status[7] != 1 && status[12] != 26 ){

                                                // 抧壓偼-2
                                                if( status[7] == 3 ){
                                                        status[0] -= 2;

                                                // 抧忋偼-1
                                                } else{
                                                        status[0]--;
                                                }

                                                // 埫崟偺寱
                                                if( have_item(28) != 0 ){
                                                        status[0]--;
                                                }

                                                // 埫崟偺奪
                                                if( have_item(39) != 0 ){
                                                        status[0]--;
                                                }

                                        }

                                        drawMapBack();

                                        g.unlock(true);

                                        if( status[0] <= 0 ){

                                                status[0] = 0;
                                                save_status(1);

                                                g.lock();
                                                drawWaku( 0, 0, 120, 65,
                                                    "您已尽力了,游戏结束。按任意键" );

                                                setSoftLabel(SOFT_KEY_1,"");
                                                setSoftLabel(SOFT_KEY_2,"");

                                                g.unlock(true);
                                                g.lock();

                                                wait_action();

                                                toTheEnd();

                                        }

                                        try{
                                                Thread.sleep(500);
                                        } catch( Exception e ){
                                                System.out.println(e);
                                        }

                                        g.lock();

                                        // 傕偟堦廃偟偨傜
                                        if( status[5] <= 0 ){

                                                // 壒
                                                if( status[8] == 1 ){
                                                        snd_mode = 1;
                                                        //if( bgm != null ){
                                                               // bgm.stop();
                                                        //}
                                                        //get_sound(1);
                                                        //bgm.play();
                                                        //try{
                                                         //       Thread.sleep(4000);
                                                        //} catch( Exception e ){
                                                              //  System.out.println(e);
                                                       // }
                                                        snd_mode = 0;
                                                }

                                                if( status[9] < status[11] - 1 ){
                                                        drawWaku( 0, 0, 120, 65,
                                                                 "做的好!旋转经验值上升。残余"
                                                                 +  ( status[11] - status[9] - 1 )
                                                                 + "周。" );
                                                } else{

                                                        status[0] = 0;
                                                        save_status(1);

                                                        status[9]++;

                                                        if( status[9] == 99 ){
                                                                drawWaku( 0, 0, 120, 100,
                                                            "您达到了最大旋转回数99周。祝贺您。游戏结束,请按任意键" );

                                                        } else{
                                                                drawWaku( 0, 0, 120, 65,
                                                            status[11]
                                 + "旋转了。游戏结束。请按任意键" );

                                                        }

                                                        setSoftLabel(SOFT_KEY_1,"");
                                                        setSoftLabel(SOFT_KEY_2,"");

                                                        g.unlock(true);
                                                        g.lock();

                                                        wait_action();

                                                        toTheEnd();

                                                }

                                                g.unlock(true);

                                                try{
                                                        Thread.sleep(2000);
                                                } catch( Exception e ){
                                                        System.out.println(e);
                                                }

                                                upExp(20);

                                                try{
                                                        Thread.sleep(1000);
                                                } catch( Exception e ){
                                                        System.out.println(e);
                                                }

                                                upHP(10);

                                                if( status[8] == 1 ){
                                                        if( status[7] == 1 ){
                                                               // get_sound(6);

⌨️ 快捷键说明

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