From 7fc4c3859c2caf4c7551d4dd1ff54fb61f84b0c6 Mon Sep 17 00:00:00 2001 From: R1ndT Date: Fri, 15 Jan 2021 14:36:32 +0100 Subject: [PATCH 1/8] Added the critical hit popup and the damage multiplier --- .../hotmail/kalebmarc/textfighter/main/Weapon.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index dbb9be87..d72fb274 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -200,6 +200,17 @@ public void dealDam() { if (Random.RInt(100) > this.chanceOfMissing) { damageDealt += BULLET_DAMAGE; Stats.bulletsThatHit++; + + if (true) { + Ui.cls(); + Ui.println("----------------------------------------------------"); + Ui.println("Critical Hit!"); + Ui.println("You dealt 10x normal damage."); + Ui.println("----------------------------------------------------"); + Ui.pause(); + damageDealt *= 10; + + } } //Results From c0e98bf79d376ae754a4ae4b33dca89b7d5fef18 Mon Sep 17 00:00:00 2001 From: R1ndT Date: Sat, 16 Jan 2021 08:46:14 +0100 Subject: [PATCH 2/8] Added damageDealt to the enemy death message I figured out, it would be nice to see the final blow damage, especially when dealing a critical hit. I could potentially use the same variable for all the other methods in Enemy.Java, getting damageDealt from Weapon.java. It would clean up the code a bit, but I don't want to go through the extra hassle, without anyone really demanding it, so if you think it would be a cool enhancement, let me know! --- src/com/hotmail/kalebmarc/textfighter/main/Enemy.java | 8 +++++++- src/com/hotmail/kalebmarc/textfighter/main/Weapon.java | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java b/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java index e37218d3..5266c7b0 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java @@ -24,6 +24,7 @@ public class Enemy { private int coinDropMax; private int damageMin; private int damageMax; + int damageDealt; private int xp; //Variables @@ -109,6 +110,11 @@ void dealDamage() { Health.takeDamage(damage); } + void returnDamage(int damage) { + damageDealt = damage; + + } + private void die() { //Get rewards & store in temp vars @@ -118,7 +124,7 @@ private void die() { com.hotmail.kalebmarc.textfighter.player.Xp.setBattleXp(0, false); //Prompt enemy death - Ui.popup("You have defeated an enemy! You've found " + tempCoin + " coins, and " + xp + "Xp!", "You've defeated an enemy!", JOptionPane.PLAIN_MESSAGE); + Ui.popup("You have defeated an enemy, dealing " + damageDealt + " damage! You've found " + tempCoin + " coins, and " + xp + "Xp!", "You've defeated an enemy!", JOptionPane.PLAIN_MESSAGE); //Rewards testFoundPipe(); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index d72fb274..f4a3ea84 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -23,6 +23,7 @@ public class Weapon { public boolean owns; private int damageMin; private int damageMax; + private int damageDealt; private double chanceOfMissing; private String name; private boolean buyable; @@ -182,7 +183,6 @@ public int getAmmo() { } public void dealDam() { - int damageDealt = 0; if (this.melee) { /* @@ -223,6 +223,8 @@ public void dealDam() { damageDealt = 0; } } + //Make damageDealt available in Enemy.java + Enemy.get().returnDamage(damageDealt); //Display stuff com.hotmail.kalebmarc.textfighter.player.Stats.totalDamageDealt += damageDealt; From 571e6ee25d1f87570341ca44d153337674f2272a Mon Sep 17 00:00:00 2001 From: R1ndT Date: Sat, 16 Jan 2021 11:31:45 +0100 Subject: [PATCH 3/8] Moved critical hit popup to it's own method --- .../kalebmarc/textfighter/main/Weapon.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index f4a3ea84..47390df2 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -200,17 +200,8 @@ public void dealDam() { if (Random.RInt(100) > this.chanceOfMissing) { damageDealt += BULLET_DAMAGE; Stats.bulletsThatHit++; + criticalHit(); - if (true) { - Ui.cls(); - Ui.println("----------------------------------------------------"); - Ui.println("Critical Hit!"); - Ui.println("You dealt 10x normal damage."); - Ui.println("----------------------------------------------------"); - Ui.pause(); - damageDealt *= 10; - - } } //Results @@ -243,7 +234,22 @@ public void dealDam() { if (Enemy.get().getHealth() <= Enemy.get().getHealthMax() / 3){ Enemy.get().useFirstAidKit(); } - } + } + damageDealt = 0; + } + + public void criticalHit() { + if (true) { + damageDealt *= 10; + + Ui.cls(); + Ui.println("----------------------------------------------------"); + Ui.println("Critical Hit!"); + Ui.println("You dealt 10x normal damage."); + Ui.println("----------------------------------------------------"); + Ui.pause(); + + } } public void viewAbout() { From bb819cc07887584e618da382a1501cb8dbd7b726 Mon Sep 17 00:00:00 2001 From: R1ndT Date: Sat, 16 Jan 2021 12:37:11 +0100 Subject: [PATCH 4/8] Added logic to critical hit chance and damage I know you originally wanted to have a 0.01% chance and 10x normal damage, but I think that 1 crit in 10 000 normal hits makes it more of an easter egg than a feature, so I've made it a 1% chance. I've further added some variability to the damage multiplier. This of course is not my project, so if you have any objections, I will change it back to what you have intended, or make an additional if statement with your parameters. --- src/com/hotmail/kalebmarc/textfighter/main/Weapon.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index 47390df2..87aa6069 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -200,7 +200,6 @@ public void dealDam() { if (Random.RInt(100) > this.chanceOfMissing) { damageDealt += BULLET_DAMAGE; Stats.bulletsThatHit++; - criticalHit(); } @@ -208,6 +207,7 @@ public void dealDam() { setAmmo(-1, true); Stats.bulletsFired += 1; } + criticalHit(); } else { noAmmo(); @@ -239,13 +239,15 @@ public void dealDam() { } public void criticalHit() { - if (true) { - damageDealt *= 10; + if (Random.RInt(100) == 1) { + int critMultiplier = Random.RInt(5, 10); + + damageDealt *= critMultiplier; Ui.cls(); Ui.println("----------------------------------------------------"); Ui.println("Critical Hit!"); - Ui.println("You dealt 10x normal damage."); + Ui.println("You dealt " + critMultiplier + "x normal damage."); Ui.println("----------------------------------------------------"); Ui.pause(); From 4e1bb3136ae09dc432699eebbf84d41489c8ab9b Mon Sep 17 00:00:00 2001 From: R1ndT Date: Sat, 16 Jan 2021 20:45:11 +0100 Subject: [PATCH 5/8] Implemented a wapon specific crit chance system Implemented a new weapon property "critChanceMultiplier" and used it to modify the critical hit logic. I also mentioned this new criteria in "viewAbout()". --- .../kalebmarc/textfighter/main/Weapon.java | 9 ++++-- .../textfighter/player/Settings.java | 28 +++++++++++-------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index 87aa6069..11083247 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -25,6 +25,7 @@ public class Weapon { private int damageMax; private int damageDealt; private double chanceOfMissing; + private double critChanceMultiplier; private String name; private boolean buyable; //Ammo @@ -34,7 +35,7 @@ public class Weapon { private int ammoIncludedWithPurchase; public Weapon(String name, int ammoUsed, int ammoIncludedWithPurchase, boolean buyable, int price, //For guns - int ammoPrice, int level, double chanceOfMissing, boolean firstInit, boolean changeDif) { + int ammoPrice, int level, double chanceOfMissing, double critChanceMultiplier, boolean firstInit, boolean changeDif) { this.name = name; this.ammoUsed = ammoUsed; @@ -44,6 +45,7 @@ public Weapon(String name, int ammoUsed, int ammoIncludedWithPurchase, boolean b this.ammoPrice = ammoPrice; this.level = level; this.chanceOfMissing = chanceOfMissing; + this.critChanceMultiplier = critChanceMultiplier; this.melee = false; if (!changeDif) { @@ -207,6 +209,7 @@ public void dealDam() { setAmmo(-1, true); Stats.bulletsFired += 1; } + //Run the logic for critical hit criticalHit(); } else { @@ -239,7 +242,8 @@ public void dealDam() { } public void criticalHit() { - if (Random.RInt(100) == 1) { + + if (Random.RInt((int) (100 / this.critChanceMultiplier)) == 1) { int critMultiplier = Random.RInt(5, 10); damageDealt *= critMultiplier; @@ -269,6 +273,7 @@ public void viewAbout() { Ui.println("Chance of missing: " + this.chanceOfMissing + "%"); Ui.println("Ammo Used: " + this.ammoUsed); Ui.println("Damage: " + this.getDamage()); + Ui.println("Chance of critical hit: " + this.critChanceMultiplier + "%"); for (int i = 0; i < BORDER_LENGTH; i++) Ui.print("-");//Make line Ui.pause(); Ui.cls(); diff --git a/src/com/hotmail/kalebmarc/textfighter/player/Settings.java b/src/com/hotmail/kalebmarc/textfighter/player/Settings.java index aab21bd2..5af13d15 100644 --- a/src/com/hotmail/kalebmarc/textfighter/player/Settings.java +++ b/src/com/hotmail/kalebmarc/textfighter/player/Settings.java @@ -156,15 +156,18 @@ private static void setConstants(String dif, boolean firstInit, boolean changeDi //Weapons //Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, firstInit, changeDif) //Melee: (name, startingWeapon, buyable, price, level, damageMin, damageMax, firstInit) + + //Melee: Game.fists = new Weapon("Fists", true, false, 0, 0, 5, 10, firstInit, changeDif); Game.baseballBat = new Weapon("Baseball Bat", false, true, 120, 1, 10, 15, firstInit, changeDif); Game.knife = new Weapon("Knife", false, true, 125, 2, 10, 20, firstInit, changeDif); Game.pipe = new Weapon("Pipe", false, false, 0, 0, 5, 20, firstInit, changeDif); - Game.pistol = new Weapon("Pistol", 1, 18, true, 250, 1, 4, 15, firstInit, changeDif); - Game.smg = new Weapon("Smg", 10, 75, true, 700, 1, 10, 75, firstInit, changeDif); - Game.shotgun = new Weapon("Shotgun", 1, 12, true, 375, 2, 9, 60, firstInit, changeDif); - Game.rifle = new Weapon("Rifle", 1, 18, true, 275, 1, 5, 10, firstInit, changeDif); - Game.sniper = new Weapon("Sniper", 1, 10, true, 700, 2, 7, 0, firstInit, changeDif); + //Guns: + Game.pistol = new Weapon("Pistol", 1, 18, true, 250, 1, 4, 15, 1.5, firstInit, changeDif); + Game.smg = new Weapon("Smg", 10, 75, true, 700, 1, 10, 75, 2.5, firstInit, changeDif); + Game.shotgun = new Weapon("Shotgun", 1, 12, true, 375, 2, 9, 60, 2, firstInit, changeDif); + Game.rifle = new Weapon("Rifle", 1, 18, true, 275, 1, 5, 10, 1.25, firstInit, changeDif); + Game.sniper = new Weapon("Sniper", 1, 10, true, 700, 2, 7, 0, 1, firstInit, changeDif); //Price Power.price = 25; @@ -198,17 +201,20 @@ private static void setConstants(String dif, boolean firstInit, boolean changeDi Game.ogre = new Enemy("Ogre", 100, 20, 50, 10, 30, 50, firstInit, changeDif); //Weapons - //Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, firstInit, changeDif) + //Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, critChanceMultiplier, firstInit, changeDif) //Melee: (name, startingWeapon, buyable, price, level, damageMin, damageMax, firstInit, changeDif) + + //Melee: Game.fists = new Weapon("Fists", true, false, 0, 0, 5, 10, firstInit, changeDif); Game.baseballBat = new Weapon("Baseball Bat", false, true, 170, 1, 10, 15, firstInit, changeDif); Game.knife = new Weapon("Knife", false, true, 175, 2, 10, 20, firstInit, changeDif); Game.pipe = new Weapon("Pipe", false, false, 0, 0, 5, 20, firstInit, changeDif); - Game.pistol = new Weapon("Pistol", 1, 18, true, 275, 1, 4, 15, firstInit, changeDif); - Game.smg = new Weapon("Smg", 10, 75, true, 800, 1, 10, 75, firstInit, changeDif); - Game.shotgun = new Weapon("Shotgun", 1, 12, true, 415, 2, 9, 60, firstInit, changeDif); - Game.rifle = new Weapon("Rifle", 1, 18, true, 300, 1, 5, 10, firstInit, changeDif); - Game.sniper = new Weapon("Sniper", 1, 10, true, 750, 2, 7, 0, firstInit, changeDif); + //Guns: + Game.pistol = new Weapon("Pistol", 1, 18, true, 275, 1, 4, 15, 1.25, firstInit, changeDif); + Game.smg = new Weapon("Smg", 10, 75, true, 800, 1, 10, 75, 1.75, firstInit, changeDif); + Game.shotgun = new Weapon("Shotgun", 1, 12, true, 415, 2, 9, 60, 1.5, firstInit, changeDif); + Game.rifle = new Weapon("Rifle", 1, 18, true, 300, 1, 5, 10, 1, firstInit, changeDif); + Game.sniper = new Weapon("Sniper", 1, 10, true, 750, 2, 7, 0, .75, firstInit, changeDif); //PRICE Power.price = 75; From 2695bc7b9ca0450e1d306a5657e8b1e08d723a8c Mon Sep 17 00:00:00 2001 From: R1ndT Date: Tue, 19 Jan 2021 16:23:58 +0100 Subject: [PATCH 6/8] Created a getter for "damageDealt" variable When getting the value, why do I have to type "Weapon.get().getDamageDealt()" instead of just "Weapon.getDamageDealt()", when the variable is not directly tied to the weapon? --- src/com/hotmail/kalebmarc/textfighter/main/Enemy.java | 8 +------- src/com/hotmail/kalebmarc/textfighter/main/Weapon.java | 6 ++++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java b/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java index 5266c7b0..d6267662 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Enemy.java @@ -24,7 +24,6 @@ public class Enemy { private int coinDropMax; private int damageMin; private int damageMax; - int damageDealt; private int xp; //Variables @@ -110,11 +109,6 @@ void dealDamage() { Health.takeDamage(damage); } - void returnDamage(int damage) { - damageDealt = damage; - - } - private void die() { //Get rewards & store in temp vars @@ -124,7 +118,7 @@ private void die() { com.hotmail.kalebmarc.textfighter.player.Xp.setBattleXp(0, false); //Prompt enemy death - Ui.popup("You have defeated an enemy, dealing " + damageDealt + " damage! You've found " + tempCoin + " coins, and " + xp + "Xp!", "You've defeated an enemy!", JOptionPane.PLAIN_MESSAGE); + Ui.popup("You have defeated an enemy, dealing " + Weapon.get().getDamageDealt() + " damage! You've found " + tempCoin + " coins, and " + xp + "Xp!", "You've defeated an enemy!", JOptionPane.PLAIN_MESSAGE); //Rewards testFoundPipe(); diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index 11083247..9fa8ba2f 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -184,6 +184,10 @@ public int getAmmo() { return this.ammo; } + public int getDamageDealt() { + return this.damageDealt; + } + public void dealDam() { if (this.melee) { @@ -217,8 +221,6 @@ public void dealDam() { damageDealt = 0; } } - //Make damageDealt available in Enemy.java - Enemy.get().returnDamage(damageDealt); //Display stuff com.hotmail.kalebmarc.textfighter.player.Stats.totalDamageDealt += damageDealt; From cc7b49ad52547b5440f4e1e8f472ca22f7d6a781 Mon Sep 17 00:00:00 2001 From: R1ndT Date: Tue, 19 Jan 2021 16:44:23 +0100 Subject: [PATCH 7/8] Cleaned up the critical hit logic --- src/com/hotmail/kalebmarc/textfighter/main/Weapon.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index 9fa8ba2f..8e144e3d 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -243,9 +243,9 @@ public void dealDam() { damageDealt = 0; } - public void criticalHit() { + private void criticalHit() { - if (Random.RInt((int) (100 / this.critChanceMultiplier)) == 1) { + if (wasCriticalHit()) { int critMultiplier = Random.RInt(5, 10); damageDealt *= critMultiplier; @@ -260,6 +260,10 @@ public void criticalHit() { } } + private boolean wasCriticalHit() { + return Random.RInt((int) (100 / this.critChanceMultiplier)) == 1; + } + public void viewAbout() { final int BORDER_LENGTH = 39; From e1165d2bffcb9b78f418992d63aad5de247acfb3 Mon Sep 17 00:00:00 2001 From: R1ndT Date: Tue, 19 Jan 2021 20:44:07 +0100 Subject: [PATCH 8/8] Implemented the weapon specific crit damage multiplier Again, if you do not like the variable values, let me know. --- .../kalebmarc/textfighter/main/Weapon.java | 9 +++-- .../textfighter/player/Settings.java | 36 ++++++++++--------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java index 8e144e3d..45055909 100644 --- a/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java +++ b/src/com/hotmail/kalebmarc/textfighter/main/Weapon.java @@ -26,6 +26,8 @@ public class Weapon { private int damageDealt; private double chanceOfMissing; private double critChanceMultiplier; + private int critDamMultiplierMin; + private int critDamMultiplierMax; private String name; private boolean buyable; //Ammo @@ -35,7 +37,7 @@ public class Weapon { private int ammoIncludedWithPurchase; public Weapon(String name, int ammoUsed, int ammoIncludedWithPurchase, boolean buyable, int price, //For guns - int ammoPrice, int level, double chanceOfMissing, double critChanceMultiplier, boolean firstInit, boolean changeDif) { + int ammoPrice, int level, double chanceOfMissing, double critChanceMultiplier, int critDamMultiplierMin, int critDamMultiplierMax, boolean firstInit, boolean changeDif) { this.name = name; this.ammoUsed = ammoUsed; @@ -46,6 +48,8 @@ public Weapon(String name, int ammoUsed, int ammoIncludedWithPurchase, boolean b this.level = level; this.chanceOfMissing = chanceOfMissing; this.critChanceMultiplier = critChanceMultiplier; + this.critDamMultiplierMin = critDamMultiplierMin; + this.critDamMultiplierMax = critDamMultiplierMax; this.melee = false; if (!changeDif) { @@ -246,7 +250,7 @@ public void dealDam() { private void criticalHit() { if (wasCriticalHit()) { - int critMultiplier = Random.RInt(5, 10); + int critMultiplier = Random.RInt(this.critDamMultiplierMin, this.critDamMultiplierMax); damageDealt *= critMultiplier; @@ -280,6 +284,7 @@ public void viewAbout() { Ui.println("Ammo Used: " + this.ammoUsed); Ui.println("Damage: " + this.getDamage()); Ui.println("Chance of critical hit: " + this.critChanceMultiplier + "%"); + Ui.println("Critical hit damage multiplier: " + this.critDamMultiplierMin + "-" + this.critDamMultiplierMax + "x"); for (int i = 0; i < BORDER_LENGTH; i++) Ui.print("-");//Make line Ui.pause(); Ui.cls(); diff --git a/src/com/hotmail/kalebmarc/textfighter/player/Settings.java b/src/com/hotmail/kalebmarc/textfighter/player/Settings.java index 5af13d15..f2aa3837 100644 --- a/src/com/hotmail/kalebmarc/textfighter/player/Settings.java +++ b/src/com/hotmail/kalebmarc/textfighter/player/Settings.java @@ -153,9 +153,11 @@ private static void setConstants(String dif, boolean firstInit, boolean changeDi Game.evilUnicorn = new Enemy("Evil Unicorn", 35, 30, 40, 5, 15, 20, firstInit, changeDif); Game.ogre = new Enemy("Ogre", 90, 20, 50, 10, 30, 50, firstInit, changeDif); - //Weapons - //Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, firstInit, changeDif) - //Melee: (name, startingWeapon, buyable, price, level, damageMin, damageMax, firstInit) + /*Weapons + * Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, critChanceMultiplier, + * critDamMultiplierMin, critDamMultiplierMax firstInit, changeDif) + * Melee: (name, startingWeapon, buyable, price, level, damageMin, damageMax, firstInit, changeDif) + */ //Melee: Game.fists = new Weapon("Fists", true, false, 0, 0, 5, 10, firstInit, changeDif); @@ -163,11 +165,11 @@ private static void setConstants(String dif, boolean firstInit, boolean changeDi Game.knife = new Weapon("Knife", false, true, 125, 2, 10, 20, firstInit, changeDif); Game.pipe = new Weapon("Pipe", false, false, 0, 0, 5, 20, firstInit, changeDif); //Guns: - Game.pistol = new Weapon("Pistol", 1, 18, true, 250, 1, 4, 15, 1.5, firstInit, changeDif); - Game.smg = new Weapon("Smg", 10, 75, true, 700, 1, 10, 75, 2.5, firstInit, changeDif); - Game.shotgun = new Weapon("Shotgun", 1, 12, true, 375, 2, 9, 60, 2, firstInit, changeDif); - Game.rifle = new Weapon("Rifle", 1, 18, true, 275, 1, 5, 10, 1.25, firstInit, changeDif); - Game.sniper = new Weapon("Sniper", 1, 10, true, 700, 2, 7, 0, 1, firstInit, changeDif); + Game.pistol = new Weapon("Pistol", 1, 18, true, 250, 1, 4, 15, 1.5, 3, 4, firstInit, changeDif); + Game.smg = new Weapon("Smg", 10, 75, true, 700, 1, 10, 75, 2.5, 4, 6, firstInit, changeDif); + Game.shotgun = new Weapon("Shotgun", 1, 12, true, 375, 2, 9, 60, 2, 5, 7, firstInit, changeDif); + Game.rifle = new Weapon("Rifle", 1, 18, true, 275, 1, 5, 10, 1.25, 6, 7, firstInit, changeDif); + Game.sniper = new Weapon("Sniper", 1, 10, true, 700, 2, 7, 0, 1, 7, 10, firstInit, changeDif); //Price Power.price = 25; @@ -200,9 +202,11 @@ private static void setConstants(String dif, boolean firstInit, boolean changeDi Game.evilUnicorn = new Enemy("Evil Unicorn", 35, 20, 40, 5, 15, 20, firstInit, changeDif); Game.ogre = new Enemy("Ogre", 100, 20, 50, 10, 30, 50, firstInit, changeDif); - //Weapons - //Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, critChanceMultiplier, firstInit, changeDif) - //Melee: (name, startingWeapon, buyable, price, level, damageMin, damageMax, firstInit, changeDif) + /*Weapons + * Gun: (name, ammoUsed, ammoIncludedWithPurchase, buyable, price, ammoPrice, level, chanceOfMissing, critChanceMultiplier, + * critDamMultiplierMin, critDamMultiplierMax firstInit, changeDif) + * Melee: (name, startingWeapon, buyable, price, level, damageMin, damageMax, firstInit, changeDif) + */ //Melee: Game.fists = new Weapon("Fists", true, false, 0, 0, 5, 10, firstInit, changeDif); @@ -210,11 +214,11 @@ private static void setConstants(String dif, boolean firstInit, boolean changeDi Game.knife = new Weapon("Knife", false, true, 175, 2, 10, 20, firstInit, changeDif); Game.pipe = new Weapon("Pipe", false, false, 0, 0, 5, 20, firstInit, changeDif); //Guns: - Game.pistol = new Weapon("Pistol", 1, 18, true, 275, 1, 4, 15, 1.25, firstInit, changeDif); - Game.smg = new Weapon("Smg", 10, 75, true, 800, 1, 10, 75, 1.75, firstInit, changeDif); - Game.shotgun = new Weapon("Shotgun", 1, 12, true, 415, 2, 9, 60, 1.5, firstInit, changeDif); - Game.rifle = new Weapon("Rifle", 1, 18, true, 300, 1, 5, 10, 1, firstInit, changeDif); - Game.sniper = new Weapon("Sniper", 1, 10, true, 750, 2, 7, 0, .75, firstInit, changeDif); + Game.pistol = new Weapon("Pistol", 1, 18, true, 275, 1, 4, 15, 1.25, 2, 3, firstInit, changeDif); + Game.smg = new Weapon("Smg", 10, 75, true, 800, 1, 10, 75, 1.75, 3, 5, firstInit, changeDif); + Game.shotgun = new Weapon("Shotgun", 1, 12, true, 415, 2, 9, 60, 1.5, 4, 6, firstInit, changeDif); + Game.rifle = new Weapon("Rifle", 1, 18, true, 300, 1, 5, 10, 1, 5, 6, firstInit, changeDif); + Game.sniper = new Weapon("Sniper", 1, 10, true, 750, 2, 7, 0, .75, 7, 9, firstInit, changeDif); //PRICE Power.price = 75;