Skip to content

Commit

Permalink
Merge pull request #29524 from ifreund/shrooms
Browse files Browse the repository at this point in the history
Fix poisonous/psychoactive shroom spawn
  • Loading branch information
ZhilkinSerg authored Apr 13, 2019
2 parents 2713c05 + b0da085 commit 38a2ebc
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1483,29 +1483,27 @@ void activity_handlers::forage_finish( player_activity *act, player *p )
///\EFFECT_PER slightly increases forage success chance
if( veggy_chance < p->get_skill_level( skill_survival ) * 3 + p->per_cur - 2 ) {
const auto dropped = g->m.put_items_from_loc( loc, p->pos(), calendar::turn );
for( const auto &it : dropped ) {
add_msg( m_good, _( "You found: %s!" ), it->tname().c_str() );
found_something = true;
}
}
// 10% to drop a item/items from this group.
if( one_in( 10 ) ) {
const auto dropped = g->m.put_items_from_loc( "trash_forest", p->pos(), calendar::turn );
for( const auto &it : dropped ) {
add_msg( m_good, _( "You found: %s!" ), it->tname().c_str() );
found_something = true;
if( it->typeId() == "mushroom" ) {
if( one_in( 10 ) ) {
it->item_tags.insert( "HIDDEN_POISON" );
it->poison = rng( 2, 7 );
break;
} else if( one_in( 10 ) ) {
it->item_tags.insert( "HIDDEN_HALLU" );
break;
}
}
}
}
// 10% to drop a item/items from this group.
if( one_in( 10 ) ) {
const auto dropped = g->m.put_items_from_loc( "trash_forest", p->pos(), calendar::turn );
for( const auto &it : dropped ) {
add_msg( m_good, _( "You found: %s!" ), it->tname().c_str() );
found_something = true;
}
}

if( !found_something ) {
add_msg( _( "You didn't find anything." ) );
Expand Down

0 comments on commit 38a2ebc

Please sign in to comment.