README If you create pack for pre-2.0.0
The 2.0.0 migrated all `newfirearms.` prefixes to `nf.`
But we also introduced the `compatabilityMode` setting that when on, before loading configs goes thru them as a plain text and replaces all occurences of `newfirearms.` to `nf.`
It mostly would work, but another thing that changed: 9mmhollow 9mmvenomus 12gaugebird and 12gaugeslug items now have nf.
But it also covered by compatabilityMode prefixing non-prefixed instances
Another thing that changed: m1911 got removed and its mag, this one, is not covered by compatabilityMode



== GUN JSON TEMPLATE ==
{
    "fullName": "string",
    "description": "string",
    "category": "utility", // "utility" default, "custom" trader only, "unobtainable" console/crafting/milkyCanSell only
    "slotRotation": -90.0,
    "weight": 0.0,
    "value": 0,
    "recognition": 0, // INT to recognize
    "spawnFrequency": 1.0, // Modifier of how often gun would appear in loot
    "milkyCanSell": true,

    "craftable": false,
    "recipe": [ "string", ], // ignores if craftable is false
    "craftBiochem": 0.0,
    "craftCutting": 0.0,
    "craftHammering": 0.0,
    "craftInt": 0,

    "feedType": "Magazine", // Magazine = 1, Tube = 2, Barrel = 3, Revolver = 4, Battery = 5. Legacy numeric values are still accepted.
    "internalCapacity": 1, // must always be 1 for mag feed
    "ammoTypes":
    [
        {
            "round": "string", // ID of item this ammo refereing to, highly recomended to be mirrored with mags "ammoTypes"
            "structureDamage": 0.0, // Damage to tiles
            "piercing": false, // Ordinary bullets pass through two terrain blocks; damage and stop at the third
            "casingSprite": "string", // Optional changes sprite of casing for this
            "minigameCasingSprite": "uiCasing556", // Optional spent casing sprite inside the minigame
            "animalDamage": 0.0, // Damage to anything else
            "additionalStun": 0.0, // Extra stun seconds on direct spider body hits, including armed projectile impacts. Not applied to StunHitbox or scaled by damage/stunMult
            "explosionParams": // Optional: fires a travelling explosive projectile instead of a hitscan bullet. Leave blank for regular ammo
            {
                "projectileVelocity": 40.0, // Initial speed in world units/second
                "minimumTravelDistance": 5.0, // Distance along flight path before impact can explode 

                "muscleDamage": { "min": 0.0, "max": 60.0 }, // Muscle damage range
                "skinDamage": { "min": 0.0, "max": 75.0 }, // Skin damage range
                "skinDamageChance": 0.2, // Chance to apply skin damage
                "boneBreakChance": 0.06, // Bone fracture chance
                "dislocationChance": 0.135, // Joint dislocation chance
                "disfigureChance": 0.34, // Disfigurement chance
                "bleedChance": 0.15, // Chance to cause bleeding
                "bleedAmount": { "min": 4.0, "max": 30.0 }, // Bleeding amount range
                "structuralDamage": 500.0, // Damage to structures and terrain
                "range": 12.0, // Explosion radius in world units0
                "velocity": 60.0, // Explosion impulse strength; separate from projectileVelocity
                "shrapnelChance": 0.4, // Chance to embed shrapnel
                "sound": "explosion", // Game sound ID, does NOT loaded
            }

            "playerDamage": // All damage applied to player, when it gets shot, have a fallback if you are too lazy to fill it out
            { // All values below are affected by wearable protection, and randomly multiplied by 0.85 to 1.15 in each shot
                traumaAmount: 0.0,
                pain: 0.0,
                adrenaline: 0.0,
                skinDamage: 0.0,
                muscleDamage: 0.0,
                bleedAmount: 0.0, // max 100 = 1.5l/m
                wearableDamage: 0.0, // 0.0-1.0, multiplier by wearableHitDurabilityLossMultiplier
                venomAmount: 0.0,
                shrapnelChance: 0.0, // 0.0-1.0, since wearables decreases this chance it still makes sense to make it above 1
                infectionChance: 0.0, // refer to previous comment
                dislocationChance: 0.0, // refer to previous comment, less likely when limb is healthy
                fractureChance: 0.0, // refer to previous comment, less likely when limb is healthy
                internalBleed: 0.0, // 0.085l/m per 10 internal, max 25, numbers displayed in health panel affected by hunger level
                brainDamage: 0.0, // beside of mutiplication mentioned earlier, gets further multiplier by random 0.5-1.5
                disfigureChance: 0.0, // actually, when rolled, 50% to lose an eye; and 50% to roll for disfigurment -> 0% when head muscle health at 100, and 100% when below 75, linear scale
                chloroformAmount: 0.0,
            },

            "knockback": 0.0, // Force player knocked back with
            "muzzleRise": 0.0, // Force muzzle rises with
            "pellets": 1,
            "verticalSpread": 0.0,
            "loudness": 0.0, // Defines hearing loss
            "conditionLoss": 0.0, // Up to 1.0 for -100% per shot
            "caseless": false, // If true casing won't be created after fire
        },
    ],
    "desiredGasTime": 0.0, // Must always stay at 0 for barrel feed
    "batteryDrainPerShot": 0.0, // feedType 5: fraction of one full battery cell consumed per shot (0 < value <= 1)
    "batteryDrainPerRetract": 0.0, // Cost per manual retraction (0..1 full cell); needs feedType 5 and needRetract. Insufficient charge blocks retraction. Automatic retraction is free.
    "needRetract": false, // feedType 5: keep a tether after each shot; press rack to retract before firing again
    "hasFlashlight": false, // feedType 5: emergency-light beam at low brightness, powered by magazine cells; starts off. Requires minigame.flashlightTogglePath.
    "spawnUnracked": false, // If true, newly spawned guns start with the slide unracked
    "removeMagazineOnRack": false, // Ejects the magazine when manually cycling the gun, with or without the minigame. Automatic firing cycles do not eject it.
    "fireModes": [ 0, ], // All fire modes gun can be putted into, 0 - safe, 1 - pump, 2 - semi, 3 - full, 4 - three-round burst
    "magazineType": [ "string", ], // If it inresects with "magazineType" in at least one entry, mag is considered compataible
    "barrelOffset": 0.0, // Vertical offset of barrel from model
    "hasLaser": false, // Laser

    "itemSpriteXOffset": 0.0, // X Offset of sprite when held in hand
    "itemSpriteYOffset": 0.0, // same but y
    // normalTexturePath and rackedTexturePath are the only mandatory paths. Textures and sprites must be .png.
    // Audio supports .wav, .ogg, .mp3, .aif/.aiff, .mod, .it, .s3m, and .xm; extensions may be omitted when a matching file exists.
    // The COPY__ is a work in progress
    "normalTexturePath": "string",
    "rackedTexturePath": "string",
    "shootAudioPath": "string",
    "unshootAudioPath": "string",
    "jamAudioPath": "string",
    "rackAudioPath": "string",
    "unrackAudioPath": "string",
    "loadRoundAudioPath": "string",
    "loadMagAudioPath": "string",
    "removeMagAudioPath": "string",
    "toggleFireModeAudioPath': "string",
    "rackSpritePath": "string",
    "unrackSpritePath": "string",
    "removeMagSpritePath": "string",
    "fireModesSpritePath": [ "string", ] // UI Sprite to be shown on fire selector !! It indexes current fire mod, thus if you have only safe and semi-auto it should go like this [ "safe", "", "semiauto", ], you can pass empty string to have nothing
    bulletsSpritesPath": [ "string", ] // Starts with empty, then casing, then all rouds from ammoTypes in same order
    magazineTexturesPath: { "string": "string", }, // Key is item id of mag, and value is sprite
    "ppu": 8.0. // Pixel Per Unit, less makes item appear bigger, use if you are using high resolution sprite. Default 8 in CU
    "minigame": Refer to minigame section

}
== MAGAZINE JSON TEMPLATE ==
{
    "fullName": "string",
    "description": "string",
    "category": "utility", // "utility" default, "custom" trader only, "unobtainable" console/milkyCanSell only
    "slotRotation": -90.0,
    "weight": 0.0,
    "value": 0,
    "recognition": 0, // INT to recognize
    "spawnFrequency": 1.0, // Modifier of how often gun would appear in loot
    "milkyCanSell": true, // Also determines if can be spawned in collapsed pod

    "craftable": false,
    "craftBiochem": 0.0,
    "recipe": [ "string", ], // ignores if craftable is false
    "craftCutting": 0.0,
    "craftHammering": 0,
    "craftInt": 0,

    "capacity" 0, // Total amounts of rounds can be held
    "type": "regular", // regular, pseudo, or battery (also numeric 0, 1, 2)
    // pseudo: spawns full, no loose-round loading/unloading, requires a racked gun; discarded on empty ejection.
    // battery: ammoTypes lists accepted battery item IDs; starts empty. Capacity is battery slots (default 1); condition is total cell charge / capacity. Use only with feedType 5.
    "magazineType": [ "string", ], // If intersect with gun's "magazineType" in at least one entry, gun is considered compatabile
    "ammoTypes": [ "string", ], // ID of all rounds can be putted into, highly recomended to be mirrored with gun's "ammoTypes"
    "nonEmptySpritePath": "string", // Optional sprite path relative to this magazine's folder (omit .png). Used when at least one round remains; empty magazines use item.png.
    // Optional audio paths; same formats as gun audio. Extensions may be omitted.
    "loadRoundAudioPath": "string",
    "unloadRoundAudioPath": "string",
}

== ROUND JSON TEMPLATE ==
{
    "fullName": "string",
    "description": "string",
    "category": "utility", // "utility" default, "custom" trader only, "unobtainable" console/milkyCanSell only
    "slotRotation": -90.0,
    "weight": 0.0,
    "value": 0,
    "recognition": 0, // INT to recognize
    "spawnFrequency": 1.0, // Modifier of how often gun would appear in loot

    "craftable": false,
    "recipe": [ "string", ], // ignores if craftable is false
    "craftHammering": 0,
    "craftInt": 0,
}

== MINIGAME JSON TEMPLATE ==
{
    // Rigid gun inertia: hand/grip and muzzle anchors, fractions of window width/height from center.
    // Defaults work with existing configs. nf_visualize displays both anchors for adjustment.
    "inertiaHandXPosition": -0.3,
    "inertiaHandYPosition": -0.05,
    "inertiaBarrelXPosition": 0.2,
    "inertiaBarrelYPosition": 0.1,
    "ammosInHandPaths": [], // Optional; omit, null, [] or entirely blank entries to disable the bandolier.
    "ammosInPtrPaths": [], // Bandolier and ammo selector require both arrays, with one entry per ammo type.
    // work in progress
    // TODO Rewrite this as current AI Agent generates documentation

    // sliderMinimumPosition and sliderMaximumPosition may be in either numeric order.
    // Minimum remains the racked endpoint, maximum the unracked/fully-forward endpoint.
    // Both transition points must lie between them. Reversing the endpoints reverses rack/unrack direction,
    // including rackByRotation, chargingHandle and mosynStyleRack.
    // Breaking change: rackPoint is removed; replace it with both fields below.
    // Positions use fractions of screen width, or degrees with rackByRotation.
    // Moving toward minimum past unrackedToRacked racks; toward maximum past rackedToUnracked unracks.
    // Keep unrackedToRacked nearer minimum and rackedToUnracked nearer maximum (equal is allowed).
    "unrackedToRacked": -0.025,
    "rackedToUnracked": -0.01,
    "mosynStyleRack": false, // Two-position slider: lift/lower only at sliderMaximumPosition (fully forward). Lower to lock (racked -> unracked); pull back past unrackedToRacked while raised for unracked -> racked. Only the front sprite lifts; both slide horizontally. Overrides rackByRotation and chargingHandle.
    "backLayerPath": "uiBackLayer", // Optional sprite below the back slider; omit .png.
    "backLayerFollowsSlider": false, // Follow the front slider's position and rotation, including Mosyn lift and automated racking. False keeps the layer fixed to the gun. Drawing order is preserved.
    "barrelPath": "", // Optional separate barrel sprite, without .png. Requires a linear slider. Drawn over the main gun sprite and under the front slider; scaled like the slider art.
    "barrelXPosition": 0.0, // Barrel image center / rotation pivot, fraction of screen width from gun center.
    "barrelYPosition": 0.0, // Fraction of screen height from gun center. Barrel rotates from 0 degrees at sliderMaximumPosition to +30 degrees at sliderMinimumPosition, following the animated slider position.
    "rackTriggerPath": "uiRackTrigger", // Optional rack/retract hit-area mask, like magReleasePath. Click opaque pixels to rack once. Available without Marksman; omit .png. Missing/blank disables it.
    "onlyUnrackedToRacked": false, // Restrict the rackTriggerPath button to unracked -> racked; clicking while already racked does nothing. Slider and hotkeys are unaffected.
    "flashlightTogglePath": "uiFlashlightToggle", // Flashlight on/off hit-area mask; required with hasFlashlight. Click opaque pixels. No hotkey or inventory toggle; omit .png.
    // Breaking change: mainPath has been removed. All four paths are required.
    // Paths are relative to the gun folder, without .png; paths may share the same image.
    "mainExperimentPath": "uiExperiment",
    "mainMilkyTriggerOnPath": "uiMilkyTriggerOn",
    "mainMilkyTriggerOffPath": "uiMilkyTriggerOff", // Cursor inside the minigame window
    "mainDunePath": "uiDune",
    "fitMainSprite": false, // Fit the main gun image to the screen width
    "fitLaserImage": true, // Fit the laser overlay to the screen width
    // Chamber contents render below the front slider and follow its travel, reaching
    // casingXPosition/casingYPosition when the slider reaches unrackedToRacked (raised in Mosyn mode).
    // Live rounds use casingsPath[ammo index + 1]; spent casings use the ammo's minigameCasingSprite,
    // then casingSprite, then casingsPath[0]. Empty chambers, jams, battery guns, and rackByRotation hide this layer.
    "frontSliderInvisble": false, // Set the front slider image alpha to zero
    "grabTrigger": "uiGrabTrigger", // Optional PNG hit-area mask, without extension. Hold RMB on it with the other hand empty to support the gun; release RMB or equip the other hand to stop. nf_visualize reveals this mask too.
    "grabOnSlider": false, // Use the opaque front slider sprite as the RMB support-grip trigger instead of grabTrigger. Requires sliderFrontPath. LMB grabs/moves the slider when not supporting the gun; all left-click minigame interactions are blocked while gripping. The hand follows the slider with inertiaBarrelXPosition/YPosition as its local offset (fractions of window width/height). Defaults to false.
    "pumpOutsideWindow": false, // Tube-fed pump guns (feedType 2), with grabOnSlider and a linear non-charging slider. Start the grip with RMB on its trigger inside the HUD, then keep holding RMB to pump outside it. After firing, move between the original cursor position (A) and screen center (B); the guide is visible only with nf_visualize enabled: pull toward B to open/eject, then return toward A to close/feed. Uses the normal rack thresholds and host-authorized Rack requests. RMB release hides/pauses the gesture; regrip inside the HUD to resume. Defaults to false.
    // Multiplayer sends support state with shot requests and ongoing fire updates; there is no separate grip action. The host validates the empty hand and configured grip. Older requests without the flag have no support bonus.
    "grabType": "Flat", // Flat (0), Curved (1), or Vertical (2): Resources/minigameGrab*.png. Defaults to Flat. The hand's top-right corner anchors at the clicked point for grabTrigger, or the barrel inertia offset for grabOnSlider. Halves muzzle rise while held. Multiplayer applies the bonus on the host.
    "fireTogglePath": "string", // Optional fire-mode toggle hit area; enables manual fire-mode selection
    // With fireTogglePath set, fire mode starts normally and this hit area cycles the available modes.
    "fireModePaths": [ "safe", "", "semi", "full", "burst" ], // Optional sprites indexed by fire mode; empty entries hide the indicator for that mode
    "sliderFireToggle": false, // Move the fire-mode indicator and toggle hit area with the slider; hide the hit area while racked
    "magazineRotation": 0.0, // Optional inserted-magazine rotation in degrees
    "p90reload": false, // Stage the magazine with its right end tilted up and left end anchored; grab the right half and drag down to insert. Closing the minigame cancels staging.
    "casingsDrop": false, // Omit the initial upward casing impulse; gravity makes casings fall. Horizontal motion and spin are unchanged.
}
