[quote=“Kevin Granade, post:25, topic:3989”]I think this kind of thing is super gamey when it has in-game impact, e.g. Fallout snowglobes that gave you stat boosts, that was super gamey. But just an explicitly collectible set of items, no problem with that.
Implementation wise, we’d want some kind of special item that tracks which member of the collection it is, and when you pick it up it merges with the main object. The definition would look something like:
{
"id": "playing_card",
"symbol": "?",
"color": "light_gray",
"name": "playing card",
"description": "A card used for various games, but you need a whole deck for that.",
"collection": [
"members": [ "2 of Spades", "3 of Spades", "4 of Spades", "5 of Spades", "6 of Spades",
"7 of Spades", "8 of Spades", "9 of Spades", "10 of Spades",
"Jack of Spades", "Queen of Spades", "King of Spades", "Ace of Spades",
"2 of Hearts", "3 of Hearts", "4 of Hearts", "5 of Hearts", "6 of Hearts",
"7 of Hearts", "8 of Hearts", "9 of Hearts", "10 of Hearts",
"Jack of Hearts", "Queen of Hearts", "King of Hearts", "Ace of Hearts",
"2 of Clubs", "3 of Clubs", "4 of Clubs", "5 of Clubs", "6 of Clubs",
"7 of Clubs", "8 of Clubs", "9 of Clubs", "10 of Clubs",
"Jack of Clubs", "Queen of Clubs", "King of Clubs", "Ace of Clubs",
"2 of Diamonds", "3 of Diamonds", "4 of Diamonds", "5 of Diamonds", "6 of Diamonds",
"7 of Diamonds", "8 of Diamonds", "9 of Diamonds", "10 of Diamonds",
"Jack of Diamonds", "Queen of Diamonds", "King of Diamonds", "Ace of Diamonds" ],
"complete": "deck_of_cards" ],
"use_action": "COLLECTION",
"price": 1,
"material": "paper",
"weight": 2,
"volume": 0,
"bashing": -8,
"cutting": 0,
"to_hit": -2
},{
"id": "deck_of_cards",
"symbol": "?",
"color": "light_gray",
"name": "deck of cards",
"description": "A complete deck of playing cards.",
"use_action": "CARD_GAME",
"price": 1000,
"material": "paper",
"weight": 94,
"volume": 1,
"bashing": -8,
"cutting": 0,
"to_hit": -2
}
When spawning, each item would get a number randomly assigned to it. This already happens with flyers, so the code is already there, and it’s already persistent across saves. They get a big random number assigned, but we only look at the last few digits of the number via modular arithmatic.
Specifically, the identity of the item would be <random_number> % collection_size. In the case of playing cards, collection_size is 52.
When you pick up a new item, the stacking code can run a special chunk of code that lets them stack, but only if the stack doesn’t already have that card. When you get the last item, extra special code runs and magically* transforms the stack into the collection item, which can have different properties. for example, once you have a full deck of playing cards you could play card games for fun (someone could even drop in a solitare implementation for some metagaming). With NPCs we could even drop in a Poker game or something** so you could play for items.
It’s fairly simple to add a special handler to the item display code to list which items you have in a collection.
*Not actually magical, not even that complicated really.
**Disclaimer, I’m not going to add one, but other people could. There’s probably a FOSS ncurses poker game or two lying around.[/quote]
That awkward moment when you realize you’re quoted in someone’s signature :v
NOW ONTO RELATED THINGS AHEM
Having collectiables with little to no game impact are kinda what I was going with with the small morale boost (it’s only temporary and when you collect stuff in real life (at least when I do when I find new bottlecaps) and you get a little burst of joy when you get a new something), and being able to play cards or something seems pretty awesome too. We can play snake and that robot+kitty game thingy already, right? It’d be cool to see card games thrown in the mix.