Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Linq;
- using Turbo.Plugins.Default;
- using SharpDX.DirectInput;
- namespace Turbo.Plugins.RNN
- {
- public class ICount : BasePlugin, IKeyEventHandler, INewAreaHandler, IInGameWorldPainter
- {
- private IFont AmarilloFontm { get; set; }
- private IFont AmarilloFonth { get; set; }
- private IFont VerdeFontm { get; set; }
- private IFont VerdeFonth { get; set; }
- private IFont RojoFontm { get; set; }
- private IFont RojoFonth { get; set; }
- private IFont OrangeFontm { get; set; }
- private IFont ContadorFont { get; set; }
- private float currentYard { get; set; }
- private IKeyEvent ToggleKeyEvent { get; set; }
- private bool MapGR { get; set; } = false;
- private GroundLabelDecorator DecoratorMother { get; set; }
- private GroundLabelDecorator DecoratorSummoner { get; set; }
- private WorldDecoratorCollection CirclesMother { get; set; }
- private WorldDecoratorCollection CirclesSumm { get; set; }
- private WorldDecoratorCollection CirclesTr { get; set; }
- private WorldDecoratorCollection CirclesTR { get; set; }
- public WorldDecoratorCollection CircleAnimatedGreen { get; set; }
- public WorldDecoratorCollection CircleAnimatedRed { get; set; }
- public WorldDecoratorCollection CircleAnimatedYellow { get; set; }
- public bool OnlyGR { get; set; }
- public float XPor { get; set; }
- public float YPor { get; set; }
- public bool YardAll { get; set; }
- public bool Circles { get; set; }
- public bool Labels { get; set; }
- public bool ShowCounters { get; set; }
- public bool CircleAnimated { get; set; }
- public bool CircleAnimatedOnlyNoElites { get; set; }
- public float LineSpacing { get; set; }
- public ICount()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- XPor = 0.772f;
- YPor = 0.925f;
- OnlyGR = false; // Show only playing GR
- YardAll = false; // If it is false, only those that are at 40y/120y will be counted. Press Control to change between 40 and 120
- Circles = true; // Show circles under the mothers and summoners creatures
- Labels = true; // Show the labels "mother" and "Summ"
- CircleAnimated = true; // Show animated circles about mothers, summoners and transformers (without transforming)
- CircleAnimatedOnlyNoElites = false; // Don't show animated circles on elites
- ShowCounters = true;
- LineSpacing = 0.2f ; // space between lines
- currentYard = 40f;
- ToggleKeyEvent = Hud.Input.CreateKeyEvent(true, Key.LeftControl, true, false, false);
- VerdeFontm = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 250, 0, true, false, true);
- VerdeFonth = Hud.Render.CreateFont("tahoma", 8f, 60, 0, 250, 0, false, false, false);
- AmarilloFontm = Hud.Render.CreateFont("tahoma", 8f, 255, 255, 255, 0, true, false, true);
- AmarilloFonth = Hud.Render.CreateFont("tahoma", 8f, 80, 255, 255, 0, false, false, false);
- RojoFontm = Hud.Render.CreateFont("tahoma", 8f, 255, 255, 20, 20, true, false, true);
- RojoFonth = Hud.Render.CreateFont("tahoma", 8f, 80, 255, 20, 20, false, false, false);
- OrangeFontm = Hud.Render.CreateFont("tahoma", 8f, 250, 255, 150, 50, true, false, true);
- CircleAnimatedGreen = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 0, 155, 0, 2.5f),
- ShadowBrush = Hud.Render.CreateBrush(200, 0, 0, 0, 1),
- ShapePainter = new CircleShapePainter(Hud),
- Radius = 10f,
- RadiusTransformator = new StandardPingRadiusTransformator(Hud, 700) { RadiusMinimumMultiplier = 0.4f }
- },
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 0, 155, 0, 6, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = -1,
- RadiusTransformator = new StandardPingRadiusTransformator(Hud, 700) { RadiusMinimumMultiplier = 0.5f }
- }
- );
- CircleAnimatedRed = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(140, 255, 0, 0, 2.5f),
- ShadowBrush = Hud.Render.CreateBrush(200, 0, 0, 0, 1),
- ShapePainter = new CircleShapePainter(Hud),
- Radius = 10f,
- RadiusTransformator = new StandardPingRadiusTransformator(Hud, 700) { RadiusMinimumMultiplier = 0.4f }
- },
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(140, 255, 0, 0, 6, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = -1,
- RadiusTransformator = new StandardPingRadiusTransformator(Hud, 700) { RadiusMinimumMultiplier = 0.5f }
- }
- );
- CircleAnimatedYellow = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(250, 255, 200, 0, 2.5f),
- ShadowBrush = Hud.Render.CreateBrush(200, 0, 0, 0, 1),
- ShapePainter = new CircleShapePainter(Hud),
- Radius = 6f,
- RadiusTransformator = new StandardPingRadiusTransformator(Hud, 700) { RadiusMinimumMultiplier = 0.4f }
- },
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(250, 255, 200, 0, 5, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = -1,
- RadiusTransformator = new StandardPingRadiusTransformator(Hud, 700) { RadiusMinimumMultiplier = 0.5f }
- }
- );
- DecoratorMother = new GroundLabelDecorator(Hud)
- {
- BackgroundBrush = Hud.Render.CreateBrush(120, 255, 0, 0, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- OffsetY = 0f,
- };
- DecoratorSummoner = new GroundLabelDecorator(Hud)
- {
- BackgroundBrush = Hud.Render.CreateBrush(200, 0, 155, 0, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 255, false, false, false),
- OffsetY = 0f,
- };
- CirclesMother = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(250, 150, 150, 150, 2f),
- Radius = 0.3f
- },
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(250, 250, 0, 0, 4f),
- Radius = 0.1f
- }
- );
- CirclesSumm = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(250, 150, 150, 150, 2f),
- Radius = 0.3f
- },
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(255, 0, 255, 0, 4f),
- Radius = 0.1f
- }
- );
- CirclesTr = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(250, 150, 150, 150, 2f),
- Radius = 0.3f
- },
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(250, 250, 125, 0, 4f),
- Radius = 0.1f
- }
- );
- CirclesTR = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(250, 150, 150, 150, 2f),
- Radius = 0.3f
- },
- new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(255, 255, 255, 0, 4f),
- Radius = 0.1f
- }
- );
- }
- public void OnKeyEvent(IKeyEvent keyEvent)
- {
- if (keyEvent.IsPressed && ToggleKeyEvent.Matches(keyEvent) )
- {
- currentYard = (currentYard != 40) ? 40 : 120;
- }
- }
- public void OnNewArea(bool newGame, ISnoArea area)
- {
- MapGR = ( Hud.Game.Me.InGreaterRift && (area.HostAreaSno == 288482 || area.Sno == 288482) ) ? true : false;
- }
- public void PaintWorld(WorldLayer layer)
- {
- if ((Hud.Game.IsInGame) && (!Hud.Game.IsInTown)) {
- if ( !OnlyGR || MapGR )
- {
- var monsters = Hud.Game.AliveMonsters ;
- if (layer == WorldLayer.Ground)
- {
- var magos = 0; var esqu = 0; var madr = 0; var hijos = 0; var trans = 0; var Trans = 0;
- foreach (var monster in monsters)
- {
- switch (monster.SnoMonster.Sno) // monster sno , el actor sno está a la derecha precedido por A
- {
- case 26421: // A6638 , Deathspitter , ¿ saca 26427?
- case 26423: // A6639 , Retching Cadaver , saca 26427
- case 116426: // A6640 , Spewing Horror, amarillo , saca 202190
- case 116427: // A6641 , Dust Retcher , amarillo , saca 218796
- if (YardAll || monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard) { madr++; }
- if (Labels && monster.IsOnScreen)
- {
- DecoratorMother.OffsetY = (monster.Rarity != ActorRarity.Normal)? -40f:0f;
- DecoratorMother.Paint(monster, monster.FloorCoordinate,"Mother");
- }
- if ( CircleAnimated && (!CircleAnimatedOnlyNoElites || !monster.IsElite)) CircleAnimatedRed.Paint(layer, monster, monster.FloorCoordinate, "");
- break;
- case 26427: // A6646 , zombies de azul (Retching Cadaver)
- case 202190: // A6651 , zombies de amarillo
- case 218796: // A218795 , zombies de amarillo
- if ((monster.SummonerAcdDynamicId != 0) && (monster.Rarity == ActorRarity.Normal))
- {
- if (YardAll || monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard) { hijos++ ; }
- if (Circles && monster.IsOnScreen) CirclesMother.Paint(layer, monster, monster.FloorCoordinate, "" );
- }
- break;
- case 26283: // A5387 , Tomb Guardian , amarillo y blanco
- case 26284: // A5388 , Returned Summoner , amarillo
- case 94183: // A5389 , Tortured Summoner , azul , saca 230836
- case 144988: // A5390 , Vengeful Summoner
- if (YardAll || monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard) { magos++; }
- if (Labels && monster.IsOnScreen)
- {
- DecoratorSummoner.OffsetY = (monster.Rarity != ActorRarity.Normal)? -40f:0f; //DecoratorSummoner.OffsetY = ( (monster.Rarity == ActorRarity.Champion) || (monster.Rarity == ActorRarity.Rare))? -40f:0f;
- DecoratorSummoner.Paint(monster, monster.FloorCoordinate,"Summ");
- }
- if ( CircleAnimated && (!CircleAnimatedOnlyNoElites || !monster.IsElite)) CircleAnimatedGreen.Paint(layer, monster, monster.FloorCoordinate, "");
- break;
- case 26285: // A5393 , Creados por amarillo
- case 26286: // A5395 , Creados por blanco
- case 230836: // A230834 , arqueros de azul (Tortured Summoner)
- case 137005: // A_shield_skeleton_d
- if ((monster.SummonerAcdDynamicId != 0) && (monster.Rarity == ActorRarity.Normal))
- {
- if (YardAll || monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard) { esqu++; }
- if (Circles && monster.IsOnScreen) CirclesSumm.Paint(layer, monster, monster.FloorCoordinate, "" );
- }
- break;
- case 26364: // A6046
- case 164138: // A6048
- if (YardAll || monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard) { trans++; }
- if (Circles && monster.IsOnScreen) CirclesTr.Paint(layer, monster, monster.FloorCoordinate, "" );
- if ( CircleAnimated && (!CircleAnimatedOnlyNoElites || !monster.IsElite)) CircleAnimatedYellow.Paint(layer, monster, monster.FloorCoordinate, "");
- break;
- case 26362: // A6042
- case 164146: // A6044
- if (YardAll || monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard) { Trans++; }
- if (Circles && monster.IsOnScreen) CirclesTR.Paint(layer, monster, monster.FloorCoordinate, "" );
- break;
- default:
- break;
- }
- }
- if (ShowCounters)
- {
- var x = Hud.Window.Size.Width * XPor; var y = Hud.Window.Size.Height * YPor;
- ContadorFont = (trans + Trans > 0)? AmarilloFontm:AmarilloFonth;
- var layout = ContadorFont.GetTextLayout("Tr: " + Trans + "/" + (Trans+trans));
- ContadorFont.DrawText(layout, x, y);
- y += layout.Metrics.Height * (1 + LineSpacing);
- ContadorFont = (magos + esqu > 0)? VerdeFontm:VerdeFonth;
- layout = ContadorFont.GetTextLayout("Sum: " + magos + " (" + esqu + ")" );
- ContadorFont.DrawText(layout, x, y);
- y += layout.Metrics.Height * (1 + LineSpacing);
- ContadorFont = (madr + hijos > 0)? RojoFontm:RojoFonth;
- layout = ContadorFont.GetTextLayout("Mom: " + madr + " (" + hijos +")");
- ContadorFont.DrawText(layout, x, y);
- layout = OrangeFontm.GetTextLayout( (YardAll)? "All": (currentYard + "y"));
- x -= layout.Metrics.Width + OrangeFontm.GetTextLayout("O").Metrics.Width;
- OrangeFontm.DrawText(layout, x, y);
- }
- }
- else {
- if (CircleAnimated)
- {
- foreach (var monster in monsters)
- {
- switch (monster.SnoMonster.Sno)
- {
- case 26421:
- case 26423:
- case 116426:
- case 116427:
- if (!CircleAnimatedOnlyNoElites || !monster.IsElite) CircleAnimatedRed.Paint(layer, monster, monster.FloorCoordinate, "");
- break;
- case 26283:
- case 26284:
- case 94183:
- case 144988:
- if (!CircleAnimatedOnlyNoElites || !monster.IsElite) CircleAnimatedGreen.Paint(layer, monster, monster.FloorCoordinate, "");
- break;
- case 26364:
- case 164138:
- if (!CircleAnimatedOnlyNoElites || !monster.IsElite) CircleAnimatedYellow.Paint(layer, monster, monster.FloorCoordinate, "");
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement