1
This commit is contained in:
parent
c84825747d
commit
6242574bfd
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
const int kReviveTimeAdd = 12;
|
const int kReviveTimeAdd = 12;
|
||||||
const int kSkinNum = 4;
|
const int kSkinNum = 4;
|
||||||
|
const int kREVIVE_BUFF_ID = 0;
|
||||||
|
|
||||||
Human::Human():MoveableEntity()
|
Human::Human():MoveableEntity()
|
||||||
{
|
{
|
||||||
@ -980,9 +981,36 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
++stats.dead_times;
|
||||||
stats.killer_id = killer_id;
|
stats.killer_id = killer_id;
|
||||||
stats.killer_name = killer_name;
|
stats.killer_name = killer_name;
|
||||||
stats.weapon_id = weapon_id;
|
stats.weapon_id = weapon_id;
|
||||||
|
if (room->GetRoomMode() == kZombieMode) {
|
||||||
|
dead = true;
|
||||||
|
downed = false;
|
||||||
|
real_dead = true;
|
||||||
|
dead_frameno = room->GetFrameNo();
|
||||||
|
DoGetDown();
|
||||||
|
if (HasBuffEffect(kBET_Camouflage)) {
|
||||||
|
RemoveBuffByEffectId(kBET_Camouflage);
|
||||||
|
}
|
||||||
|
ClearLordMode();
|
||||||
|
ClearBuffList();
|
||||||
|
room->frame_event.AddDead(this,
|
||||||
|
MetaMgr::Instance()->zbmode_revive_time * 1000);
|
||||||
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
|
room->xtimer.AddDeadLineTimerAndAttach
|
||||||
|
(MetaMgr::Instance()->zbmode_revive_time * SERVER_FRAME_RATE,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
Human* hum = (Human*)param.sender.GetUserData();
|
||||||
|
hum->Revive();
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
} else {
|
||||||
dead = true;
|
dead = true;
|
||||||
downed = false;
|
downed = false;
|
||||||
ability.hp = 0.0f;
|
ability.hp = 0.0f;
|
||||||
@ -1008,6 +1036,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
DoGetDown();
|
DoGetDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Human::DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id)
|
void Human::DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id)
|
||||||
{
|
{
|
||||||
@ -2962,6 +2991,28 @@ void Human::RecalcBuffAttr()
|
|||||||
|
|
||||||
void Human::Revive()
|
void Human::Revive()
|
||||||
{
|
{
|
||||||
|
if (room->GetRoomMode() == kZombieMode) {
|
||||||
|
dead = false;
|
||||||
|
downed = false;
|
||||||
|
real_dead = false;
|
||||||
|
ability.hp = GetMaxHP();
|
||||||
|
ClearBuffList();
|
||||||
|
{
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(kREVIVE_BUFF_ID);
|
||||||
|
if (buff_meta) {
|
||||||
|
AddBuff(buff_meta, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
room->frame_event.AddRevive(this);
|
||||||
|
room->OnHumanRevive(this);
|
||||||
|
|
||||||
|
use_skill = false;
|
||||||
|
curr_skill_phase = 0;
|
||||||
|
skill_dir = a8::Vec2();
|
||||||
|
skill_param1 = 0.0f;
|
||||||
|
playing_skill = false;
|
||||||
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
|
} else {
|
||||||
auto callback =
|
auto callback =
|
||||||
[] (const a8::XParams& param)
|
[] (const a8::XParams& param)
|
||||||
{
|
{
|
||||||
@ -2984,6 +3035,7 @@ void Human::Revive()
|
|||||||
});
|
});
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Human::ResetTankSkin()
|
void Human::ResetTankSkin()
|
||||||
{
|
{
|
||||||
|
@ -48,6 +48,7 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
|||||||
MetaData::Robot* RandRobot(std::set<int>& refreshed_robot_set);
|
MetaData::Robot* RandRobot(std::set<int>& refreshed_robot_set);
|
||||||
MetaData::AI* GetAI(int ai_level);
|
MetaData::AI* GetAI(int ai_level);
|
||||||
|
|
||||||
|
int zbmode_revive_time = 3;
|
||||||
int gas_inactive_time = 10;
|
int gas_inactive_time = 10;
|
||||||
int newbie_gas_inactive_time = 5;
|
int newbie_gas_inactive_time = 5;
|
||||||
int midbrid_gas_inactive_time = 15;
|
int midbrid_gas_inactive_time = 15;
|
||||||
|
@ -557,6 +557,9 @@ void Room::RemoveObjectLater(RoomEntity* entity)
|
|||||||
|
|
||||||
void Room::OnHumanDie(Human* hum)
|
void Room::OnHumanDie(Human* hum)
|
||||||
{
|
{
|
||||||
|
if (GetRoomMode() == kZombieMode) {
|
||||||
|
NotifyUiUpdate();
|
||||||
|
} else {
|
||||||
--alive_count_;
|
--alive_count_;
|
||||||
alive_count_chged_frameno_ = GetFrameNo();
|
alive_count_chged_frameno_ = GetFrameNo();
|
||||||
--PerfMonitor::Instance()->alive_count;
|
--PerfMonitor::Instance()->alive_count;
|
||||||
@ -564,6 +567,12 @@ void Room::OnHumanDie(Human* hum)
|
|||||||
NotifyUiUpdate();
|
NotifyUiUpdate();
|
||||||
CheckShowHand();
|
CheckShowHand();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Room::OnHumanRevive(Human* hum)
|
||||||
|
{
|
||||||
|
NotifyUiUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
bool Room::OverBorder(const a8::Vec2 pos, float radius)
|
bool Room::OverBorder(const a8::Vec2 pos, float radius)
|
||||||
{
|
{
|
||||||
|
@ -93,6 +93,7 @@ public:
|
|||||||
a8::Vec2 pos, a8::Vec2 dir, float fly_distance, bool is_tank_skin = false);
|
a8::Vec2 pos, a8::Vec2 dir, float fly_distance, bool is_tank_skin = false);
|
||||||
|
|
||||||
void OnHumanDie(Human* hum);
|
void OnHumanDie(Human* hum);
|
||||||
|
void OnHumanRevive(Human* hum);
|
||||||
bool OverBorder(const a8::Vec2 pos, float radius);
|
bool OverBorder(const a8::Vec2 pos, float radius);
|
||||||
Human* GetWatchWarTarget(Human* hum);
|
Human* GetWatchWarTarget(Human* hum);
|
||||||
bool BattleStarted();
|
bool BattleStarted();
|
||||||
|
@ -85,6 +85,8 @@ struct PlayerStats
|
|||||||
|
|
||||||
int rank = 0;
|
int rank = 0;
|
||||||
int use_skill_times = 0;
|
int use_skill_times = 0;
|
||||||
|
|
||||||
|
int dead_times = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CarObject
|
struct CarObject
|
||||||
|
Loading…
x
Reference in New Issue
Block a user