Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void trigger_ember_gain( warlock_t* p, double amount, gain_t* gain, double chance = 1.0 )
- {
- if ( ! p -> rng().roll( chance ) ) return;
- if ( ( p -> sets.has_set_bonus( SET_CASTER, T16, B4 ) || p -> sets.has_set_bonus( WARLOCK_DESTRUCTION, T17, B4 )) && //check whether we fill one up.
- ( ( p -> resources.current[RESOURCE_BURNING_EMBER] < 1.0 && p -> resources.current[RESOURCE_BURNING_EMBER] + amount >= 1.0 ) ||
- ( p -> resources.current[RESOURCE_BURNING_EMBER] < 2.0 && p -> resources.current[RESOURCE_BURNING_EMBER] + amount >= 2.0 ) ||
- ( p -> resources.current[RESOURCE_BURNING_EMBER] < 3.0 && p -> resources.current[RESOURCE_BURNING_EMBER] + amount >= 3.0 ) ||
- ( p -> resources.current[RESOURCE_BURNING_EMBER] < 4.0 && p -> resources.current[RESOURCE_BURNING_EMBER] + amount >= 4.0 ) ) )
- {
- if(p -> sets.has_set_bonus( SET_CASTER, T16, B4 ))
- p -> buffs.tier16_4pc_ember_fillup -> trigger();
- if( p -> sets.has_set_bonus( WARLOCK_DESTRUCTION, T17, B4 ) && p -> rppm_chaotic_infusion.trigger())
- p -> buffs.chaotic_infusion ->trigger();
- }
- p -> resource_gain( RESOURCE_BURNING_EMBER, amount, gain );
- // If getting to 1 full ember was a surprise, the player would have to react to it
- if ( p -> resources.current[RESOURCE_BURNING_EMBER] == 1.0 && ( amount > 0.1 || chance < 1.0 ) )
- p -> ember_react = p -> sim -> current_time() + p -> total_reaction_time();
- else if ( p -> resources.current[RESOURCE_BURNING_EMBER] >= 1.0 )
- p -> ember_react = p -> sim -> current_time();
- else
- p -> ember_react = timespan_t::max();
- }
Advertisement
Add Comment
Please, Sign In to add comment