Skip to content

Turns the Grenade Satchel into a Belt, plus related changes#12481

Open
TheManWithNoHands wants to merge 6 commits into
cmss13-devs:masterfrom
TheManWithNoHands:id-grenade-belt
Open

Turns the Grenade Satchel into a Belt, plus related changes#12481
TheManWithNoHands wants to merge 6 commits into
cmss13-devs:masterfrom
TheManWithNoHands:id-grenade-belt

Conversation

@TheManWithNoHands

@TheManWithNoHands TheManWithNoHands commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

About the pull request

  • Adds a grenade belt that can be ID locked with the same stats as the Grenade Satchel
  • Moves the code for id lock from backpack to its parent storage, allowing storage items to easily gain an ID lock using a 1 var change.
  • Adds a new belt sprite for the lockable belt.
  • Cleand up some redundant var's from the UPP grenade belt.

Explain why it's good for the game

The Grenade Satchel has no real reason to use the backpack slot. It holds about the same in grenades, and while it can hold bigger grenades we just dont have bigger grenades. Its only real diffrence is the ability to lock it. Wich is not worth the backpack slot. So on the belt it goes like its non lockable cousin. This should make the satchel into more then a box sitting at FOB to store your private stash.

How i did that i might have wasted my time by doing a small refactor kinda. (Idunno if that counts)
To not repeat code by having the same id lock code in bags and belts, i put it on their parent. /obj/item/storage.
I think this is the better option, being now you can slap the ID lock function on any storage with 1 var change, but i will undo that and just put it on belts if thats preferd.
I dont think its breaking any item either, i couldnt find any storage item that is messed up because of it.

Testing Photographs and Procedure

Screenshots & Videos grafik grafik

Changelog

🆑NHC
add: Added an ID lockable Grenade Belt
code: Moved the ID lock code from backpacks to its parent, storage
del: Removed the Grenade Satchel
imageadd: added Item and on_mob sprites for the new grenade belt
/:cl:

@github-project-automation github-project-automation Bot moved this to Awaiting Review in Review Backlog Jun 20, 2026
@cmss13-ci cmss13-ci Bot added Sprites Remove the soul from the game. Mapping did you remember to save in tgm format? Feature Feature coder badge Code Improvement Make the code longer Removal snap Quality of Life Make the game harder to play size/M Denotes a PR that changes 50-199 lines, ignoring generated files. labels Jun 20, 2026
@kooarbiter

Copy link
Copy Markdown

does the grenade qol also work for the regular grenade belts riflemen can buy?

@TheManWithNoHands

TheManWithNoHands commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

does the grenade qol also work for the regular grenade belts riflemen can buy?

Its for ALL grenade belts. All.. like 3 or so.

Comment thread code/game/objects/items/storage/belt.dm Outdated
Comment thread code/game/objects/items/storage/belt.dm Outdated
Comment thread code/game/objects/items/storage/belt.dm Outdated
Comment on lines +1050 to +1053
/obj/item/storage/proc/toggle_lock(obj/item/card/id/card, mob/living/carbon/human/H)
if(QDELETED(locking_id))
to_chat(H, SPAN_NOTICE("You lock \the [src]!"))
locking_id = card

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to clear the locking_id reference properly

Either store a WEAKREF() or add it to Destroy on /obj/item/storage then attach a COMSIG_PARENT_QDELETED handler to it

@TheManWithNoHands TheManWithNoHands Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aight. Then i'll sit down and learn how those things are used.
I think i did it right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what i suggest specifically: Use the WEAKREF() method. Since this is core storage object code, using signals can conflict with other storages use of it.
A weakref allows you to keep track of something without holding it up from being deleted.

  • Instead of defining locking_id as /obj/item/card/id above, you use a /datum/weakref
  • When you store it, you use WEAKREF : locking_id = WEAKREF(card)
  • When you want to check it, you "resolve" it into the real item: var/obj/item/card/id/card = locking_id?.resolve()
  • If the result is null, that means the id is gone. That can also replace your QDELETED check just above this.
  • In Destroy() you only need to = null the weakref, not QDEL_NULL

If you have more questions about it don't hesitate to reply here or hit me up on discord

@github-project-automation github-project-automation Bot moved this from Awaiting Review to Changes Requested in Review Backlog Jun 20, 2026
@TheManWithNoHands TheManWithNoHands requested a review from fira June 21, 2026 02:53
@TheManWithNoHands

Copy link
Copy Markdown
Contributor Author

removed qol changes with grenade packs for atomization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Improvement Make the code longer Feature Feature coder badge Mapping did you remember to save in tgm format? Quality of Life Make the game harder to play Removal snap size/M Denotes a PR that changes 50-199 lines, ignoring generated files. Sprites Remove the soul from the game.

Projects

Status: Changes Requested

Development

Successfully merging this pull request may close these issues.

3 participants