Each gun is (as of 1.5) stored as an object. Getting information is as easy as importing it from yolkbot/constants/guns.
In 1.5, multiple properties were removed from all guns.
Each gun has a few consistent properties:
ammo: object - ammunition data
ammo.capacity: number - the maximum number of shots in one magazineammo.reload: number - the number of shots added when you reloadammo.store: number - the maximum number of shots you can carryammo.pickup: number - the number of shots you get when you pick up ammolongReloadTime: number - the tick time it takes to reload the gun if the gun is fully out of ammo in your current magazine and you reloadshortReloadTime: number - the tick time it takes to reload the gun if you have some ammo left in the magazine and you reloadweaponName: string - the stylized name of the guninternalName: string - the internal name of the gun (otherwise called the "class name")standardMeshName: string - the name of the mesh used for the gun in the gameautomatic: boolean - whether the gun is automatic or notdamage: number - the damage dealt by the gunrange: number - the range of the gunrof: number - the rate of fire of the gun (presumably in ticks)totalDamage: number - the total damage dealt by the gunvelocity: number - the velocity of the bullet fired by the gunYou can use the guns like this:
import {
EggK47,
DozenGauge, // scrambler
CSG1, // free ranger
RPEGG,
SMG, // whipper
M24, // crackshot
AUG, // tri-hard
Cluck9mm
} from 'yolkbot/constants/guns';
You should then initialize them and you can use whatever properties you want:
import { EggK47 } from 'yolkbot/constants/guns';
const eggk = new EggK47();
console.log(eggk.ammo.rounds); // --> 30
Each gun is (as of 1.5) stored as an object. Getting information is as easy as importing it from yolkbot/constants/guns.
In 1.5, multiple properties were removed from all guns.
Each gun has a few consistent properties:
ammo: object - ammunition data
ammo.capacity: number - the maximum number of shots in one magazineammo.reload: number - the number of shots added when you reloadammo.store: number - the maximum number of shots you can carryammo.pickup: number - the number of shots you get when you pick up ammolongReloadTime: number - the tick time it takes to reload the gun if the gun is fully out of ammo in your current magazine and you reloadshortReloadTime: number - the tick time it takes to reload the gun if you have some ammo left in the magazine and you reloadweaponName: string - the stylized name of the guninternalName: string - the internal name of the gun (otherwise called the "class name")standardMeshName: string - the name of the mesh used for the gun in the gameautomatic: boolean - whether the gun is automatic or notdamage: number - the damage dealt by the gunrange: number - the range of the gunrof: number - the rate of fire of the gun (presumably in ticks)totalDamage: number - the total damage dealt by the gunvelocity: number - the velocity of the bullet fired by the gunYou can use the guns like this:
import {
EggK47,
DozenGauge, // scrambler
CSG1, // free ranger
RPEGG,
SMG, // whipper
M24, // crackshot
AUG, // tri-hard
Cluck9mm
} from 'yolkbot/constants/guns';
You should then initialize them and you can use whatever properties you want:
import { EggK47 } from 'yolkbot/constants/guns';
const eggk = new EggK47();
console.log(eggk.ammo.rounds); // --> 30