Skip to content

Commit

Permalink
EEL.
Browse files Browse the repository at this point in the history
  • Loading branch information
webmilio committed Mar 29, 2019
1 parent 193da11 commit 514398f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ private static void Main(string[] args)
Instance = new Program(args);
Instance.Start();
}


private readonly Random _random = new Random();
private readonly float[] _recentHealth = new float[25];
private DateTime _lastRunesSound = new DateTime(0);
private int _midasTimer = 0;
Expand Down Expand Up @@ -119,6 +120,16 @@ private void GSL_OnNewGameState(GameState gameState)
PlaySound(Properties.Resources.wefuckinglost);
}

int healthPercentage = gameState.Hero.HealthPercent;

// On Player Heal
if (PreviousGameState != null && gameState.Previously.Hero.Health != 0 && // Previous State health must be higher than 0 (not dead/wraith king passive).
gameState.Hero.Health - PreviousGameState.Hero.Health > 200 && // Hero must have gained at least 200 health.
healthPercentage - PreviousGameState.Hero.HealthPercent > 5 && // Hero must have gained at least 5% of its health.
_random.NextDouble() <= 0.33)
PlaySound(Properties.Resources.eel);


// Midas Check
foreach (Item item in gameState.Items.Inventory)
{
Expand Down
9 changes: 9 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="eel" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sounds\Processed\eel.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="npc_dota_hero_abaddon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Sounds\Processed\npc_dota_hero\npc_dota_hero_abaddon.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
Expand Down
Binary file added Sounds/Processed/eel.wav
Binary file not shown.
3 changes: 3 additions & 0 deletions Webmilio.Dota2.AdmiralBulldog.CustomVoice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,8 @@
<ItemGroup>
<None Include="Sounds\Processed\useyourmidas.wav" />
</ItemGroup>
<ItemGroup>
<None Include="Sounds\Processed\eel.wav" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

0 comments on commit 514398f

Please sign in to comment.