Spy Module: texture/model assets, unit test, docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wQrHUdrwThVfoqXVv4TT2
This commit is contained in:
Claude 2026-11-28 16:20:31 +01:00 • committed by DuneRealms Development
commit 8d9f45ca8f
5 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,20 @@
package com.example.dunenpc;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class SmugglerCoverTest {
@Test void bonusGrowsTwoPercentPerRunAndCapsAtTen() {
assertEquals(0, SmugglerCover.bonusPercent(0));
assertEquals(4, SmugglerCover.bonusPercent(2));
assertEquals(10, SmugglerCover.bonusPercent(5));
assertEquals(10, SmugglerCover.bonusPercent(50));
assertEquals(0, SmugglerCover.bonusPercent(-3));
}
@Test void coverTimeGrowsTenSecondsPerRunAndCapsAt120() {
assertEquals(180, SmugglerCover.durationSeconds(180, 0));
assertEquals(230, SmugglerCover.durationSeconds(180, 5));
assertEquals(300, SmugglerCover.durationSeconds(180, 99));
assertEquals(10, SmugglerCover.durationSeconds(0, 0));
}
}

View file

@ -0,0 +1 @@
{"model":{"type":"minecraft:model","model":"dunerealms:item/spy_module"}}

View file

@ -0,0 +1 @@
{"parent":"minecraft:item/generated","textures":{"layer0":"dunerealms:item/spy_module"}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

29
docs/SPY-MODULE.md Normal file
View file

@ -0,0 +1,29 @@
# Spy Module (Smuggler / Spy ability)
Status: written without compiling or testing. Needs a build and a two-player test.
## Recipe (cookbook)
Shapeless, crafting table. Unlocked in the recipe book when a player accepts a smuggler contract.
| Ingredient | Item | ei-id |
|---|---|---|
| Egg | Weirding Module (MK III) | `jerboa_egg` |
| Orange dye | Smuggled Spice | `smuggled_spice` |
| Clay ball | Jerboa Hide Paste (MK II) | `jerboa_hide_paste` |
Result: **Spy Module**, Uncommon, MK IV (highest ingredient MK + 1), ei-id `spy_module`, item model `dunerealms:spy_module`.
Recipe key `dunenpc:spy_module`. A spy quest can call `SmugglerCover.unlock(player)` to grant it as well.
## Active
Throw the egg at a player. It does no damage, knockback, sound or message to them. The thrower looks like the target
(armour, main hand, off hand) to every player within `spy.view-distance` blocks. Cosmetic only. 3 s cooldown.
Cover ends on attacking, being hurt, death, quit, world change, or after `spy.duration-seconds` (180 s).
## Passive: Quiet Contacts
Per completed smuggling run: +2% payout (max +10%, paid as an extra deposit after the Trust levy) and +10 s cover time (max +120 s).
Runs are stored on the player as `dunenpc:smuggler_runs`.
## Not done
- No `item-templates.json` entry (avoids breaking catalogue tests); add it so the catalogue lists the item.
- `DuneResourcePack.zip` is not rebuilt; only the source assets were added.
- No spy quest exists yet.