feat: Flaschengroessen mit echter Laufzeit und persistenter Restluft
Lint / Lint Resource (push) Has been cancelled

Der Sauerstoff war eine lokale Client-Variable: nicht persistent, an kein Item
gebunden, weg bei Relog. Dazu ergab startingOxygenLevel=100 bei decayRate=1/s
genau 100 Sekunden Tauchzeit statt Minuten.

Sauerstoff-Logik:
- Restsekunden statt Punkte, Verbrauch ueber GetGameTimer-Delta statt gezaehlter
  Wait(1000) - ein Tick laeuft unter Last laenger als eine Sekunde, was sich
  ueber einen langen Tauchgang aufsummiert
- Float-Vergleiche (oxygenLevel % 10 == 0, == 0) raus, Warnschwellen als
  config.warnAtSeconds, jede Schwelle einmal pro Tauchgang
- Verbrauch steigt mit der Tiefe (1 + tiefe/30, gedeckelt), abschaltbar
- Anzeige als mm:ss

Flaschen:
- Vier Items mit capacity in Sekunden (300/600/900/1200) in config/shared.lua
- Restluft in metadata.oxygen, Fuellstand zusaetzlich in metadata.durability,
  damit der Balken direkt im Inventar-Slot sichtbar ist
- Kein decay auf den Items: ox_inventory loescht sonst die leere Flasche
- Auswahlmenue beim Anlegen und Auffuellen (entfaellt bei nur einer Flasche)
- diving_fill fuellt bis capacity statt auf einen Fixwert, verweigert volle
  Flaschen und verbraucht sich nur bei Erfolg
- items_for_ox_inventory.lua zum Reinkopieren

Server:
- getTanks/syncTank als Callbacks, Restluft kann nur sinken und nicht schneller
  als maxDrainPerSecond pro echter Sekunde
- SetMetadata ersetzt die Metadata-Tabelle komplett, daher wird der bestehende
  Inhalt kopiert statt nur oxygen gesetzt

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 23:45:11 +02:00
co-authored by Claude Opus 5
parent 58f31adfa9
commit d661152bc9
8 changed files with 469 additions and 47 deletions
+13 -4
View File
@@ -1,8 +1,12 @@
{
"error": {
"not_standing_up": "You need to be on solid ground to put this on...",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
"need_otube": "You don't have an air tank with you!",
"underwater": "You cannot do this underwater...",
"no_tank": "You don't have an air tank to refill!",
"tank_empty": "This air tank is empty!",
"tank_already_full": "This air tank is already full!",
"out_of_air": "You're out of air! Surface now!"
},
"success": {
"took_out": "You've taken your gear off!",
@@ -11,6 +15,11 @@
"info": {
"put_suit": "Putting on your diving suit...",
"pullout_suit": "Taking off your diving suit...",
"filling_air": "Filling air..."
"filling_air": "Filling air...",
"oxygen_low": "Only %s of air left!",
"tank_remaining": "%s remaining (%d%%)"
},
"menu": {
"choose_tank": "Choose an air tank"
}
}
}