B5: Inventory and pickups
Five slots plus the always-carried boathook (selection 0), ammunition carried apart from the slots, and items lying in the world as pickup entities. All changes are made by the server from commands: interact picks up the nearest pickup in reach, drop (new BUTTON_DROP) leaves the held stack at the feet, and both act once per press. A full inventory swaps the held item. Consumables and thrown weapons stack; ammunition stops at its cap and leaves the rest on the ground. An eliminated player drops everything on a ring around where they fell, and the simulation now emits an "eliminated" event when health reaches 0. Item definitions are ItemDef resources built by ItemCatalog from the tables in Tuning (WEAPONS, ITEMS and the new AMMO), so a new item is a data change only. Closes #19 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+44
-2
@@ -232,39 +232,81 @@ const BREAKWATER_MAX_HEAD: float = 6.0
|
||||
const BREAKWATER_WEAR_PER_METRE: float = 2.0
|
||||
const BREACH_FLOW_METRES_PER_SECOND: float = 1.5
|
||||
|
||||
# Inventory and pickups
|
||||
## Items picked up or dropped must be within this distance of the player's feet.
|
||||
const PICKUP_RANGE: float = 2.5
|
||||
## Changing the held slot takes this long before the new item can be used.
|
||||
const SWAP_SECONDS: float = 0.25
|
||||
## Dropped items land on a ring this far from the player's feet.
|
||||
const DROP_SCATTER_METRES: float = 1.2
|
||||
## Ammunition, carried apart from the five slots. `cap` is the most a player carries,
|
||||
## `pickup` how much one ammunition pickup holds.
|
||||
const AMMO: Dictionary = {
|
||||
"birdshot": {"cap": 60, "pickup": 12},
|
||||
"cartridges": {"cap": 300, "pickup": 30},
|
||||
"heavy_balls": {"cap": 30, "pickup": 6},
|
||||
"lines": {"cap": 12, "pickup": 3},
|
||||
}
|
||||
|
||||
# Weapons. Falloff is linear from full damage at `range_full` to `falloff_min`
|
||||
# (a fraction of damage) at `range_max`.
|
||||
# (a fraction of damage) at `range_max`. `spread` is the cone half-angle in degrees
|
||||
# from the hip; aiming multiplies it by AIM_SPREAD_FACTOR. Each shot adds `bloom`
|
||||
# degrees, which decays at BLOOM_DECAY_DEGREES_PER_SECOND while the weapon is ready. `projectile_speed` 0 means
|
||||
# hitscan; otherwise shots fly at that speed under `projectile_gravity`. `ammo` names
|
||||
# an AMMO type; a weapon with `stack` above 1 is thrown and is its own ammunition.
|
||||
const WEAPONS: Dictionary = {
|
||||
"boathook": {
|
||||
"damage": 20, "fire_rate": 1.5, "magazine": 0, "reload": 0.0,
|
||||
"range_full": 2.5, "range_max": 2.5, "falloff_min": 1.0, "rarity": 0,
|
||||
"spread": 0.0, "bloom": 0.0,
|
||||
},
|
||||
"fowling_piece": {
|
||||
"damage": 9, "pellets": 9, "fire_rate": 1.1, "magazine": 6, "reload": 4.0,
|
||||
"range_full": 6.0, "range_max": 25.0, "falloff_min": 0.2, "rarity": 1,
|
||||
"spread": 5.0, "bloom": 0.0, "ammo": "birdshot", "headshot": 1.5,
|
||||
},
|
||||
"dock_carbine": {
|
||||
"damage": 27, "fire_rate": 6.0, "magazine": 30, "reload": 2.4,
|
||||
"range_full": 40.0, "range_max": 120.0, "falloff_min": 0.5, "rarity": 1,
|
||||
"spread": 1.2, "bloom": 0.35, "ammo": "cartridges", "headshot": 1.75,
|
||||
},
|
||||
"signal_revolver": {
|
||||
"damage": 38, "fire_rate": 2.2, "magazine": 6, "reload": 2.0,
|
||||
"range_full": 30.0, "range_max": 80.0, "falloff_min": 0.5, "rarity": 0,
|
||||
"spread": 0.8, "bloom": 0.6, "ammo": "cartridges", "headshot": 2.0,
|
||||
},
|
||||
"whalers_longgun": {
|
||||
"damage": 105, "fire_rate": 0.5, "magazine": 1, "reload": 2.6,
|
||||
"range_full": 120.0, "range_max": 350.0, "falloff_min": 0.7, "rarity": 2,
|
||||
"spread": 3.0, "bloom": 0.0, "ammo": "heavy_balls", "headshot": 2.5,
|
||||
"aim_spread": 0.0, "projectile_speed": 300.0, "projectile_gravity": 9.0,
|
||||
},
|
||||
"line_thrower": {
|
||||
"damage": 0, "fire_rate": 0.6, "magazine": 3, "reload": 3.0,
|
||||
"range_full": 45.0, "range_max": 45.0, "falloff_min": 1.0, "rarity": 2,
|
||||
"spread": 0.0, "bloom": 0.0, "ammo": "lines",
|
||||
"projectile_speed": 90.0, "projectile_gravity": 4.0,
|
||||
},
|
||||
"powder_keg": {
|
||||
"damage": 80, "structure_damage": 400, "blast_radius": 6.0, "fuse": 3.0,
|
||||
"fire_rate": 0.8, "magazine": 1, "reload": 0.0,
|
||||
"fire_rate": 0.8, "magazine": 1, "reload": 0.0, "stack": 3,
|
||||
"range_full": 0.0, "range_max": 30.0, "falloff_min": 1.0, "rarity": 2,
|
||||
"spread": 0.0, "bloom": 0.0,
|
||||
},
|
||||
}
|
||||
## Spread multiplier while aiming, unless a weapon sets its own `aim_spread`.
|
||||
const AIM_SPREAD_FACTOR: float = 0.4
|
||||
## Extra spread while moving, and while airborne or swimming, in degrees.
|
||||
const MOVING_SPREAD_DEGREES: float = 1.5
|
||||
const AIRBORNE_SPREAD_DEGREES: float = 4.0
|
||||
const MAX_BLOOM_DEGREES: float = 6.0
|
||||
const BLOOM_DECAY_DEGREES_PER_SECOND: float = 6.0
|
||||
## Default damage multiplier for a hit on the head, unless a weapon sets `headshot`.
|
||||
const HEADSHOT_MULTIPLIER: float = 1.5
|
||||
## The top of a player's body this tall counts as the head.
|
||||
const HEAD_HEIGHT: float = 0.35
|
||||
## Shots against built pieces and props do this fraction of their player damage.
|
||||
const WEAPON_STRUCTURE_FACTOR: float = 1.0
|
||||
|
||||
# Consumables
|
||||
const ITEMS: Dictionary = {
|
||||
|
||||
Reference in New Issue
Block a user