1
This commit is contained in:
parent
5677b168a5
commit
9c122135cf
@ -6,6 +6,7 @@
|
|||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "collider.h"
|
#include "collider.h"
|
||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
|
#include "incubator.h"
|
||||||
|
|
||||||
int Buff::GetLeftTime()
|
int Buff::GetLeftTime()
|
||||||
{
|
{
|
||||||
@ -145,6 +146,24 @@ void Buff::ProcSummonHero(Creature* caster)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Buff::ProcBeRecycle(Creature* caster)
|
||||||
|
{
|
||||||
|
owner->room->xtimer.AddRepeatTimerAndAttach
|
||||||
|
(
|
||||||
|
SERVER_FRAME_RATE * 2,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
Buff* buff = (Buff*)param.sender.GetUserData();
|
||||||
|
if (buff->owner->IsHuman()) {
|
||||||
|
buff->owner->room->GetIncubator()->RecycleAndroid((Human*)buff->owner);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
bool Buff::NeedSync(Human* hum)
|
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);
|
||||||
|
@ -36,6 +36,7 @@ class Buff
|
|||||||
void ProcIntervalAddBuff(Creature* caster);
|
void ProcIntervalAddBuff(Creature* caster);
|
||||||
void ProcBatchAddBuff(Creature* caster);
|
void ProcBatchAddBuff(Creature* caster);
|
||||||
void ProcSummonHero(Creature* caster);
|
void ProcSummonHero(Creature* caster);
|
||||||
|
void ProcBeRecycle(Creature* caster);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InternalTimerAddBuff(Creature* caster);
|
void InternalTimerAddBuff(Creature* caster);
|
||||||
|
@ -874,6 +874,11 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
buff->ProcBatchAddBuff(caster);
|
buff->ProcBatchAddBuff(caster);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kBET_BeRecycle:
|
||||||
|
{
|
||||||
|
buff->ProcBeRecycle(caster);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -1056,9 +1056,6 @@ void Human::DoJump()
|
|||||||
MustBeAddBuff(this, JUMP_BUFFID);
|
MustBeAddBuff(this, JUMP_BUFFID);
|
||||||
jump_frameno_ = room->GetFrameNo();
|
jump_frameno_ = room->GetFrameNo();
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
if (IsAndroid() && team_uuid.empty()) {
|
|
||||||
MustBeAddBuff(this, kBeRecycleBuffId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3226,6 +3223,9 @@ void Human::OnLand()
|
|||||||
}
|
}
|
||||||
SetPos(old_pos);
|
SetPos(old_pos);
|
||||||
}
|
}
|
||||||
|
if (IsAndroid() && team_uuid.empty()) {
|
||||||
|
MustBeAddBuff(this, kBeRecycleBuffId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::NextReload(int prev_weapon_id, int prev_weapon_idx)
|
void Human::NextReload(int prev_weapon_id, int prev_weapon_idx)
|
||||||
|
@ -12,6 +12,11 @@ void Incubator::UnInit()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Incubator::RecycleAndroid(Human* hum)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Incubator::AddHoldHuman(Human* hum)
|
void Incubator::AddHoldHuman(Human* hum)
|
||||||
{
|
{
|
||||||
hold_humans_.insert(hum);
|
hold_humans_.insert(hum);
|
||||||
|
@ -9,6 +9,9 @@ class Incubator
|
|||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
|
void RecycleAndroid(Human* hum);
|
||||||
|
|
||||||
|
private:
|
||||||
void AddHoldHuman(Human* hum);
|
void AddHoldHuman(Human* hum);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -170,6 +170,7 @@ public:
|
|||||||
int GetOnlinePlayerNum();
|
int GetOnlinePlayerNum();
|
||||||
RoomObstacle* CreateObstacle(int id, float x, float y);
|
RoomObstacle* CreateObstacle(int id, float x, float y);
|
||||||
int AllocUniid();
|
int AllocUniid();
|
||||||
|
Incubator* GetIncubator() { return incubator_;};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ShuaAndroid();
|
void ShuaAndroid();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user