Compare commits

..

No commits in common. "0f6d7eac0fb99d3b6d1cc64838693857ab6822c7" and "3cca8b4fad362963c7fddd775b3494847e33de3b" have entirely different histories.

2 changed files with 19 additions and 166 deletions

View file

@ -26,9 +26,9 @@ interface Weapon {
abstract class Sword implements Weapon {
Map<String, Integer> requirements;
String infoDamageDice;
String infoDamageBonus;
int playerStrength;
int playerDex;
String type = "Melee";
String name;
String rarity;
@ -61,7 +61,6 @@ abstract class Sword implements Weapon {
abstract class Bow implements Weapon {
Map<String, Integer> requirements;
String infoDamageDice;
String infoDamageBonus;
int playerStrength;
int playerDex;

View file

@ -7,7 +7,6 @@ class Longbow extends Bow {
requirements.put("Str", 8);
playerStrength = strength;
playerDex = dex;
infoDamageDice = "1d8";
infoDamageBonus = "0-2";
name = "Longbow";
rarity = "Common";
@ -18,9 +17,10 @@ class Longbow extends Bow {
@Override
public int getDamageBonus(int distance) {
if (playerDex < requirements.get("Dex") || playerStrength < requirements.get("Str") || distance > range) {
if (playerDex < requirements.get("Dex") || playerStrength < requirements.get("Str")) {
return -20;
}
if (distance > 20 && distance <= 165) {
return 2;
}
@ -33,120 +33,8 @@ class Longbow extends Bow {
}
@Override
public int rollDamage(int bonus) {
int dieResult = dice.rollD8();
if (dieResult + bonus < 0) {
return 0;
} else {
return dieResult + bonus;
}
}
}
class Shortbow extends Bow {
public Shortbow(int strength, int dex) {
requirements = new HashMap<>();
requirements.put("Dex", 8);
requirements.put("Str", 6);
infoDamageDice = "1d6";
infoDamageBonus = "0";
playerStrength = strength;
playerDex = dex;
name = "Shortbow";
rarity = "Common";
range = getRange();
hitBonus = getHitBonus();
damageBonus = getDamageBonus();
}
@Override
public int getDamageBonus(int distance) {
if (playerDex < requirements.get("Dex") || playerStrength < requirements.get("Str") || distance > range) {
return -20;
} else {
return 0;
}
}
@Override
public int rollDamage(int bonus){
int dieResult = dice.rollD6();
if (dieResult + bonus < 0) {
return 0;
} else {
return dieResult;
}
}
}
class BowOfTheEnchantedOak extends Bow {
public BowOfTheEnchantedOak(int distance, int strength, int dex) {
requirements = new HashMap<>();
requirements.put("Dex", 25);
requirements.put("Str", 12);
playerStrength = strength;
playerDex = dex;
infoDamageDice = "2d8";
infoDamageBonus = "0-4";
name = "Bow of the Enchanted Oak";
rarity = "Rare";
range = getRange(650);
hitBonus = getHitBonus();
damageBonus = getDamageBonus(distance);
}
@Override
public int getDamageBonus(int distance) {
if (playerDex < requirements.get("Dex") || playerStrength < requirements.get("Str") || distance > range) {
return -20;
}
if (distance > 20 && distance <= 200) {
return 4;
}
else if (distance > 200 && distance <= 400) {
return 2;
}
else if (distance > 400 && distance <= 500){
return 1;
}
else {
return 0;
}
}
@Override
public int rollDamage(int bonus) {
int dieResult = dice.rollD8() + dice.rollD8();
if (dieResult + bonus < 0) {
return 0;
} else {
return dieResult + bonus;
}
}
}
class StraightSword extends Sword {
public StraightSword(int strength) {
requirements = new HashMap<>();
requirements.put("Str", 12);
playerStrength = strength;
infoDamageDice = "1d10";
infoDamageBonus = "1-4";
name = "Straight Sword";
rarity = "Common";
range = getRange();
hitBonus = getHitBonus();
damageBonus = getHitBonus();
}
@Override
public int getDamageBonus() {
if (requirements.get("Str") > playerStrength) {
return -20;
} else {
return dice.rollD4();
}
public int rollToHit(int bonus) {
return dice.rollD20();
}
@Override
@ -160,70 +48,36 @@ class StraightSword extends Sword {
}
}
class ShortSword extends Sword {
public ShortSword(int strength) {
class Shortbow extends Bow {
public Shortbow(int strength, int dex) {
requirements = new HashMap<>();
requirements.put("Str", 8);
infoDamageDice = "1d8";
infoDamageBonus = "-1 - 2";
requirements.put("Dex", 8);
requirements.put("Str", 6);
infoDamageBonus = "0";
playerStrength = strength;
name = "Short Sword";
playerDex = dex;
name = "Shortbow";
rarity = "Common";
range = getRange();
hitBonus = getHitBonus();
damageBonus = getHitBonus();
damageBonus = getDamageBonus();
}
@Override
public int getDamageBonus() {
if (requirements.get("Str") > playerStrength) {
if (playerDex < requirements.get("Dex") || playerStrength < requirements.get("Str")) {
return -20;
} else {
return dice.rollD4() -2;
return 0;
}
}
@Override
public int rollDamage(int bonus) {
int dieResult = dice.rollD8();
public int rollDamage(int bonus){
int dieResult = dice.rollD6();
if (dieResult + bonus < 0) {
return 0;
} else {
return dieResult + bonus;
}
}
}
class PrideOfTheGiantForges extends Sword {
public PrideOfTheGiantForges(int strength) {
requirements = new HashMap<>();
requirements.put("Str", 25);
playerStrength = strength;
infoDamageDice = "2d10";
infoDamageBonus = "3-6";
name = "Pride of the Giant's forges";
rarity = "Rare";
range = getRange();
hitBonus = getHitBonus();
damageBonus = getHitBonus();
}
@Override
public int getDamageBonus() {
if (requirements.get("Str") > playerStrength) {
return -25;
} else {
return dice.rollD4() + 2;
}
}
@Override
public int rollDamage(int bonus) {
int dieResult = dice.rollD10() + dice.rollD10();
if (dieResult + bonus < 0) {
return 0;
} else {
return dieResult + bonus;
return dieResult;
}
}
}