C# Class Swordening.Wizard

Inheritance: Hero
Exibir arquivo Open project: ArghyV/Peliohjelmointi-s2011 Class Usage Examples

Public Methods

Method Description
Cast1 ( GameTime gameTime ) : bool

checks if hero has enough mana to cast a fireball and if so then plays the sound and adds a fireball projectile.

RegenerateMana ( float amount = -1 ) : void

Regenerates mana.

Update ( GameTime gameTime ) : void

Allows the game component to update itself.

Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
checkDeath ( ) : void

Checks if hero has been slain and removes it from the game components.

increaseStats ( ) : void

When a level is gained hitpoints and and mana is increased. If hero dies at the same time when he gains a level, hero does not get max hitpoints back. The dead should stay dead.

killGain ( int exp, int money ) : void

this method is called whenever a monster dies. The hero gains exp and gold from the monster that died and calls for levelup method.

levelup ( ) : void

Checks if the hero has gained enough experience to gain a lvl and if so multiplies to next level by 2 so that the next level won't be reached as fast as the previous and also calls for increaseStats() method.

takeDmg ( int amount ) : void

Reduces hitpoints as given in the parametres. Calls checkDeath() after this.

Protected Methods

Method Description
LoadContent ( ) : void

Allows the game comopnent to load content from disk.

ProcessKeyboardInput ( GameTime gameTime ) : void

Reads and processes the input from the keyboard.

ProcessMouseInput ( GameTime gameTime ) : void

Reads and processes the input from the mouse.

Private Methods

Method Description
addProjectile ( ) : void

the direction of the fireball is taken from the mouse position in other words the projectile is launched towards the current mouse position

Method Details

Cast1() public method

checks if hero has enough mana to cast a fireball and if so then plays the sound and adds a fireball projectile.
public Cast1 ( GameTime gameTime ) : bool
gameTime Microsoft.Xna.Framework.GameTime
return bool

LoadContent() protected method

Allows the game comopnent to load content from disk.
protected LoadContent ( ) : void
return void

ProcessKeyboardInput() protected method

Reads and processes the input from the keyboard.
protected ProcessKeyboardInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

ProcessMouseInput() protected method

Reads and processes the input from the mouse.
protected ProcessMouseInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

RegenerateMana() public method

Regenerates mana.
public RegenerateMana ( float amount = -1 ) : void
amount float
return void

Update() public method

Allows the game component to update itself.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
return void

Wizard() public method

public Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
game SwordeningGame
gameState InGame
position Vector3
return System

checkDeath() public method

Checks if hero has been slain and removes it from the game components.
public checkDeath ( ) : void
return void

increaseStats() public method

When a level is gained hitpoints and and mana is increased. If hero dies at the same time when he gains a level, hero does not get max hitpoints back. The dead should stay dead.
public increaseStats ( ) : void
return void

killGain() public method

this method is called whenever a monster dies. The hero gains exp and gold from the monster that died and calls for levelup method.
public killGain ( int exp, int money ) : void
exp int
money int
return void

levelup() public method

Checks if the hero has gained enough experience to gain a lvl and if so multiplies to next level by 2 so that the next level won't be reached as fast as the previous and also calls for increaseStats() method.
public levelup ( ) : void
return void

takeDmg() public method

Reduces hitpoints as given in the parametres. Calls checkDeath() after this.
public takeDmg ( int amount ) : void
amount int
return void