remove safezone
This commit is contained in:
parent
8b367c8d96
commit
be84d4aa81
@ -20,16 +20,10 @@ AndroidAI::~AndroidAI()
|
|||||||
void AndroidAI::Update(int delta_time)
|
void AndroidAI::Update(int delta_time)
|
||||||
{
|
{
|
||||||
Human* hum = (Human*)owner;
|
Human* hum = (Human*)owner;
|
||||||
if (hum->poisoning) {
|
|
||||||
hum->poisoning_time += delta_time;
|
|
||||||
}
|
|
||||||
state_elapsed_time += delta_time;
|
state_elapsed_time += delta_time;
|
||||||
if (hum->dead) {
|
if (hum->dead) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hum->poisoning) {
|
|
||||||
hum->UpdatePoisoning();
|
|
||||||
}
|
|
||||||
if (hum->playing_skill) {
|
if (hum->playing_skill) {
|
||||||
hum->UpdateSkill();
|
hum->UpdateSkill();
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,6 @@ enum SkillCond_e
|
|||||||
|
|
||||||
enum VirtualWeapon_e
|
enum VirtualWeapon_e
|
||||||
{
|
{
|
||||||
VW_SafeArea = 9000000,
|
|
||||||
VW_Spectate = 9000001,
|
VW_Spectate = 9000001,
|
||||||
VW_SelfDetonate = 9000002,
|
VW_SelfDetonate = 9000002,
|
||||||
VW_Mine = 9000003,
|
VW_Mine = 9000003,
|
||||||
@ -113,7 +112,6 @@ enum VirtualWeapon_e
|
|||||||
|
|
||||||
enum VirtualPlayer_e
|
enum VirtualPlayer_e
|
||||||
{
|
{
|
||||||
VP_SafeArea = 9000000,
|
|
||||||
VP_Spectate = 9000001,
|
VP_Spectate = 9000001,
|
||||||
VP_SelfDetonate = 9000002,
|
VP_SelfDetonate = 9000002,
|
||||||
VP_Mine = 9000003,
|
VP_Mine = 9000003,
|
||||||
|
@ -400,29 +400,6 @@ float Human::GetMaxHP()
|
|||||||
return ability.max_hp;
|
return ability.max_hp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::UpdatePoisoning()
|
|
||||||
{
|
|
||||||
if (dead) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bool need_notify = poisoning_time > 1000;
|
|
||||||
while (poisoning_time > 1000) {
|
|
||||||
if (room->gas_data.is_last_gas) {
|
|
||||||
DecHP(room->gas_data.new_area_meta->i->hurt(), VP_SafeArea, "安全区", VW_SafeArea);
|
|
||||||
} else {
|
|
||||||
DecHP(room->gas_data.old_area_meta->i->hurt(), VP_SafeArea, "安全区", VW_SafeArea);
|
|
||||||
}
|
|
||||||
if (dead) {
|
|
||||||
poisoning_time = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
poisoning_time -= 1000;
|
|
||||||
}
|
|
||||||
if (need_notify && entity_subtype == EST_Player) {
|
|
||||||
SyncAroundPlayers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::UpdateSkill()
|
void Human::UpdateSkill()
|
||||||
{
|
{
|
||||||
if (skill_meta) {
|
if (skill_meta) {
|
||||||
@ -1419,32 +1396,7 @@ void Human::ProcBuffEffect(Buff* buff)
|
|||||||
|
|
||||||
void Human::OnAttack()
|
void Human::OnAttack()
|
||||||
{
|
{
|
||||||
if (a8::HasBitFlag(status, HS_InGrass)) {
|
GrassTempShow();
|
||||||
if (HasBuffEffect(BET_InGrass)) {
|
|
||||||
RemoveBuffByEffectId(BET_InGrass);
|
|
||||||
}
|
|
||||||
if (grass_hide_timer_list_) {
|
|
||||||
room->xtimer.ModifyTimer(grass_hide_timer_list_,
|
|
||||||
MetaMgr::Instance()->grass_invisible_time2 * SERVER_FRAME_RATE);
|
|
||||||
} else {
|
|
||||||
auto hide_func =
|
|
||||||
[] (const a8::XParams& param)
|
|
||||||
{
|
|
||||||
Human* hum = (Human*)param.sender.GetUserData();
|
|
||||||
hum->grass_hide_timer_list_ = nullptr;
|
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(GRASS_HIDE_BUFF_ID);
|
|
||||||
if (buff_meta) {
|
|
||||||
hum->AddBuff(buff_meta);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
grass_hide_timer_list_ =
|
|
||||||
room->xtimer.AddDeadLineTimerAndAttach(MetaMgr::Instance()->grass_invisible_time2 * SERVER_FRAME_RATE,
|
|
||||||
a8::XParams()
|
|
||||||
.SetSender(this),
|
|
||||||
hide_func,
|
|
||||||
&xtimer_attacher.timer_list_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::OnEnterGrass()
|
void Human::OnEnterGrass()
|
||||||
@ -1535,6 +1487,36 @@ void Human::CheckGrass()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::GrassTempShow()
|
||||||
|
{
|
||||||
|
if (a8::HasBitFlag(status, HS_InGrass)) {
|
||||||
|
if (HasBuffEffect(BET_InGrass)) {
|
||||||
|
RemoveBuffByEffectId(BET_InGrass);
|
||||||
|
}
|
||||||
|
if (grass_hide_timer_list_) {
|
||||||
|
room->xtimer.ModifyTimer(grass_hide_timer_list_,
|
||||||
|
MetaMgr::Instance()->grass_invisible_time2 * SERVER_FRAME_RATE);
|
||||||
|
} else {
|
||||||
|
auto hide_func =
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
Human* hum = (Human*)param.sender.GetUserData();
|
||||||
|
hum->grass_hide_timer_list_ = nullptr;
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(GRASS_HIDE_BUFF_ID);
|
||||||
|
if (buff_meta) {
|
||||||
|
hum->AddBuff(buff_meta);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
grass_hide_timer_list_ =
|
||||||
|
room->xtimer.AddDeadLineTimerAndAttach(MetaMgr::Instance()->grass_invisible_time2 * SERVER_FRAME_RATE,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
hide_func,
|
||||||
|
&xtimer_attacher.timer_list_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float* Human::GetAbilityById(int attr_id)
|
float* Human::GetAbilityById(int attr_id)
|
||||||
{
|
{
|
||||||
switch (attr_id) {
|
switch (attr_id) {
|
||||||
|
@ -74,8 +74,6 @@ class Human : public Entity
|
|||||||
int max_energy_shield = 0;
|
int max_energy_shield = 0;
|
||||||
int vip = 0;
|
int vip = 0;
|
||||||
int sdmg = 0;
|
int sdmg = 0;
|
||||||
bool poisoning = false;
|
|
||||||
long long poisoning_time = 0;
|
|
||||||
int lethal_weapon = 0;
|
int lethal_weapon = 0;
|
||||||
long long dead_frameno = 0;
|
long long dead_frameno = 0;
|
||||||
long long join_frameno = 0;
|
long long join_frameno = 0;
|
||||||
@ -138,7 +136,6 @@ class Human : public Entity
|
|||||||
float GetRadius();
|
float GetRadius();
|
||||||
float GetHP();
|
float GetHP();
|
||||||
float GetMaxHP();
|
float GetMaxHP();
|
||||||
void UpdatePoisoning();
|
|
||||||
void UpdateSkill();
|
void UpdateSkill();
|
||||||
void SyncAroundPlayers();
|
void SyncAroundPlayers();
|
||||||
void AutoLoadingBullet(bool manual = false);
|
void AutoLoadingBullet(bool manual = false);
|
||||||
@ -209,6 +206,7 @@ class Human : public Entity
|
|||||||
void OnEnterGrass();
|
void OnEnterGrass();
|
||||||
void OnLeaveGrass();
|
void OnLeaveGrass();
|
||||||
void CheckGrass();
|
void CheckGrass();
|
||||||
|
void GrassTempShow();
|
||||||
float* GetAbilityById(int attr_id);
|
float* GetAbilityById(int attr_id);
|
||||||
void RecalcBaseAttr();
|
void RecalcBaseAttr();
|
||||||
|
|
||||||
|
@ -52,9 +52,6 @@ void Player::Initialize()
|
|||||||
|
|
||||||
void Player::Update(int delta_time)
|
void Player::Update(int delta_time)
|
||||||
{
|
{
|
||||||
if (poisoning) {
|
|
||||||
poisoning_time += delta_time;
|
|
||||||
}
|
|
||||||
if (a8::HasBitFlag(status, HS_Assaulting)) {
|
if (a8::HasBitFlag(status, HS_Assaulting)) {
|
||||||
_UpdateAssaultMove();
|
_UpdateAssaultMove();
|
||||||
} else {
|
} else {
|
||||||
@ -72,9 +69,6 @@ void Player::Update(int delta_time)
|
|||||||
if (interaction_objids.size() > 0) {
|
if (interaction_objids.size() > 0) {
|
||||||
ProcInteraction();
|
ProcInteraction();
|
||||||
}
|
}
|
||||||
if (poisoning) {
|
|
||||||
UpdatePoisoning();
|
|
||||||
}
|
|
||||||
if (playing_skill) {
|
if (playing_skill) {
|
||||||
UpdateSkill();
|
UpdateSkill();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user