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

0.e merge #39398

Merged
merged 10 commits into from
Apr 12, 2020
2 changes: 1 addition & 1 deletion build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ then
cd android
# Specify dumb terminal to suppress gradle's constatnt output of time spent building, which
# fills the log with nonsense.
TERM=dumb ./gradlew assembleRelease -Pj=$num_jobs -Plocalize=false -Pabi_arm_32=false -Pabi_arm_64=true -Pdeps=/home/travis/build/CleverRaven/Cataclysm-DDA/android/app/deps.zip
TERM=dumb ./gradlew assembleExperimentalRelease -Pj=$num_jobs -Plocalize=false -Pabi_arm_32=false -Pabi_arm_64=true -Pdeps=/home/travis/build/CleverRaven/Cataclysm-DDA/android/app/deps.zip
else
make -j "$num_jobs" RELEASE=1 CCACHE=1 BACKTRACE=1 CROSS="$CROSS_COMPILATION" LINTJSON=0

Expand Down
2 changes: 1 addition & 1 deletion data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@
"name": { "str": "television" },
"description": "A large LCD television, full of delicious electronics.",
"price": 0,
"material": "plastic",
"material": [ "aluminum", "plastic" ],
"weight": "15000 g",
"volume": "20 L",
"bashing": 5,
Expand Down
7 changes: 6 additions & 1 deletion data/json/obsolete_terrains.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@
"house_north",
"house_south",
"house_east",
"house_west"
"house_west",
"rural_house",
"rural_house_north",
"rural_house_south",
"rural_house_east",
"rural_house_west"
]
}
]
9 changes: 7 additions & 2 deletions data/mods/Generic_Guns/ammo/gg_ammo_migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,14 @@
"replace": "reloaded_rifle_huge_AP"
},
{
"id": [ "36navy", "44army" ],
"id": [ "36navy", "44army", "flintlock_ammo" ],
"type": "MIGRATION",
"replace": "flintlock_ammo"
"replace": "black_powder_ball"
},
{
"id": [ "flintlock_shot" ],
"type": "MIGRATION",
"replace": "black_powder_shot"
},
{
"id": [ "40x46mm_m1006" ],
Expand Down
20 changes: 20 additions & 0 deletions data/mods/Generic_Guns/recipes/recipe_obsolete.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,26 @@
"result": "reloaded_762_m87",
"obsolete": true
},
{
"type": "recipe",
"result": "36navy",
"obsolete": true
},
{
"type": "recipe",
"result": "44army",
"obsolete": true
},
{
"type": "recipe",
"result": "flintlock_ammo",
"obsolete": true
},
{
"type": "recipe",
"result": "flintlock_shot",
"obsolete": true
},
{
"type": "recipe",
"result": "bot_crows_m240",
Expand Down
34 changes: 34 additions & 0 deletions data/mods/Generic_Guns/recipes/recipes_rifle.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
[
{
"result": "black_powder_ball",
"type": "recipe",
"category": "CC_AMMO",
"subcategory": "CSC_AMMO_RIFLE",
"skill_used": "fabrication",
"difficulty": 3,
"skills_required": [ "gun", 1 ],
"time": "1 m",
"batch_time_factors": [ 60, 5 ],
"autolearn": true,
"charges": 1,
"reversible": true,
"using": [ [ "ammo_bullet", 10 ] ],
"qualities": [ { "id": "CUT", "level": 1 } ],
"components": [ [ [ "chem_black_powder", 5 ] ], [ [ "paper", 1 ] ] ]
},
{
"result": "black_powder_shot",
"type": "recipe",
"category": "CC_AMMO",
"subcategory": "CSC_AMMO_RIFLE",
"skill_used": "fabrication",
"difficulty": 3,
"skills_required": [ "gun", 1 ],
"time": "1 m",
"batch_time_factors": [ 60, 5 ],
"autolearn": true,
"charges": 1,
"reversible": true,
"using": [ [ "ammo_bullet", 10 ] ],
"qualities": [ { "id": "CUT", "level": 1 } ],
"components": [ [ [ "chem_black_powder", 5 ] ], [ [ "paper", 1 ] ] ]
},
{
"result": "reloaded_rifle_ball",
"type": "recipe",
Expand Down
2 changes: 1 addition & 1 deletion src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ bool Creature::sees( const tripoint &t, bool is_avatar, int range_mod ) const
g->m.ambient_light_at( t ) > g->natural_light_level( t.z ) ) ) {
int range = 0;
if( g->m.ambient_light_at( t ) > g->natural_light_level( t.z ) ) {
range = wanted_range;
range = MAX_VIEW_DISTANCE;
} else {
range = range_min;
}
Expand Down
2 changes: 1 addition & 1 deletion src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ std::string game_info::operating_system()
#endif
}

#if !defined(__CYGWIN__) && ( defined (__linux__) || defined(unix) || defined(__unix__) || defined(__unix) || ( defined(__APPLE__) && defined(__MACH__) ) || defined(BSD) ) // linux; unix; MacOs; BSD
#if !defined(__CYGWIN__) && !defined (__ANDROID__) && ( defined (__linux__) || defined(unix) || defined(__unix__) || defined(__unix) || ( defined(__APPLE__) && defined(__MACH__) ) || defined(BSD) ) // linux; unix; MacOs; BSD
/** Execute a command with the shell by using `popen()`.
* @param command The full command to execute.
* @note The output buffer is limited to 512 characters.
Expand Down
2 changes: 1 addition & 1 deletion src/explosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void do_blast( const tripoint &p, const float power,
player *pl = dynamic_cast<player *>( critter );
if( pl == nullptr ) {
// TODO: player's fault?
const double dmg = force - critter->get_armor_bash( bp_torso ) / 2.0;
const double dmg = std::max( force - critter->get_armor_bash( bp_torso ) / 2.0, 0.0 );
const int actual_dmg = rng_float( dmg * 2, dmg * 3 );
critter->apply_damage( nullptr, bp_torso, actual_dmg );
critter->check_dead_state();
Expand Down
3 changes: 0 additions & 3 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8482,7 +8482,6 @@ void game::wield( item_location &loc )
worn_index = Character::worn_position_to_index( item_pos );
}
}
int move_cost = loc.obtain_cost( u );
loc.remove_item();
if( !u.wield( to_wield ) ) {
switch( location_type ) {
Expand Down Expand Up @@ -8512,8 +8511,6 @@ void game::wield( item_location &loc )
}
return;
}

u.mod_moves( -move_cost );
}

void game::wield()
Expand Down
1 change: 1 addition & 0 deletions src/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ float fastexp( float x )
int i;
} u, v;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
u.i = static_cast<long long>( 6051102 * x + 1056478197 );
Expand Down
8 changes: 5 additions & 3 deletions src/npctalk_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,18 +525,20 @@ void talk_function::give_equipment( npc &p )
{
std::vector<item_pricing> giving = npc_trading::init_selling( p );
int chosen = -1;
while( chosen == -1 && giving.size() > 1 ) {
while( chosen == -1 && !giving.empty() ) {
int index = rng( 0, giving.size() - 1 );
if( giving[index].price < p.op_of_u.owed ) {
chosen = index;
} else {
giving.erase( giving.begin() + index );
}
giving.erase( giving.begin() + index );
}
if( giving.empty() ) {
popup( _( "%s has nothing to give!" ), p.name );
return;
}
if( chosen == -1 ) {
if( chosen < 0 || static_cast<size_t>( chosen ) >= giving.size() ) {
debugmsg( "Chosen index is outside of available item range!" );
chosen = 0;
}
item it = *giving[chosen].loc.get_item();
Expand Down
9 changes: 7 additions & 2 deletions src/npctrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,14 @@ std::vector<item_pricing> npc_trading::init_buying( player &buyer, player &selle
check_item( item_location( seller, &seller.weapon ), 1 );
}

for( map_cursor &cursor : map_selector( seller.pos(), PICKUP_RANGE ) ) {
buy_helper( cursor, check_item );
//nearby items owned by the NPC will only show up in
//the trade window if the NPC is also a shopkeeper
if( np.mission == NPC_MISSION_SHOPKEEP ) {
for( map_cursor &cursor : map_selector( seller.pos(), PICKUP_RANGE ) ) {
buy_helper( cursor, check_item );
}
}

for( vehicle_cursor &cursor : vehicle_selector( seller.pos(), 1 ) ) {
buy_helper( cursor, check_item );
}
Expand Down
3 changes: 2 additions & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,8 @@ void player::on_hit( Creature *source, body_part bp_hit,
} else {
add_msg( m_bad, _( "You lose your balance while being hit!" ) );
}
add_effect( effect_downed, 2_turns );
// This kind of downing is not subject to immunity.
add_effect( effect_downed, 2_turns, num_bp, false, 0, true );
}
}
Character::on_hit( source, bp_hit, 0.0f, proj );
Expand Down
10 changes: 10 additions & 0 deletions src/savegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,16 @@ void overmap::convert_terrain( const std::unordered_map<tripoint, std::string> &
ter_set( pos, oter_id( "house_w_1_east" ) );
} else if( old == "house_base_west" || old == "house_west" ) {
ter_set( pos, oter_id( "house_w_1_west" ) );
} else if( old == "rural_house" || old == "rural_house_north" ) {
ter_set( pos, oter_id( "rural_house1_north" ) );
} else if( old == "rural_house_south" ) {
ter_set( pos, oter_id( "rural_house1_south" ) );
} else if( old == "rural_house_east" ) {
ter_set( pos, oter_id( "rural_house1_east" ) );
} else if( old == "rural_house_west" ) {
ter_set( pos, oter_id( "rural_house1_west" ) );
} else if( old.compare( 0, 10, "mass_grave" ) == 0 ) {
ter_set( pos, oter_id( "field" ) );
}

for( const auto &conv : nearby ) {
Expand Down