diff --git a/src/com/hotmail/kalebmarc/textfighter/item/Chest.java b/src/com/hotmail/kalebmarc/textfighter/item/Chest.java index 41e6687f..92a46770 100644 --- a/src/com/hotmail/kalebmarc/textfighter/item/Chest.java +++ b/src/com/hotmail/kalebmarc/textfighter/item/Chest.java @@ -23,11 +23,11 @@ public static void view() { Ui.println(" Recovery: " + Potion.get("recovery")); Ui.println("Coins: " + Coins.get()); Ui.println("POWERS: " + Power.get()); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - if (Weapon.arrayWeapon.get(i).owns()) { - Ui.println(Weapon.arrayWeapon.get(i).getName()); - if (!Weapon.arrayWeapon.get(i).melee) - Ui.println(" (Ammo: " + Weapon.arrayWeapon.get(i).getAmmo() + ")"); + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + if (Weapon.getWeapons().get(i).owns()) { + Ui.println(Weapon.getWeapons().get(i).getName()); + if (!Weapon.getWeapons().get(i).melee) + Ui.println(" (Ammo: " + Weapon.getWeapons().get(i).getAmmo() + ")"); } } for (int i = 1; i < Armour.getArmours().size(); i++) { @@ -35,9 +35,9 @@ public static void view() { Ui.println(Armour.getArmours().get(i).toString()); } } - for (int i = 0; i < Food.arrayFood.size(); i++) { - if (Food.arrayFood.get(i).getQuantity() > 0) - Ui.println(Food.arrayFood.get(i).getName() + "(x" + Food.arrayFood.get(i).getQuantity() + ")"); + for (int i = 0; i < Food.getFoods().size(); i++) { + if (Food.getFoods().get(i).getQuantity() > 0) + Ui.println(Food.getFoods().get(i).getName() + "(x" + Food.getFoods().get(i).getQuantity() + ")"); } Ui.println(); Ui.println("------------------------------"); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Cheats.java b/src/com/hotmail/kalebmarc/textfighter/main/Cheats.java index 4ecdb042..5af1425c 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Cheats.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Cheats.java @@ -44,27 +44,27 @@ private static void cheatSelect() { Coins.set(5000, false); FirstAid.set(5000, false); InstaHealth.set(5000, false); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - Weapon.arrayWeapon.get(i).setAmmo(5000, false); + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + Weapon.getWeapons().get(i).setAmmo(5000, false); } Power.set(5000, false); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - Weapon.arrayWeapon.get(i).owns = true; + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + Weapon.getWeapons().get(i).owns = true; } Stats.timesCheated++; - for (int i = 0; i < Food.arrayFood.size(); i++) - Food.arrayFood.get(i).setQuantity(5000); + for (int i = 0; i < Food.getFoods().size(); i++) + Food.getFoods().get(i).setQuantity(5000); Potion.set("Survival", 5000, false); Potion.set("Recovery", 5000, false); break; case "weaponstash": - for (int i = 0; i <= Weapon.arrayWeapon.size(); i++) { - Weapon.arrayWeapon.get(i).setAmmo(5000, false); + for (int i = 0; i <= Weapon.getWeapons().size(); i++) { + Weapon.getWeapons().get(i).setAmmo(5000, false); } Power.set(5000, false); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - Weapon.arrayWeapon.get(i).owns = true; + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + Weapon.getWeapons().get(i).owns = true; } Stats.timesCheated++; break; @@ -73,8 +73,8 @@ private static void cheatSelect() { InstaHealth.set(500, false); Potion.set("Survival", 500, false); Potion.set("Recovery", 500, false); - for (int i = 0; i < Food.arrayFood.size(); i++) - Food.arrayFood.get(i).setQuantity(100); + for (int i = 0; i < Food.getFoods().size(); i++) + Food.getFoods().get(i).setQuantity(100); Stats.timesCheated++; break; case "healme": @@ -103,8 +103,8 @@ private static void cheatSelect() { Stats.timesCheated++; break; case "thirstforfood": - for (int i = 0; i < Food.arrayFood.size(); i++) - Food.arrayFood.get(i).setQuantity(10); + for (int i = 0; i < Food.getFoods().size(); i++) + Food.getFoods().get(i).setQuantity(10); Stats.timesCheated++; break; diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Debug.java b/src/com/hotmail/kalebmarc/textfighter/main/Debug.java index 48b0e98e..5520c30f 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Debug.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Debug.java @@ -56,12 +56,12 @@ public static void menu() { Xp.set(Ui.getValidInt(), false); break; case 3: - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - Weapon.arrayWeapon.get(i).owns = true; + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + Weapon.getWeapons().get(i).owns = true; } Power.set(100, true); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - Weapon.arrayWeapon.get(i).setAmmo(10000, false); + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + Weapon.getWeapons().get(i).setAmmo(10000, false); } Ui.println("You now have all weapons"); Ui.pause(); @@ -84,10 +84,10 @@ public static void menu() { break; case 8: Ui.cls(); - for (int i = 0; i < Food.arrayFood.size(); i++) { - Ui.println(i + ") " + Food.arrayFood.get(i).getName()); + for (int i = 0; i < Food.getFoods().size(); i++) { + Ui.println(i + ") " + Food.getFoods().get(i).getName()); } - Food.arrayFood.get(Ui.getValidInt()).setQuantity(10); + Food.getFoods().get(Ui.getValidInt()).setQuantity(10); break; case 9: return; diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java b/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java index adb16e21..5b280d9d 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java @@ -1,5 +1,6 @@ package com.hotmail.kalebmarc.textfighter.main; +import com.hotmail.kalebmarc.textfighter.item.Armour; import com.hotmail.kalebmarc.textfighter.player.*; import javax.swing.*; @@ -72,6 +73,10 @@ public static void set(int i) { current = arrayEnemy.get(i); } + public static ArrayList getEnemies() { + return arrayEnemy; + } + public static Enemy get() { return current; } @@ -84,9 +89,9 @@ public static void findEnemy() { int playerLevel = Xp.getLevel(); ArrayList suitableEnemies = new ArrayList<>(); - for (int i = 0; i < arrayEnemy.size(); i++) { - if (arrayEnemy.get(i).levelMin <= playerLevel && playerLevel <= arrayEnemy.get(i).levelMax) { - suitableEnemies.add(arrayEnemy.get(i)); + for (int i = 0; i < getEnemies().size(); i++) { + if (getEnemies().get(i).levelMin <= playerLevel && playerLevel <= getEnemies().get(i).levelMax) { + suitableEnemies.add(getEnemies().get(i)); } } current = suitableEnemies.get(Random.RInt(0, suitableEnemies.size() -1)); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Food.java b/src/com/hotmail/kalebmarc/textfighter/main/Food.java index 927b9d9b..aac8f2fa 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Food.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Food.java @@ -1,5 +1,6 @@ package com.hotmail.kalebmarc.textfighter.main; +import com.hotmail.kalebmarc.textfighter.item.Armour; import com.hotmail.kalebmarc.textfighter.player.Health; import java.util.ArrayList; @@ -32,10 +33,10 @@ public static void list() { while (true) { Ui.cls(); int j = 0; - int[] offset = new int[arrayFood.size()]; - for (int i = 0; i < arrayFood.size(); i++) { - if (arrayFood.get(i).quantity > 0) { - Ui.println((j + 1) + ") " + arrayFood.get(i).getName() + "(" + arrayFood.get(i).quantity + ")"); + int[] offset = new int[getFoods().size()]; + for (int i = 0; i < getFoods().size(); i++) { + if (getFoods().get(i).quantity > 0) { + Ui.println((j + 1) + ") " + getFoods().get(i).getName() + "(" + getFoods().get(i).quantity + ")"); offset[j] = i - j; j++; } @@ -57,14 +58,14 @@ public static void list() { //TODO once more status effects are implemented, use a switch here if appropriate. //Testing to make sure the option is valid goes here: - if (arrayFood.get(menuItem).getStatusEffect() == StatusEffect.type.HEALTH && Health.get() == Health.getOutOf()) { + if (getFoods().get(menuItem).getStatusEffect() == StatusEffect.type.HEALTH && Health.get() == Health.getOutOf()) { Ui.msg("Your health is already full. No need to eat this!"); return; } //Results go here: - if (arrayFood.get(menuItem).quantity > 0) { - Food.arrayFood.get(menuItem).eat(); + if (getFoods().get(menuItem).quantity > 0) { + Food.getFoods().get(menuItem).eat(); } return; @@ -76,6 +77,10 @@ public static void list() { } } + public static ArrayList getFoods() { + return arrayFood; + } + public String getName() { return this.name; } diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Help.java b/src/com/hotmail/kalebmarc/textfighter/main/Help.java index 10d4e448..56e84652 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Help.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Help.java @@ -63,18 +63,18 @@ private static void info_enemy() { Ui.println(" ENEMY INFO "); Ui.println("Which enemy would you like to know about?"); Ui.println(); - for (int i = 0; i < Enemy.arrayEnemy.size(); i++) { - Ui.println((i + 1) + ") " + Enemy.arrayEnemy.get(i).getName()); + for (int i = 0; i < Enemy.getEnemies().size(); i++) { + Ui.println((i + 1) + ") " + Enemy.getEnemies().get(i).getName()); } - Ui.println((Enemy.arrayEnemy.size() + 1) + ") Back"); + Ui.println((Enemy.getEnemies().size() + 1) + ") Back"); Ui.println("------------------------------------------------------------"); int menuItem = Ui.getValidInt(); try { - Enemy.arrayEnemy.get(menuItem - 1).viewAbout(); + Enemy.getEnemies().get(menuItem - 1).viewAbout(); } catch (Exception e) { - if (menuItem == (Enemy.arrayEnemy.size() + 1)) return; + if (menuItem == (Enemy.getEnemies().size() + 1)) return; Ui.println(menuItem + " is not an option."); Ui.pause(); } @@ -115,18 +115,18 @@ private static void info_weapons() { Ui.println(" WEAPON INFO "); Ui.println("Which weapon would you like to know about?"); Ui.println(); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - Ui.println((i + 1) + ") " + Weapon.arrayWeapon.get(i).getName()); + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + Ui.println((i + 1) + ") " + Weapon.getWeapons().get(i).getName()); } - Ui.println((Weapon.arrayWeapon.size() + 1) + ") Back"); + Ui.println((Weapon.getWeapons().size() + 1) + ") Back"); Ui.println("------------------------------------------------------------"); int menuItem = Ui.getValidInt(); try { - Weapon.arrayWeapon.get(menuItem - 1).viewAbout(); + Weapon.getWeapons().get(menuItem - 1).viewAbout(); } catch (Exception e) { - if (menuItem == (Weapon.arrayWeapon.size() + 1)) return; + if (menuItem == (Weapon.getWeapons().size() + 1)) return; Ui.println(menuItem + " is not an option."); Ui.pause(); } @@ -176,18 +176,18 @@ private static void info_food() { Ui.println(" FOOD INFO "); Ui.println("Which food would you like to know about?"); Ui.println(); - for (int i = 0; i < Food.arrayFood.size(); i++) { - Ui.println((i + 1) + ") " + Food.arrayFood.get(i).getName()); + for (int i = 0; i < Food.getFoods().size(); i++) { + Ui.println((i + 1) + ") " + Food.getFoods().get(i).getName()); } - Ui.println((Food.arrayFood.size() + 1) + ") Back"); + Ui.println((Food.getFoods().size() + 1) + ") Back"); Ui.println("------------------------------------------------------------"); int menuItem = Ui.getValidInt(); try { - Food.arrayFood.get(menuItem - 1).viewAbout(); + Food.getFoods().get(menuItem - 1).viewAbout(); } catch (Exception e) { - if (menuItem == (Food.arrayFood.size() + 1)) return; + if (menuItem == (Food.getFoods().size() + 1)) return; Ui.println(menuItem + " is not an option."); Ui.pause(); } @@ -266,10 +266,10 @@ private static void info_achs() { Ui.println(" Enemy Slayer | Kill a total of 100 enemies"); Ui.println(" First Kill | Kill one enemy"); Ui.println(" Time For An Upgrade | Buy any weapon from the shop"); - for (int i = 0; i < Enemy.arrayEnemy.size(); i++) { - Ui.print(" Goodbye, " + Enemy.arrayEnemy.get(i).getName()); - for (int x = 0; x < (14 - Enemy.arrayEnemy.get(i).getName().length()); x++) Ui.print(" "); - Ui.println("| Kill a " + Enemy.arrayEnemy.get(i).getName()); + for (int i = 0; i < Enemy.getEnemies().size(); i++) { + Ui.print(" Goodbye, " + Enemy.getEnemies().get(i).getName()); + for (int x = 0; x < (14 - Enemy.getEnemies().get(i).getName().length()); x++) Ui.print(" "); + Ui.println("| Kill a " + Enemy.getEnemies().get(i).getName()); } Ui.println(" Text-Fighter Master | Get all other achievements"); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Saves.java b/src/com/hotmail/kalebmarc/textfighter/main/Saves.java index e9179079..189e2860 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Saves.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Saves.java @@ -91,16 +91,16 @@ public static void save() { set("Stats.Kills", Stats.kills); set("Stats.Total_Kills", Stats.totalKills); set("Stats.High_Score", Stats.highScore); - set("User.Weapons.Current", Weapon.arrayWeapon.indexOf(Weapon.get())); + set("User.Weapons.Current", Weapon.getWeapons().indexOf(Weapon.get())); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - if (Weapon.arrayWeapon.get(i).owns()) { + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + if (Weapon.getWeapons().get(i).owns()) { set(("User.Weapons." + i), true); } else { set(("User.Weapons." + i), false); } - set(("User.Weapons.Ammo." + i), Weapon.arrayWeapon.get(i).getAmmo()); + set(("User.Weapons.Ammo." + i), Weapon.getWeapons().get(i).getAmmo()); } @@ -120,7 +120,7 @@ public static void save() { set("User.Armour.Current", Armour.get()); //Enemy - set("Battle.Current.Enemy", Enemy.arrayEnemy.indexOf(Enemy.get())); + set("Battle.Current.Enemy", Enemy.getEnemies().indexOf(Enemy.get())); set("Battle.Current.Enemy_Health", Enemy.get().getHealth()); set("Battle.Current.Enemy_Max_Health", Enemy.get().getHealthMax()); set("Battle.Current.Enemy_First_Aid_Kit", Enemy.get().getFirstAidKit()); @@ -133,9 +133,9 @@ public static void save() { List enemiesKilled = new ArrayList<>(); - for (int i = 0; i < Enemy.arrayEnemy.size(); i++) + for (int i = 0; i < Enemy.getEnemies().size(); i++) if (Achievements.arrayKilled.get(i)) - enemiesKilled.add(Enemy.arrayEnemy.get(i).getName()); + enemiesKilled.add(Enemy.getEnemies().get(i).getName()); set("Achievements.Enemies_Killed", enemiesKilled); set("Achievements.Text_Fighter_Master", Achievements.textFighterMaster); set("Achievements.YAY_POWER", Achievements.YAYPOWER); @@ -249,11 +249,11 @@ public static boolean load() { Stats.totalKills = getInteger("Stats.Total_Kills"); Weapon.set(getInteger("User.Weapons.Current")); - for(int i = 0; i < Weapon.arrayWeapon.size(); i++){ + for(int i = 0; i < Weapon.getWeapons().size(); i++){ if (getBoolean("User.Weapons." + i)){ - Weapon.arrayWeapon.get(i).owns = true; + Weapon.getWeapons().get(i).owns = true; } - Weapon.arrayWeapon.get(i).setAmmo(getInteger("User.Weapons.Ammo." + i), false); + Weapon.getWeapons().get(i).setAmmo(getInteger("User.Weapons.Ammo." + i), false); } Power.set(getInteger("User.Power"), false); @@ -283,8 +283,8 @@ public static boolean load() { List achSet = (List) getList("Achievements.Enemies_Killed"); for (int i = 0; i < achSet.size(); i++){ - for (int x = 0; x < Enemy.arrayEnemy.size(); x++){ - if(Enemy.arrayEnemy.get(x).getName().equals(achSet.get(i))){ + for (int x = 0; x < Enemy.getEnemies().size(); x++){ + if(Enemy.getEnemies().get(x).getName().equals(achSet.get(i))){ Achievements.arrayKilled.set(x, true); } } @@ -457,10 +457,10 @@ public static boolean convert() { Stats.highScore = readInt(); Stats.totalKills = readInt(); Weapon.set(readInt()); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) - Weapon.arrayWeapon.get(i).owns = readBoolean(); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) - Weapon.arrayWeapon.get(i).setAmmo(readInt(), false); + for (int i = 0; i < Weapon.getWeapons().size(); i++) + Weapon.getWeapons().get(i).owns = readBoolean(); + for (int i = 0; i < Weapon.getWeapons().size(); i++) + Weapon.getWeapons().get(i).setAmmo(readInt(), false); Power.set(readInt(), false); Power.used = readInt(); Stats.totalDamageDealt = readInt(); @@ -479,7 +479,7 @@ public static boolean convert() { Achievements.enemySlayer = readBoolean(); Achievements.firstKill = readBoolean(); Achievements.timeForAnUpgrade = readBoolean(); - for (int i = 0; i < Enemy.arrayEnemy.size(); i++) + for (int i = 0; i < Enemy.getEnemies().size(); i++) Achievements.arrayKilled.set(i, readBoolean()); Achievements.textFighterMaster = readBoolean(); Achievements.YAYPOWER = readBoolean(); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Shop.java b/src/com/hotmail/kalebmarc/textfighter/main/Shop.java index cc6f295b..7528bcc1 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Shop.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Shop.java @@ -132,12 +132,12 @@ private static void weapons() { Ui.println(); Ui.println("-------------------------------------------------------------------"); int j = 0; - int[] offset = new int[Weapon.arrayWeapon.size()]; - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - if (Weapon.arrayWeapon.get(i).isBuyable()) { - Ui.println((j + 1) + ") " + Weapon.arrayWeapon.get(i).getName()); - Ui.println(" Price: " + Weapon.arrayWeapon.get(i).price); - Ui.println(" Level: " + Weapon.arrayWeapon.get(i).level); + int[] offset = new int[Weapon.getWeapons().size()]; + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + if (Weapon.getWeapons().get(i).isBuyable()) { + Ui.println((j + 1) + ") " + Weapon.getWeapons().get(i).getName()); + Ui.println(" Price: " + Weapon.getWeapons().get(i).price); + Ui.println(" Level: " + Weapon.getWeapons().get(i).level); offset[j] = i - j; j++; Ui.println(); @@ -170,7 +170,7 @@ private static void weapons() { menuItem = menuItem + offset[menuItem]; //Results go here: - Weapon.arrayWeapon.get(menuItem).buy(); + Weapon.getWeapons().get(menuItem).buy(); return; } catch (Exception e) { @@ -255,12 +255,12 @@ private static void buyAmmo() { Ui.println(); Ui.println("-------------------------------------------------------------------"); ArrayList validWeapons = new ArrayList(); - for (int i = 0; i < Weapon.arrayWeapon.size(); i++) { - if (Weapon.arrayWeapon.get(i).isBuyable() && !Weapon.arrayWeapon.get(i).melee && Weapon.arrayWeapon.get(i).owns()) { - Ui.println((validWeapons.size() + 1) + ") " + Weapon.arrayWeapon.get(i).getName()); - Ui.println(" Price: " + Weapon.arrayWeapon.get(i).getAmmoPrice()); - Ui.println(" Level: " + Weapon.arrayWeapon.get(i).level); - validWeapons.add(Weapon.arrayWeapon.get(i)); + for (int i = 0; i < Weapon.getWeapons().size(); i++) { + if (Weapon.getWeapons().get(i).isBuyable() && !Weapon.getWeapons().get(i).melee && Weapon.getWeapons().get(i).owns()) { + Ui.println((validWeapons.size() + 1) + ") " + Weapon.getWeapons().get(i).getName()); + Ui.println(" Price: " + Weapon.getWeapons().get(i).getAmmoPrice()); + Ui.println(" Level: " + Weapon.getWeapons().get(i).level); + validWeapons.add(Weapon.getWeapons().get(i)); } } Ui.println((validWeapons.size() + 1) + ") Back"); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index 48a2e615..ba4fc51d 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -1,5 +1,6 @@ package com.hotmail.kalebmarc.textfighter.main; +import com.hotmail.kalebmarc.textfighter.item.Armour; import com.hotmail.kalebmarc.textfighter.player.Achievements; import com.hotmail.kalebmarc.textfighter.player.Coins; import com.hotmail.kalebmarc.textfighter.player.Stats; @@ -91,6 +92,10 @@ public Weapon(String name, boolean startingWeapon, boolean buyable, int price, i } } + public static ArrayList getWeapons() { + return arrayWeapon; + } + public static Weapon get() { return current; } @@ -117,10 +122,10 @@ public static void choose() { Ui.println("Equipped weapon: " + current.getName()); Ui.println("----------------------------"); int j = 0; - int[] offset = new int[arrayWeapon.size()]; - for (int i = 0; i < arrayWeapon.size(); i++) { - if (arrayWeapon.get(i).owns()) { - Ui.println((j + 1) + ") " + arrayWeapon.get(i).getName()); + int[] offset = new int[getWeapons().size()]; + for (int i = 0; i < getWeapons().size(); i++) { + if (getWeapons().get(i).owns()) { + Ui.println((j + 1) + ") " + getWeapons().get(i).getName()); offset[j] = i - j; j++; } @@ -142,13 +147,13 @@ public static void choose() { menuItem = menuItem + offset[menuItem]; //Testing to make sure the option is valid goes here: - if (!arrayWeapon.get(menuItem).owns) { + if (!getWeapons().get(menuItem).owns) { Ui.msg("You do not own this weapon!"); return; } - current = arrayWeapon.get(menuItem); - Ui.msg("You have equipped a " + arrayWeapon.get(menuItem).getName()); + current = getWeapons().get(menuItem); + Ui.msg("You have equipped a " + getWeapons().get(menuItem).getName()); return; } catch (Exception e) {