Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Fountain Enemy fix #1428

Open
wants to merge 1 commit into
base: indev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,11 @@ public void AddBuff(IBuff b)
_game.PacketNotifier.NotifyNPC_BuffAdd2(b);
}
// Activate the buff for BuffScripts
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

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

MaxStacks is meant to be used inside each buff script for specific stacking behavior, and the only buffs which stack that should be activated multiple times are those with a BuffAddType of STACKS_AND_OVERLAPS (and that functionality is already implemented).

Copy link
Contributor

Choose a reason for hiding this comment

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

Although, in order to OnActivate get properly triggered multiple times, you have to give multiple calls or adding 1 stack.
OnActivate gets triggered only once regardless of how many buffs you're adding.
On other note, OnDeactivate also gets triggered only once regardless of many stacks the buff has.

Maybe we should have a few extra Functions in BuffScripts?

  • OnAddStack(int stacks)
  • OnRemoveStack(int stacks)

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently we have OnAllowAddBuff which should satisfy OnAddStack, but since we don't have an equivalent for OnRemoveStack it should be fine to add.

{
b.ActivateBuff();
}

}
// If the buff is supposed to replace any existing buff instances of the same name
else if (b.BuffAddType == BuffAddType.REPLACE_EXISTING)
Expand Down Expand Up @@ -1219,7 +1223,11 @@ public void AddBuff(IBuff b)
}

// New buff means new script, so we need to activate it.
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
{
b.ActivateBuff();
}

}
else if (b.BuffAddType == BuffAddType.RENEW_EXISTING)
{
Expand Down Expand Up @@ -1302,7 +1310,11 @@ public void AddBuff(IBuff b)
_game.PacketNotifier.NotifyNPC_BuffUpdateCount(b, b.Duration, b.TimeElapsed);
}
}
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
{
b.ActivateBuff();
}


return;
}
Expand All @@ -1326,7 +1338,11 @@ public void AddBuff(IBuff b)
_game.PacketNotifier.NotifyNPC_BuffUpdateCount(b, b.Duration, b.TimeElapsed);
}
}
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
{
b.ActivateBuff();
}

}
// If the buff is supposed to add a stack to any existing buffs of the same name and refresh their timer.
// Essentially the method is: have one parent buff which has the stacks, and just refresh its time, this means no overlapping buff instances, but functionally it is the same.
Expand Down
2 changes: 1 addition & 1 deletion GameServerLib/GameObjects/Fountain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Update(float diff)
{
if (champion.Team != Team)
{
continue;
champion.Stats.CurrentHealth -= 5000;
Copy link
Contributor

Choose a reason for hiding this comment

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

The behavior of the Fountain Turret is one which should be scripted, not designed into the system.

}

var hp = champion.Stats.CurrentHealth;
Expand Down