C# Class PantheonPrototype.Weapon

A basic implementation of a weapon inheriting from Item. As more weapons are added, the specific logic of the weapon should be moved to a subclass and this should be a parent of all weapons.
Inheritance: Item
Afficher le fichier Open project: Bacon41/PantheonPrototype

Protected Properties

Свойство Type Description
bulletType String
currentAmmo int
damage int
fireRate float
offset double
range int
reloadDelay System.TimeSpan
reloading bool
speed int
totalAmmo int

Méthodes publiques

Méthode Description
PercentToEndReload ( ) : float
Reload ( GameTime gameTime ) : void

The method to start the reloading procudure.

Update ( GameTime gameTime, Pantheon gameReference ) : void

Updates the weapon, taking care for cooldown and other time sensitive functions.

Weapon ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System

Initializes key values of a weapon.

activate ( Pantheon gameReference, CharacterEntity holder ) : void

Shoot the weapon. That's what this game is really about, right? Also, we need to rethink the way that shooting works right now. Eventually, I think that the Character Entity class needs an aiming point. This makes it so both Enemies and Players can use weapons.

Private Methods

Méthode Description
shootABullet ( Pantheon gameReference, CharacterEntity holder ) : void

Shoots a bullet.

Method Details

PercentToEndReload() public méthode

public PercentToEndReload ( ) : float
Résultat float

Reload() public méthode

The method to start the reloading procudure.
public Reload ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Time since last call.
Résultat void

Update() public méthode

Updates the weapon, taking care for cooldown and other time sensitive functions.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime The current game time.
gameReference Pantheon A reference to the entire game.
Résultat void

Weapon() public méthode

Initializes key values of a weapon.
public Weapon ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D
Résultat System

activate() public méthode

Shoot the weapon. That's what this game is really about, right? Also, we need to rethink the way that shooting works right now. Eventually, I think that the Character Entity class needs an aiming point. This makes it so both Enemies and Players can use weapons.
public activate ( Pantheon gameReference, CharacterEntity holder ) : void
gameReference Pantheon A reference so we can see where everything is.
holder CharacterEntity A reference to the character holding the weapon.
Résultat void

Property Details

bulletType protected_oe property

protected String bulletType
Résultat String

currentAmmo protected_oe property

The current amount of ammunition available to the player.
protected int currentAmmo
Résultat int

damage protected_oe property

protected int damage
Résultat int

fireRate protected_oe property

The rate of fire of the gun as the number of shots per second.
protected float fireRate
Résultat float

offset protected_oe property

This is hacky but it works... and it's due tomorrow; So ya.
protected double offset
Résultat double

range protected_oe property

The distance that the bullet can travel.
protected int range
Résultat int

reloadDelay protected_oe property

protected TimeSpan,System reloadDelay
Résultat System.TimeSpan

reloading protected_oe property

protected bool reloading
Résultat bool

speed protected_oe property

protected int speed
Résultat int

totalAmmo protected_oe property

The total amount of ammunition available to the player.
protected int totalAmmo
Résultat int