1
This commit is contained in:
parent
71123a3434
commit
077cc66182
@ -207,6 +207,7 @@ class Human : public Creature
|
||||
a8::XTimerWp dead_timer;
|
||||
int match_mode = 0;
|
||||
std::shared_ptr<cs::MFThrow> throw_bomb;
|
||||
std::map<int, std::shared_ptr<cs::MFThrow>> pending_throw_bomb;
|
||||
|
||||
std::string name;
|
||||
std::string avatar_url;
|
||||
|
@ -1581,5 +1581,67 @@ void Player::InternalRevive(int target_uniid, int revive_coin)
|
||||
|
||||
void Player::UpdateThrowBomb()
|
||||
{
|
||||
if (downed) {
|
||||
throw_bomb.reset();
|
||||
return;
|
||||
}
|
||||
if (IsCar()) {
|
||||
throw_bomb.reset();
|
||||
return;
|
||||
}
|
||||
if (HasBuffEffect(kBET_Jump) ||
|
||||
HasBuffEffect(kBET_Fly)) {
|
||||
throw_bomb.reset();
|
||||
return;
|
||||
}
|
||||
if (action_type == AT_Reload ||
|
||||
action_type == AT_Rescue ||
|
||||
action_type == AT_UseItem ||
|
||||
action_type == AT_Relive) {
|
||||
CancelAction();
|
||||
throw_bomb.reset();
|
||||
return;
|
||||
}
|
||||
const mt::Equip* equip_meta = mt::Equip::GetById(throw_bomb->weapon_id());
|
||||
if (equip_meta && equip_meta->_inventory_slot() > 0) {
|
||||
int slot_id = 0;
|
||||
switch (equip_meta->_inventory_slot()) {
|
||||
case IS_FRAG:
|
||||
case IS_SMOKE:
|
||||
{
|
||||
slot_id = SPEC1_SLOT_BEGIN + equip_meta->_inventory_slot() - IS_FRAG;
|
||||
}
|
||||
break;
|
||||
case IS_MOLOTOR_COCKTAIL:
|
||||
{
|
||||
slot_id = SPEC2_SLOT_BEGIN + equip_meta->_inventory_slot() - IS_MINE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
}//end switch
|
||||
if (slot_id > 0 && slot_id < weapons.size()) {
|
||||
Weapon& weapon = weapons[slot_id];
|
||||
if (weapon.weapon_idx != 0 &&
|
||||
weapon.meta &&
|
||||
weapon.ammo > 0) {
|
||||
if (HasBuffEffect(kBET_Hide)) {
|
||||
RemoveBuffByEffectId(kBET_Hide);
|
||||
}
|
||||
--weapon.ammo;
|
||||
room->frame_event.AddPropChg
|
||||
(
|
||||
GetWeakPtrRef(),
|
||||
kPropWeaponAmmo,
|
||||
weapon.weapon_idx,
|
||||
weapon.ammo,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
throw_bomb.reset();
|
||||
}
|
||||
|
@ -662,6 +662,7 @@ message MFThrow
|
||||
optional MFVec3 pos = 3; //位置
|
||||
optional MFVec3 dir = 4; //方向
|
||||
optional float fly_distance = 5; //飞行距离
|
||||
optional int32 estimated_time = 6; //预估时间(单位毫秒)
|
||||
}
|
||||
|
||||
//爆炸
|
||||
|
Loading…
x
Reference in New Issue
Block a user