tjc12821

Untitled

Jul 30th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.89 KB | None | 0 0
  1.     struct seed_of_corruption_t : public affliction_spell_t
  2.     {
  3.       struct seed_of_corruption_aoe_t : public affliction_spell_t
  4.       {
  5.         bool deathbloom; //azerite_trait
  6.         seed_of_corruption_aoe_t( warlock_t* p ) :
  7.           affliction_spell_t( "seed_of_corruption_aoe", p, p -> find_spell( 27285 ) )
  8.         {
  9.           aoe = -1;
  10.           dual = true;
  11.           background = true;
  12.           deathbloom = false;
  13.           p->spells.seed_of_corruption_aoe = this;
  14.         }
  15.  
  16.         double bonus_da(const action_state_t* s) const override
  17.         {
  18.           double da = affliction_spell_t::bonus_da(s);
  19.           if(deathbloom)
  20.             da += p()->azerite.deathbloom.value();
  21.           return da;
  22.         }
  23.  
  24.         void impact( action_state_t* s ) override
  25.         {
  26.           affliction_spell_t::impact( s );
  27.  
  28.           if ( result_is_hit( s->result ) )
  29.           {
  30.             warlock_td_t* tdata = this->td( s->target );
  31.             if ( tdata->dots_seed_of_corruption->is_ticking() && tdata->soc_threshold > 0 )
  32.             {
  33.               tdata->soc_threshold = 0;
  34.               tdata->dots_seed_of_corruption->cancel();
  35.             }
  36.           }
  37.         }
  38.       };
  39.  
  40.       double threshold_mod;
  41.       double sow_the_seeds_targets;
  42.       seed_of_corruption_aoe_t* explosion;
  43.  
  44.       seed_of_corruption_t( warlock_t* p, const std::string& options_str ) :
  45.         affliction_spell_t( "seed_of_corruption", p, p -> find_spell( 27243 ) ),
  46.           threshold_mod( 3.0 ),
  47.           sow_the_seeds_targets( p->talents.sow_the_seeds->effectN( 1 ).base_value() ),
  48.           explosion( new seed_of_corruption_aoe_t( p ) )
  49.       {
  50.         parse_options( options_str );
  51.         may_crit = false;
  52.         base_tick_time = dot_duration;
  53.         hasted_ticks = false;
  54.         add_child( explosion );
  55.         if ( p->talents.sow_the_seeds->ok() )
  56.           aoe = 2;
  57.       }
  58.  
  59.       void init() override
  60.       {
  61.         affliction_spell_t::init();
  62.         snapshot_flags |= STATE_SP;
  63.       }
  64.  
  65.       void execute() override
  66.       {
  67.         if ( p()->sets->has_set_bonus( WARLOCK_AFFLICTION, T21, B4 ) )
  68.           p()->active.tormented_agony->schedule_execute();
  69.  
  70.         affliction_spell_t::execute();
  71.       }
  72.  
  73.       void impact( action_state_t* s ) override
  74.       {
  75.         if ( result_is_hit( s->result ) )
  76.         {
  77.           td( s->target )->soc_threshold = s->composite_spell_power();
  78.         }
  79.  
  80.         assert(p()->active.corruption);
  81.         p()->active.corruption->target = s->target;
  82.         p()->active.corruption->schedule_execute();
  83.  
  84.         affliction_spell_t::impact( s );
  85.       }
  86.  
  87.       void last_tick( dot_t* d ) override
  88.       {
  89.         affliction_spell_t::last_tick( d );
  90.  
  91.         if (!d->end_event) {
  92.           explosion->deathbloom = true;
  93.         }
  94.         explosion->target = d->target;
  95.         explosion->execute();
  96.       }
  97.     };
Advertisement
Add Comment
Please, Sign In to add comment