B7: Weapon roster and consumables
Eight slot weapons: the six from the design plus the rivet repeater (fast, short-range automatic) and the harpoon gun (slow heavy bolt, 2.5x damage to built pieces). Four quality tiers, Rusted to Captain's, scale damage and reload time. The line thrower now yanks the shooter towards where its line lands, through a data field (pull_speed) any weapon can use. Four consumables: sailcloth bandage (heals to 75), brine tonic, cork vest and the new tar patch. Fire with one held starts using it if it would help; it takes effect after its use time. Changing slot, dropping, sprinting, swimming or elimination interrupts it and uses nothing up. All checks run on the server. A data-validation test covers every weapon, tier, consumable and ammunition type, including unknown stat keys, name format and that every ammo type is used. The GDD's weapons section lists the roster. Closes #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
-2
@@ -30,6 +30,10 @@ const AMMO: int = 2
|
||||
@export var bloom_degrees: float = 0.0
|
||||
@export var headshot_multiplier: float = 1.0
|
||||
@export var structure_damage: int = 0
|
||||
## Multiplies damage to built pieces and props.
|
||||
@export var structure_factor: float = 1.0
|
||||
## Speed the shooter is pulled towards where a shot lands; 0 for none.
|
||||
@export var pull_speed: float = 0.0
|
||||
## 0 means hitscan.
|
||||
@export var projectile_speed: float = 0.0
|
||||
@export var projectile_gravity: float = 0.0
|
||||
@@ -40,6 +44,8 @@ const AMMO: int = 2
|
||||
|
||||
@export_group("Consumable")
|
||||
@export var heal: int = 0
|
||||
## Healing stops at this much health.
|
||||
@export var heal_cap: int = 0
|
||||
@export var armor: int = 0
|
||||
@export var use_seconds: float = 0.0
|
||||
|
||||
@@ -61,8 +67,14 @@ func fire_interval_ticks() -> int:
|
||||
return maxi(ceili(Tuning.TICK_RATE_HZ / fire_rate), 1)
|
||||
|
||||
|
||||
func reload_ticks() -> int:
|
||||
return roundi(reload_seconds * Tuning.TICK_RATE_HZ)
|
||||
## Reload time in ticks for a weapon of quality `tier`.
|
||||
func reload_ticks(tier: int = 0) -> int:
|
||||
return roundi(reload_seconds * Tuning.TICK_RATE_HZ * float(tier_stats(tier)["reload"]))
|
||||
|
||||
|
||||
## The Tuning.WEAPON_TIERS entry for `tier`, clamped into range.
|
||||
static func tier_stats(tier: int) -> Dictionary:
|
||||
return Tuning.WEAPON_TIERS[clampi(tier, 0, Tuning.WEAPON_TIERS.size() - 1)]
|
||||
|
||||
|
||||
func use_ticks() -> int:
|
||||
|
||||
Reference in New Issue
Block a user