-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEffectHelper.cs
More file actions
69 lines (56 loc) · 2.92 KB
/
EffectHelper.cs
File metadata and controls
69 lines (56 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System.Collections.Generic;
using System.Numerics;
using System.Linq;
using ExileCore;
using ExileCore.PoEMemory;
using ExileCore.PoEMemory.Components;
using ExileCore.Shared.Enums;
using ImGuiNET;
namespace RitualVessels;
public class EffectHelper(
GameController gameController,
Graphics graphics
)
{
private void DrawHazard(string text, Vector2 screenPos, Vector3 worldPos, float radius, int segments, int score, SharpDX.Color color = default)
{
ImGui.PushFont(ImGui.GetIO().Fonts.Fonts[0]);
var textSize = ImGui.CalcTextSize(text);
ImGui.PopFont();
var textPosition = screenPos with { Y = screenPos.Y - textSize.Y - 20 };
var glowColor = color with { A = 100 };
graphics.DrawTextWithBackground(text, textPosition with { X = textPosition.X + 2, Y = textPosition.Y + 2 }, glowColor, FontAlign.Center, SharpDX.Color.Transparent);
graphics.DrawTextWithBackground(text, textPosition with { X = textPosition.X - 2, Y = textPosition.Y - 2 }, glowColor, FontAlign.Center, SharpDX.Color.Transparent);
graphics.DrawTextWithBackground(text, textPosition, color, FontAlign.Center, SharpDX.Color.Black with { A = 240 });
var circleAlpha = (byte)60;
if (score >= 300)
{
circleAlpha = (byte)255;
graphics.DrawFilledCircleInWorld(worldPos, radius * 0.1f, color with { A = 80 }, segments);
}
graphics.DrawCircleInWorld(worldPos, radius * 0.4f, color with { A = circleAlpha }, 5.0f, segments);
}
public void DrawRitualSize(Dictionary<long, int> ritualScores)
{
var terrainEntityList = gameController?.EntityListWrapper?.ValidEntitiesByType[EntityType.Terrain] ?? [];
var ingameIconEntityList = gameController?.EntityListWrapper?.ValidEntitiesByType[EntityType.IngameIcon] ?? [];
var hasNamelessAo = ingameIconEntityList.Any(entity =>
entity.Metadata.Contains("Metadata/Terrain/Leagues/Ritual/RitualRuneInteractable") &&
entity.GetComponent<Animated>()?.BaseAnimatedObjectEntity?.Path?.Contains("Metadata/Effects/Spells/monsters_effects/League_Ritual/ritual_rune/runetypes/ritual_rune_nameless1.ao") == true);
var color = hasNamelessAo ? SharpDX.Color.LimeGreen with { A = 255 } : SharpDX.Color.Gray with { A = 120 };
foreach (var entity in terrainEntityList)
{
if (entity.DistancePlayer >= 150)
continue;
var pos = RemoteMemoryObject.pTheGame.IngameState.Camera.WorldToScreen(entity.PosNum);
if (entity.Metadata.Contains("Metadata/Terrain/Leagues/Ritual/RitualRuneObject"))
{
if (ritualScores[entity.Id] >= 300)
{
color = SharpDX.Color.Orange;
}
DrawHazard($" RITUAL SCORE: {ritualScores[entity.Id]}", pos, entity.PosNum, 2500.0f, 50, ritualScores[entity.Id], color);
}
}
}
}