My coding knowledge is extremely poor, but I'd still like to give it a shot.
I have looked over the master files and I see how weapons are written.
Code: Select all
The code reminds me of LUA, which I tinkered with for Trouble in Terrorist Town. I see it being easy to make new guns, but it's the implementation/addition that I'm worried about, since I'd like to have at around 15 guns of varying types.class RifleWeapon3: public Weapon {
public:
RifleWeapon3(World*w,Player*p):Weapon(w,p){}
virtual std::string GetName() { return "Rifle"; }
virtual float GetDelay() { return 0.5f; }
virtual int GetClipSize() { return 10; }
virtual int GetMaxStock() { return 50; }
virtual float GetReloadTime() { return 2.5f; }
virtual bool IsReloadSlow() { return false; }
virtual WeaponType GetWeaponType() { return RIFLE_WEAPON; }
virtual int GetDamage(HitType type, float distance) {
switch(type){
case HitTypeTorso: return 49;
case HitTypeHead: return 100;
case HitTypeArms: return 33;
case HitTypeLegs: return 33;
case HitTypeBlock: return 50;
default: SPAssert(false); return 0;
}
}
virtual Vector3 GetRecoil () {
return MakeVector3(0.0001f, 0.05f, 0.f);
}
virtual float GetSpread() { return 0.006f; }
virtual int GetPelletSize() { return 1; }
};


