Skip to content

Added Functions (Very Scuffed w/ Claude): - #5

Open
SimonLeeCats wants to merge 1 commit into
mainfrom
SimonChanges
Open

Added Functions (Very Scuffed w/ Claude):#5
SimonLeeCats wants to merge 1 commit into
mainfrom
SimonChanges

Conversation

@SimonLeeCats

Copy link
Copy Markdown
Collaborator

This is lowkey scuffed AF and I'm not sure if this is gonna break the system... I've tested it locally and everything seems to work on my end however, I only tested it locally so I'm not sure how it works if it was deployed.

Summary

  • Changed that you can't contest your own territories
  • Added a Yellow boarder for territories you own
  • Added functionality for the rest of the items (shield and double points)
image image image image

Claude Description:

Bug fixes

tsx not found — fixed by pointing @feastfite/shared package.json to its TypeScript source so services don't need a build step
Services getting ECONNREFUSED — caused by the shared package having no dist/ folder; same fix above resolved it
Territory service missing ECONOMY_SERVICE_URL and VOTE_SERVICE_URL in .env so inter-service HTTP calls failed locally
Double Points item

New user_boosts table tracks active boosts with an expiry time
awardPoints() in the ledger checks for an active boost and doubles any positive delta automatically — no changes needed anywhere points are awarded
POST /boosts/activate consumes one from inventory and writes a 1-hour boost row
GET /boosts/active returns active boosts with expiry timestamps
Frontend shows an ACTIVATE button when you own one, and a live countdown timer when it's running
Territory Shield item

shielded_until column added to the territories table
POST /territories/:id/shield verifies you own the territory, consumes the item from economy, sets a 24-hour shield
Claim route rejects challengers immediately with 423 if the territory is shielded — the fight never starts
voteWinner consumer also checks the shield as a safety net for votes already in progress
Map polygons get a solid gold border when shielded so it's visible at a glance
Territory panel shows a gold "🛡️ Shielded" banner with the exact expiry time instead of the claim button
Battering Ram item

/inventory/use generalized to work for any consumable (was hardcoded to battering ram only)
Frontend shows locked territories in a picker when you click USE, lets you pick one and smash the lock
Self-contesting prevention

Backend rejects claims where owner_id === userId with a 409
Frontend shows "You own this territory" instead of the claim button

@SimonLeeCats

Copy link
Copy Markdown
Collaborator Author

its lowkirkly cooked

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