1
This commit is contained in:
parent
d84652ec93
commit
721fa5ffd5
@ -199,6 +199,10 @@ void Human::Shot(a8::Vec2& target_dir)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action_type == AT_Reload) {
|
||||||
|
CancelAction();
|
||||||
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
float fly_distance = 5;
|
float fly_distance = 5;
|
||||||
#endif
|
#endif
|
||||||
@ -231,6 +235,9 @@ void Human::Shot(a8::Vec2& target_dir)
|
|||||||
room->CreateBullet(this, curr_weapon, bullet_born_pos, attack_dir, fly_distance);
|
room->CreateBullet(this, curr_weapon, bullet_born_pos, attack_dir, fly_distance);
|
||||||
}
|
}
|
||||||
--curr_weapon->ammo;
|
--curr_weapon->ammo;
|
||||||
|
if (curr_weapon->ammo <= 0) {
|
||||||
|
AutoLoadingBullet();
|
||||||
|
}
|
||||||
last_shot_frameno_ = room->frame_no;
|
last_shot_frameno_ = room->frame_no;
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
}
|
}
|
||||||
@ -1714,7 +1721,7 @@ void Human::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
switch (phase->func_id) {
|
switch (phase->func_id) {
|
||||||
case Skill_Jump:
|
case Skill_Jump:
|
||||||
{
|
{
|
||||||
|
pos = skill_target_pos;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Skill_Shot:
|
case Skill_Shot:
|
||||||
|
@ -297,57 +297,6 @@ void Player::Shot()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
--curr_weapon->ammo;
|
--curr_weapon->ammo;
|
||||||
#if 0
|
|
||||||
int slot_id = curr_weapon->meta->i->_inventory_slot();
|
|
||||||
switch (slot_id) {
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
//手雷
|
|
||||||
if (curr_weapon->ammo <= 0) {
|
|
||||||
if (GetInventory(slot_id) > 0) {
|
|
||||||
DecInventory(slot_id, 1);
|
|
||||||
++curr_weapon->ammo;
|
|
||||||
} else {
|
|
||||||
int weapon_idx = curr_weapon->weapon_idx;
|
|
||||||
*curr_weapon = Weapon();
|
|
||||||
curr_weapon->weapon_idx = weapon_idx;
|
|
||||||
if (weapons[SMOKE_SLOT].weapon_id != 0) {
|
|
||||||
curr_weapon = &weapons[SMOKE_SLOT];
|
|
||||||
} else {
|
|
||||||
curr_weapon = &weapons[0];
|
|
||||||
}
|
|
||||||
AutoLoadingBullet();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
need_sync_active_player = true;
|
|
||||||
SyncAroundPlayers();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
//烟雾弹
|
|
||||||
if (curr_weapon->ammo <= 0) {
|
|
||||||
if (GetInventory(slot_id) > 0) {
|
|
||||||
DecInventory(slot_id, 1);
|
|
||||||
++curr_weapon->ammo;
|
|
||||||
} else {
|
|
||||||
int weapon_idx = curr_weapon->weapon_idx;
|
|
||||||
*curr_weapon = Weapon();
|
|
||||||
curr_weapon->weapon_idx = weapon_idx;
|
|
||||||
if (weapons[FRAG_SLOT].weapon_id != 0) {
|
|
||||||
curr_weapon = &weapons[FRAG_SLOT];
|
|
||||||
} else {
|
|
||||||
curr_weapon = &weapons[0];
|
|
||||||
}
|
|
||||||
AutoLoadingBullet();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
need_sync_active_player = true;
|
|
||||||
SyncAroundPlayers();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (curr_weapon->ammo <= 0) {
|
if (curr_weapon->ammo <= 0) {
|
||||||
AutoLoadingBullet();
|
AutoLoadingBullet();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user