1
0
Fork 0

Paintings: add sound effects, remove critical hitting (#5276)

This commit is contained in:
Rorkh 2021-07-28 23:51:59 +03:00 committed by GitHub
parent 6a4460383e
commit 4221e08f3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 5 deletions

View File

@ -61,6 +61,7 @@ p-mcgowan
pokechu22
ProjectBM
pwnOrbitals
Rorkh
rs2k
SamJBarney
Schwertspize

View File

@ -390,6 +390,18 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
return false;
}
if (IsPainting())
{
KilledBy(a_TDI);
if (a_TDI.Attacker != nullptr)
{
a_TDI.Attacker->Killed(this);
}
return true;
}
if ((a_TDI.Attacker != nullptr) && (a_TDI.Attacker->IsPlayer()))
{
cPlayer * Player = static_cast<cPlayer *>(a_TDI.Attacker);

View File

@ -24,6 +24,8 @@ void cPainting::SpawnOn(cClientHandle & a_Client)
{
Super::SpawnOn(a_Client);
a_Client.SendPaintingSpawn(*this);
m_World->BroadcastSoundEffect("entity.painting.place", GetPosition(), 1, 1);
}
@ -41,3 +43,10 @@ void cPainting::GetDrops(cItems & a_Items, cEntity * a_Killer)
void cPainting::KilledBy(TakeDamageInfo & a_TDI)
{
Super::KilledBy(a_TDI);
m_World->BroadcastSoundEffect("entity.painting.break", GetPosition(), 1, 1);
Destroy();
}

View File

@ -28,11 +28,7 @@ private:
virtual void SpawnOn(cClientHandle & a_Client) override;
virtual void GetDrops(cItems & a_Items, cEntity * a_Killer) override;
virtual void KilledBy(TakeDamageInfo & a_TDI) override
{
Super::KilledBy(a_TDI);
Destroy();
}
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
AString m_Name;