battlecore::weapon
The weaponmodule controls firing and reloading, reports trigger and busy state, and reads or writes the weapon's ammo and shot configuration. Include its declarations with include "./battlecore/weapon.bst";.
Actions
native void battlecore::weapon.fire ();
native void battlecore::weapon.reload ();fire— fires the weapon.reload— reloads the weapon.
Status
native bool battlecore::weapon.getCanFire ();
native bool battlecore::weapon.getIsTriggerDown ();
native bool battlecore::weapon.getIsReloadDown ();
native bool battlecore::weapon.getIsBusy ();getCanFire— returns whether the weapon can currently fire.getIsTriggerDown— returns whether the trigger is held down.getIsReloadDown— returns whether the reload control is held down.getIsBusy— returns whether the weapon is busy.
Busy count
native bool battlecore::weapon.getBusyCount ();
native void battlecore::weapon.setBusyCount (bool newVal);
native bool battlecore::weapon.incrementBusyCount ();
native bool battlecore::weapon.decrementBusyCount ();getBusyCount/setBusyCount— gets or sets the busy count.incrementBusyCount— increments the busy count.decrementBusyCount— decrements the busy count.
Charge state
native bool battlecore::weapon.getIsChargeBased ();
native bool battlecore::weapon.getIsCharging ();
native void battlecore::weapon.setIsCharging (bool newVal);getIsChargeBased— returns whether the weapon is charge based.getIsCharging/setIsCharging— gets or sets whether the weapon is charging.
Ammo and shot configuration (getters and setters)
Each of the following exposes a getter and a setter. Setters take a single newVal argument of the type shown.
| Getter | Setter |
|---|---|
native int battlecore::weapon.getAmmoMax (); | native void battlecore::weapon.setAmmoMax (int newVal); |
native int battlecore::weapon.getAmmo (); | native void battlecore::weapon.setAmmo (int newVal); |
native int battlecore::weapon.getShotType (); | native void battlecore::weapon.setShotType (int newVal); |
native int battlecore::weapon.getShotPower (); | native void battlecore::weapon.setShotPower (int newVal); |
native int battlecore::weapon.getShotIntervalMs (); | native void battlecore::weapon.setShotIntervalMs (int newVal); |
native int battlecore::weapon.getShotDelayMs (); | native void battlecore::weapon.setShotDelayMs (int newVal); |
native int battlecore::weapon.getShotChargeMinMs (); | native void battlecore::weapon.setShotChargeMinMs (int newVal); |
native int battlecore::weapon.getShotChargeMaxMs (); | native void battlecore::weapon.setShotChargeMaxMs (int newVal); |
native bool battlecore::weapon.getShotChargeAutoFire (); | native void battlecore::weapon.setShotChargeAutoFire (bool newVal); |
native int battlecore::weapon.getReloadDelayMs (); | native void battlecore::weapon.setReloadDelayMs (int newVal); |
native int battlecore::weapon.getShotsFired (); | native void battlecore::weapon.setShotsFired (int newVal); |