-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChest.java
More file actions
45 lines (44 loc) · 2.59 KB
/
Chest.java
File metadata and controls
45 lines (44 loc) · 2.59 KB
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
package hod_game;
import java.util.*;
public class Chest {
int rand;
Items item;
Items longsword = new Items("Longsword",0,3,0,0,0,0,0,0,0,0,0,0,0,0,1);
Items chainmail = new Items("Chainmail",0,0,0,3,0,0,0,0,0,0,0,0,0,0,3);
Items mace = new Items("Mace",0,2,0,0,0,0,0,0,0,0,0,0,0,0,1);
Items bow = new Items("Bow",0,0,3,0,0,0,0,0,0,0,0,0,0,0,2);
Items staff = new Items("Staff",0,0,0,0,3,0,0,0,0,0,0,0,0,0,2);
Items knife = new Items("Knife",0,1,1,0,0,0,0,0,0,0,0,0,0,0,1);
Items crossbow = new Items("Crossbow",0,1,2,0,0,0,0,0,0,0,0,0,0,0,2);
Items shortsword = new Items("Shortsword",0,2,0,0,0,0,0,0,0,0,0,0,0,0,1);
Items katana = new Items("Katana",0,2,1,0,0,0,0,0,0,0,0,0,0,0,1);
Items scimitar = new Items("Scimitar",0,1,2,0,0,0,0,0,0,0,0,0,0,0,1);
Items BLK_leather = new Items("Black Leather Armor",0,0,0,3,0,0,0,0,0,0,0,0,0,0,3);
Items BLK_robes = new Items("Black Robes",0,0,0,3,0,0,0,0,0,0,0,0,0,0,3);
Items robes = new Items("Robes",0,0,0,2,0,0,0,0,0,0,0,0,0,0,3);
Items rags = new Items("Rags",0,0,0,1,0,0,0,0,0,0,0,0,0,0,3);
Items ironarmor = new Items("Iron Armor",0,0,0,5,0,0,0,0,0,1,0,0,0,0,3);
Items platemail = new Items("Platemail Armor",0,0,0,7,0,0,0,0,0,2,0,0,0,0,3);
Items leathershield = new Items("Leather Buckler Shield",0,0,0,2,0,0,0,0,0,0,0,0,0,0,3);
Items steelshield = new Items("Steel Shield",0,0,0,4,0,0,0,0,0,1,0,0,0,0,3);
Items leatherhelmet = new Items("Leather Helmet",0,0,0,2,0,0,0,0,0,0,0,0,0,0,3);
Items steelhelmet = new Items("Steel Helmet",0,0,0,3,0,0,0,0,0,1,0,0,0,0,3);
Items leatherboots = new Items("Leather Boots",0,0,0,2,0,0,0,0,0,0,0,0,0,0,3);
Items steelboots = new Items("Steel Boots",0,0,0,3,0,0,0,0,0,1,0,0,0,0,3);
Items smallHpPot = new Items("Small Health Potion",10,0,0,0,0,0,0,0,0,0,0,0,0,0,4);
Items mediumHpPot = new Items("Health Potion",25,0,0,0,0,0,0,0,0,0,0,0,0,0,4);
Items largeHpPot = new Items("Max Health Potion",50,0,0,0,0,0,0,0,0,0,0,0,0,0,4);
Items[] possItems = {longsword, chainmail, mace, bow, BLK_leather, staff, BLK_robes, robes, rags, knife, crossbow, shortsword, ironarmor, platemail, leathershield, steelshield, leatherhelmet, steelhelmet, leatherboots, steelboots, katana, scimitar, smallHpPot, mediumHpPot, largeHpPot};
public Chest(){
rand = new Random().nextInt(possItems.length);
item = possItems[rand];
}
public Items open(){
return item;
}
public void newItem()
{
rand = new Random().nextInt(possItems.length);
item = possItems[rand];
}
}