logo bannerlogo banner
Page Navigator

Each gun is (as of 1.5) stored as an object. Getting information is as easy as importing it from yolkbot/constants/guns.

Note

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 magazine
    • ammo.reload: number - the number of shots added when you reload
    • ammo.store: number - the maximum number of shots you can carry
    • ammo.pickup: number - the number of shots you get when you pick up ammo
  • longReloadTime: number - the tick time it takes to reload the gun if the gun is fully out of ammo in your current magazine and you reload
  • shortReloadTime: number - the tick time it takes to reload the gun if you have some ammo left in the magazine and you reload
  • weaponName: string - the stylized name of the gun
  • internalName: 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 game
  • automatic: boolean - whether the gun is automatic or not
  • damage: number - the damage dealt by the gun
  • range: number - the range of the gun
  • rof: number - the rate of fire of the gun (presumably in ticks)
  • totalDamage: number - the total damage dealt by the gun
  • velocity: number - the velocity of the bullet fired by the gun

You 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