Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
/ sniper Public archive

[Beta] Minetest mod that adds realistic sniper rifles alongside a nice API for registering custom rifles. NOTE: This project is abandoned, and a similar, more generic mod is being continued at https://github.com/ClobberXD/gunslinger

License

Notifications You must be signed in to change notification settings

ClobberXD/sniper

Repository files navigation

Sniper Travis-CI

Sniper is a Minetest mod which adds advanced sniper rifles to the game. Sniper comes with a default rifle, and it also provides a nice API to register custom rifles. It differs from other gun mods in that it's very realistic - this mod supports functional-scopes with zoom, realistic recoil, accurate shoot and reload sounds, and more on a per-rifle basis - check out the registration section for more details.

Current version: v0.3

screenshot

Registering custom rifles

New sniper rifles can be registered using the sniper.register_rifle(name, def) function, where name is a string used to address the rifle internally, and def is a table containing the rifle's definition. Here's an example def table that provides the available fields with their default values:

{
    -- The name displayed in the inventory and other places visible to the player.
    display_name = "Sniper Rifle",

    -- Inventory and wield images
    inventory_image = "",
    wield_image = "",

    -- Scope FOV (in degrees) is used to specify the amount of zoom provided by the rifle's scope.
    -- Valid range of values: 1 to 160
    scope_fov = 60,

    -- Scope style accepts values from 1 to 4. Style 1 is the simplest, style 4 is the most sophisticated.
    scope_style = 1,

    -- Damage dealt (in HP) will be calculated using the following formula: "sniper.base_dmg * damage_mult".
    -- Valid range of values: 0.1 to 5
    damage_mult = 1.0,

    -- Stability multiplier affects the amount of recoil after every shot.
    -- The more stable a rifle is, the slower a player would move while using it.
    -- Valid range of values: 0.1 to 5
    stab_mult = 1.0,

    -- Fire rate multiplier is used to calculate the reload time between each shot.
    -- Valid range of values: 0.1 to 5
    fire_rate = 1.0
}

Making use of the bleeding-edge features

This mod makes use of features that haven't been merged into the engine just yet. To make use of them, follow the given instructions below:

TODO

  • Provide more rifles with the mod itself.
  • Ability to upgrade. e.g. better scope, improved stability, etc.
    • Maybe pass another table to sniper.register_rifle defining all possible upgrade paths?
  • Support for custom shoot/reload sounds; default to provided sounds.
  • Support for per-rifle "perks".

License: MIT

Attributions

About

[Beta] Minetest mod that adds realistic sniper rifles alongside a nice API for registering custom rifles. NOTE: This project is abandoned, and a similar, more generic mod is being continued at https://github.com/ClobberXD/gunslinger

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages