1
This commit is contained in:
parent
9991af795a
commit
6a08b4bd6b
@ -35,6 +35,7 @@
|
||||
#include "buff/reverse.h"
|
||||
#include "buff/select_target_with_self_pos.h"
|
||||
#include "buff/sprint.h"
|
||||
#include "buff/summon_loot.h"
|
||||
#include "buff/summon_hero.h"
|
||||
#include "buff/summon_obstacle.h"
|
||||
#include "buff/turnover.h"
|
||||
@ -49,6 +50,8 @@
|
||||
std::shared_ptr<Buff> BuffFactory::MakeBuff(const mt::Buff* buff_meta)
|
||||
{
|
||||
switch (buff_meta->buff_effect()) {
|
||||
case kBET_SummonLoot:
|
||||
return std::make_shared<SummonLootBuff>();
|
||||
case kBET_AddCarBuff:
|
||||
return std::make_shared<AddCarBuff>();
|
||||
case kBET_AddInventory:
|
||||
|
@ -104,11 +104,6 @@ void CallFuncBuff::Activate()
|
||||
ProcLightCircle();
|
||||
}
|
||||
break;
|
||||
case BuffCallFunc_e::kCreateLoot:
|
||||
{
|
||||
ProcCreateLoot();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
@ -565,8 +560,3 @@ void CallFuncBuff::ProcLightCircle()
|
||||
context->keep_buff_uniid = owner->TryAddBuff(GetCaster().Get(), meta->_int_buff_param4, skill_meta);
|
||||
}
|
||||
}
|
||||
|
||||
void CallFuncBuff::ProcCreateLoot()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -16,8 +16,7 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int,
|
||||
kAddHp = 11,
|
||||
kFlashMoveToPos = 12,
|
||||
kLightCircle = 13,
|
||||
kDmgAddition = 14,
|
||||
kCreateLoot = 15
|
||||
kDmgAddition = 14
|
||||
);
|
||||
|
||||
|
||||
@ -38,7 +37,6 @@ class CallFuncBuff : public Buff
|
||||
void ProcAddHp();
|
||||
void ProcFlashMoveToPos();
|
||||
void ProcLightCircle();
|
||||
void ProcCreateLoot();
|
||||
|
||||
float hold_param2_ = 0.0;
|
||||
};
|
||||
|
40
server/gameserver/buff/summon_loot.cc
Normal file
40
server/gameserver/buff/summon_loot.cc
Normal file
@ -0,0 +1,40 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "buff/summon_loot.h"
|
||||
|
||||
#include "creature.h"
|
||||
#include "room.h"
|
||||
#include "loot.h"
|
||||
|
||||
#include "mt/Buff.h"
|
||||
#include "mt/Equip.h"
|
||||
|
||||
void SummonLootBuff::Activate()
|
||||
{
|
||||
if (!owner->dead || meta->dead_valid() != 0) {
|
||||
int equip_id = meta->_int_buff_param1;
|
||||
float x = meta->GetBuffParam2(this);
|
||||
float y = meta->GetBuffParam3(this);
|
||||
float z = meta->GetBuffParam4(this);
|
||||
int flag = meta->_int_buff_param5;
|
||||
float show_time = meta->GetBuffParam5(this);
|
||||
const mt::Equip* equip_meta = mt::Equip::GetById(equip_id);
|
||||
if (equip_meta) {
|
||||
int loot_uniid = owner->room->CreateLoot
|
||||
(
|
||||
equip_id,
|
||||
glm::vec3(x, y, z),
|
||||
1,
|
||||
1
|
||||
);
|
||||
Entity* e = owner->room->GetEntityByUniId(loot_uniid);
|
||||
if (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SummonLootBuff::Deactivate()
|
||||
{
|
||||
}
|
12
server/gameserver/buff/summon_loot.h
Normal file
12
server/gameserver/buff/summon_loot.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "buff.h"
|
||||
|
||||
class SummonLootBuff : public Buff
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void Activate() override;
|
||||
virtual void Deactivate() override;
|
||||
|
||||
};
|
@ -32,7 +32,7 @@ A8_DECLARE_ENUM(SpecBuffId_e,
|
||||
|
||||
A8_DECLARE_ENUM(BuffEffectType_e,
|
||||
kBET_Begin = 0,
|
||||
kBET_UnUse1 = 1,
|
||||
kBET_SummonLoot = 1,
|
||||
kBET_TurnOver = 2, //翻滚
|
||||
kBET_UnUse3 = 3,
|
||||
kBET_Invincible = 4, //无敌
|
||||
|
Loading…
x
Reference in New Issue
Block a user