添加换弹时间处理
This commit is contained in:
parent
c85492693e
commit
a7fc32cd26
@ -166,6 +166,7 @@ enum HumanAttrType_e
|
||||
kHAT_FireRate = 9,
|
||||
kHAT_Volume = 10,
|
||||
kHAT_MaxHp = 11,
|
||||
kHAT_ReloadTime = 14,
|
||||
kHAT_BulletAngle = 20,
|
||||
kHAT_End
|
||||
};
|
||||
|
@ -829,7 +829,7 @@ void Human::AutoLoadingBullet(bool manual)
|
||||
on_loading_bullet();
|
||||
}
|
||||
StartAction(AT_Reload,
|
||||
p_weapon->meta->i->reload_time(),
|
||||
p_weapon->GetAttrValue(kHAT_ReloadTime),
|
||||
p_weapon->weapon_id,
|
||||
p_weapon->weapon_idx);
|
||||
}
|
||||
@ -848,6 +848,7 @@ void Human::StartAction(ActionType_e action_type,
|
||||
this->action_target_id == target_id) {
|
||||
return;
|
||||
}
|
||||
action_duration = std::max(0, action_duration);
|
||||
this->action_type = action_type;
|
||||
this->action_frameno = room->GetFrameNo();
|
||||
this->action_duration = action_duration;
|
||||
|
@ -57,6 +57,12 @@ float Weapon::GetAttrValue(HumanAttrType_e attr_type)
|
||||
(upgrade_meta ? upgrade_meta->GetAttrValue(weapon_lv, attr_type) : 0);
|
||||
}
|
||||
break;
|
||||
case kHAT_ReloadTime:
|
||||
{
|
||||
return meta->i->reload_time() -
|
||||
(upgrade_meta ? upgrade_meta->GetAttrValue(weapon_lv, attr_type) : 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user