-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.cs
More file actions
64 lines (52 loc) · 1.8 KB
/
Module.cs
File metadata and controls
64 lines (52 loc) · 1.8 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
using MonoMod.RuntimeDetour;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using UnityEngine;
namespace MirrorMadness
{
public class Module : ETGModule
{
public static readonly string MOD_NAME = "Mirror Madness";
public static readonly string VERSION = "1.0.0";
public static readonly string TEXT_COLOR = "#00FFFF";
public override void Start()
{
var StartHook = new Hook(
typeof(BehaviorSpeculator).GetMethod("Start", BindingFlags.Instance | BindingFlags.NonPublic),
typeof(Module).GetMethod("StartHookSB", BindingFlags.Static | BindingFlags.NonPublic));
Log($"{MOD_NAME} v{VERSION} started successfully.", TEXT_COLOR);
}
private static void StartHookSB(Action<BehaviorSpeculator> orig, BehaviorSpeculator self)
{
float hp = 15;
if (self.healthHaver)
{
hp = self.healthHaver.GetMaxHealth() / 3;
}
if (!self.healthHaver.IsBoss)
{
self.AttackBehaviors.Add(new MirrorImageBehavior
{
NumImages = 2,
MaxImages = 3,
MirrorHealth = hp,
SpawnDelay = 0.5f,
SplitDelay = 1,
SplitDistance = 1.25f,
AnimRequiresTransparency = true,
Cooldown = 8,
});
}
orig(self);
}
public static void Log(string text, string color="FFFFFF")
{
ETGModConsole.Log($"<color={color}>{text}</color>");
}
public override void Exit() { }
public override void Init() { }
}
}