Weapons are used by the player.
They derive from the base classes
WeaponTypeInfo which are defined in
WeaponTypeInfo is used to hold and share information which is the same across all instances of a weapon class.
Creating new weapons
You should use the weapons provided with the game as examples for implementing weapons. They can be found inside
To create a new weapon you need to create two new classes:
The first class derives from
WeaponTypeInfo, and defines shared information.
Read the comments in
Weapon.as and look at weapon examples to learn what each member variable is used for.
You need to add an instance of your new
WeaponTypeInfo derived class in the global Dictionary
weapon_types. Look in the file
Data/Scripts/Weapons.as for example.
The second class derives from
fire function to define what happens when the player fires the weapon.
You can use things from Attacks for your weapon.
Weapon class comes with some utility functions like
For extra weapon utlities you can use things from
Data/Scripts/WeaponUtility.as, such as
In your class's constructor you should set
Weapon::type to the corresponding class derived from
WeaponTypeInfo by getting it from