Skip to content

Instantly share code, notes, and snippets.

@DynamicField
Created March 12, 2018 19:15
Show Gist options
  • Save DynamicField/f074209549ccfa2a05abd40960c33cd0 to your computer and use it in GitHub Desktop.
Save DynamicField/f074209549ccfa2a05abd40960c33cd0 to your computer and use it in GitHub Desktop.
DONG
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using HeimDotGG.Models;
using RiotSharp.Endpoints.MatchEndpoint;
using RiotSharp.Misc;
namespace HeimDotGG.Analysers
{
public class LaneStandingAnalyser : DuelAnalyserBase
{
public LaneStandingAnalyser(HeimerReviewModel reviewModel) : base(reviewModel) { }
public LaneStandingAnalyser(Participant ally, Participant enemy, Region server = Region.euw) : base(ally, enemy, server) { }
public override async Task<List<MatchTip>> GetTips()
{
// Initializing tips
var tips = new List<MatchTip>(2);
// Gathering damage difference to then later evaluate their standing.
var enemyChampionDamagedReceived = EnemyChampion.Timeline.DamageTakenPerMinDeltas["0-10"] * 10;
var allyChampionEarlyGameDamageDiff = AllyChampion.Timeline.DamageTakenPerMinDeltas["0-10"] * 10 - EnemyChampion.Timeline.DamageTakenPerMinDeltas["0-10"] * 10;
// Add a tip about that, if our little heim in bad standing :(.
if (allyChampionEarlyGameDamageDiff > 200)
{
tips.Add(new MatchTip(
"You took a bit more damage than your opponent early, consider playing safer and avoid being poked by minions.",
MatchTip.TipType.Negative));
}
// Else, give that boi a good mention if he did nice poke :) !
else if (allyChampionEarlyGameDamageDiff < -275)
{
var diff = allyChampionEarlyGameDamageDiff; // Readability
tips.Add(new MatchTip(
$"You did great damage to your opponent early, " +
$"while keeping your health high, and doing a difference of {-diff} damage, good job !",
MatchTip.TipType.Positive));
}
// Or, if their lanes weren't very pokey, well....
else
{
tips.Add(new MatchTip("Your lane was pretty equal.", MatchTip.TipType.Neutral));
}
// If heim didn't poke at all :(
if (enemyChampionDamagedReceived < 420) // 420 yeeee boiii
{
tips.Add(new MatchTip(
"You didn't poke much your opponent. Try to use your poke power !",
MatchTip.TipType.MediumNegative,
"You can make use of your grenade more often to harass your enemy, as well as your rockets, " +
"which you can try to use on a low minion, that will probably hit your opponent."));
}
// Get their cs diff for their early game.
var allyChampionMinionsDiffEarly = AllyChampion.Timeline.CreepsPerMinDeltas["0-10"] * 10 - EnemyChampion.Timeline.CreepsPerMinDeltas["0-10"] * 10;
// If our poor heim missed some cs...
if (allyChampionMinionsDiffEarly <= -10)
{
var diff = allyChampionMinionsDiffEarly;
tips.Add(new MatchTip(
$"You missed a lot of creeps ({diff}), make better use of your turrets and last-hit !",
MatchTip.TipType.Negative));
}
// or if his lane was very great !
else if (allyChampionMinionsDiffEarly >= 10)
{
var diff = allyChampionMinionsDiffEarly;
tips.Add(new MatchTip(
$"You greatly got {diff} cs more than your opponent !",
MatchTip.TipType.Positive));
}
// But in another case, if their cs were similar...
else if (allyChampionMinionsDiffEarly >= -5 && allyChampionMinionsDiffEarly <= 5) // between -5 and 5
{
tips.Add(new MatchTip(
"Both of your creep scores were almost the same... Heimer has a great zoning potential !",
MatchTip.TipType.Neutral,
"Try to deny more cs from your opponent by using your turrets and grenade to block him from getting cs."));
}
// Give all the tips.
return await Task.FromResult(tips);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment