1
This commit is contained in:
parent
f35c9b7c18
commit
d682d27422
@ -1626,8 +1626,27 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance)
|
|||||||
}
|
}
|
||||||
if (GetCurrWeapon()->weapon_idx != 0 &&
|
if (GetCurrWeapon()->weapon_idx != 0 &&
|
||||||
GetCurrWeapon()->ammo <= 0) {
|
GetCurrWeapon()->ammo <= 0) {
|
||||||
|
if (GetCurrWeapon()->meta->i->reload_delay_time() > 0) {
|
||||||
|
room->xtimer.AddDeadLineTimerAndAttach
|
||||||
|
(
|
||||||
|
GetCurrWeapon()->meta->i->reload_delay_time() / FRAME_RATE_MS,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this)
|
||||||
|
.SetParam1(GetCurrWeapon()->weapon_id),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
Creature* c = (Creature*)param.sender.GetUserData();
|
||||||
|
int weapon_id = param.param1;
|
||||||
|
if (c->GetCurrWeapon()->weapon_id == weapon_id) {
|
||||||
|
c->AutoLoadingBullet();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
} else {
|
||||||
AutoLoadingBullet();
|
AutoLoadingBullet();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
last_shot_frameno_ = room->GetFrameNo();
|
last_shot_frameno_ = room->GetFrameNo();
|
||||||
if ((IsPlayer() || IsCar())) {
|
if ((IsPlayer() || IsCar())) {
|
||||||
room->frame_event.AddBulletNumChg(GetWeakPtrRef());
|
room->frame_event.AddBulletNumChg(GetWeakPtrRef());
|
||||||
|
@ -139,6 +139,7 @@ message Equip
|
|||||||
optional int32 use_scene = 60;
|
optional int32 use_scene = 60;
|
||||||
optional int32 ispenetrate = 61;
|
optional int32 ispenetrate = 61;
|
||||||
optional int32 is_penetrate_thing = 62;
|
optional int32 is_penetrate_thing = 62;
|
||||||
|
optional int32 reload_delay_time = 63;
|
||||||
|
|
||||||
optional string inventory_slot = 31; //库存槽位
|
optional string inventory_slot = 31; //库存槽位
|
||||||
optional int32 _inventory_slot = 32; //库存槽位
|
optional int32 _inventory_slot = 32; //库存槽位
|
||||||
|
Loading…
x
Reference in New Issue
Block a user