forked from h1pp0/FFACETools_ffevo.net
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fish.cs
204 lines (167 loc) · 5.9 KB
/
Fish.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
using System;
namespace FFACETools
{
public partial class FFACE
{
/// <summary>
/// Wrapper class for Fishing information from FFACE
/// </summary>
public class FishTools
{
#region Classes
/// <summary>
/// ID of a fish
/// </summary>
public struct FishID
{
/// <summary>
/// Part 1 of the fish ID
/// </summary>
public int ID1 { get; set; }
/// <summary>
/// Part 2 of the fish ID
/// </summary>
public int ID2 { get; set; }
/// <summary>
/// Part 3 of the fish ID
/// </summary>
public int ID3 { get; set; }
/// <summary>
/// Part 4 of the fish ID
/// </summary>
public int ID4 { get; set; }
public override bool Equals (object obj)
{
bool bResult = false;
if (obj is FishID)
{
if (this.ID1.Equals(( (FishID)obj ).ID1)
&& this.ID2.Equals(( (FishID)obj ).ID2)
&& this.ID3.Equals(( (FishID)obj ).ID3)
&& this.ID4.Equals(( (FishID)obj ).ID4))
bResult = true;
}
return bResult;
}
public override int GetHashCode ()
{
return this.ID1.GetHashCode();
}
} // @ public struct FishID
#endregion
#region Constructor
/// <summary>
/// Constructor
/// </summary>
/// <param name="instance">Instance ID generated by FFACE</param>
public FishTools (int instanceID)
{
_InstanceID = instanceID;
} // @ public Fish(int instance)
#endregion
#region Members
/// <summary>
/// Instance ID generated by FFACE
/// </summary>
private int _InstanceID { get; set; }
/// <summary>
/// If player has a fish on the hook
/// </summary>
public bool FishOnLine
{
get { return FishOnLine(_InstanceID); }
} // @ public bool FishOnLine
/// <summary>
/// Current position of the rod
/// </summary>
public RodAlign RodPosition
{
get { return GetRodPosition(_InstanceID); }
} // @ public RodAlign RodPosition
/// <summary>
/// Fish's maximum hit points
/// </summary>
public int HPMax
{
get { return GetFishHPMax(_InstanceID); }
} // @ public int HPMax
/// <summary>
/// Fish's current hit points
/// </summary>
public int HPCurrent
{
get { return GetFishHP(_InstanceID); }
set { SetFishHP(_InstanceID, value); }
} // @ public int HPCurrent
/// <summary>
/// Time fish has been on the line
/// </summary>
public int OnLineTime
{
get { return GetFishOnlineTime(_InstanceID); }
} // @ public int OnLineTime
/// <summary>
/// Time, in seconds, before we lose the catch
/// </summary>
public int Timeout
{
get { return GetFishTimeout(_InstanceID); }
set { SetTimeOut(_InstanceID, (short)value); }
} // @ public int Timeout
/// <summary>
/// ID of the fish on the hook
/// </summary>
public FishID ID
{
get
{
// get all the fish id's
FishID id = new FishID();
id.ID1 = GetFishID1(_InstanceID);
id.ID2 = GetFishID2(_InstanceID);
id.ID3 = GetFishID3(_InstanceID);
id.ID4 = GetFishID4(_InstanceID);
return id;
}
} // @ public FishID ID
#endregion
#region Methods
/// <summary>
/// Return value of FightFish success.
/// </summary>
public bool FightFish ()
{
return FFACE.FightFish(_InstanceID);
} // @ public bool Fight
/// <summary>
/// Set the current HP of the fish on the line.
/// </summary>
/// <param name="value">Value to set the Fish's HP.</param>
/// <returns>true on success, false otherwise</returns>
public bool SetHP (int value)
{
bool result = false;
if (SetFishHP(_InstanceID, value))
{
result = true;
}
return result;
} // @ public bool SetHP
/// <summary>
/// Set the timeout value in seconds for the fish on the line (second before you lose your catch).
/// </summary>
/// <param name="value">Value in seconds to set the timeout to.</param>
/// <returns>true on success, false otherwise</returns>
public bool SetFishTimeOut (short value)
{
bool result = false;
if (SetTimeOut(_InstanceID, value))
{
result = true;
}
return result;
} // @ public bool SetFishTimeOut
#endregion
} // @ public class FishTools
} // @ public partial class FFACE
}