1
This commit is contained in:
parent
92db366545
commit
245dbfafdb
@ -330,3 +330,65 @@ void Buff::ProcSprint(Creature* caster)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Buff::ProcSeletTargetWithSelfPos(Creature* caster)
|
||||||
|
{
|
||||||
|
std::vector<Creature*> targets;
|
||||||
|
owner->TraverseCreatures
|
||||||
|
(
|
||||||
|
[this, &targets] (Creature* c, bool& stop)
|
||||||
|
{
|
||||||
|
switch (meta->int_param1) {
|
||||||
|
case kBST_All:
|
||||||
|
{
|
||||||
|
targets.push_back(c);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kBST_Self:
|
||||||
|
{
|
||||||
|
if (c == owner) {
|
||||||
|
targets.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kBST_FriendlyIncludeSelf:
|
||||||
|
{
|
||||||
|
if (c->team_id == owner->team_id) {
|
||||||
|
targets.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kBST_FriendlyExcludeSelf:
|
||||||
|
{
|
||||||
|
if (c->team_id == owner->team_id && c != owner) {
|
||||||
|
targets.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kBST_Enemy:
|
||||||
|
{
|
||||||
|
if (c->team_id != owner->team_id) {
|
||||||
|
targets.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kBST_EnemyAndSelf:
|
||||||
|
{
|
||||||
|
if (c->team_id != owner->team_id || c == owner) {
|
||||||
|
targets.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
for (auto& target : targets) {
|
||||||
|
for (int buff_id : meta->param2_int_list) {
|
||||||
|
target->TryAddBuff(caster, buff_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -45,6 +45,7 @@ class Buff
|
|||||||
void ProcPassenger(Creature* caster);
|
void ProcPassenger(Creature* caster);
|
||||||
void ProcRemovePassenger(Creature* caster);
|
void ProcRemovePassenger(Creature* caster);
|
||||||
void ProcSprint(Creature* caster);
|
void ProcSprint(Creature* caster);
|
||||||
|
void ProcSeletTargetWithSelfPos(Creature* caster);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InternalTimerAddBuff(Creature* caster);
|
void InternalTimerAddBuff(Creature* caster);
|
||||||
|
@ -167,6 +167,18 @@ enum SkillTarget_e
|
|||||||
kST_SpecDir = 11
|
kST_SpecDir = 11
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum BuffSelectTarget_e
|
||||||
|
{
|
||||||
|
kBST_All = 0,
|
||||||
|
|
||||||
|
kBST_Self = 1,
|
||||||
|
kBST_FriendlyIncludeSelf = 2,
|
||||||
|
kBST_FriendlyExcludeSelf = 3,
|
||||||
|
|
||||||
|
kBST_Enemy = 5,
|
||||||
|
kBST_EnemyAndSelf = 6,
|
||||||
|
};
|
||||||
|
|
||||||
enum VirtualWeapon_e
|
enum VirtualWeapon_e
|
||||||
{
|
{
|
||||||
VW_SafeArea = 9000000,
|
VW_SafeArea = 9000000,
|
||||||
|
@ -54,6 +54,7 @@ enum BuffEffectType_e
|
|||||||
kBET_FlashMove = 37, //瞬间移动
|
kBET_FlashMove = 37, //瞬间移动
|
||||||
kBET_Become = 38, //变身
|
kBET_Become = 38, //变身
|
||||||
kBET_ShotCharge = 39, //射击蓄力
|
kBET_ShotCharge = 39, //射击蓄力
|
||||||
|
kBET_SelectTargetWithSelfPos = 39, //已自己坐标为中心范围内选取目标,并且批量添加buff
|
||||||
|
|
||||||
kBET_FollowMaster = 49, //跟随主人
|
kBET_FollowMaster = 49, //跟随主人
|
||||||
kBET_ThroughWall = 50, //穿墙
|
kBET_ThroughWall = 50, //穿墙
|
||||||
|
@ -938,6 +938,11 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
buff->ProcBecome(caster);
|
buff->ProcBecome(caster);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kBET_SelectTargetWithSelfPos:
|
||||||
|
{
|
||||||
|
buff->ProcSeletTargetWithSelfPos(caster);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case kBET_Driver:
|
case kBET_Driver:
|
||||||
{
|
{
|
||||||
buff->ProcDriver(caster);
|
buff->ProcDriver(caster);
|
||||||
@ -1136,6 +1141,13 @@ bool Creature::IsEnemy(Creature* target)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::TraverseCreatures(std::function<void (Creature*, bool&)> func)
|
||||||
|
{
|
||||||
|
room->grid_service->TraverseCreatures(room->GetRoomIdx(),
|
||||||
|
GetGridList(),
|
||||||
|
func);
|
||||||
|
}
|
||||||
|
|
||||||
void Creature::TraverseProperTargets(std::function<void (Creature*, bool&)> func)
|
void Creature::TraverseProperTargets(std::function<void (Creature*, bool&)> func)
|
||||||
{
|
{
|
||||||
auto callback =
|
auto callback =
|
||||||
@ -1780,6 +1792,9 @@ void Creature::GetHitEnemys(std::set<Creature*>& enemys)
|
|||||||
|
|
||||||
void Creature::AddHp(float hp)
|
void Creature::AddHp(float hp)
|
||||||
{
|
{
|
||||||
|
if (dead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
float old_health = GetHP();
|
float old_health = GetHP();
|
||||||
ability.hp += hp;
|
ability.hp += hp;
|
||||||
ability.hp = std::min(GetHP(), GetMaxHP());
|
ability.hp = std::min(GetHP(), GetMaxHP());
|
||||||
|
@ -134,6 +134,7 @@ class Creature : public MoveableEntity
|
|||||||
int GetActionType() { return action_type; }
|
int GetActionType() { return action_type; }
|
||||||
int GetActionTargetId() { return action_target_id; }
|
int GetActionTargetId() { return action_target_id; }
|
||||||
|
|
||||||
|
void TraverseCreatures(std::function<void (Creature*, bool&)> func);
|
||||||
void TraverseProperTargets(std::function<void (Creature*, bool&)> func);
|
void TraverseProperTargets(std::function<void (Creature*, bool&)> func);
|
||||||
void TraverseProperTargetsNoTeammate(std::function<void (Creature*, bool&)> func);
|
void TraverseProperTargetsNoTeammate(std::function<void (Creature*, bool&)> func);
|
||||||
CreatureWeakPtrChunk* GetWeakPtrChunk() { return &weak_ptr_chunk_; };
|
CreatureWeakPtrChunk* GetWeakPtrChunk() { return &weak_ptr_chunk_; };
|
||||||
|
@ -644,6 +644,10 @@ namespace MetaData
|
|||||||
param2 = a8::XValue(i->buff_param2()).GetDouble();
|
param2 = a8::XValue(i->buff_param2()).GetDouble();
|
||||||
param3 = a8::XValue(i->buff_param3()).GetDouble();
|
param3 = a8::XValue(i->buff_param3()).GetDouble();
|
||||||
param4 = a8::XValue(i->buff_param4()).GetDouble();
|
param4 = a8::XValue(i->buff_param4()).GetDouble();
|
||||||
|
int_param1 = a8::XValue(i->buff_param1());
|
||||||
|
int_param2 = a8::XValue(i->buff_param2());
|
||||||
|
int_param3 = a8::XValue(i->buff_param3());
|
||||||
|
int_param4 = a8::XValue(i->buff_param4());
|
||||||
{
|
{
|
||||||
std::vector<std::string> strings;
|
std::vector<std::string> strings;
|
||||||
a8::Split(i->immune_buffeffect_list(), strings, '|');
|
a8::Split(i->immune_buffeffect_list(), strings, '|');
|
||||||
|
@ -180,6 +180,10 @@ namespace MetaData
|
|||||||
float param2 = 0.0f;
|
float param2 = 0.0f;
|
||||||
float param3 = 0.0f;
|
float param3 = 0.0f;
|
||||||
float param4 = 0.0f;
|
float param4 = 0.0f;
|
||||||
|
int int_param1 = 0;
|
||||||
|
int int_param2 = 0;
|
||||||
|
int int_param3 = 0;
|
||||||
|
int int_param4 = 0;
|
||||||
std::vector<int> param1_int_list;
|
std::vector<int> param1_int_list;
|
||||||
std::vector<int> param2_int_list;
|
std::vector<int> param2_int_list;
|
||||||
std::vector<std::tuple<int, std::vector<std::tuple<int, int>>>> batch_add_list;
|
std::vector<std::tuple<int, std::vector<std::tuple<int, int>>>> batch_add_list;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user