import java.util.Random;
public class driver{
    public static void main(String[] args){

        System.out.println("Game Start");
        System.out.println("------------");
        Rider r= new Rider();
        r.RiderAttack();

    }
}
class zombie{
    int BossBlood=20;
}

class Rider extends zombie{

    int RiderBlood=10;
    int RiderDefense=4;
    public void RiderAttack() {
        for (int i = 1; RiderBlood > 0 && BossBlood >= 0; i++) {
            int BossAttack = (int) (Math.random() * 12);
            int RiderAttack = (int) (Math.random() * 10);
            System.out.println("玩家正在攻击,造成" + RiderAttack + "点伤害");
            sleep(800);
            if (RiderAttack == 0 ) {
                System.out.println("“真可惜被挡住了呢”");
                sleep(800);
            }
            if (RiderAttack >= 6) {
                System.out.println("玩家打出了致命的一击!!!");
                sleep(800);
            }
            if (RiderAttack >= 6) {
                System.out.println("玩家触发了吸血");
                RiderBlood += RiderAttack - 6;
                sleep(800);
            }
            BossBlood -= RiderAttack;
            System.out.println("genm 所剩血量: " + BossBlood);
            sleep(800);
            if ((BossBlood == 4) || (BossBlood == 3) || (BossBlood == 2) || (BossBlood == 1) || (BossBlood == 0)) {
                System.out.println("genm表现很奇怪");
                BossBlood += 3;
                sleep(800);
            }
            if (BossBlood < 0) {
                System.out.println("genm 死亡.");
                sleep(800);
                System.out.println("Game Clear!!!!!");
                break;
            }
            System.out.println("genm正在攻击,造成" + BossAttack + "点伤害");
            sleep(800);
            if (BossAttack == 0) {
                System.out.println("“真可惜被挡住了呢”");
                sleep(800);
            }

            RiderBlood -= BossAttack - RiderDefense;
            System.out.println("玩家所剩血量: " + RiderBlood);
            sleep(800);
            if (RiderBlood <= 4) {
                System.out.println("玩家触发护盾");
                sleep(800);
                RiderDefense += 1;
            }
            if (RiderBlood <= 0) {
                System.out.println("玩家死亡");
                sleep(800);
                System.out.println("Game Over");
                break;
            }
        }
    }




    public static void sleep(int time){
    try {
        Thread.sleep(time);
    }catch (Exception e){
        e.printStackTrace();
    }
}}