BattleTest2.java



/** ゲームの戦闘シーンのテスト(その2) */
public class BattleTest2 {

    public static void main( String argv[] ) {
        Monster monster = new Monster( "Fujikkie", 8, 50 );
        int num = 4;
        Human[] humans = new Human[num];
        for( int i=0; i<num; i++ ) {
            humans[i]= new Human( "人間その" + i );
        }
        System.out.println( "########################################" ); 
        System.out.println( Monster.species + " VS " + Human.species 
                         + " 戦闘開始!" );
        System.out.println( "########################################" ); 

        for( int i=0; i<num; i++ ) {
            Battle battle = new Battle( humans[i], monster );
            battle.start();
            if( !monster.isAlive() ) break;
        }
        System.out.println( "########################################" ); 
        if( humans[num-1].isAlive() )
            System.out.println( Human.species + "は勝利した" );
        else
            System.out.println( Human.species + "は滅亡した" );
        System.out.println( "########################################" ); 
    }
}