diff --git a/README.md b/README.md index fd2609b..0837e4d 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ works with. The maintainers publish the releases of the mods in this repository. | [waypoint-tools](mods/waypoint-tools/) | lets Waypoint's tools reach the game without the client control bridge: the item crafter gives its items through it | | [itemquantity](mods/itemquantity/) | 10× as many item drops | | [itemrarity](mods/itemrarity/) | 10× the chance of magic, rare and unique equipment | +| [petcurrency](mods/petcurrency/) | Pet currency pickup into an affinity stash; requires the proposed currency-pickup server API. | ## Contributing People and AI agents are both welcome. Start with [AGENTS.md](AGENTS.md): how a mod is laid out, the rules, and how to diff --git a/mods.json b/mods.json index 633e3a0..e7d4cc6 100644 --- a/mods.json +++ b/mods.json @@ -7,6 +7,7 @@ { "id": "itemquantity", "name": "Item Quantity", "description": "10 times as many item drops from every kill.", "author": "LocalExile", "version": "1.1.1", "compatibleClientVersions": ["0.4.2-beta"], "kind": "feature", "type": "project", "path": "mods/itemquantity", "depends": [], "settings": true }, { "id": "itemrarity", "name": "Item Rarity", "description": "10 times the chance of magic, rare and unique equipment.", "author": "LocalExile", "version": "1.1.1", "compatibleClientVersions": ["0.4.2-beta"], "kind": "feature", "type": "project", "path": "mods/itemrarity", "depends": [], "settings": true }, { "id": "liveeconomy", "name": "Live Economy", "description": "Faustus's Currency Exchange as a live market: the official Path of Exile leagues' prices, a spread, depth, and orders that fill with time.", "author": "JetStream", "version": "1.1.1", "compatibleClientVersions": ["0.4.2-beta"], "kind": "feature", "type": "project", "path": "mods/liveeconomy", "depends": [], "settings": true }, + { "id": "petcurrency", "name": "Pet Currency", "description": "Pet currency pickup into an affinity stash; requires the proposed currency-pickup server API.", "author": "JJ ouyang", "version": "1.1.0", "compatibleClientVersions": ["0.4.2-beta"], "kind": "feature", "type": "script", "path": "mods/petcurrency", "depends": [], "settings": true }, { "id": "waypoint-tools", "name": "Waypoint Tools", "description": "Lets Waypoint's tools reach the game without the client control bridge: the item crafter gives its items through it.", "author": "Waypoint", "version": "1.0.0", "compatibleClientVersions": ["0.4.2-beta"], "kind": "feature", "type": "project", "path": "mods/waypoint-tools", "depends": ["Game"], "settings": false } ] } diff --git a/mods/petcurrency/README.md b/mods/petcurrency/README.md new file mode 100644 index 0000000..6338a8b --- /dev/null +++ b/mods/petcurrency/README.md @@ -0,0 +1,30 @@ +# Pet Currency + +![Pet Currency icon](icon.png) + +Author: **JJ ouyang**. + +A worn pet collects nearby currency into the first root stash tab with currency affinity, ordered by tab position. Pickup respects private loot ownership and transfers a complete stack atomically. A full tab or failed save leaves the same item on the ground. Quest items and other equipment are excluded. + +## Compatibility + +This mod requires the Gateway API added by [LocalExile #792](https://github.com/LocalExile/LocalExile/pull/792). +The manifest lists 0.4.2-beta provisionally for review. To install this mod, use a server build with that PR applied. +Release compatibility will be set to the first LocalExile version that ships the required API. + +## Installation and settings + +Waypoint can install this folder, or its contents can live in `Mods/Binaries/petcurrency/` of a server with the required API. +The manifest starts disabled. `/mod_enable petcurrency`, `/mod_reload petcurrency` and `/mod_disable petcurrency` control its lifecycle. +Declared settings are in `settings.json` when present; the user's overrides belong in `data/mods/petcurrency.json`. + +A zero radius disables automatic pickup. Pickup runs at most twice per second and stops on death or area departure. This mod adds no chat commands. Disabling or unloading it removes its policy without moving existing ground or stash items. + +## Validation + +The associated server tests cover the policy's default, enable, reload and disable behaviour and its game rules. +See the pull request for current build and in-game verification status. + +## Icon + +The 256×256 icon is AI-assisted original artwork based on LocalExile in-game screenshots and this mod's gameplay description. diff --git a/mods/petcurrency/icon.png b/mods/petcurrency/icon.png new file mode 100644 index 0000000..a25ee3f Binary files /dev/null and b/mods/petcurrency/icon.png differ diff --git a/mods/petcurrency/main.cs b/mods/petcurrency/main.cs new file mode 100644 index 0000000..ca4835d --- /dev/null +++ b/mods/petcurrency/main.cs @@ -0,0 +1,12 @@ +using GameServer.Modding; + +public sealed class Petcurrency : IMod +{ + sealed record Choices(int Radius, int MaximumItemsPerTick, bool RequirePet); + + public void Load(IModContext mod) + { + var choices = mod.Settings(); + CurrencyPickupPolicy.Use(mod.Manifest.Id, new(choices.Radius, choices.MaximumItemsPerTick, choices.RequirePet)); + } +} diff --git a/mods/petcurrency/mod.json b/mods/petcurrency/mod.json new file mode 100644 index 0000000..33d2958 --- /dev/null +++ b/mods/petcurrency/mod.json @@ -0,0 +1,16 @@ +{ + "id": "petcurrency", + "name": "Pet Currency", + "description": "Pet currency pickup into an affinity stash; requires the proposed currency-pickup server API.", + "author": "JJ ouyang", + "version": "1.1.0", + "compatibleClientVersions": [ + "0.4.2-beta" + ], + "kind": "feature", + "depends": [], + "enabled": false, + "requiredServerApis": [ + "CurrencyPickupPolicy.Use" + ] +} diff --git a/mods/petcurrency/settings.json b/mods/petcurrency/settings.json new file mode 100644 index 0000000..1a11897 --- /dev/null +++ b/mods/petcurrency/settings.json @@ -0,0 +1,25 @@ +{ + "version": 1, + "settings": { + "radius": { + "type": "integer", + "default": 12, + "min": 0, + "max": 64, + "label": "Pickup radius", + "unit": "cells" + }, + "maximumItemsPerTick": { + "type": "integer", + "default": 8, + "min": 1, + "max": 64, + "label": "Stacks per pickup pass" + }, + "requirePet": { + "type": "bool", + "default": true, + "label": "Require an equipped pet" + } + } +}