爆炸战前无伤害
This commit is contained in:
parent
0c51f6badb
commit
01803f1290
@ -24,6 +24,7 @@ void Explosion::IndifferenceAttack(Room* room,
|
|||||||
dmg_ = dmg;
|
dmg_ = dmg;
|
||||||
center_ = center;
|
center_ = center;
|
||||||
special_damage_type_ = special_damage_type;
|
special_damage_type_ = special_damage_type;
|
||||||
|
create_frameno_ = room_->GetFrameNo();
|
||||||
InternalAttack();
|
InternalAttack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ void Explosion::EnemyAndObstacleAttack(CreatureWeakPtr& sender,
|
|||||||
dmg_ = dmg;
|
dmg_ = dmg;
|
||||||
center_ = center;
|
center_ = center;
|
||||||
special_damage_type_ = special_damage_type;
|
special_damage_type_ = special_damage_type;
|
||||||
|
create_frameno_ = room_->GetFrameNo();
|
||||||
InternalAttack();
|
InternalAttack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,3 +124,8 @@ void Explosion::InternalAttack()
|
|||||||
target->OnExplosionHit(this);
|
target->OnExplosionHit(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Explosion::IsPreBattleExplosion()
|
||||||
|
{
|
||||||
|
return create_frameno_ <= room_->GetBattleStartFrameNo();
|
||||||
|
}
|
||||||
|
@ -12,6 +12,7 @@ class Explosion
|
|||||||
CreatureWeakPtr GetSender() { return sender_; };
|
CreatureWeakPtr GetSender() { return sender_; };
|
||||||
float GetDmg() { return dmg_; };
|
float GetDmg() { return dmg_; };
|
||||||
long long GetSpecialDamageType() { return special_damage_type_; };
|
long long GetSpecialDamageType() { return special_damage_type_; };
|
||||||
|
bool IsPreBattleExplosion();
|
||||||
|
|
||||||
void IndifferenceAttack(Room* room,
|
void IndifferenceAttack(Room* room,
|
||||||
const a8::Vec2& center,
|
const a8::Vec2& center,
|
||||||
@ -37,4 +38,5 @@ class Explosion
|
|||||||
float dmg_ = 0;
|
float dmg_ = 0;
|
||||||
a8::Vec2 center_;
|
a8::Vec2 center_;
|
||||||
long long special_damage_type_ = 0;
|
long long special_damage_type_ = 0;
|
||||||
|
long long create_frameno_ = 0;
|
||||||
};
|
};
|
||||||
|
@ -86,6 +86,14 @@ void Hero::OnExplosionHit(Explosion* e)
|
|||||||
if (dead) {
|
if (dead) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (e->IsPreBattleExplosion()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (HasBuffEffect(kBET_Jump) ||
|
||||||
|
HasBuffEffect(kBET_Fly)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||||
float dmg = e->GetDmg();
|
float dmg = e->GetDmg();
|
||||||
float def = GetDef() * (1 + GetAbility()->GetAttrRate(kHAT_Def)) +
|
float def = GetDef() * (1 + GetAbility()->GetAttrRate(kHAT_Def)) +
|
||||||
@ -118,6 +126,11 @@ void Hero::OnBulletHit(Bullet* bullet)
|
|||||||
if (IsInvincible()) {
|
if (IsInvincible()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (HasBuffEffect(kBET_Jump) ||
|
||||||
|
HasBuffEffect(kBET_Fly)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||||
if (!IsDead(room) && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
if (!IsDead(room) && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
||||||
float dmg = bullet->GetAtk();
|
float dmg = bullet->GetAtk();
|
||||||
|
@ -3602,6 +3602,11 @@ void Human::OnBulletHit(Bullet* bullet)
|
|||||||
bullet->sender.Get()->GetRace() == GetRace()) {
|
bullet->sender.Get()->GetRace() == GetRace()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (HasBuffEffect(kBET_Jump) ||
|
||||||
|
HasBuffEffect(kBET_Fly)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||||
if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
||||||
float old_hp = GetHP();
|
float old_hp = GetHP();
|
||||||
@ -3658,6 +3663,14 @@ void Human::OnExplosionHit(Explosion* e)
|
|||||||
if (dead) {
|
if (dead) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (e->IsPreBattleExplosion()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (HasBuffEffect(kBET_Jump) ||
|
||||||
|
HasBuffEffect(kBET_Fly)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||||
float dmg = e->GetDmg();
|
float dmg = e->GetDmg();
|
||||||
float def = GetDef() * (1 + GetAbility()->GetAttrRate(kHAT_Def)) +
|
float def = GetDef() * (1 + GetAbility()->GetAttrRate(kHAT_Def)) +
|
||||||
|
@ -475,6 +475,7 @@ void Obstacle::OnBulletHit(Bullet* bullet)
|
|||||||
if (bullet->IsPreBattleBullet()) {
|
if (bullet->IsPreBattleBullet()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsDead(bullet->room) &&
|
if (!IsDead(bullet->room) &&
|
||||||
!IsTerminatorAirDropBox(bullet->room)) {
|
!IsTerminatorAirDropBox(bullet->room)) {
|
||||||
if (meta->receive_special_damage_type != 0 &&
|
if (meta->receive_special_damage_type != 0 &&
|
||||||
@ -556,6 +557,9 @@ void Obstacle::OnExplosionHit(Explosion* e)
|
|||||||
((e->GetSpecialDamageType() & meta->receive_special_damage_type) == 0)) {
|
((e->GetSpecialDamageType() & meta->receive_special_damage_type) == 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (e->IsPreBattleExplosion()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
float dmg = e->GetDmg();
|
float dmg = e->GetDmg();
|
||||||
float def = 0;
|
float def = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user