This commit is contained in:
aozhiwei 2022-09-11 11:15:36 +08:00
parent 2585a9ffbb
commit 672ef8d303
13 changed files with 42 additions and 43 deletions

View File

@ -96,7 +96,7 @@ void Buff::ProcBatchAddBuff()
if (rnd < std::get<1>(items[0])){
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(std::get<0>(items[0]));
if (buff_meta) {
owner->AddBuff(caster_.Get(), buff_meta, 1, nullptr);
owner->AddBuff(caster_.Get(), buff_meta, nullptr);
}
}
} else {
@ -106,7 +106,7 @@ void Buff::ProcBatchAddBuff()
if (rnd <= std::get<1>(item)) {
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(std::get<0>(item));
if (buff_meta) {
owner->AddBuff(caster_.Get(), buff_meta, 1, nullptr);
owner->AddBuff(caster_.Get(), buff_meta, nullptr);
}
break;
}
@ -145,7 +145,7 @@ void Buff::InternalTimerAddBuff()
caster.Get()->FillSkillCasterState(&old_caster_state);
caster.Get()->RecoverSkillCasterState(caster_state);
//!!!在AddBuff的过程可能删除buff导致caster_state野指针
receiver->AddBuff(caster.Get(), buff_meta, 1, skill);
receiver->AddBuff(caster.Get(), buff_meta, skill);
caster.Get()->RecoverSkillCasterState(&old_caster_state);
}

View File

@ -36,7 +36,6 @@ class Buff
MetaData::Skill* skill_meta = nullptr;
a8::XTimerAttacher xtimer_attacher;
long long add_frameno = 0;
int skill_lv = 0;
list_head effect_entry;
list_head depend_entry;
list_head cond_entry;

View File

@ -710,8 +710,7 @@ void Bullet::AddGunBuff()
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(gun_meta->i->buffid());
if (buff_meta) {
sender.Get()->AddBuff(sender.Get(),
buff_meta,
1
buff_meta
);
}
sender.Get()->context_dir = old_context_dir;

View File

@ -199,7 +199,7 @@ void Car::GetOn(Human* passenger)
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff
(driver_ == passenger ? DRIVER_BUFFID : PASSENGER_BUFFID);
if (buff_meta) {
passenger->AddBuff(passenger, buff_meta, 1);
passenger->AddBuff(passenger, buff_meta);
}
}
if (meta->i->buffid() != 0) {

View File

@ -472,6 +472,21 @@ enum BulletBornOffsetIdx_e
kBulletBornOffsetRecoilForce = 4,
};
enum MagicType_e
{
MAGIC_NONE = 0,
MAGIC_AXXF = 1, //20101 爱心香风
MAGIC_SJYDHX = 2, //20701 瞬间移动回血
MAGIC_HLYZ = 3, //20801 火力压制
MAGIC_YMCZ = 4, //20901 野蛮冲撞
MAGIC_LDFY = 5, //21001 立盾防御
MAGIC_HJHX = 6, //20201 火箭浣熊
MAGIC_FG = 7, //20401 飞勾
MAGIC_WLFB = 8, //20601 威力翻倍
MAGIC_YLZ = 9, //20301 医疗站
MAGIC_YS = 10, //20501 隐身
};
const char* const PROJ_NAME_FMT = "game%d_gameserver";
const char* const PROJ_ROOT_FMT = "/data/logs/%s";

View File

@ -156,8 +156,7 @@ void InternalShot(Creature* c,
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(bullet_meta->i->buffid());
if (buff_meta) {
c->AddBuff(c,
buff_meta,
1
buff_meta
);
}
c->context_dir = old_context_dir;
@ -363,7 +362,6 @@ int Creature::GetBuffNum(int buff_id)
int Creature::AddBuff(Creature* caster,
MetaData::Buff* buff_meta,
int skill_lv,
MetaData::Skill* buff_skill_meta,
bool no_check_immune)
{
@ -423,7 +421,6 @@ int Creature::AddBuff(Creature* caster,
Buff* buff = &a8::FastAppend(buff_list_);
buff->buff_uniid = new_buff_uniid;
buff->SetCaster(caster);
buff->skill_lv = skill_lv;
buff->owner = this;
buff->meta = buff_meta;
buff->skill_meta = buff_skill_meta;
@ -484,7 +481,7 @@ int Creature::AddBuff(Creature* caster,
for (int child_buff_id : buff->meta->child_buff_list) {
MetaData::Buff* child_buff_meta = MetaMgr::Instance()->GetBuff(child_buff_id);
if (child_buff_meta) {
AddBuff(caster, child_buff_meta, skill_lv, buff_skill_meta, true);
AddBuff(caster, child_buff_meta, buff_skill_meta, true);
}
}
}
@ -507,14 +504,14 @@ int Creature::MustBeAddBuff(Creature* caster, int buff_id)
if (!buff_meta) {
A8_ABORT();
}
return AddBuff(caster, buff_meta, 1);
return AddBuff(caster, buff_meta);
}
int Creature::TryAddBuff(Creature* caster, int buff_id)
{
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
if (buff_meta) {
return AddBuff(caster, buff_meta, 1);
return AddBuff(caster, buff_meta);
}
return -1;
}
@ -868,21 +865,21 @@ void Creature::TriggerOneObjectBuff(Skill* skill, Creature* target, BuffTriggerT
case kBuffTargetSelf: //自己
{
if (target == this) {
target->AddBuff(this, buff_meta, 1, skill->meta);
target->AddBuff(this, buff_meta, skill->meta);
}
}
break;
case kBuffTargetFriendly: //友军
{
if (target->team_id == team_id) {
target->AddBuff(this, buff_meta, 1, skill->meta);
target->AddBuff(this, buff_meta, skill->meta);
}
}
break;
case kBuffTargetEnemy: //敌军
{
if (target->team_id != team_id) {
target->AddBuff(this, buff_meta, 1, skill->meta);
target->AddBuff(this, buff_meta, skill->meta);
}
}
break;
@ -3270,7 +3267,7 @@ void Creature::_UpdateSpecMove()
if (buff) {
MetaData::Buff* new_buff = MetaMgr::Instance()->GetBuff(1039);
if (new_buff) {
AddBuff(this, new_buff, 1);
AddBuff(this, new_buff);
}
RemoveBuffByEffectId(kBET_BePull);
}

View File

@ -127,7 +127,6 @@ class Creature : public MoveableEntity
int GetBuffNum(int buff_id);
int AddBuff(Creature* caster,
MetaData::Buff* buff_meta,
int skill_lv,
MetaData::Skill* buff_skill_meta = nullptr,
bool no_check_immune = false);
bool IsImmuneBuffEffect(int buff_effect);

View File

@ -1028,6 +1028,11 @@ namespace MetaData
}
}
int Skill::GetMagicId()
{
return MAGIC_NONE;
}
bool Skill::IsTurnOverSkill()
{
return !phases.empty() && phases[0].func_id == kSkill_TurnOver;

View File

@ -283,6 +283,7 @@ namespace MetaData
std::map<int, std::set<MetaData::Buff*>> trigger_type_buffs;
std::vector<MetaData::SkillPhase> phases;
bool IsTurnOverSkill();
int GetMagicId();
};
struct SkillNumber

View File

@ -2374,7 +2374,6 @@ void Room::NotifyGameStart()
#if 0
pair.second->AddBuff(pair.second,
buff_meta,
1,
nullptr);
#endif
}
@ -3094,7 +3093,7 @@ void Room::AddPlayerPostProc(Player* hum)
for (int buff_id : MetaMgr::Instance()->newbie_buff_list) {
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
if (buff_meta) {
hum->AddBuff(hum, buff_meta, 1);
hum->AddBuff(hum, buff_meta);
}
}
if (room_type_ == RT_MidBrid) {

View File

@ -198,8 +198,8 @@ void RoomObstacle::UpdateTimerFunc()
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
if (buff_meta) {
hum->AddBuff(master.Get(),
buff_meta,
1);
buff_meta
);
}
}
}
@ -261,8 +261,8 @@ void RoomObstacle::SpecExplosion()
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
if (buff_meta) {
c->AddBuff(master.Get(),
buff_meta,
1);
buff_meta
);
}
}
}
@ -660,8 +660,8 @@ void RoomObstacle::ProcKeepRangeBuff()
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
if (buff_meta && hum->GetBuffById(buff_id)) {
hum->AddBuff(master.Get(),
buff_meta,
1);
buff_meta
);
}
}
if (hit_objects_->find(hum->GetUniId()) == hit_objects_->end()) {

View File

@ -16,21 +16,6 @@ enum SkillMinorType
SMT_BLINK = 1,
};
enum MagicType_e
{
MAGIC_NONE = 0,
MAGIC_AXXF = 1, //20101 爱心香风
MAGIC_SJYDHX = 2, //20701 瞬间移动回血
MAGIC_HLYZ = 3, //20801 火力压制
MAGIC_YMCZ = 4, //20901 野蛮冲撞
MAGIC_LDFY = 5, //21001 立盾防御
MAGIC_HJHX = 6, //20201 火箭浣熊
MAGIC_FG = 7, //20401 飞勾
MAGIC_WLFB = 8, //20601 威力翻倍
MAGIC_YLZ = 9, //20301 医疗站
MAGIC_YS = 10, //20501 隐身
};
struct xtimer_list;
class Creature;
class Skill

View File

@ -25,7 +25,7 @@ void SmokeMiTask::Check()
{
if (bomb_pos.Distance(hum->GetPos()) < gun_meta->i->bullet_rad() + hum->meta->i->radius()) {
if (!hum->HasBuffEffect(kBET_HunLuan)) {
hum->AddBuff(nullptr, buff_meta, 1, nullptr);
hum->AddBuff(nullptr, buff_meta, nullptr);
player_set.insert(hum);
}
}