rename buff_vec2_param1->context_pos
This commit is contained in:
parent
84adf74342
commit
80c8f92d37
@ -448,8 +448,8 @@ void Bullet::AddGunBuff()
|
||||
{
|
||||
if (sender.Get()) {
|
||||
std::shared_ptr<Ability> old_context_ability = sender.Get()->context_ability;
|
||||
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
|
||||
sender.Get()->buff_vec2_param1 = GetPos();
|
||||
a8::Vec2 old_context_pos = sender.Get()->context_pos;
|
||||
sender.Get()->context_pos = GetPos();
|
||||
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(gun_meta->i->buffid());
|
||||
if (buff_meta) {
|
||||
sender.Get()->AddBuff(sender.Get(),
|
||||
@ -457,7 +457,7 @@ void Bullet::AddGunBuff()
|
||||
1
|
||||
);
|
||||
}
|
||||
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
|
||||
sender.Get()->context_pos = old_context_pos;
|
||||
sender.Get()->context_ability = old_context_ability;
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ void InternalShot(Creature* c,
|
||||
{
|
||||
if (weapon_meta->i->_inventory_slot() == IS_TRAP ||
|
||||
weapon_meta->i->_inventory_slot() == IS_MINE) {
|
||||
a8::Vec2 old_buff_vec2_param1 = c->buff_vec2_param1;
|
||||
c->buff_vec2_param1 = c->GetPos() + c->GetAttackDir() * fly_distance;
|
||||
a8::Vec2 old_context_pos = c->context_pos;
|
||||
c->context_pos = c->GetPos() + c->GetAttackDir() * fly_distance;
|
||||
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(bullet_meta->i->buffid());
|
||||
if (buff_meta) {
|
||||
c->AddBuff(c,
|
||||
@ -32,7 +32,7 @@ void InternalShot(Creature* c,
|
||||
1
|
||||
);
|
||||
}
|
||||
c->buff_vec2_param1 = old_buff_vec2_param1;
|
||||
c->context_pos = old_context_pos;
|
||||
return;
|
||||
}
|
||||
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
||||
@ -571,7 +571,7 @@ void Creature::DoSkill(int skill_id,
|
||||
skill_distance_ = skill_distance;
|
||||
curr_skill_ = skill;
|
||||
playing_skill = true;
|
||||
buff_vec2_param1 = GetPos() + skill_dir_ * skill_distance_;
|
||||
context_pos = GetPos() + skill_dir_ * skill_distance_;
|
||||
CurrentSkill()->last_use_frameno = room->GetFrameNo();
|
||||
if (CurrentSkill()->meta->i->skill_target() == kST_Self
|
||||
) {
|
||||
@ -927,7 +927,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
case kBET_SummonObstacle:
|
||||
{
|
||||
if (!dead) {
|
||||
SummonObstacle(buff, buff->meta->param1, buff_vec2_param1);
|
||||
SummonObstacle(buff, buff->meta->param1, context_pos);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -69,7 +69,7 @@ class Creature : public MoveableEntity
|
||||
int power_idx = -1;
|
||||
|
||||
Weapon second_weapon;
|
||||
a8::Vec2 buff_vec2_param1;
|
||||
a8::Vec2 context_pos;
|
||||
std::shared_ptr<Ability> context_ability;
|
||||
|
||||
bool need_sync_active_player = false;
|
||||
|
@ -764,12 +764,12 @@ std::tuple<long long, a8::Vec2>* Obstacle::GetInteractionData(Human* sender)
|
||||
|
||||
void Obstacle::AddObstacleBuff(Creature* c)
|
||||
{
|
||||
a8::Vec2 old_buff_vec2_param1 = c->buff_vec2_param1;
|
||||
c->buff_vec2_param1 = c->GetPos();
|
||||
a8::Vec2 old_context_pos = c->context_pos;
|
||||
c->context_pos = c->GetPos();
|
||||
for (int buff_id : meta->buff_list) {
|
||||
c->TryAddBuff(c, buff_id);
|
||||
}
|
||||
c->buff_vec2_param1 = old_buff_vec2_param1;
|
||||
c->context_pos = old_context_pos;
|
||||
}
|
||||
|
||||
void Obstacle::ClearObstacleBuff(Creature* c)
|
||||
|
Loading…
x
Reference in New Issue
Block a user