-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathModMissileAddon.cs
93 lines (81 loc) · 2.48 KB
/
ModMissileAddon.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using System;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ModLoader;
using MetroidMod.Default;
using MetroidMod.ID;
namespace MetroidMod
{
/*
public abstract class ModMissileAddon : ModType
{
public int Type { get; private set; }
internal void ChangeType(int type) => Type = type;
/// <summary>
/// The <see cref="ModItem"/> this addon controls.
/// </summary>
public ModItem Item;
/// <summary>
/// The <see cref="ModTile"/> this addon controls.
/// </summary>
public ModTile Tile;
public int ItemType { get; internal set; }
public int TileType { get; internal set; }
/// <summary>
/// The translations for the display name of this item.
/// </summary>
public ModTranslation DisplayName { get; internal set; }
/// <summary>
/// The translations for the tooltip of this item.
/// </summary>
public ModTranslation Tooltip { get; internal set; }
public abstract string PowerBeamTexture { get; }
public abstract bool AddOnlyMissileItem { get; }
public override sealed void SetupContent()
{
//Textures = new Asset<Texture2D>[4];
SetStaticDefaults();
}
public override void Load()
{
Item = new MissileAddonItem(this);
Tile = new MissileAddonTile(this);
if (Item == null) { throw new Exception("WTF happened here? MissileAddonItem is null!"); }
if (Tile == null) { throw new Exception("WTF happened here? MissileAddonTile is null!"); }
Mod.AddContent(Item);
Mod.AddContent(Tile);
}
protected override sealed void Register()
{
DisplayName = LocalizationLoader.CreateTranslation(Mod, $"SuitAddonName.{Name}");
Tooltip = LocalizationLoader.CreateTranslation(Mod, $"SuitAddonTooltip.{Name}");
if (!AddOnlyMissileItem)
{
Type = MissileLauncherLoader.MissileCount;
if (Type > 127)
{
throw new Exception("Missile Limit Reached. (Max: 128)");
}
MissileLauncherLoader.missileAddons.Add(this);
}
Mod.Logger.Info("Register new Missile: " + FullName + ", OnlyMissileItem: " + AddOnlyMissileItem);
}
public override void SetStaticDefaults() => base.SetStaticDefaults();
public virtual void OnHit(Entity entity)
{
}
public virtual bool OnShoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
return true;
}
public virtual bool CanUse(Player player)
{
return true;
}
}
*/
}