1
This commit is contained in:
parent
83a2fe5601
commit
01f55ae48f
@ -281,3 +281,31 @@ bool Ability::CanImmune(const std::set<int>& tags)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ability::AddSpeedRuduce(float rate)
|
||||||
|
{
|
||||||
|
speed_ruduce_rate_ += rate;
|
||||||
|
++speed_ruduce_times_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Ability::DelSpeedRuduce(float rate)
|
||||||
|
{
|
||||||
|
speed_ruduce_rate_ -= rate;
|
||||||
|
speed_ruduce_rate_ = std::max(0.0f, speed_ruduce_rate_);
|
||||||
|
--speed_ruduce_times_;
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (speed_ruduce_times_ < 0) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
float Ability::GetSpeedRuduce()
|
||||||
|
{
|
||||||
|
return speed_ruduce_rate_;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Ability::GetSpeedRuduceTimes()
|
||||||
|
{
|
||||||
|
return speed_ruduce_times_;
|
||||||
|
}
|
||||||
|
@ -23,10 +23,17 @@ class Ability
|
|||||||
void DelSpeedAddition(float rate);
|
void DelSpeedAddition(float rate);
|
||||||
float GetSpeedAddition();
|
float GetSpeedAddition();
|
||||||
int GetSpeedAdditionTimes();
|
int GetSpeedAdditionTimes();
|
||||||
|
|
||||||
|
void AddSpeedRuduce(float rate);
|
||||||
|
void DelSpeedRuduce(float rate);
|
||||||
|
float GetSpeedRuduce();
|
||||||
|
int GetSpeedRuduceTimes();
|
||||||
|
|
||||||
void AddDmgRuduce(float rate);
|
void AddDmgRuduce(float rate);
|
||||||
void DelDmgRuduce(float rate);
|
void DelDmgRuduce(float rate);
|
||||||
float GetDmgRuduce();
|
float GetDmgRuduce();
|
||||||
int GetDmgRuduceTimes();
|
int GetDmgRuduceTimes();
|
||||||
|
|
||||||
void AddDmgAddition(float rate);
|
void AddDmgAddition(float rate);
|
||||||
void DelDmgAddition(float rate);
|
void DelDmgAddition(float rate);
|
||||||
float GetDmgAddition();
|
float GetDmgAddition();
|
||||||
@ -54,6 +61,9 @@ class Ability
|
|||||||
int speed_addition_times_ = 0;
|
int speed_addition_times_ = 0;
|
||||||
float speed_addition_rate_ = 0;
|
float speed_addition_rate_ = 0;
|
||||||
|
|
||||||
|
int speed_ruduce_times_ = 0;
|
||||||
|
float speed_ruduce_rate_ = 0;
|
||||||
|
|
||||||
int dmg_ruduce_times_ = 0;
|
int dmg_ruduce_times_ = 0;
|
||||||
float dmg_ruduce_rate_ = 0;
|
float dmg_ruduce_rate_ = 0;
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ int Creature::AddBuff(Creature* caster,
|
|||||||
{
|
{
|
||||||
SendDebugMsg(a8::Format("添加buff_id:%d effect:%d %s params:%d,%d,%d,%d,%d uniid:%d dur:%d",
|
SendDebugMsg(a8::Format("添加buff_id:%d effect:%d %s params:%d,%d,%d,%d,%d uniid:%d dur:%d",
|
||||||
{
|
{
|
||||||
buff_meta->i->buff_id(),
|
buff_meta->i->buff_id(),
|
||||||
buff_meta->i->buff_effect(),
|
buff_meta->i->buff_effect(),
|
||||||
buff_meta->i->name(),
|
buff_meta->i->name(),
|
||||||
buff_meta->int_param1,
|
buff_meta->int_param1,
|
||||||
|
@ -439,7 +439,7 @@ float Human::GetSpeed()
|
|||||||
}
|
}
|
||||||
float old_speed = speed;
|
float old_speed = speed;
|
||||||
#if 1
|
#if 1
|
||||||
speed = (speed * SERVER_FRAME_RATE * (1 + GetAbility()->GetSpeedAddition())) / SERVER_FRAME_RATE;
|
speed = (speed * SERVER_FRAME_RATE * (1 + GetAbility()->GetSpeedAddition() + GetAbility()->GetSpeedRuduce())) / SERVER_FRAME_RATE;
|
||||||
#else
|
#else
|
||||||
speed = (speed + GetAbility()->GetAttrAbs(kHAT_Speed)) *
|
speed = (speed + GetAbility()->GetAttrAbs(kHAT_Speed)) *
|
||||||
(1 + GetAbility()->GetAttrRate(kHAT_Speed));
|
(1 + GetAbility()->GetAttrRate(kHAT_Speed));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user