Guest User

Untitled

a guest
Jun 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. diff --git a/engine/class_modules/sc_mage.cpp b/engine/class_modules/sc_mage.cpp
  2. index 25ce93d64..eccfab486 100755
  3. --- a/engine/class_modules/sc_mage.cpp
  4. +++ b/engine/class_modules/sc_mage.cpp
  5. @@ -902,6 +902,27 @@ struct mage_spell_base_t : public spell_t
  6. {
  7. sim -> errorf( "Player %s firestarer expression: unknown operation '%s'", player -> name(), splits[ 1 ].c_str() );
  8. }
  9. + } else if ( splits.size() == 4 && util::str_compare_ci( splits[ 0 ], "action" ) && util::str_compare_ci( splits[ 1 ], "arcane_blast" ) ) {
  10. + enum arcane_blast_expr_type_e { BASE_COST, CHARGED_COST };
  11. +
  12. + struct arcane_blast_charged_cost_expr_t : public expr_t {
  13. + mage_t& mage;
  14. + action_t* a;
  15. + int arcane_charges;
  16. +
  17. + arcane_blast_charged_cost_expr_t( mage_t& m, const std::string& name, action_t* a, int arcane_charges = 0 ) :
  18. + expr_t( name ), mage( m ), a( a ), arcane_charges( arcane_charges ) { }
  19. +
  20. + double evaluate() override {
  21. + // unknown type name 'arcane_blast_t'
  22. + return debug_cast<const arcane_blast_t*>( a ) -> cost();
  23. + }
  24. + };
  25. +
  26. + if ( util::str_compare_ci( splits[ 2 ], "charged_cost" ) )
  27. + {
  28. + return new arcane_blast_charged_cost_expr_t( *mage, expr_str, this, atof( splits[ 3 ].c_str() ) );
  29. + }
  30. }
  31.  
  32. return spell_t::create_expression( expr_str );
  33. @@ -2347,13 +2368,21 @@ struct arcane_blast_t : public arcane_mage_spell_t
  34. }
  35. }
  36.  
  37. - virtual double cost() const override
  38. - {
  39. + double charged_cost( int arcane_charges ) const {
  40. double c = arcane_mage_spell_t::cost();
  41.  
  42. - c *= 1.0 + p() -> buffs.arcane_charge -> check() *
  43. - p() -> spec.arcane_charge -> effectN( 5 ).percent();
  44. + c *= 1.0 + arcane_charges * p() -> spec.arcane_charge -> effectN( 5 ).percent();
  45. +
  46. + return c;
  47. + }
  48.  
  49. + double charged_cost() const {
  50. + return charged_cost( p() -> buffs.arcane_charge -> check() );
  51. + }
  52. +
  53. + virtual double cost() const override
  54. + {
  55. + double c = charged_cost();
  56.  
  57. c *= 1.0 + p() -> buffs.rule_of_threes -> check_value();
Add Comment
Please, Sign In to add comment