Next. I made it's simplier to mind of modders.
Not: (in "def manual_trade")
goods = add_mod_goods(charStoreHashName) good += goods if goods != nil
Then:
begin; name = $game_map.interpreter.get_character(0).npc_name; rescue; name = nil; end goods = add_mod_goods(name) if name != nil good += goods if goods != nil
And then use in json normal names instead of numbers.
{ "npc_name": "UniqueTavernWaifu", "items": [ { "item_name": "ItemSurBot", "custom_price": null, "price_add": 0, "price_mult": 1, "rndMin": 1, "rndMax": 5, "shop_nerf": [ { "base": 0, "base_mult": 1, "attr_name": "weak", "attr_mult": 1, "attr_type": 0 }, { "base": -100, "base_mult": 0, "attr_name": "sexy", "attr_mult": -1, "attr_type": 0 } ] }, { "item_name": "ItemAdvBot", "custom_price": null, "price_add": 0, "price_mult": 1, "rndMin": 1, "rndMax": 5, "shop_nerf": [ { "base": 0, "base_mult": 1, "attr_name": "weak", "attr_mult": 0.5, "attr_type": 0 } ] } ] }
And we can add story_stats check and stats check after shopnerf. And work with it in "def add_mod_goods", and when collect data from jsons to $barter_hash. Of course we should allow code to ignore if some of the hash-keys don't exist in some of jsons. If not need then allow human to don't write keys in json..
We can add something like this to allow adding item to good :
"req_lower_than": [{"stat_name": "name (as weak)", "value": num}, {.......}] ,
for example. If Lona have high weak then she can't buy something
"req_higher_than": [{"stat_name": "name (as sexy or morality)", "value": num}, {.......}] ,
for example. Lona need to have high sexy to buy something strange
Or may be:
"req_between": [{"stat_name": "name (as weak)", "valueMin": num, "valueMax": num }, {...}] ,
"req_story_stats": [{"story_stats_name": "name of story stat", "value": num (or other)}, {.......}] ,
for example. Lona need to done certain quest to buy something uniq
"req_game_player_stat": [{"player_stat_name": "name of stat", "value": num (or other)}, {.......}] ,
For example Elisa won't sell aids of stats while Lona don't need it.
Or Lona can't buy something if her stat["SlaveBrand"] != 0 :
req_game_player_stat": [{"player_stat_name": "SlaveBrand", "value": 0}],