Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename Base>
- void actions::rogue_action_t<Base>::trigger_hand_of_fate( const action_state_t* state, bool biased, bool trigger_inevitable )
- {
- if ( !p()->talent.fatebound.hand_of_fate->ok() )
- return;
- if ( cast_state( state )->get_combo_points() < p()->talent.fatebound.hand_of_fate->effectN( 1 ).base_value() )
- return;
- const bool double_jeopardy = p()->buffs.double_jeopardy->check();
- bool trigger_heads = false;
- bool trigger_tails = false;
- if ( p()->buffs.edge_case->check() )
- {
- p()->buffs.edge_case->expire();
- trigger_heads = trigger_tails = true;
- }
- else if ( p()->buffs.fatebound_coin_tails->check() == p()->buffs.fatebound_coin_heads->check() )
- {
- trigger_heads = !(trigger_tails = p()->rng().roll( 0.5 ));
- }
- else
- {
- double matching_odds = 0.5;
- if ( biased )
- {
- // TODO: Validate how these stack with the presumed base 50/50 chance and one another
- if ( p()->talent.fatebound.mean_streak->ok() )
- {
- matching_odds += matching_odds * p()->talent.fatebound.mean_streak->effectN( 1 ).percent();
- }
- if ( p()->talent.fatebound.destiny_defined->ok() )
- {
- matching_odds += p()->talent.fatebound.destiny_defined->effectN( 3 ).percent();
- }
- }
- if ( p()->talent.fatebound.inevitability->ok() && trigger_inevitable )
- {
- // TODO: Inevitable flips when you have both coins don't always produce a flip
- // for the coin with the higher coin count. There may be an underlying "order" to an
- // edge result that is respected; but it's probably just a bug because it makes no sense.
- matching_odds = 1.0;
- }
- const bool is_match = p()->rng().roll( matching_odds );
- const bool current_is_heads = p()->buffs.fatebound_coin_heads->check() > p()->buffs.fatebound_coin_tails->check();
- trigger_tails = !(trigger_heads = ( current_is_heads && is_match ));
- }
- if ( trigger_heads )
- {
- p()->buffs.fatebound_coin_heads->increment( 1 + double_jeopardy );
- if ( !trigger_tails )
- p()->buffs.fatebound_coin_tails->expire();
- }
- if ( trigger_tails )
- {
- p()->buffs.fatebound_coin_tails->increment();
- if ( !trigger_heads )
- p()->buffs.fatebound_coin_heads->expire();
- if ( !ab::is_precombat )
- {
- auto tails_action = ( p()->talent.fatebound.delivered_doom->ok() && p()->sim->target_non_sleeping_list.size() <= 1 )
- ? p()->active.fatebound.fatebound_coin_tails_delivered
- : p()->active.fatebound.fatebound_coin_tails;
- tails_action->execute_on_target( state->target );
- if ( double_jeopardy )
- {
- p()->buffs.fatebound_coin_tails->increment();
- tails_action->execute_on_target( state->target );
- }
- }
- }
- p()->buffs.double_jeopardy->expire();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement