Skip to content
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

Update Forge of Wonders merchants #57993

Merged
merged 2 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion data/mods/Magiclysm/npc/TALK_FORGE_ARDELIA.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"common": false,
"bonus_int": { "one_in": 4 },
"bonus_per": { "one_in": 4 },
"shopkeeper_item_group": "NC_FORGE_LORD_STORE_LIBRARY",
"shopkeeper_item_group": [ { "group": "NC_FORGE_LORD_STORE_LIBRARY_SHOP", "rigid": true } ],
"worn_override": "NC_FORGE_LIBRARIAN_clothes",
"skills": [
{
Expand All @@ -41,6 +41,12 @@
"subtype": "collection",
"entries": [ { "item": "sundress", "prob": 100 }, { "item": "heels", "prob": 100 }, { "item": "sweater", "prob": 100 } ]
},
{
"type": "item_group",
"subtype": "collection",
"id": "NC_FORGE_LORD_STORE_LIBRARY_SHOP",
"items": [ { "group": "NC_FORGE_LORD_STORE_LIBRARY", "prob": 100, "count": [ 15, 24 ] } ]
},
{
"type": "item_group",
"subtype": "collection",
Expand Down
11 changes: 10 additions & 1 deletion data/mods/Magiclysm/npc/TALK_FORGE_HELEN_TAVREL.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"common": false,
"bonus_int": { "one_in": 4 },
"bonus_per": { "one_in": 4 },
"shopkeeper_item_group": "NC_FORGE_LORD_STORE_REAGENT",
"shopkeeper_item_group": [ { "group": "NC_FORGE_LORD_STORE_REAGENT_SHOP", "rigid": true } ],
"worn_override": "NC_FORGE_REAGENT_clothes",
"weapon_override": "NC_FORGE_REAGENT_wield",
"skills": [
Expand Down Expand Up @@ -69,6 +69,15 @@
{ "item": "enchanted_blackpowder_pistol", "ammo-item": "flintlock_ammo", "charges": 1 }
]
},
{
"type": "item_group",
"subtype": "collection",
"id": "NC_FORGE_LORD_STORE_REAGENT_SHOP",
"items": [
{ "group": "NC_FORGE_LORD_STORE_REAGENT", "count": [ 10, 20 ], "prob": 100 },
{ "group": "NC_FORGE_PIRATE_wield", "count": 10, "prob": 20 }
]
},
{
"type": "item_group",
"subtype": "collection",
Expand Down
8 changes: 7 additions & 1 deletion data/mods/Magiclysm/npc/TALK_FORGE_MERCHANT.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"common": false,
"bonus_int": { "rng": [ 20, 25 ] },
"bonus_per": { "rng": [ 20, 25 ] },
"shopkeeper_item_group": "NC_FORGE_LORD_STORE",
"shopkeeper_item_group": [ { "group": "NC_FORGE_LORD_SHOP", "rigid": true } ],
"worn_override": "NC_FORGE_LORD_clothes",
"skills": [
{
Expand Down Expand Up @@ -65,6 +65,12 @@
{ "group": "spellbook_loot_1", "prob": 35, "count": [ 1, 3 ] }
]
},
{
"type": "item_group",
"subtype": "collection",
"id": "NC_FORGE_LORD_SHOP",
"items": [ { "group": "NC_FORGE_LORD_STORE", "count": [ 20, 32 ], "prob": 100 } ]
},
{
"id": "TALK_FORGE_LORD",
"type": "talk_topic",
Expand Down
29 changes: 22 additions & 7 deletions data/mods/Magiclysm/worldgen/forge_of_wonders.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,28 @@
{ "monster": "GROUP_FORGE_DWARVES", "x": [ 77, 82 ], "y": [ 24, 30 ], "density": 0.1, "repeat": [ 3, 6 ] },
{ "monster": "GROUP_FORGE_DWARVES", "x": [ 24, 47 ], "y": [ 40, 45 ], "density": 0.1, "repeat": [ 3, 6 ] },
{ "monster": "GROUP_FORGEDEMONS", "x": [ 80, 90 ], "y": [ 8, 14 ], "density": 0.1, "repeat": [ 3, 6 ] }
],
"place_zones": [
{
"type": "LOOT_ITEM_GROUP",
"filter": "NC_FORGE_LORD_STORE_LIBRARY_SHOP",
"faction": "forge_lords",
"x": [ 22, 23 ],
"y": 43
},
{
"type": "LOOT_ITEM_GROUP",
"filter": "NC_FORGE_LORD_STORE_REAGENT_SHOP",
"faction": "forge_lords",
"x": [ 13, 17 ],
"y": [ 7, 8 ]
},
{ "type": "LOOT_ITEM_GROUP", "filter": "NC_FORGE_LORD_SHOP", "faction": "forge_lords", "x": 75, "y": 10 },
{ "type": "LOOT_ITEM_GROUP", "filter": "NC_FORGE_LORD_SHOP", "faction": "forge_lords", "x": 76, "y": 11 },
{ "type": "LOOT_ITEM_GROUP", "filter": "NC_FORGE_LORD_SHOP", "faction": "forge_lords", "x": 75, "y": 12 },
{ "type": "LOOT_UNSORTED", "faction": "forge_lords", "x": [ 22, 23 ], "y": 43 },
{ "type": "LOOT_UNSORTED", "faction": "forge_lords", "x": [ 13, 17 ], "y": [ 7, 8 ] },
{ "type": "LOOT_UNSORTED", "faction": "forge_lords", "x": [ 75, 76 ], "y": [ 10, 12 ] }
]
}
},
Expand Down Expand Up @@ -140,13 +162,6 @@
},
"items": {
"!": { "item": "magic_smith", "chance": 40, "repeat": [ 1, 2 ] },
"f": [
{ "item": "NC_FORGE_LORD_STORE_REAGENT", "chance": 40, "repeat": [ 1, 2 ] },
{ "item": "NC_FORGE_PIRATE_wield", "chance": 20 }
],
"7": { "item": "NC_FORGE_LORD_STORE_LIBRARY", "chance": 100, "repeat": [ 5, 8 ] },
"8": { "item": "NC_FORGE_LORD_STORE", "chance": 100, "repeat": [ 5, 8 ] },
"9": { "item": "NC_FORGE_LORD_STORE", "chance": 100, "repeat": [ 5, 8 ] },
"$": [
{ "item": "forge_vault_items", "chance": 10, "repeat": [ 1, 2 ] },
{ "item": "forge_vault_money", "chance": 95, "repeat": [ 1, 3 ] }
Expand Down
12 changes: 3 additions & 9 deletions src/clzones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,13 +836,7 @@ bool zone_manager::custom_loot_has( const tripoint_abs_ms &where, const item *it
return z( *it );
}
if( ztype == zone_type_LOOT_ITEM_GROUP ) {
std::set<itype const *> const &gr =
item_group::every_possible_item_from( item_group_id( filter_string ) );

return std::any_of( gr.begin(), gr.end(),
[it]( itype const * type ) {
return type->get_id() == it->typeId();
} );
return item_group::group_contains_item( item_group_id( filter_string ), it->typeId() );
}

return false;
Expand All @@ -858,7 +852,7 @@ std::unordered_set<tripoint_abs_ms> zone_manager::get_near( const zone_type_id &
if( point.z() == where.z() ) {
if( square_dist( point, where ) <= range ) {
if( ( type != zone_type_LOOT_CUSTOM and type != zone_type_LOOT_ITEM_GROUP ) or
( it != nullptr and custom_loot_has( point, it, type ) ) ) {
( it != nullptr and custom_loot_has( point, it, type, fac ) ) ) {
near_point_set.insert( point );
}
}
Expand All @@ -870,7 +864,7 @@ std::unordered_set<tripoint_abs_ms> zone_manager::get_near( const zone_type_id &
if( point.z() == where.z() ) {
if( square_dist( point, where ) <= range ) {
if( ( type != zone_type_LOOT_CUSTOM and type != zone_type_LOOT_ITEM_GROUP ) or
( it != nullptr and custom_loot_has( point, it, type ) ) ) {
( it != nullptr and custom_loot_has( point, it, type, fac ) ) ) {
near_point_set.insert( point );
}
}
Expand Down