This commit is contained in:
aozhiwei 2024-01-04 17:00:09 +08:00
parent f6e05fcf49
commit 104b2f4b68
8 changed files with 25 additions and 15 deletions

View File

@ -114,5 +114,15 @@ enum HumanVirtualAttrType_e
kHVAT_Dmg = 1001, kHVAT_Dmg = 1001,
kHVAT_BulletAngle = 1002, kHVAT_BulletAngle = 1002,
kHVAT_WeaponAtk = 1003, kHVAT_WeaponAtk = 1003,
kHVAT_ShotRange = 1004,
kHVAT_WeaponExplosionContinueTime = 1005,
kHVAT_RescueTime = 1006,
kHVAT_PoisoningReduction = 1007,
kHVAT_WeaponReloadTime = 1008,
kHVAT_CarOil = 1009,
kHVAT_WeaponExplosionDealyTime = 1010,
kHVAT_WeaponDmg = 1011,
kHVAT_WeaponExplosionRange = 1012,
kHVAT_End kHVAT_End
}; };

View File

@ -243,9 +243,9 @@ void Bullet::ProcBomb()
} }
if (IsCurrWeapon() && if (IsCurrWeapon() &&
sender.Get() && sender.Get() &&
sender.Get()->GetAbility()->GetAttrAbs(kHAT_WeaponExplosionDealyTime) > 0) { sender.Get()->GetAbility()->GetAttrAbs(kHVAT_WeaponExplosionDealyTime) > 0) {
delay_time = delay_time - delay_time = delay_time -
sender.Get()->GetAbility()->GetAttrAbs(kHAT_WeaponExplosionDealyTime); sender.Get()->GetAbility()->GetAttrAbs(kHVAT_WeaponExplosionDealyTime);
delay_time = std::max(0, delay_time); delay_time = std::max(0, delay_time);
} }
{ {
@ -508,7 +508,7 @@ float Bullet::GetAtk()
} }
float attr_rate = 1 + ability_->GetAttrRate(kHAT_Atk); float attr_rate = 1 + ability_->GetAttrRate(kHAT_Atk);
if (IsCurrWeapon()) { if (IsCurrWeapon()) {
attr_rate += ability_->GetAttrRate(kHAT_WeaponDmg); attr_rate += ability_->GetAttrRate(kHVAT_WeaponDmg);
} }
return atk * attr_rate; return atk * attr_rate;
} }
@ -517,7 +517,7 @@ float Bullet::GetExplosionRange()
{ {
float e_range = gun_meta->explosion_range(); float e_range = gun_meta->explosion_range();
if (IsCurrWeapon()) { if (IsCurrWeapon()) {
e_range *= (1 + ability_->GetAttrRate(kHAT_WeaponExplosionRange)); e_range *= (1 + ability_->GetAttrRate(kHVAT_WeaponExplosionRange));
} }
return e_range; return e_range;
} }

View File

@ -519,7 +519,7 @@ void Car::SetAttackDir(const glm::vec3& attack_dir)
void Car::DecOil(float dec_oil) void Car::DecOil(float dec_oil)
{ {
dec_oil *= 1 - GetAbility()->GetAttrRate(kHAT_CarOil); dec_oil *= 1 - GetAbility()->GetAttrRate(kHVAT_CarOil);
cur_oil_ -= dec_oil; cur_oil_ -= dec_oil;
cur_oil_ = std::max(0.0f, cur_oil_); cur_oil_ = std::max(0.0f, cur_oil_);
if (!HasOil()) { if (!HasOil()) {

View File

@ -127,7 +127,7 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
} else if (cmd == "jiuyuan") { } else if (cmd == "jiuyuan") {
TryAddBuff(this, kRescuerBuffId); TryAddBuff(this, kRescuerBuffId);
int downed_relive_time = mt::Param::GetIntParam("downed_relive_time") * 1000; int downed_relive_time = mt::Param::GetIntParam("downed_relive_time") * 1000;
downed_relive_time -= GetAbility()->GetAttrAbs(kHAT_RescueTime); downed_relive_time -= GetAbility()->GetAttrAbs(kHVAT_RescueTime);
downed_relive_time = std::max(0, downed_relive_time); downed_relive_time = std::max(0, downed_relive_time);
downed_relive_time = 1000 * 30; downed_relive_time = 1000 * 30;
StartAction( StartAction(

View File

@ -1365,7 +1365,7 @@ void Creature::UpdatePoisoning()
dmg = room->GetGasData().new_area_meta->hurt(); dmg = room->GetGasData().new_area_meta->hurt();
} }
dmg = dmg * GetMaxHP(); dmg = dmg * GetMaxHP();
dmg *= 1 + GetAbility()->GetAttrRate(kHAT_PoisoningReduction); dmg *= 1 + GetAbility()->GetAttrRate(kHVAT_PoisoningReduction);
if (room->IsPveRoom()) { if (room->IsPveRoom()) {
dmg = std::max(1.0f, dmg); dmg = std::max(1.0f, dmg);
} else { } else {
@ -1617,7 +1617,7 @@ void Creature::AutoLoadingBullet(bool manual)
on_loading_bullet(); on_loading_bullet();
} }
int duration_time = p_weapon->GetReloadTime(this) * int duration_time = p_weapon->GetReloadTime(this) *
(1 + GetAbility()->GetAttrRate(kHAT_WeaponReloadTime)); (1 + GetAbility()->GetAttrRate(kHVAT_WeaponReloadTime));
StartAction(AT_Reload, StartAction(AT_Reload,
duration_time, duration_time,
p_weapon->weapon_id, p_weapon->weapon_id,

View File

@ -151,7 +151,7 @@ void PBUtils::_Ability_FillMFAttrAdditionList(Ability* self,
) )
{ {
#if 0 #if 0
for (int attr_id = 0; attr_id < kHAT_End; ++attr_id) { for (int attr_id = 0; attr_id < kNHAT_End; ++attr_id) {
if (!(attr_id == 12 || attr_id == 33)) { if (!(attr_id == 12 || attr_id == 33)) {
continue; continue;
} }

View File

@ -308,8 +308,8 @@ void RoomObstacle::Active()
void RoomObstacle::ActiveSelfExplosion() void RoomObstacle::ActiveSelfExplosion()
{ {
total_explosion_times_ = meta->explosion_times(); total_explosion_times_ = meta->explosion_times();
if (context_ability && context_ability->GetAttrAbs(kHAT_WeaponExplosionContinueTime) > 0.001f) { if (context_ability && context_ability->GetAttrAbs(kHVAT_WeaponExplosionContinueTime) > 0.001f) {
total_explosion_times_ += context_ability->GetAttrAbs(kHAT_WeaponExplosionContinueTime) * 1000 / total_explosion_times_ += context_ability->GetAttrAbs(kHVAT_WeaponExplosionContinueTime) * 1000 /
meta->explosion_interval(); meta->explosion_interval();
} }
room->xtimer.SetTimeoutEx room->xtimer.SetTimeoutEx
@ -365,8 +365,8 @@ void RoomObstacle::ActiveTrap()
void RoomObstacle::ActivePosionGas() void RoomObstacle::ActivePosionGas()
{ {
total_explosion_times_ = meta->explosion_times(); total_explosion_times_ = meta->explosion_times();
if (context_ability && context_ability->GetAttrAbs(kHAT_WeaponExplosionContinueTime) > 0.001f) { if (context_ability && context_ability->GetAttrAbs(kHVAT_WeaponExplosionContinueTime) > 0.001f) {
total_explosion_times_ += context_ability->GetAttrAbs(kHAT_WeaponExplosionContinueTime) * 1000 / total_explosion_times_ += context_ability->GetAttrAbs(kHVAT_WeaponExplosionContinueTime) * 1000 /
meta->explosion_interval(); meta->explosion_interval();
} }
room->xtimer.SetTimeoutEx room->xtimer.SetTimeoutEx

View File

@ -336,10 +336,10 @@ void InternalShot(Creature* c,
} }
int weapon_buff_id = 0; int weapon_buff_id = 0;
#if 1 #if 1
if (c->GetAbility()->GetAttrAddition(kHAT_ShotRange) > 0.00001f) { if (c->GetAbility()->GetAttrAddition(kHVAT_ShotRange) > 0.00001f) {
if (fly_distance > 0.00001f) { if (fly_distance > 0.00001f) {
} else { } else {
fly_distance = weapon_meta->range() * (1 + c->GetAbility()->GetAttrAddition(kHAT_ShotRange)); fly_distance = weapon_meta->range() * (1 + c->GetAbility()->GetAttrAddition(kHVAT_ShotRange));
} }
} }
#endif #endif