完成变身逻辑
This commit is contained in:
parent
6aeda0b548
commit
b8c76dc6af
@ -169,6 +169,11 @@ bool Buff::NeedSync(Human* hum)
|
|||||||
return !meta->i->only_server() || !(meta->i->only_self() && owner == hum);
|
return !meta->i->only_server() || !(meta->i->only_self() && owner == hum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Buff::FreezeOperate()
|
||||||
|
{
|
||||||
|
return meta->i->buff_effect() == kBET_Become && !hold_weapons_.empty();
|
||||||
|
}
|
||||||
|
|
||||||
void Buff::ProcBecome(Creature* caster)
|
void Buff::ProcBecome(Creature* caster)
|
||||||
{
|
{
|
||||||
if (caster->IsHuman() && meta->param2 > 0.01) {
|
if (caster->IsHuman() && meta->param2 > 0.01) {
|
||||||
|
@ -31,6 +31,7 @@ class Buff
|
|||||||
int GetLastingTime();
|
int GetLastingTime();
|
||||||
bool NeedSync(Human* hum);
|
bool NeedSync(Human* hum);
|
||||||
void FillMFBuff(cs::MFBuff* buff_pb);
|
void FillMFBuff(cs::MFBuff* buff_pb);
|
||||||
|
bool FreezeOperate();
|
||||||
|
|
||||||
void ProcDelayAddBuff(Creature* caster);
|
void ProcDelayAddBuff(Creature* caster);
|
||||||
void ProcIntervalAddBuff(Creature* caster);
|
void ProcIntervalAddBuff(Creature* caster);
|
||||||
|
@ -1537,3 +1537,9 @@ void Creature::SummonHero(const a8::Vec2& pos,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Creature::FreezeOperate()
|
||||||
|
{
|
||||||
|
Buff* buff = GetBuffByEffectId(kBET_Become);
|
||||||
|
return buff && !buff->FreezeOperate();
|
||||||
|
}
|
||||||
|
@ -145,6 +145,7 @@ class Creature : public MoveableEntity
|
|||||||
void SetCurrWeapon(Weapon* weapon);
|
void SetCurrWeapon(Weapon* weapon);
|
||||||
void ResetAllSkillCd();
|
void ResetAllSkillCd();
|
||||||
void UpdateSkill();
|
void UpdateSkill();
|
||||||
|
bool FreezeOperate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -2290,7 +2290,9 @@ void Human::DeadDrop()
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GetRace() == kHumanRace && !HasBuffEffect(kBET_Terminator)) {
|
if (GetRace() == kHumanRace &&
|
||||||
|
!HasBuffEffect(kBET_Terminator) &&
|
||||||
|
!(HasBuffEffect(kBET_Become) && GetBuffByEffectId(kBET_Become)->FreezeOperate())) {
|
||||||
for (auto& weapon : weapons) {
|
for (auto& weapon : weapons) {
|
||||||
if (weapon.weapon_id != 0 && weapon.weapon_id != default_weapon.weapon_id) {
|
if (weapon.weapon_id != 0 && weapon.weapon_id != default_weapon.weapon_id) {
|
||||||
a8::Vec2 drop_pos = GetPos();
|
a8::Vec2 drop_pos = GetPos();
|
||||||
|
@ -218,16 +218,18 @@ void Player::UpdateShot()
|
|||||||
|
|
||||||
void Player::UpdateSelectWeapon()
|
void Player::UpdateSelectWeapon()
|
||||||
{
|
{
|
||||||
if (selected_weapon_idx >= 0 && selected_weapon_idx < weapons.size()) {
|
if (!FreezeOperate()) {
|
||||||
Weapon* old_weapon = GetCurrWeapon();
|
if (selected_weapon_idx >= 0 && selected_weapon_idx < weapons.size()) {
|
||||||
Weapon* weapon = &weapons[selected_weapon_idx];
|
Weapon* old_weapon = GetCurrWeapon();
|
||||||
if (weapon->weapon_id != 0) {
|
Weapon* weapon = &weapons[selected_weapon_idx];
|
||||||
SetCurrWeapon(weapon);
|
if (weapon->weapon_id != 0) {
|
||||||
ResetAction();
|
SetCurrWeapon(weapon);
|
||||||
need_sync_active_player = true;
|
ResetAction();
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
need_sync_active_player = true;
|
||||||
if (old_weapon != weapon) {
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
AutoLoadingBullet();
|
if (old_weapon != weapon) {
|
||||||
|
AutoLoadingBullet();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1119,7 +1121,8 @@ void Player::UpdateDropWeapon()
|
|||||||
{
|
{
|
||||||
if (drop_weapon_idx >= 0 &&
|
if (drop_weapon_idx >= 0 &&
|
||||||
drop_weapon_idx < weapons.size() &&
|
drop_weapon_idx < weapons.size() &&
|
||||||
!HasBuffEffect(kBET_Terminator)) {
|
!HasBuffEffect(kBET_Terminator) &&
|
||||||
|
!FreezeOperate()) {
|
||||||
bool drop_ok = false;
|
bool drop_ok = false;
|
||||||
Weapon* weapon = &weapons[drop_weapon_idx];
|
Weapon* weapon = &weapons[drop_weapon_idx];
|
||||||
int weapon_id = weapon->weapon_id;
|
int weapon_id = weapon->weapon_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user