2013 -- FYD file system content
[FYD.git] / src / gui / module3d / weapons / CWeapon.java
blob7d0da22507e04e5afe1e51c3a932e4ac4053fb99
1 package gui.module3d.weapons;
3 /**
5 * @author yann
6 */
7 public abstract class CWeapon {
8 public static final int UNKNOWN_WEAPON_TYPE = -1;
9 public static final int NORMAL_WEAPON_TYPE = 0;
10 public static final int ROCKET_WEAPON_TYPE = 1;
11 public static final int LIGHT_WEAPON_TYPE = 2;
13 protected int MaxAmmo;
14 protected int BulletFlow; // plus il est petit et plus c'est rapide
15 protected String name;
16 protected int currentAmmo;
17 protected int mType;
18 protected int damage;
20 public CWeapon(int MaxAmmo,int BulletFlow,String name, int pType,int damage)
22 this.MaxAmmo=MaxAmmo;
23 this.BulletFlow=BulletFlow;
24 this.name=name;
25 this.damage=damage;
26 currentAmmo=MaxAmmo;
27 mType = pType;
30 public int GetBulletFlow()
32 return BulletFlow;
35 public String GetName()
37 return name;
40 public int GetcurrentAmmo()
42 return currentAmmo;
44 public int GetMaxAmmo()
46 return MaxAmmo;
49 public Boolean Shoot()
51 if(currentAmmo>0)
53 currentAmmo--;
54 return true;
56 else
58 return false;
63 public int getDamage()
65 return damage;
68 public void Reload()
70 currentAmmo=MaxAmmo;
73 public abstract int WeaponType();