Esempio n. 1
0
void action_t::refresh_duration()
{
  if ( sim -> debug ) log_t::output( sim, "%s refreshes duration of %s", player -> name(), name() );

  // Make sure this DoT is still ticking......
  assert( tick_event );

  // Recalculate player power
  if ( base_attack_power_multiplier > 0 )
  {
    player_attack_power            = player -> composite_attack_power();
    player_attack_power_multiplier = player -> composite_attack_power_multiplier();
  }
  if ( base_spell_power_multiplier > 0 )
  {
    player_spell_power            = player -> composite_spell_power( school );
    player_spell_power_multiplier = player -> composite_spell_power_multiplier();
  }

  if ( dot_behavior == DOT_WAIT )
  {
    // Refreshing a DoT does not interfere with the next tick event.  Ticks will stil occur
    // every "base_tick_time" seconds.  To determine the new finish time for the DoT, start
    // from the time of the next tick and add the time for the remaining ticks to that event.

    double duration = tick_event -> time + tick_time() * ( num_ticks - 1 );

    dot -> start( this, duration );
  }

  current_tick = 0;
}
Esempio n. 2
0
void action_t::schedule_tick()
{
  if ( sim -> debug ) log_t::output( sim, "%s schedules tick for %s", player -> name(), name() );

  if ( current_tick == 0 )
  {
    if ( school == SCHOOL_BLEED ) sim -> target -> debuffs.bleeding -> increment();

    if ( tick_zero )
    {
      time_to_tick = 0;
      tick();
    }
  }

  ticking = 1;

  if ( snapshot_haste <= 0.0 )
  {
    snapshot_haste = haste();
  }

  time_to_tick = tick_time();

  tick_event = new ( sim ) action_tick_event_t( sim, this, time_to_tick );

  if ( channeled ) player -> channeling = this;

  if ( observer ) *observer = this;
}
Esempio n. 3
0
int Gate_Manager::close_client(int player_cid) {
	if (player_cid >= 2) {
		Close_Info info(player_cid, tick_time());
		close_list_.push_back(info);
	} else {
		LOG_TRACE("player_cid < 2");
	}
	return 0;
}
Esempio n. 4
0
void action_t::extend_duration( int extra_ticks )
{
  num_ticks += extra_ticks;
  added_ticks += extra_ticks;

  if ( dot_behavior == DOT_WAIT )
  {
    dot -> ready += tick_time() * extra_ticks;
  }

  if ( sim -> debug ) log_t::output( sim, "%s extends duration of %s, adding %d tick(s), totalling %d ticks", player -> name(), name(), extra_ticks, num_ticks );
}
Esempio n. 5
0
void
start_ticker(CONFIG* cfg, int count)
{
	CONS* actor;
	CONS* state;
	CONS* msg;
	
	DBUG_ENTER("start_ticker");
	DBUG_PRINT("", ("count=%d", count));
	state = map_put(NIL, ATOM("count"), NUMBER(count));
	actor = CFG_ACTOR(cfg, each_second, state);
	
	state = map_put(NIL, ATOM("sec"), actor);
	msg = map_put(NIL, ATOM("time"), tick_time());
	CFG_SEND(cfg, CFG_ACTOR(cfg, time_ticker, state), msg);
	DBUG_RETURN;
}
Esempio n. 6
0
void action_t::update_ready()
{
  if ( cooldown -> duration > 0 && ! dual )
  {
    if ( sim -> debug ) log_t::output( sim, "%s starts cooldown for %s (%s)", player -> name(), name(), cooldown -> name() );

    cooldown -> start();
  }
  if ( num_ticks && ( dot_behavior == DOT_WAIT ) )
  {
    if ( ticking && ! channeled )
    {
      assert( num_ticks && tick_event );

      int remaining_ticks = num_ticks - current_tick;

      double next_tick = tick_event -> occurs() - sim -> current_time;

      double duration = 0.01 + next_tick + tick_time() * ( remaining_ticks - 1 );

      if ( sim -> debug )
        log_t::output( sim, "%s shares duration (%.2f) for %s (%s)", 
                       player -> name(), duration, name(), dot -> name() );

      dot -> start( this, duration );
    }
    else if( result_is_miss() )
    {
      if ( sim -> debug ) 
        log_t::output( sim, "%s pushes out re-cast (%.2f) on miss for %s (%s)", 
                       player -> name(), sim -> reaction_time, name(), dot -> name() );

      dot -> start( this, sim -> reaction_time );
    }
  }
}
Esempio n. 7
0
std::string special_effect_t::to_string() const
{
  std::ostringstream s;

  s << name();
  s << " type=" << util::special_effect_string( type );
  s << " source=" << util::special_effect_source_string( source );

  if ( ! trigger_str.empty() )
    s << " proc=" << trigger_str;

  if ( spell_id > 0 )
    s << " driver=" << spell_id;

  if ( trigger() -> ok() )
    s << " trigger=" << trigger() -> id();

  if ( is_stat_buff() )
  {
    s << " stat=" << util::stat_type_abbrev( stat );
    s << " amount=" << stat_amount;
    s << " duration=" << duration().total_seconds();
    if ( tick_time() != timespan_t::zero() )
      s << " tick=" << tick_time().total_seconds();
    if ( reverse )
      s << " Reverse";
  }

  if ( school != SCHOOL_NONE )
  {
    s << " school=" << util::school_type_string( school );
    s << " amount=" << discharge_amount;
    if ( discharge_scaling > 0 )
      s << " coeff=" << discharge_scaling;
  }

  if ( max_stacks > 0 )
    s << " max_stack=" << max_stacks;

  if ( proc_chance() > 0 )
    s << " proc_chance=" << proc_chance() * 100.0 << "%";

  if ( ppm() > 0 )
    s << " ppm=" << ppm();

  if ( rppm() > 0 )
  {
    s << " rppm=" << rppm();
    switch ( rppm_scale )
    {
      case RPPM_HASTE:
        s << " (Haste)";
        break;
      case RPPM_ATTACK_CRIT:
        s << " (AttackCrit)";
        break;
      case RPPM_SPELL_CRIT:
        s << " (SpellCrit)";
        break;
      default:
        break;
    }
  }

  if ( cooldown() > timespan_t::zero() )
  {
    if ( type == SPECIAL_EFFECT_EQUIP )
      s << " icd=";
    else if ( type == SPECIAL_EFFECT_USE )
      s << " cd=";
    else
      s << " (i)cd=";
    s << cooldown().total_seconds();
  }

  if ( weapon_proc )
    s << " weaponproc";

  return s.str();
}