Skip to content

NX earned per kill / per hour at env rates (row 205 NX source 3) - #1005

Merged
neeerp merged 1 commit into
masterfrom
v83/earned-nx
Oct 25, 2026
Merged

neeerp merged 1 commit into
masterfrom
v83/earned-nx

Conversation

@neeerp

@neeerp neeerp commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Row 205, NX source 3: NX earned by playing, at env rates that default to off.

  • net::rates::nx() reads two env rates. Each is a positive integer, and 0 (off) when unset or invalid:
    • RUSTMS_NX_PER_KILL: NX Credit for each kill the player loots, so one award per kill even in a party.
    • RUSTMS_NX_PER_HOUR: NX Credit for each hour connected to a channel. It comes with a pink line, "You earned N NX Credit for an hour of play.", which is skipped while the player is in the Cash Shop.
  • The client actor keeps a running total (nx_earned) and moves it to the account with db::cash_shop::grant at each 60 s autosave, on entering the Cash Shop (before the balances are read) and on logout or channel change. Kills therefore cost no database write of their own. If a bank fails, the total is kept for the next try.
  • The harness world sets RUSTMS_NX_PER_KILL: "1". No other test both kills and checks a balance (checked with grep).

Tests:

  • Unit test nx_rates_are_off_unless_set_to_a_positive_number.
  • Harness test earned_nx: kill 3 snails, enter the shop, and the NX Credit is 3.
  • beginner_skills, cash_shop_purchases, cash_coupons, gm_commands and monster_book pass.

…MS_NX_PER_HOUR per hour online (both off by default), banked at autosave, Cash Shop entry and logout
@neeerp
neeerp merged commit 8595280 into master Oct 25, 2026
1 check passed
@neeerp
neeerp deleted the v83/earned-nx branch October 25, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant