-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPG dice #31031
RPG dice #31031
Conversation
data/json/items/ammo.json
Outdated
"type": "AMMO", | ||
"id": "rpg_dice", | ||
"price": 10, | ||
"name": "rpg dice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need a "name_plural"
, or else multiples will show up as x rpg dices
.
(The plural name should be the same, because it's already plural)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay so (I really don't know how this works) should I end this one and make a new one with that in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you make the change, commit it, and push it to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, the singular is "die"
These ought to spawn somewhere in-world too, not just in the DM's starting gear. |
Don't forget the rpg table basement room! |
One step closer to me programming an entire session of d&d in the game with NPCs |
You can get metal rpg dice. These could have higher damage and range. |
data/json/items/ammo.json
Outdated
"id": "rpg_dice", | ||
"price": 10, | ||
"name": "rpg dice", | ||
"name_plural": "rpg dice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and above, "RPG" should be all caps
data/json/items/ammo.json
Outdated
"symbol": "=", | ||
"color": "light_gray", | ||
"looks_like": "marble", | ||
"description": "Some dice used to play various role playing games, coming in several shapes and sizes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description should be for that of a singular die (rather than "some dice"). Also, "role-playing" is hyphenated
Eg
"description": "Some dice used to play various role playing games, coming in several shapes and sizes", | |
"description": "A die often used to play various role-playing games", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason the item can't depict a set of dice. A deck of cards is a single item, not 52 individual playing cards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the PR:
The dice are (unless I messed up) usable as ammunition for the sling and slingshot. They are pretty much marbles with slightly adjusted stats such as less damage and higher range.
It probably makes more sense to be shooting individual die, no?
You need to lint your changes (paste the whole file you editing into the linter, format it, and paste it back into the file). |
data/json/professions.json
Outdated
@@ -3582,7 +3582,7 @@ | |||
"skills": [ { "level": 2, "name": "speech" }, { "level": 1, "name": "survival" } ], | |||
"items": { | |||
"both": { | |||
"items": [ "jeans", "tshirt", "socks", "sneakers", "mbag", "pizza_cheese", "cola", "dnd_handbook", "wristwatch" ], | |||
"items": [ "jeans", "tshirt", "socks", "sneakers", "mbag", "pizza_cheese", "cola", "dnd_handbook", "wristwatch", "rpg_dice" ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"items": [ "jeans", "tshirt", "socks", "sneakers", "mbag", "pizza_cheese", "cola", "dnd_handbook", "wristwatch", "rpg_dice" ], | |
"items": [ "jeans", "tshirt", "socks", "sneakers", "mbag", "pizza_cheese", "cola", "dnd_handbook", "wristwatch", "RPG_dice" ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you when changing the ID I forgot about that.
This would be even better if dice can be activated to roll it and get number, like already existing coin |
Add die use action
src/item.cpp
Outdated
@@ -2691,6 +2691,11 @@ std::string item::info( std::vector<iteminfo> &info, const iteminfo_query *parts | |||
} | |||
} | |||
} | |||
if( this->get_var( "die_num_sides", 0 ) != 0 ) { | |||
info.emplace_back( "DESCRIPTION", | |||
string_format( _( "* This item can be used as a <info>die</info>, and has %s sides." ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add accent maybe?
string_format( _( "* This item can be used as a <info>die</info>, and has %s sides." ), | |
string_format( _( "* This item can be used as a <info>die</info>, and has <info>%s</info> sides." ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/iuse.cpp
Outdated
@@ -4051,6 +4051,23 @@ int iuse::mp3_on( player *p, item *it, bool t, const tripoint &pos ) | |||
return it->type->charges_to_use(); | |||
} | |||
|
|||
int iuse::rpgdie( player *you, item *die, bool, const tripoint & ) | |||
{ | |||
const std::array<int, 6> sides_options = { 4, 6, 8, 10, 12, 20 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Adjust use action a bit
Co-Authored-By: anothersimulacrum <[email protected]>
"color": "light_gray", | ||
"looks_like": "marble", | ||
"description": "A metal die used to play various role-playing games", | ||
"material": "zinc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This material does not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I made another PR adding it, and removed it from this one. I'll put it back in this one and just mention that in both PRs.
add d4 that can be used as caltrops |
Summary
Summary: Content "adds rpg dice and makes the game master profession start with them"
Purpose of change
Purpose of Change: Now as I didn't fix a bug I don't know if I should use this, but just in case I am I'll do it anyways. I saw that the game master didn't have any dice, and most rpgs use dice. I figured I'd just add them in and see if anyone saw any reason for them existing.
Describe the solution
Describe the Solution: The dice are (unless I messed up) usable as ammunition for the sling and slingshot. They are pretty much marbles with slightly adjusted stats such as less damage and higher range.
Describe alternatives you've considered
Describe alternatives you've considered: I mean I haven't considered any alternatives besides just not having the dice put in. They don't really contribute much to the game after all.
Additional context
The zinc material is also added in #31217 If one is merged the other one will have its zinc material removed.