Java
UNIT 5 CHALLENGES

separator-blank.png

UNIT 5 CHALLENGE 2


separator-blank.png

INTRO

In this small project, you will create all the classes required to have an RPG style text based battle.  Please be careful not to add too much extras to your project so that it becomes impossible to complete or excessively time consuming.

SPECIFICATIONS

You will create a text-based RPG battle that will be between your group of Characters and a group of Badguys.  You must have at least 3 Characters in your group and there can be any number of Badguys (1 or more). 

The battle should continue until all Characters or all Badguys reach an HP of zero.  Ideally, once you've coded this, you will tweak the starting attributes so that the result that we do not always get the same winner.

Your game can be interactive asking the user to make choices such as Attack or Defend or can be a pure simulation where everything just happens and is outputted to screen.

Your game needs to output a play-by-play to screen and should be slow enough to read.  You need to either make the user "Hit any key to continue" or make the program pause for a little bit of time.

REQUIRED CLASSES

The classes that you must include are listed below along with their minimal details.  Of couse, you can add more functionality if you wish.

Character

A class that represents your character with RPG character attributes.  You character also has a Weapon and Armor.  Your character also requires HP.

Weapon

An RPG game weapon.  It has a base damage.

Armor

An RPG game armor item.  It has an armor level that helps lower the damage that you character takes.

Badguy

A simpler version of character that represents badguys in an RPG.  It requires a damage amount that it makes and HP.

CHARACTER CLASS

Characters in this game must have at least 4 attributes that impact the character's ability to do battle.

EXAMPLE

Here is an example of four character attributes that you can choose.  Of course, you can use whatever you want instead.

Let's consider a character with these four attributes: ATT, DEF, HP & SP.

ATT stands for attack.  It impacts the amount of damage the character does.
DEF stands for defense.  It impacts the amount of damage the character takes.
HP stands for hit points.  It is the amount of health your character has.
SP stands for speed.  It impacts the order of a character's turn.

Of course, you will have to determine exactly how each attribute above impacts your character. 

Perhaps ATT (attack) will be directly added to the weapon's base damage to calculate the total damage.  Or perhaps your character's ATT will be compared to the defender's DEF and the difference will impact the total damage.  Or perhaps a greater ATT simply increases your chances to hit the enemy.  You decide how each attribute impacts your character.

Note: You will have to explain how each attribute impacts the battle when you present your work to Mr. C.

The minimal Character class diagram is below.  Note that the attributes might vary.  Also note that we made an exception and broke with traditional Java convention to allow for the attribute data fields to be all caps.

Character

name
ATT
DEF
HP
SP
weapon
armor

getDamage()
applyDamage()
isDead()
toString()


WEAPON CLASS


The Weapon class diagram:

Weapon

name
damage

toString()


ARMOR CLASS


The Armor class diagram:

Armor

name
armorAmount

toString()

BADGUY CLASS

The Badguy class diagram:

Badguy

name
damage
hp

toString()


POSSIBLE ADDITIONS

There are too many possible additions for them to all be listed here.  But here are a few"

·         Weapons could have a series of action verbs such as "slashes", "stabs", "swings" that are randomly chosen to give some variety to the battle text.

·         You could do a Roll system to decide your characters initial stats with the option to re-roll if you do not like what you got.

·         You could have random badguys.

·         You can add-on a story.

·         You can have the user enter an option such as attack, defend, annoy and so on that have different impacts on the game.

·         You can have a spellcaster character that can do things like heal, life share and chain lighthing. (I know, I mixed two types of spellcasters there.)

 

 

 





separator-campeau.png