-
Notifications
You must be signed in to change notification settings - Fork 17
/
MissileLauncherLoader.cs
75 lines (62 loc) · 2.38 KB
/
MissileLauncherLoader.cs
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
70
71
72
73
74
75
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
//using Terraria.GameContent.Liquid;
using Terraria.ID;
using Terraria.ModLoader.IO;
namespace MetroidMod
{
public static class MissileLauncherLoader
{
/*
internal static readonly List<ModMissileAddon> missileAddons = new();
internal static readonly List<GlobalMissileAddon> globalMissileAddons = new();
//internal static readonly List<BeamCombination> beamCombinations = new();
internal static readonly Dictionary<int, string> unloadedMissileAddons = new();
internal static bool TryGetValue(this IList<ModMissileAddon> list, int type, out ModMissileAddon modMissileAddon) =>
list.TryGetValue(i => i.Type == type, out modMissileAddon);
internal static bool TryGetValue(this IList<ModMissileAddon> list, string fullName, out ModMissileAddon modMissileAddon) =>
list.TryGetValue(i => i.FullName == fullName, out modMissileAddon);
public static int MissileCount => missileAddons.Count;
public static ModMissileAddon GetMissileAddon(int type) =>
missileAddons.TryGetValue(type, out var modMissileAddon) ? modMissileAddon : null;
public static ModMissileAddon GetMissileAddon(string fullName) =>
missileAddons.TryGetValue(fullName, out var modMissileAddon) ? modMissileAddon : null;
public static ModMissileAddon GetMissileAddon<T>() where T : ModMissileAddon =>
missileAddons.TryGetValue(i => i is T, out var modMissileAddon) ? modMissileAddon : null;
*/
public static string GetAddonSlotName(int AddonSlot)
{
return AddonSlot switch
{
0 => "Charge",
1 => "Primary",
2 => "Expansion",
_ => "Unknown"
};
}
/*
public static bool OnShoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
bool flag = true;
if (missileAddons.TryGetValue(type, out var modMissileAddon))
{
flag &= modMissileAddon.OnShoot(player, source, position, velocity, type, damage, knockback);
}
foreach (var globalMissileAddon in globalMissileAddons)
{
flag &= globalMissileAddon.OnShoot(player, source, position, velocity, type, damage, knockback);
}
return flag;
}
*/
}
}