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 magazineammo.reload: number - the number of shots added when you reloadammo.store: number - the maximum number of shots you can carryammo.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 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 gunrecoil: number - the recoil 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 gunaccuracyMin: number - the minimum accuracy of the gunaccuracyMax: 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
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 magazineammo.reload: number - the number of shots added when you reloadammo.store: number - the maximum number of shots you can carryammo.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 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 gunrecoil: number - the recoil 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 gunaccuracyMin: number - the minimum accuracy of the gunaccuracyMax: 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