1
This commit is contained in:
parent
bf24b15380
commit
8df475806c
@ -53,5 +53,6 @@ void Android::GiveEquip()
|
||||
weapons[GUN_SLOT1].meta = weapon_meta;
|
||||
weapons[GUN_SLOT1].Recalc();
|
||||
curr_weapon = &weapons[GUN_SLOT1];
|
||||
DirectReload();
|
||||
}
|
||||
}
|
||||
|
@ -246,10 +246,22 @@ void Bullet::ProcMissible(const a8::XParams& param)
|
||||
if (target && !target->dead) {
|
||||
if (bullet_meta->i->equip_subtype() == BulletType_Trace) {
|
||||
if (src_pos.Distance(target->pos) < bullet_meta->i->range()) {
|
||||
target->DecHP(bullet_meta->i->atk(), sender->entity_uniid, sender->name, bullet_meta->i->id());
|
||||
if (!target->HasBuffEffect(BET_Invincible)) {
|
||||
target->DecHP(bullet_meta->i->atk(),
|
||||
sender->entity_uniid,
|
||||
sender->name,
|
||||
bullet_meta->i->id()
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
target->DecHP(bullet_meta->i->atk(), sender->entity_uniid, sender->name, bullet_meta->i->id());
|
||||
if (!target->HasBuffEffect(BET_Invincible)) {
|
||||
target->DecHP(bullet_meta->i->atk(),
|
||||
sender->entity_uniid,
|
||||
sender->name,
|
||||
bullet_meta->i->id()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1152,22 +1152,7 @@ void Human::UpdateAction()
|
||||
curr_weapon->weapon_id == action_item_id
|
||||
) {
|
||||
{
|
||||
int ammo = curr_weapon->ammo;
|
||||
if (ammo < curr_weapon->GetClipVolume()) {
|
||||
if (GetInventory(WEAPON_SLOT) > 0) {
|
||||
int add_num = 0;
|
||||
if (GetInventory(WEAPON_SLOT) <=
|
||||
curr_weapon->GetClipVolume() - ammo) {
|
||||
add_num = GetInventory(WEAPON_SLOT);
|
||||
DecInventory(WEAPON_SLOT, add_num);
|
||||
} else {
|
||||
add_num = curr_weapon->GetClipVolume() - ammo;
|
||||
DecInventory(WEAPON_SLOT, add_num);
|
||||
}
|
||||
curr_weapon->ammo += add_num;
|
||||
need_sync_active_player = true;;
|
||||
}
|
||||
}
|
||||
DirectReload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1272,6 +1257,26 @@ void Human::UpdateAction()
|
||||
}
|
||||
}
|
||||
|
||||
void Human::DirectReload()
|
||||
{
|
||||
int ammo = curr_weapon->ammo;
|
||||
if (ammo < curr_weapon->GetClipVolume()) {
|
||||
if (GetInventory(WEAPON_SLOT) > 0) {
|
||||
int add_num = 0;
|
||||
if (GetInventory(WEAPON_SLOT) <=
|
||||
curr_weapon->GetClipVolume() - ammo) {
|
||||
add_num = GetInventory(WEAPON_SLOT);
|
||||
DecInventory(WEAPON_SLOT, add_num);
|
||||
} else {
|
||||
add_num = curr_weapon->GetClipVolume() - ammo;
|
||||
DecInventory(WEAPON_SLOT, add_num);
|
||||
}
|
||||
curr_weapon->ammo += add_num;
|
||||
need_sync_active_player = true;;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Human::SendUIUpdate()
|
||||
{
|
||||
cs::SMUiUpdate notifymsg;
|
||||
|
@ -188,6 +188,7 @@ class Human : public Entity
|
||||
void SendDebugMsg(const std::string& debug_msg);
|
||||
void SendRollMsg(const std::string& roll_msg);
|
||||
void UpdateAction();
|
||||
void DirectReload();
|
||||
void SendUIUpdate();
|
||||
void SendWxVoip();
|
||||
int GetWeaponConfigLv(int weapon_id);
|
||||
|
@ -203,7 +203,7 @@ void Obstacle::Explosion()
|
||||
case ET_Player:
|
||||
{
|
||||
Human* hum = (Human*)target;
|
||||
if (!hum->dead) {
|
||||
if (!hum->dead && hum != master) {
|
||||
float dmg = meta->i->damage();
|
||||
float def = hum->ability.def + hum->ability.def_add;
|
||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||
|
@ -43,6 +43,7 @@ void Player::Initialize()
|
||||
weapons[GUN_SLOT1].meta = weapon_meta;
|
||||
weapons[GUN_SLOT1].Recalc();
|
||||
curr_weapon = &weapons[GUN_SLOT1];
|
||||
DirectReload();
|
||||
}
|
||||
}
|
||||
RecalcBaseAttr();
|
||||
|
Loading…
x
Reference in New Issue
Block a user