@Dipspiggy/

Text Adventure

Java

idk

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    int monshp = 100;
    int youhp = 100;
    int v = 0;
    int vc = 2;
    Scanner edwin = new Scanner(System.in);
    while (monshp > 0 && youhp > 0) {
      System.out.println("Monster's HP: " + monshp);
      System.out.println("Your HP: " + youhp);
      System.out.println("To [Attack], press 1. To [Heal] (" + vc + "), press 0.");
      int x = edwin.nextInt();
      if (x == 1) {
        int f = (int)(15 * Math.random()) + 1;
        monshp = monshp - f;
        System.out.println("You did " + f + " damage to the Monster.");
      }
      else if (x == 0) {
        if (vc > 0) {
          v = (int)(20 * Math.random()) + 10;
          System.out.println("You have been healed " + v + " HP.");
          youhp = youhp + v;
          if (youhp > 100)
            youhp = 100;
          vc--;
        }
        else if (vc == 0)
          System.out.println("You have no heals left!");
      }
      int ma = (int)(15 * Math.random()) + 1;
      youhp = youhp - ma;
      System.out.println("The Monster did " + ma + " damage to you.");
    }
    if (monshp <= 0) {
      System.out.println("Monster's HP: 0");
      System.out.println("⬜⬛⬛⬛⬜⬛⬛⬛⬜⬜⬜⬛⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬜⬛⬜⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬛⬜⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬛⬜⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬛⬜⬛⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛⬛⬜⬜⬜⬛");
      System.out.println("");
      System.out.println("⬜⬛⬛⬛⬜⬛⬛⬜⬜⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬜⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬜⬜⬛⬛⬜");
      System.out.println("⬜⬛⬜⬛⬜⬛⬛⬛⬜⬛⬛⬛⬜⬛⬜⬛⬜");
      System.out.println("⬜⬛⬜⬛⬜⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬜");
      System.out.println("⬛⬜⬛⬜⬛⬛⬛⬜⬜⬜⬛⬛⬜⬛⬛⬛⬜");
    }
    else if (youhp <= 0) {
      System.out.println("Your HP: 0");
      System.out.println("⬜⬛⬛⬛⬜⬛⬛⬛⬜⬜⬜⬛⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬜⬛⬜⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬛⬜⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬛⬜⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬜");
      System.out.println("⬛⬛⬜⬛⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛⬛⬜⬜⬜⬛");
      System.out.println("");
      System.out.println("⬜⬛⬛⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜");
      System.out.println("⬜⬛⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬛⬛");
      System.out.println("⬜⬛⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬛⬛");
      System.out.println("⬜⬛⬛⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬛⬛");
      System.out.println("⬜⬜⬜⬜⬛⬛⬛⬜⬜⬜⬛⬛⬛⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜");
    }


  }
}