Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Sword.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public boolean useOn(Character other) {
int breakChance = (int) (Math.random() * 100);
if (isBroken) {
System.out.println("Your weapon is broken you can't use it");
isBroken = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use fixWeapon()?

System.out.println("Your weapon has been fixed");
return false;
} else if (breakChance >= 99) {
System.out.println("Your weapon broke! You need to fix it before it can be used again.");
Expand All @@ -30,6 +32,9 @@ public boolean useOn(Character other) {
} else if (hitNumber > 1) {
System.out.println("You hit " + hitNumber + " times!");
}
else {
System.out.println("You hit once.");
}
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Warrior.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Warrior extends Character {

public Warrior(String name, int weight, int height, String eyeColor, String hairColor) {
super(name);
addWeapon(new Sword(name + "'s sword", "Plain Old Sword"));
addWeapon(new Sword("Plain Old Sword", name + "'s weapon"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to PR name

this.weight = weight;
this.height = height;
this.eyeColor = eyeColor;
Expand Down