From a8f549f021c1fd95885cb64440f191777a754175 Mon Sep 17 00:00:00 2001 From: akirashirosawa <38557723+akirashirosawa@users.noreply.github.com> Date: Fri, 13 Nov 2020 23:32:30 +0300 Subject: [PATCH 1/5] fix pay_gas --- src/iexamine.cpp | 83 ++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 6fe473b15199b..a7bcae8acbd37 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -4175,10 +4175,10 @@ static int getNearPumpCount( const tripoint &p, std::string &fuel_type ) const auto t = here.ter( tmp ); if( t == ter_str_id( "t_gas_pump" ) || t == ter_str_id( "t_gas_pump_a" ) ) { result++; - fuel_type = "gasoline"; + fuel_type = _( "gasoline" ); } else if( t == ter_str_id( "t_diesel_pump" ) || t == ter_str_id( "t_diesel_pump_a" ) ) { result++; - fuel_type = "diesel"; + fuel_type = _( "diesel" ); } } return result; @@ -4196,12 +4196,12 @@ cata::optional iexamine::getNearFilledGasTank( const tripoint ¢er, auto check_for_fuel_tank = here.furn( tmp ); - if( fuel_type == "gasoline" ) { + if( fuel_type == _( "gasoline" ) ) { if( check_for_fuel_tank != furn_str_id( "f_gas_tank" ) && here.ter( tmp ) != ter_str_id( "t_gas_tank" ) ) { continue; } - } else if( fuel_type == "diesel" ) { + } else if( fuel_type == _( "diesel" ) ) { if( check_for_fuel_tank != furn_str_id( "f_diesel_tank" ) && here.ter( tmp ) != ter_str_id( "t_diesel_tank" ) ) { continue; @@ -4244,15 +4244,10 @@ static int findBestGasDiscount( player &p ) { int discount = 0; - for( size_t i = 0; i < p.inv->size(); i++ ) { - item &it = p.inv->find_item( i ); - - if( it.has_flag( flag_GAS_DISCOUNT ) ) { - - int q = getGasDiscountCardQuality( it ); - if( q > discount ) { - discount = q; - } + for( const item *it : p.all_items_with_flag( flag_GAS_DISCOUNT ) ) { + int q = getGasDiscountCardQuality( *it ); + if( q > discount ) { + discount = q; } } @@ -4350,16 +4345,19 @@ static int fromPumpFuel( const tripoint &dst, const tripoint &src ) for( auto item_it = items.begin(); item_it != items.end(); ++item_it ) { if( item_it->made_of( phase_id::LIQUID ) ) { // how much do we have in the pump? - item liq_d( item_it->type, calendar::turn, item_it->charges ); + int amount = item_it->charges; + item liq_d( item_it->type, calendar::turn, amount ); // add the charges to the destination - const auto backup_tank = here.ter( dst ); + const ter_id backup_ter = here.ter( dst ); + const furn_id backup_furn = here.furn( dst ); here.ter_set( dst, ter_str_id::NULL_ID() ); + here.furn_set( dst, furn_str_id::NULL_ID() ); here.add_item_or_charges( dst, liq_d ); - here.ter_set( dst, backup_tank ); + here.ter_set( dst, backup_ter ); + here.furn_set( dst, backup_furn ); // remove the liquid from the pump - int amount = item_it->charges; items.erase( item_it ); return amount; } @@ -4373,7 +4371,7 @@ static void turnOnSelectedPump( const tripoint &p, int number, const std::string map &here = get_map(); for( const tripoint &tmp : here.points_in_radius( p, 12 ) ) { const auto t = here.ter( tmp ); - if( fuel_type == "gasoline" ) { + if( fuel_type == _( "gasoline" ) ) { if( t == ter_str_id( "t_gas_pump" ) || t == ter_str_id( "t_gas_pump_a" ) ) { if( number == k++ ) { here.ter_set( tmp, ter_str_id( "t_gas_pump_a" ) ); @@ -4381,7 +4379,7 @@ static void turnOnSelectedPump( const tripoint &p, int number, const std::string here.ter_set( tmp, ter_str_id( "t_gas_pump" ) ); } } - } else if( fuel_type == "diesel" ) { + } else if( fuel_type == _( "diesel" ) ) { if( t == ter_str_id( "t_diesel_pump" ) || t == ter_str_id( "t_diesel_pump_a" ) ) { if( number == k++ ) { here.ter_set( tmp, ter_str_id( "t_diesel_pump_a" ) ); @@ -4543,30 +4541,45 @@ void iexamine::pay_gas( player &p, const tripoint &examp ) } if( refund == choice ) { - const int pos = p.inv->position_by_type( itype_id( "cash_card" ) ); - - if( pos == INT_MIN ) { - add_msg( _( "Never mind." ) ); + std::vector cash_cards = p.items_with( []( const item & i ) { + return i.typeId() == itype_cash_card; + } ); + if( cash_cards.empty() ) { + popup( _( "You do not have a cash card to refund money!" ) ); return; } - item *cashcard = &( p.i_at( pos ) ); - // Okay, we have a cash card. Now we need to know what's left in the pump. const cata::optional pGasPump = getGasPumpByNumber( examp, uistate.ags_pay_gas_selected_pump ); - int amount = pGasPump ? fromPumpFuel( pTank, *pGasPump ) : 0; - if( amount >= 0 ) { - sounds::sound( p.pos(), 6, sounds::sound_t::activity, _( "Glug Glug Glug" ), true, "tool", - "gaspump" ); - cashcard->charges += amount * pricePerUnit / 1000.0f; - add_msg( m_info, _( "Your cash cards now hold %s." ), - format_money( p.charges_of( itype_cash_card ) ) ); - p.moves -= to_moves( 5_seconds ); - return; - } else { + int amountFuel = pGasPump ? fromPumpFuel( pTank, *pGasPump ) : -1; + if( amountFuel < 0 ) { popup( _( "Unable to refund, no fuel in pump." ) ); return; } + sounds::sound( p.pos(), 6, sounds::sound_t::activity, _( "Glug Glug Glug" ), true, "tool", + "gaspump" ); + + int refundPricePerUnit = getGasPricePerLiter( 3 ); // min price to avoid exploit + int amountMoney = amountFuel * refundPricePerUnit / 1000.0f; + std::sort( cash_cards.begin(), cash_cards.end(), []( item * l, const item * r ) { + return l->ammo_remaining() > r->ammo_remaining(); + } ); + for( item * const &cc : cash_cards ) { + if( amountMoney == 0 ) { + break; + } + int transfer = std::min( amountMoney, cc->remaining_ammo_capacity() ); + cc->ammo_set( cc->ammo_default(), transfer + cc->ammo_remaining() ); + amountMoney -= transfer; + } + if( amountMoney ) { + add_msg( m_info, _( "All cash cards at maximum capacity" ) ); + // all fuel already removed from pump, so remaning amountMoney simply ignored + } + add_msg( m_info, _( "Your cash cards now hold %s." ), + format_money( p.charges_of( itype_cash_card ) ) ); + p.moves -= to_moves( 5_seconds ); + return; } } From a2c084df0ea9657e4af5749fa2d0451e8f250c34 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Fri, 13 Nov 2020 17:34:38 -0600 Subject: [PATCH 2/5] [ Magiclysm ] Mutant NPCs (#45102) * Magiclysm Mutant NPCs * lint * Update trait_groups.json * Update trait_groups.json * Update classes.json --- data/mods/Magiclysm/npc/classes.json | 38 ++++++ data/mods/Magiclysm/npc/trait_groups.json | 140 ++++++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 data/mods/Magiclysm/npc/trait_groups.json diff --git a/data/mods/Magiclysm/npc/classes.json b/data/mods/Magiclysm/npc/classes.json index ce3354bb46ba5..a7588ccb955ee 100644 --- a/data/mods/Magiclysm/npc/classes.json +++ b/data/mods/Magiclysm/npc/classes.json @@ -75,5 +75,43 @@ { "skill": "spellcraft", "bonus": { "rng": [ 1, 3 ] } } ], "spells": [ { "id": "light_healing", "level": 3 }, { "id": "bio_bonespear", "level": 6 } ] + }, + { + "type": "npc_class", + "id": "NC_NPC_MUTANT_MANATOUCHED", + "name": "Manatouched Mutant", + "job_description": "I'm becoming something more than mortal. I need to find a way off this plane.", + "skills": [ + { "skill": "spellcraft", "bonus": { "rng": [ 3, 6 ] } }, + { "skill": "chemistry", "bonus": { "rng": [ 3, 6 ] } }, + { "skill": "marksmanship", "bonus": { "rng": [ 2, 4 ] } } + ], + "bonus_int": 4, + "bonus_per": 2, + "traits": [ + { "group": "trait_mutant_npc_common" }, + { "group": "BG_survival_story_UNIVERSAL" }, + { "group": "NPC_starting_traits" }, + { "group": "trait_group_manatouched" }, + { + "distribution": [ { "group": "trait_group_manatouched_nonthres" }, { "group": "trait_group_manatouched_postthres" } ] + } + ] + }, + { + "type": "npc_class", + "id": "NC_NPC_MUTANT_BDRAGON", + "name": "Black Dragon Mutant", + "job_description": "I've got the blood of dragons in my veins. I need more.", + "skills": [ { "skill": "melee", "bonus": { "rng": [ 3, 6 ] } }, { "skill": "unarmed", "bonus": { "rng": [ 3, 6 ] } } ], + "traits": [ + { "group": "trait_mutant_npc_common" }, + { "group": "BG_survival_story_UNIVERSAL" }, + { "group": "NPC_starting_traits" }, + { "group": "trait_group_bdragon" }, + { + "distribution": [ { "group": "trait_group_bdragon_nonthres" }, { "group": "trait_group_bdragon_postthres" } ] + } + ] } ] diff --git a/data/mods/Magiclysm/npc/trait_groups.json b/data/mods/Magiclysm/npc/trait_groups.json new file mode 100644 index 0000000000000..2b2ded40e5f69 --- /dev/null +++ b/data/mods/Magiclysm/npc/trait_groups.json @@ -0,0 +1,140 @@ +[ + { + "type": "trait_group", + "id": "trait_mutant_npc_common", + "subtype": "collection", + "traits": [ + { "distribution": [ { "trait": "FASTLEARNER" }, { "trait": "SLOWLEARNER" } ], "prob": 10 }, + { + "distribution": [ { "trait": "FASTREADER" }, { "trait": "SLOWREADER" }, { "trait": "ILLITERATE", "prob": 5 } ], + "prob": 10 + }, + { "distribution": [ { "trait": "PARKOUR" }, { "trait": "BADKNEES" } ], "prob": 10 }, + { "distribution": [ { "trait": "LIAR" }, { "trait": "TRUTHTELLER" } ], "prob": 10 }, + { + "distribution": [ + { "trait": "MARTIAL_ARTS" }, + { "trait": "MARTIAL_ARTS2" }, + { "trait": "MARTIAL_ARTS3" }, + { "trait": "MARTIAL_ARTS4" }, + { "trait": "MARTIAL_ARTS5" } + ], + "prob": 10 + }, + { "trait": "DEFT", "prob": 10 }, + { "trait": "ADRENALINE", "prob": 10 }, + { "trait": "OUTDOORSMAN", "prob": 10 }, + { "trait": "PAINRESIST", "prob": 10 }, + { "trait": "QUICK", "prob": 10 }, + { "trait": "ROBUST", "prob": 10 }, + { "trait": "SELFAWARE", "prob": 10 }, + { "trait": "SPIRITUAL", "prob": 10 }, + { "trait": "STYLISH", "prob": 10 }, + { "trait": "ALBINO", "prob": 5 }, + { "trait": "ASTHMA", "prob": 5 }, + { "trait": "CHEMIMBALANCE", "prob": 10 }, + { "trait": "HOARDER", "prob": 10 }, + { "trait": "JITTERY", "prob": 10 }, + { "trait": "MOODSWINGS", "prob": 10 }, + { "trait": "SAVANT", "prob": 10 }, + { "trait": "SCHIZOPHRENIC", "prob": 10 }, + { "trait": "SQUEAMISH", "prob": 10 }, + { "group": "Appearance_demographics", "prob": 100 } + ] + }, + { + "type": "trait_group", + "id": "trait_group_manatouched", + "subtype": "collection", + "traits": [ + { "trait": "FEYHEARING", "prob": 50 }, + { "trait": "FASTREADER", "prob": 50 }, + { "trait": "FASTLEARNER", "prob": 50 }, + { "trait": "GOODMEMORY", "prob": 50 }, + { "trait": "SPIRITUAL", "prob": 50 }, + { "trait": "LOVES_BOOKS" }, + { "trait": "BADCARDIO", "prob": 50 }, + { "trait": "SLOWHEALER", "prob": 50 }, + { "trait": "ASTHMA", "prob": 50 } + ] + }, + { + "type": "trait_group", + "id": "trait_group_manatouched_nonthres", + "subtype": "collection", + "traits": [ + { "trait": "MANA_ADD_MANATOUCHED", "prob": 50 }, + { "trait": "MANA_REGEN_MANATOUCHED", "prob": 50 }, + { "trait": "MANA_LUM", "prob": 50 }, + { "trait": "WEAK", "prob": 50 }, + { "trait": "ROT2", "prob": 25 }, + { "trait": "BIOLUM0", "prob": 65 }, + { "distribution": [ { "trait": "MANA_MULT3" }, { "trait": "MANA_MULT_MANATOUCHED" } ] } + ] + }, + { + "type": "trait_group", + "id": "trait_group_manatouched_postthres", + "subtype": "collection", + "traits": [ + { "trait": "THRESH_MANA" }, + { "distribution": [ { "trait": "MANA_SIPHON_1" }, { "trait": "MANA_SIPHON_2" } ] }, + { "trait": "MANA_SEEKER_BOLTS" }, + { "trait": "ALBINO", "prob": 50 }, + { "trait": "MANA_CRYST_MANA", "prob": 50 }, + { "trait": "MANA_SUBTLE_SPELL", "prob": 50 }, + { "trait": "MANA_SILENT_SPELL", "prob": 50 }, + { "trait": "MANA_REGEN_MANATOUCHED", "prob": 50 } + ] + }, + { + "type": "trait_group", + "id": "trait_group_bdragon", + "subtype": "collection", + "traits": [ + { "trait": "GOODHEARING", "prob": 50 }, + { "distribution": [ { "trait": "DRAGON_STR" }, { "trait": "DRAGON_STR2" }, { "trait": "DRAGON_STR3" } ] }, + { "trait": "PAINRESIST", "prob": 50 }, + { "trait": "ANTIJUNK", "prob": 50 }, + { "trait": "NAUSEA", "prob": 50 }, + { "trait": "HUNGER", "prob": 50 }, + { "trait": "ADDICTIVE", "prob": 50 }, + { "trait": "CLUMSY", "prob": 50 }, + { "trait": "HOARDER", "prob": 50 }, + { "trait": "LIZ_EYE", "prob": 50 }, + { "trait": "LARGE_DRAGON", "prob": 20 }, + { "trait": "SCALES", "prob": 30 }, + { "trait": "THIRST2", "prob": 40 }, + { "trait": "CARNIVORE", "prob": 70 }, + { "trait": "DRAGONBLOOD", "prob": 40 }, + { "trait": "HISS", "prob": 60 } + ] + }, + { + "type": "trait_group", + "id": "trait_group_bdragon_nonthres", + "subtype": "collection", + "traits": [ + { "trait": "TERRIFYING", "prob": 50 }, + { "trait": "BADTEMPER", "prob": 50 }, + { "trait": "CHEMIMBALANCE", "prob": 50 }, + { "trait": "POISRESIST", "prob": 50 }, + { "trait": "TOE_CLAWS", "prob": 50 }, + { "trait": "SCALES", "prob": 50 } + ] + }, + { + "type": "trait_group", + "id": "trait_group_bdragon_postthres", + "subtype": "collection", + "traits": [ + { "trait": "THRESH_DRAGON_BLACK" }, + { "trait": "LIZ_IR", "prob": 50 }, + { "trait": "REGEN_LIZ", "prob": 50 }, + { "trait": "DRAGON_SCALES_BLACK", "prob": 50 }, + { "trait": "DRAGON_FEET", "prob": 50 }, + { "trait": "LARGE_OK_DRAGON", "prob": 50 }, + { "trait": "DRAGON_BREATH_BLACK", "prob": 50 } + ] + } +] From 03098167f563c5e208dd8ab8d469df75318afeaa Mon Sep 17 00:00:00 2001 From: dissociativity <40927483+dissociativity@users.noreply.github.com> Date: Sat, 14 Nov 2020 12:48:41 +1100 Subject: [PATCH 3/5] reduce the kiltpocaplyse (#45380) * reduce the kiltpocaplyse * still too many kilts! they're like a plague I say! * less kilts n scabbards * waders, chaps, football armour, more scarves and hats --- .../itemgroups/Clothing_Gear/clothing.json | 14 +++---- .../Clothing_Gear/gear_civilian.json | 2 +- .../Locations_MapExtras/mansion.json | 4 +- data/json/itemgroups/SUS/domestic.json | 40 +++++++++++-------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/data/json/itemgroups/Clothing_Gear/clothing.json b/data/json/itemgroups/Clothing_Gear/clothing.json index ebeac8fc2f632..59abf98e0cb49 100644 --- a/data/json/itemgroups/Clothing_Gear/clothing.json +++ b/data/json/itemgroups/Clothing_Gear/clothing.json @@ -1076,7 +1076,7 @@ { "item": "hot_pants_fur", "prob": 5 }, { "item": "hot_pants_leather", "prob": 25 }, { "item": "breeches", "prob": 25 }, - { "item": "kilt", "prob": 5 } + { "item": "kilt", "prob": 2 } ] }, { @@ -1194,7 +1194,7 @@ [ "b_shorts", 15 ], [ "halter_top", 30 ], [ "linuxtshirt", 10 ], - [ "kilt", 5 ], + [ "kilt", 2 ], [ "nanoskirt", 10 ], [ "sleeveless_tunic", 5 ], [ "fedora", 10 ], @@ -1269,7 +1269,7 @@ [ "dress_wedding", 1 ], [ "postman_shorts", 5 ], [ "b_shorts", 15 ], - [ "kilt", 5 ], + [ "kilt", 2 ], [ "nanoskirt", 10 ] ] }, @@ -1741,7 +1741,7 @@ { "item": "maid_hat", "prob": 3 }, { "item": "halter_top", "prob": 50 }, { "item": "linuxtshirt", "prob": 20 }, - { "item": "kilt", "prob": 5 }, + { "item": "kilt", "prob": 2 }, { "item": "nanoskirt", "prob": 10 }, { "item": "sleeveless_tunic", "prob": 5 }, { "item": "ear_spool", "prob": 30 }, @@ -2602,7 +2602,7 @@ [ "maid_dress", 3 ], [ "halter_top", 50 ], [ "linuxtshirt", 20 ], - [ "kilt", 5 ], + [ "kilt", 2 ], [ "nanoskirt", 10 ], [ "robe", 50 ] ] @@ -2648,7 +2648,7 @@ "//": "clothing found on a coat rack", "subtype": "collection", "items": [ - { "group": "scarfs_unisex", "prob": 30 }, + { "group": "scarfs_unisex", "prob": 40 }, { "group": "bags_unisex", "prob": 20 }, { "group": "coats_unisex", "prob": 70 }, { "group": "hats_unisex", "prob": 70 } @@ -2894,7 +2894,7 @@ "type": "item_group", "//": "mens pants and leg coverings for domestic locations.", "subtype": "distribution", - "items": [ { "item": "kilt", "prob": 10 }, { "item": "kilt_leather", "prob": 5 } ] + "items": [ { "item": "kilt", "prob": 2 }, { "item": "kilt_leather", "prob": 1 } ] }, { "id": "gloves_unisex", diff --git a/data/json/itemgroups/Clothing_Gear/gear_civilian.json b/data/json/itemgroups/Clothing_Gear/gear_civilian.json index 9141ec7aa2e2e..612b78b90289e 100644 --- a/data/json/itemgroups/Clothing_Gear/gear_civilian.json +++ b/data/json/itemgroups/Clothing_Gear/gear_civilian.json @@ -223,7 +223,7 @@ [ "razor_shaving", 5 ], [ "toothbrush_plain", 10 ], [ "string_floss", 10 ], - [ "kilt", 5 ], + [ "kilt", 4 ], [ "hobo_stove", 1 ], [ "tinder", 1 ], [ "tinderbox", 1 ], diff --git a/data/json/itemgroups/Locations_MapExtras/mansion.json b/data/json/itemgroups/Locations_MapExtras/mansion.json index 1c95775dd850a..160580d8f728b 100644 --- a/data/json/itemgroups/Locations_MapExtras/mansion.json +++ b/data/json/itemgroups/Locations_MapExtras/mansion.json @@ -1352,7 +1352,7 @@ [ "pants_army", 10 ], [ "jersey", 40 ], [ "linuxtshirt", 20 ], - [ "kilt", 5 ] + [ "kilt", 3 ] ] }, { @@ -1472,7 +1472,7 @@ { "group": "neckties", "prob": 5 }, [ "tieclip", 2 ], [ "collarpin", 2 ], - [ "kilt", 5 ], + [ "kilt", 3 ], [ "fedora", 5 ], [ "kufi", 2 ], [ "kippah", 2 ], diff --git a/data/json/itemgroups/SUS/domestic.json b/data/json/itemgroups/SUS/domestic.json index fa7540f2d4e70..e4f62e78ae545 100644 --- a/data/json/itemgroups/SUS/domestic.json +++ b/data/json/itemgroups/SUS/domestic.json @@ -778,18 +778,20 @@ "subtype": "collection", "entries": [ { "group": "shoes_unisex", "prob": 50 }, - { "item": "fishing_waders", "prob": 3 }, - { "item": "kilt", "prob": 10 }, - { "item": "football_armor", "prob": 10 }, + { "item": "fishing_waders", "prob": 2 }, + { "item": "kilt", "prob": 3 }, + { "item": "football_armor", "prob": 3 }, { "item": "sleeping_bag", "prob": 10 }, { "item": "sleeping_bag_roll", "prob": 10 }, - { "item": "bscabbard", "prob": 5 }, - { "item": "kilt_leather", "prob": 5 }, - { "item": "chaps_leather", "prob": 5 }, + { "item": "bscabbard", "prob": 1 }, + { "item": "kilt_leather", "prob": 2 }, + { "item": "chaps_leather", "prob": 3 }, { "group": "coats_unisex", "prob": 50 }, { "group": "suits_unisex", "prob": 30 }, { "group": "suits_mens", "prob": 30 }, - { "group": "bags_unisex", "prob": 20 } + { "group": "bags_unisex", "prob": 20 }, + { "group": "hats_unisex", "prob": 20 }, + { "group": "scarfs_unisex", "prob": 30 } ] }, { @@ -800,18 +802,20 @@ "entries": [ { "group": "shoes_unisex", "prob": 50 }, { "group": "shoes_womens", "prob": 60 }, - { "item": "fishing_waders", "prob": 2 }, - { "item": "football_armor", "prob": 5 }, + { "item": "fishing_waders", "prob": 1 }, + { "item": "football_armor", "prob": 2 }, { "item": "skirt", "prob": 20 }, { "item": "skirt_leather", "prob": 10 }, { "item": "bscabbard", "prob": 3 }, { "item": "sleeping_bag", "prob": 10 }, { "item": "sleeping_bag_roll", "prob": 10 }, - { "item": "chaps_leather", "prob": 5 }, + { "item": "chaps_leather", "prob": 3 }, { "group": "coats_unisex", "prob": 50 }, { "group": "suits_unisex", "prob": 30 }, { "group": "suits_womens", "prob": 40 }, - { "group": "bags_unisex", "prob": 20 } + { "group": "bags_unisex", "prob": 20 }, + { "group": "hats_unisex", "prob": 20 }, + { "group": "scarfs_unisex", "prob": 20 } ] }, { @@ -822,15 +826,16 @@ "entries": [ { "group": "accesories_personal_unisex", "prob": 10 }, { "group": "accesories_personal_mens", "prob": 10 }, - { "group": "masks_unisex", "prob": 5 }, + { "group": "masks_unisex", "prob": 3 }, { "group": "socks_unisex", "prob": 70 }, - { "group": "scarfs_unisex", "prob": 20 }, + { "group": "scarfs_unisex", "prob": 30 }, { "group": "shirts_unisex", "prob": 50 }, { "group": "underwear_mens", "prob": 80 }, { "group": "underwear_unisex", "prob": 80 }, { "group": "pants_unisex", "prob": 50 }, { "group": "pants_mens", "prob": 60 }, - { "group": "gloves_unisex", "prob": 20 } + { "group": "gloves_unisex", "prob": 30 }, + { "group": "hats_unisex", "prob": 10 } ] }, { @@ -841,9 +846,9 @@ "entries": [ { "group": "accesories_personal_unisex", "prob": 30 }, { "group": "accesories_personal_womens", "prob": 5 }, - { "group": "masks_unisex", "prob": 5 }, + { "group": "masks_unisex", "prob": 3 }, { "group": "socks_unisex", "prob": 70 }, - { "group": "scarfs_unisex", "prob": 10 }, + { "group": "scarfs_unisex", "prob": 30 }, { "group": "shirts_womens", "prob": 60 }, { "group": "shirts_unisex", "prob": 50 }, { "group": "underwear_womens", "prob": 80 }, @@ -851,7 +856,8 @@ { "group": "pants_unisex", "prob": 50 }, { "group": "pants_womens", "prob": 60 }, { "group": "gloves_womens", "prob": 5 }, - { "group": "gloves_unisex", "prob": 30 } + { "group": "gloves_unisex", "prob": 30 }, + { "group": "hats_unisex", "prob": 10 } ] } ] From 70f9f6c4be80fc2fb1f98e6e9913556419c3a586 Mon Sep 17 00:00:00 2001 From: akirashirosawa <38557723+akirashirosawa@users.noreply.github.com> Date: Sat, 14 Nov 2020 13:04:01 +0300 Subject: [PATCH 4/5] apply suggestions --- src/iexamine.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/iexamine.cpp b/src/iexamine.cpp index a7bcae8acbd37..df034ddf11934 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -693,7 +693,7 @@ class atm_menu } if( remaining ) { - add_msg( m_info, _( "All cash cards at maximum capacity" ) ); + add_msg( m_info, _( "All cash cards at maximum capacity." ) ); } //dst->charges += amount; @@ -4245,10 +4245,7 @@ static int findBestGasDiscount( player &p ) int discount = 0; for( const item *it : p.all_items_with_flag( flag_GAS_DISCOUNT ) ) { - int q = getGasDiscountCardQuality( *it ); - if( q > discount ) { - discount = q; - } + discount = std::max( discount, getGasDiscountCardQuality( *it ) ); } return discount; @@ -4345,7 +4342,7 @@ static int fromPumpFuel( const tripoint &dst, const tripoint &src ) for( auto item_it = items.begin(); item_it != items.end(); ++item_it ) { if( item_it->made_of( phase_id::LIQUID ) ) { // how much do we have in the pump? - int amount = item_it->charges; + const int amount = item_it->charges; item liq_d( item_it->type, calendar::turn, amount ); // add the charges to the destination @@ -4551,30 +4548,30 @@ void iexamine::pay_gas( player &p, const tripoint &examp ) const cata::optional pGasPump = getGasPumpByNumber( examp, uistate.ags_pay_gas_selected_pump ); - int amountFuel = pGasPump ? fromPumpFuel( pTank, *pGasPump ) : -1; - if( amountFuel < 0 ) { + int amount_fuel = pGasPump ? fromPumpFuel( pTank, *pGasPump ) : -1; + if( amount_fuel < 0 ) { popup( _( "Unable to refund, no fuel in pump." ) ); return; } sounds::sound( p.pos(), 6, sounds::sound_t::activity, _( "Glug Glug Glug" ), true, "tool", "gaspump" ); - int refundPricePerUnit = getGasPricePerLiter( 3 ); // min price to avoid exploit - int amountMoney = amountFuel * refundPricePerUnit / 1000.0f; + // getGasPricePerLiter( platinum_discount) min price to avoid exploit + int amount_money = amount_fuel * getGasPricePerLiter( 3 ) / 1000.0f; std::sort( cash_cards.begin(), cash_cards.end(), []( item * l, const item * r ) { return l->ammo_remaining() > r->ammo_remaining(); } ); for( item * const &cc : cash_cards ) { - if( amountMoney == 0 ) { + if( amount_money == 0 ) { break; } - int transfer = std::min( amountMoney, cc->remaining_ammo_capacity() ); + const int transfer = std::min( amount_money, cc->remaining_ammo_capacity() ); cc->ammo_set( cc->ammo_default(), transfer + cc->ammo_remaining() ); - amountMoney -= transfer; + amount_money -= transfer; } - if( amountMoney ) { - add_msg( m_info, _( "All cash cards at maximum capacity" ) ); - // all fuel already removed from pump, so remaning amountMoney simply ignored + if( amount_money ) { + add_msg( m_info, _( "All cash cards at maximum capacity." ) ); + // all fuel already removed from pump, so remaning amount_money simply ignored } add_msg( m_info, _( "Your cash cards now hold %s." ), format_money( p.charges_of( itype_cash_card ) ) ); From a1622e922b13cf0f365ba0ccadccaa05befcc6cd Mon Sep 17 00:00:00 2001 From: Theawesomeboophis <71793015+Theawesomeboophis@users.noreply.github.com> Date: Sat, 14 Nov 2020 13:22:30 -0500 Subject: [PATCH 5/5] Fix Skill ID --- data/mods/Magiclysm/npc/classes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/npc/classes.json b/data/mods/Magiclysm/npc/classes.json index a7588ccb955ee..6d8b5b5b632ca 100644 --- a/data/mods/Magiclysm/npc/classes.json +++ b/data/mods/Magiclysm/npc/classes.json @@ -84,7 +84,7 @@ "skills": [ { "skill": "spellcraft", "bonus": { "rng": [ 3, 6 ] } }, { "skill": "chemistry", "bonus": { "rng": [ 3, 6 ] } }, - { "skill": "marksmanship", "bonus": { "rng": [ 2, 4 ] } } + { "skill": "gun", "bonus": { "rng": [ 2, 4 ] } } ], "bonus_int": 4, "bonus_per": 2,