Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SuddenEyePuncture committed Jun 10, 2021
2 parents 58cd96e + 25abf78 commit 10e8689
Show file tree
Hide file tree
Showing 18 changed files with 15,731 additions and 15,370 deletions.
3 changes: 2 additions & 1 deletion data/json/items/gun/9mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@
[ "muzzle", 1 ],
[ "rail", 1 ],
[ "sights", 1 ],
[ "sling", 1 ]
[ "sling", 1 ],
[ "stock", 1 ]
],
"faults": [ "fault_gun_blackpowder", "fault_gun_dirt", "fault_gun_chamber_spent" ],
"pocket_data": [
Expand Down
4 changes: 2 additions & 2 deletions data/json/overmap/overmap_special/specials.json
Original file line number Diff line number Diff line change
Expand Up @@ -6656,8 +6656,8 @@
{ "point": [ 29, 29, 0 ], "overmap": "special_forest_thick" }
],
"locations": [ "land", "lake_shore", "lake_surface", "road" ],
"occurrences": [ 65, 100 ],
"//": "Inflated chance, effective rate ~ 30%",
"occurrences": [ 35, 100 ],
"//": "Inflated chance, effective rate ~19% (n=726)",
"connections": [ { "point": [ -1, 15, 0 ], "terrain": "road" } ],
"flags": [ "CLASSIC", "FARM", "UNIQUE" ]
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"name": "Large Building",
"points": -2,
"description": "Whether due to stubbornness, ignorance, or just plain bad luck, you missed the evacuation, and are stuck in a large building full of the risen dead.",
"allowed_locs": [ "sloc_mall_loading_area", "sloc_mall_food_court", "sloc_apartments_rooftop", "sloc_hospital" ],
"allowed_locs": [ "sloc_mall_loading_area", "sloc_mall_food_court", "sloc_apartments_rooftop", "sloc_hospital", "sloc_school" ],
"start_name": "In Large Building",
"flags": [ "SUR_START", "CITY_START", "LONE_START" ]
},
Expand Down
Binary file modified gfx/ChibiUltica/ChibiLargeMonster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gfx/ChibiUltica/ChibiNormalCharacter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gfx/ChibiUltica/ChibiNormalCharacterMagiclysm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gfx/ChibiUltica/incomplete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11,797 changes: 5,961 additions & 5,836 deletions gfx/ChibiUltica/tile_config.json

Large diffs are not rendered by default.

Binary file modified gfx/MshockXotto+/tall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9,084 changes: 4,589 additions & 4,495 deletions gfx/MshockXotto+/tile_config.json

Large diffs are not rendered by default.

Binary file modified gfx/MshockXotto+/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gfx/UltimateCataclysm/incomplete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gfx/UltimateCataclysm/small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gfx/UltimateCataclysm/tall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10,152 changes: 5,128 additions & 5,024 deletions gfx/UltimateCataclysm/tile_config.json

Large diffs are not rendered by default.

43 changes: 37 additions & 6 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1759,19 +1759,50 @@ std::string avatar::total_daily_calories_string() const
const std::string format_string =
" %4d %4d %4d %4d %4d %4d %4d %6d %6d";

const float light_ex_thresh = ( NO_EXERCISE + LIGHT_EXERCISE ) / 2.0f;
const float mod_ex_thresh = ( LIGHT_EXERCISE + MODERATE_EXERCISE ) / 2.0f;
const float brisk_ex_thresh = ( MODERATE_EXERCISE + BRISK_EXERCISE ) / 2.0f;
const float active_ex_thresh = ( BRISK_EXERCISE + ACTIVE_EXERCISE ) / 2.0f;
const float extra_ex_thresh = ( ACTIVE_EXERCISE + EXTRA_EXERCISE ) / 2.0f;

std::string ret = header_string;

// Start with today in the first row, day number from start of cataclysm
int today = day_of_season<int>( calendar::turn ) + 1;
int day_offset = 0;
for( const daily_calories &day : calorie_diary ) {
// Yes, this is clunky.
// Perhaps it should be done in log_activity_level? But that's called a lot more often.
int no_exercise = 0;
int light_exercise = 0;
int moderate_exercise = 0;
int brisk_exercise = 0;
int active_exercise = 0;
int extra_exercise = 0;
for( const std::pair<const float, int> &level : day.activity_levels ) {
if( level.second > 0 ) {
if( level.first < light_ex_thresh ) {
no_exercise += level.second;
} else if( level.first < mod_ex_thresh ) {
light_exercise += level.second;
} else if( level.first < brisk_ex_thresh ) {
moderate_exercise += level.second;
} else if( level.first < active_ex_thresh ) {
brisk_exercise += level.second;
} else if( level.first < extra_ex_thresh ) {
active_exercise += level.second;
} else {
extra_exercise += level.second;
}
}
}
std::string row_data = string_format( format_string, today + day_offset--,
5 * day.activity_levels.at( NO_EXERCISE ),
5 * day.activity_levels.at( LIGHT_EXERCISE ),
5 * day.activity_levels.at( MODERATE_EXERCISE ),
5 * day.activity_levels.at( BRISK_EXERCISE ),
5 * day.activity_levels.at( ACTIVE_EXERCISE ),
5 * day.activity_levels.at( EXTRA_EXERCISE ),
5 * no_exercise,
5 * light_exercise,
5 * moderate_exercise,
5 * brisk_exercise,
5 * active_exercise,
5 * extra_exercise,
day.gained, day.spent );
// Alternate gray and white text for row data
if( day_offset % 2 == 0 ) {
Expand Down
5 changes: 5 additions & 0 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4733,12 +4733,14 @@ cata::optional<int> iuse::blood_draw( player *p, item *it, bool, const tripoint
item blood( "blood", calendar::turn );
bool drew_blood = false;
bool acid_blood = false;
float blood_temp = -1.0f; //kelvins
for( item &map_it : get_map().i_at( point( p->posx(), p->posy() ) ) ) {
if( map_it.is_corpse() &&
query_yn( _( "Draw blood from %s?" ),
colorize( map_it.tname(), map_it.color_in_inventory() ) ) ) {
p->add_msg_if_player( m_info, _( "You drew blood from the %s…" ), map_it.tname() );
drew_blood = true;
blood_temp = map_it.temperature * 0.00001;
auto bloodtype( map_it.get_mtype()->bloodType() );
if( bloodtype.obj().has_acid ) {
acid_blood = true;
Expand All @@ -4751,6 +4753,7 @@ cata::optional<int> iuse::blood_draw( player *p, item *it, bool, const tripoint
if( !drew_blood && query_yn( _( "Draw your own blood?" ) ) ) {
p->add_msg_if_player( m_info, _( "You drew your own blood…" ) );
drew_blood = true;
blood_temp = 310.15f;
if( p->has_trait( trait_ACIDBLOOD ) ) {
acid_blood = true;
}
Expand All @@ -4765,6 +4768,7 @@ cata::optional<int> iuse::blood_draw( player *p, item *it, bool, const tripoint

if( acid_blood ) {
item acid( "chem_sulphuric_acid", calendar::turn );
acid.set_item_temperature( blood_temp );
it->put_in( acid, item_pocket::pocket_type::CONTAINER );
if( one_in( 3 ) ) {
if( it->inc_damage( damage_type::ACID ) ) {
Expand All @@ -4782,6 +4786,7 @@ cata::optional<int> iuse::blood_draw( player *p, item *it, bool, const tripoint
return it->type->charges_to_use();
}

blood.set_item_temperature( blood_temp );
it->put_in( blood, item_pocket::pocket_type::CONTAINER );
return it->type->charges_to_use();
}
Expand Down
11 changes: 6 additions & 5 deletions tests/char_biometrics_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,21 +453,22 @@ TEST_CASE( "activity levels and calories in daily diary", "[avatar][biometrics][

SECTION( "shows time at each activity level for the current day" ) {
dummy.reset_activity_level();
test_activity_duration( dummy, NO_EXERCISE, 1_hours );
test_activity_duration( dummy, NO_EXERCISE, 59_minutes );
test_activity_duration( dummy, LIGHT_EXERCISE, 45_minutes );
test_activity_duration( dummy, MODERATE_EXERCISE, 30_minutes );
test_activity_duration( dummy, BRISK_EXERCISE, 20_minutes );
test_activity_duration( dummy, ACTIVE_EXERCISE, 15_minutes );
test_activity_duration( dummy, EXTRA_EXERCISE, 10_minutes );
test_activity_duration( dummy, NO_EXERCISE, 1_minutes );

int expect_gained_kcal = 1283;
int expect_net_kcal = 551;
int expect_spent_kcal = 732;
int expect_gained_kcal = 1282;
int expect_net_kcal = 552;
int expect_spent_kcal = 730;

CHECK( condensed_spaces( dummy.total_daily_calories_string() ) == string_format(
"<color_c_white> Minutes at each exercise level Calories per day</color>\n"
"<color_c_yellow> Day None Light Moderate Brisk Active Extra Gained Spent Total</color>\n"
"<color_c_light_gray> 61 60 45 30 20 15 10 %d %d</color><color_c_light_blue> %d</color>\n",
"<color_c_light_gray> 61 60 45 30 20 20 5 %d %d</color><color_c_light_blue> %d</color>\n",
expect_gained_kcal, expect_spent_kcal, expect_net_kcal ) );
}
}
Expand Down

0 comments on commit 10e8689

Please sign in to comment.