This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathL2IP.cs
78 lines (64 loc) · 2.16 KB
/
L2IP.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
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace LEdit
{
public class L2IP
{
#region STATIC
public const int Count = 0xA8;
public const long TableOffset = 0x20F11;
//public const long TableOffset_New = 0x308000;
public const byte Bank = 0x84;
static L2IP[] IP = new L2IP[Count];
public static L2IP Get(int n)
{
if (n >= 0 && n < Count)
return IP[n];
else
return null;
}
public static void Set(int n, L2IP ip)
{
if (n >= 0 && n < Count)
IP[n] = ip;
}
public static void InitROM(BinaryReader br)
{
for (int i = 0; i < Count; i++)
{
br.BaseStream.Seek(TableOffset + (i << 1), SeekOrigin.Begin);
SNESExLoROMAddress rom_addr = new SNESExLoROMAddress(Bank, br.ReadUInt16());
br.BaseStream.Seek(rom_addr.ToPCAddress(), SeekOrigin.Begin);
IP[i] = new L2IP(br);
}
}
#endregion
ushort effect;
public ushort Effect { get { return effect; } set { effect = value; } }
byte anim;
public byte Animation { get { return anim; } set { anim = value; } }
byte targeting_cursor;
public byte TargetingCursor { get { return targeting_cursor; } set { targeting_cursor = value; } }
byte targeting_mode;
public byte TargetingMode { get { return targeting_mode; } set { targeting_mode = value; } }
byte ip_cost;
public byte IPCost { get { return ip_cost; } set { ip_cost = value; } }
L2String name;
public L2String Name { get { return name; } set { name = value; } }
public L2IP(BinaryReader br)
{
FromStream(br);
}
public void FromStream(BinaryReader br)
{
effect = br.ReadUInt16();
anim = br.ReadByte();
targeting_cursor = br.ReadByte();
targeting_mode = br.ReadByte();
ip_cost = br.ReadByte();
name = new L2String(br);
}
}
}