Objectives

The goal of this assignment is to learn the following:

Overview

In this assignment you will create an interactive battle simulator. Users will be given the chance to record their own sound effects. They will be given a description of three different types of champions, and will get to choose their champion and their opponent. Then, the two will fight to the death, with the user's own sound effects detailing each hit and miss in this epic battle.

Requirements

You will need six classes: Equipment, Sounds, Stats, Warrior, Wizard, and Ranger. Class Stats will be your base class, and will contain actions and blueprint actions to be used in each class that inherits from Stats.

To do : You have to put your own record (.wav) in the good files. And only after, you can run this project. When it's implemented, each of the records should last no more than 2 seconds.

Class Equipment

In this class, you will implement a getter and a setter a class variable of type text called name:

Class Stats

This class will need the following library: use Libraries.Containers.Array. As you did in Lab 6.2, you will need to create an array of type Equipment. Name this array inventory. Class Stats will use the following actions:

Class Sounds

This class will contain several actions to record your own sound effects to be used in the simulator. Implement the following actions:

Class Ranger

Class Ranger will inherit from class Stats. It will have one action: action BuildCharacter. Similar to Lab 6.2, BuildCharacter will describe the Ranger in terms of his equipment and weapons. Using the inherited actions from class Stats, add at least 5 items to describe the Ranger. Example:

action BuildCharacter
    Equipment bow
    bow:SetEquipment("uses a two hand bow with steel arrows")
    parent:Stats:AddEquipment(bow)
end

Class Warrior

Class Warrior will inherit from class Stats. It will have one action: action BuildCharacter. BuildCharacter will do the same in class Warrior as it did in class Ranger.

Class Wizard

Class Wizard will inherit from class Stats. It will have one action: action BuildCharacter. BuildCharacter will do the same in class Wizard as it did in class Warrior.

Class Main

Class Main will have two actions:

Next, prompt the user to choose an opponent. Do the same for the opponent selection as you did for the champion selection: telling the user which opponent they selected, and playing the appropriate sound. Now you will simulate a battle between the champion and the opponent. Create a random number generator (named decider) that will generate integers between 0 and 3. Repeat the following until either the champion or the opponent has less than or equal to 0 hp:

if decider = 0
Play "Hit.wav". Decrement the opponent's hp.  Play "Ouch.wav". Tell the user
their champion made a successful hit, and tell them the enemies current hp.

if decider = 1
Tell the user their champion missed the enemy. Play "Miss.wav". Play "Taunt.wav".

if decider = 2
Play "Hit.wav". Decrement the champion's hp. Play "Ouch.wav". Tell the user
their champion was successfully hit by their opponent, and tell them the champions current hp.

if decider = 3
Tell the user the opponent missed their attack on the champion. Play "Miss.wav". Play "Taunt.wav"

Lastly, check to see if either the champion or the opponent has died. If the champion died, play "Defeat.wav" and tell the user the opponent was the victor. If the opponent died, play "Victory.wav" and tell the user the champion was the victor.

Sample Output

When run, the program should describe the three champions to the user. Then, the user will select a champion and an opponent. The battle will ensue, and the user will be told who the victor was in the end. The following is an example of when the program is run after the champions are described:

Choose a Champion: Enter 1 for the Warrior, 2 for the Ranger, or 3 for the Wizard
1
You have chosen the Warrior as your champion.
*Play Warrior.wav*
Choose an opponent: Enter 1 for the Warrior, 2 for the Ranger, or 3 for the Wizard
2
You have chosen the Ranger as your opponent
*Play Ranger.wav*

*Play Hit.wav*
*Play Ouch.wav*
Successfully hit the enemy! His HP is 50

Your opponent missed their attack on you.
*Play Miss.wav*
*Play Taunt.wav*

*Play Hit.wav*
*Play Ouch.wav*
Successfully hit the enemy! His HP is 0

Your champion is the victor!!!
*Play Victory.wav*