Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ammo file refactoring #404

Merged
merged 7 commits into from
Apr 26, 2024

Commits on Apr 24, 2024

  1. Configuration menu
    Copy the full SHA
    ce1cf1e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f49844e View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. Additional Annotations And Simplifications To VerifyData

    Annotated some more things in the file, Simplified the logic of VerifyData and fixed what was confirmed to be a likely typo in the detonation code that prevented ammo crates with a single shot from being able to cookoff, only detonate.
    
    (Planned in a future commit is to fix cookoffs being impossible for shells above a certain weight)
    LengthenedGradient committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d889224 View commit details
    Browse the repository at this point in the history
  2. Add Probability Cap To Cookoff Volumerolll

    Caps the VolumeRoll randomness to 25% minimum, particularly for larger calibers.
    
    Originally `BulletData.RoundVolume ^ 0.5` was not capped and could reach values above 150 (e.g. 155mmC AP), and since math.rand(0,150) is never larger than 150, it was possible for high caliber ammo types to be immune to cookoff. This was confirmed as unintentional.
    
    Adjusting the random range would require us knowing some upper bound on BulletData.RoundVolume (if you consider ACF missiles than the upper bound stretches the range quite a bit). So capping is the simplest solution that doesn't change the detonation changes for anything below the cap. I determined 25% minimum was a reasonable choice, but that could be changed if necessary.
    
    AmmoRoll was updated for the very rare case that the random call returns exactly the ratio (e.g. 1 for 1)
    LengthenedGradient committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ae2815c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    72d2a90 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ee5768a View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. Improved caliber verification, fixed crate name and short names

    - Improved caliber verification for non scalable weapons, now it should properly default to 50mm if the weapon is defined but the user failed to provide a caliber value.
    - Fixed weapon name and weapon short name having trouble accounting for scalable weapons having items registered items under them.
    - Added a bunch of spaces between variables and the start of conditions.
    - Removed seemingly unused WeaponData field from ammo crates.
    TwistedTail committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    2d8e66b View commit details
    Browse the repository at this point in the history