本文整理汇总了C++中AWeapon::GetAtkState方法的典型用法代码示例。如果您正苦于以下问题:C++ AWeapon::GetAtkState方法的具体用法?C++ AWeapon::GetAtkState怎么用?C++ AWeapon::GetAtkState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AWeapon
的用法示例。
在下文中一共展示了AWeapon::GetAtkState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: P_FireWeapon
void P_FireWeapon (player_t *player, FState *state)
{
AWeapon *weapon;
// [SO] 9/2/02: People were able to do an awful lot of damage
// when they were observers...
if (player->Bot == nullptr && bot_observer)
{
return;
}
weapon = player->ReadyWeapon;
if (weapon == nullptr || !weapon->CheckAmmo (AWeapon::PrimaryFire, true))
{
return;
}
player->mo->PlayAttacking ();
weapon->bAltFire = false;
if (state == nullptr)
{
state = weapon->GetAtkState(!!player->refire);
}
P_SetPsprite(player, PSP_WEAPON, state);
if (!(weapon->WeaponFlags & WIF_NOALERT))
{
P_NoiseAlert (player->mo, player->mo, false);
}
}