Skip to content

Commit

Permalink
Fixes 100% chances to trigger teleglow effects (#39895)
Browse files Browse the repository at this point in the history
* Update teleglow effect

Adjust chances to be consistent with those in old versions.

* Update rng.cpp

Add "one_in chance>0" assertion.

* Update rng.cpp

Delete "="

* Update player_hardcoded_effects.cpp

Replaced 6_turns with 6_seconds

* Delete debugmsg

* Adjust chance calculations
  • Loading branch information
RedShakespeare authored Apr 25, 2020
1 parent 889f657 commit 4e59722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/player_hardcoded_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,10 @@ void player::hardcoded_effects( effect &it )
}
if( dur > 4_hours ) {
// 8 teleports
if( one_in( 10000 - to_turns<int>( dur ) ) && !has_effect( effect_valium ) ) {
if( one_turn_in( 1000_minutes - dur ) ) && !has_effect( effect_valium ) ) {
add_effect( effect_shakes, rng( 4_minutes, 8_minutes ) );
}
if( one_in( 12000 - to_turns<int>( dur ) ) ) {
if( one_turn_in( 1200_minutes - dur ) ) {
add_msg_if_player( m_bad, _( "Your vision is filled with bright lights…" ) );
add_effect( effect_blind, rng( 1_minutes, 2_minutes ) );
if( one_in( 8 ) ) {
Expand Down

0 comments on commit 4e59722

Please sign in to comment.