Skip to content

Commit

Permalink
voodoos full armor doubles voodoos spirit time
Browse files Browse the repository at this point in the history
  • Loading branch information
teoman002 committed Mar 24, 2019
1 parent 8b85533 commit e5b2e3e
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/game/server/entities/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,13 @@ void CCharacter::FireWeapon()

pTarget->m_EmoteType = EMOTE_HAPPY;
pTarget->m_EmoteStop = Server()->Tick() + Server()->TickSpeed();

if(pTarget->GetClass() == PLAYERCLASS_VOODOO)
{
int alivefactor = m_Armor * 2;
pTarget->m_VoodooTimeAlive = (Server()->TickSpeed()*g_Config.m_InfVoodooAliveTime * alivefactor) / 10;

This comment has been minimized.

Copy link
@bretonium

bretonium Mar 26, 2019

Collaborator

This is super weird.

Why do we use m_Armor? m_Armor is the armor of the healing zombie, not armor of the zombie being healed.

Assuming we fix the bug mentioned above, why do we set voodoo alivetime like this? Suppose the following happens:

  1. Voodoo gets spawned, its alivetime is N
  2. Voodoo gets healed to 3 armor, its alivetime is... N * 3 * 2 / 10 = N * 0.6. So... less than before the healing?

Or the following:

  1. Voodoo get healed to max armor, its alivetime becomes x2.
  2. Voodoo gets shot to 5 health and 0 armor. Its alivetime is still x2
  3. Voodoo gets healed to 10 health and 1 armor, so its alivetime is x0.1 now, which is less than before the healing.

The idea proposed by me in the bugreport was very raw. It should have been thought through and various scenarios should have been discussed.

This comment has been minimized.

Copy link
@teoman002

teoman002 Mar 26, 2019

Author Collaborator

Yea you are right. I thought it would be an easy fix, but obviously it isn't. Let's revert the commit.

}

}

if(!pTarget->GetPlayer()->HookProtectionEnabled())
Expand Down Expand Up @@ -1675,16 +1682,19 @@ void CCharacter::Tick()
//~ }
//~ else
//~ m_InWater = 0;
// Delayed Death
if(GetClass() == PLAYERCLASS_VOODOO && m_VoodooAboutToDie && m_VoodooTimeAlive > 0)
{
m_VoodooTimeAlive-=1000;
}
else if(GetClass() == PLAYERCLASS_VOODOO && m_VoodooAboutToDie && m_VoodooTimeAlive <= 0)
{
Die(m_VoodooKiller, m_VoodooWeapon);

if(GetClass() == PLAYERCLASS_VOODOO)
{
// Delayed Death
if(m_VoodooAboutToDie)
{
m_VoodooTimeAlive-=1000;

if(m_VoodooTimeAlive <= 0)
Die(m_VoodooKiller, m_VoodooWeapon);
}
}

// Display time left to live
if(GetClass() == PLAYERCLASS_VOODOO && m_VoodooAboutToDie)
{
Expand Down

1 comment on commit e5b2e3e

@teoman002
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closed #137

Please sign in to comment.