logo bannerlogo banner
Page Navigator

Each gun is a class. That means that grabbing the infomation requires you to create a new class.

We use it in class formation because it's easier internally.

Each gun has a few consistent properties:

  • ammo: object - ammunition data
    • ammo.rounds: number - the number of shots in one magazine (same as ammo.capacity)
    • 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.storeMax: number - the maximum number of shots you can carry (same as ammo.store)
    • 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
  • recoil: number - the recoil 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
  • accuracyMin: number - the minimum accuracy of the gun
  • accuracyMax: number - the maximum accuracy of the gun (always lower than or equal to accuracyMin)
  • accuracyLoss: number - the accuracy loss of the gun (the amount of accuracy lost per shot fired)
  • accuracyRecovery: number - the accuracy recovery of the gun (the amount of accuracy recovered per tick)

Each gun also has a few extra properties that are not consistent across all guns:

  • adsMod: number - i got no clue (default: 0.5)
  • burst: number - some measurement of burst fire, only tri-hard (default: 0)
  • burstRof: number - the rate of fire of the burst fire (default: 0)
  • movementAccuracyMod: number - the accuracy modifier when moving (default: 0.5)
  • radius: number - the radius of the bullet hitbox, only rpegg (default: 0.1)
  • reloadBloom: boolean - is there bloom when reloading? (default: true)
  • reloadTimeMod: number - the reload time modifier (default: 1)
  • tracer: number - i got no clue (default: 0)

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