97 {
98 Act.CC.combatCount = 10;
102 {
105 {
107 }
108 return true;
109 }
112 {
113 Act.TC = c;
114 });
116 if (effect !=
null && effect.
id == 6 &&
EClass.
rnd(2) == 0)
117 {
120 return true;
121 }
122 bool hasHit = false;
123 bool usedWeapon = false;
124 bool usedTalisman = false;
125 int count = 0;
131 {
132 _Attack(slot);
133 }
134 if (!usedWeapon)
135 {
136 _Attack(null);
137 }
139 {
141 }
142 if (!hasHit)
143 {
145 }
147 {
149 }
150 return true;
152 {
153 Act.TC = orgTC;
154 Act.TP = orgPos;
156 int splash;
157 int chaser;
158 int flurry;
159 int frustration;
160 int feint;
161 int mod_talisman;
163 {
164 w = null;
165 if (slot != null)
166 {
168 {
169 return;
170 }
172 }
175 {
176 int num2 = GetWeaponEnc(606, addSelfEnc: false);
177 int scatter = GetWeaponEnc(607, addSelfEnc: false);
178 splash = GetWeaponEnc(608, addSelfEnc: true);
179 chaser = GetWeaponEnc(620, addSelfEnc: true);
180 flurry = GetWeaponEnc(621, addSelfEnc: true);
181 frustration = GetWeaponEnc(624, addSelfEnc: true);
182 int num3 = GetWeaponEnc(622, addSelfEnc: true);
183 feint = GetWeaponEnc(623, addSelfEnc: true);
184 mod_talisman = GetWeaponEnc(609, addSelfEnc: true);
186 if (w != null)
187 {
189 {
191 {
192 return;
193 }
194 num2 = (scatter = (splash = (num3 = 0)));
195 }
196 usedWeapon = true;
198 {
200 }
201 }
202 AttackWithFlurry(
Act.
TC,
Act.
TP, 1f, subAttack:
false);
203 if (num2 > 0)
204 {
206 {
207 if (!
item.Equals(orgPos))
208 {
211 {
212 AttackWithFlurry(firstChara,
item, 1f, subAttack:
false);
213 }
214 }
215 }
216 }
217 else if (scatter > 0)
218 {
220 {
222 {
223 Chara firstChara2 = p.FirstChara;
224 if (firstChara2 != null && firstChara2.IsHostile(Act.CC))
225 {
226 AttackWithFlurry(firstChara2, p, Mathf.Min(0.5f + 0.05f * Mathf.Sqrt(scatter), 1f + 0.01f * Mathf.Sqrt(scatter)), subAttack: true);
227 }
228 }
229 });
230 }
231 else if (num3 > 0)
232 {
233 List<Point> list = new List<Point>();
235 {
237 });
238 list.Shuffle();
239 int num4 = 0;
240 for (
int i = 0; i < 9 && num3 >
EClass.
rnd(10 + (
int)Mathf.Pow(3f, i + 2)); i++)
241 {
242 num4++;
243 }
244 foreach (
Point item2
in list)
245 {
247 {
249 {
250 break;
251 }
253 {
254 AttackWithFlurry(item3, item2, 1f, subAttack: true);
255 num4--;
256 }
257 }
258 }
259 }
260 count++;
261 }
262 }
264 {
265 Act.TC = _tc;
266 Act.TP = _tp;
268 int num5 = 1;
269 if (chaser > 0)
270 {
271 for (int j = 0; j < 10; j++)
272 {
273 if (chaser >
EClass.
rnd(4 + (
int)Mathf.Pow(4f, j + 2)))
274 {
275 num5++;
276 }
277 }
278 }
279 bool flag = false;
280 for (int k = 0; k < num5; k++)
281 {
282 if (k > 0)
283 {
285 }
287 if (!flag && frustration > 0 && 10f + 2f * Mathf.Sqrt(frustration) > (
float)
EClass.
rnd(100))
288 {
289 AttackProcess.Current.critFury = true;
291 AttackProcess.Current.critFury = false;
292 }
294 {
295 break;
296 }
297 }
298 Act.TC = _tc;
299 Act.TP = _tp;
301 {
302 bool flag2 = true;
305 {
306 flag2 = false;
308 {
312 {
313 usedTalisman = true;
314 flag2 = true;
315 if (mod_talisman > 0 && Mathf.Min(10f + Mathf.Sqrt(mod_talisman) * 5f, 90f) > (
float)
EClass.
rnd(100))
316 {
317 flag2 = false;
318 }
321 }
322 Act.powerMod = 100;
323 }
324 }
325 if (flag2)
326 {
329 {
330 w.ammoData.Num = w.
c_ammo;
331 }
333 {
334 w.c_ammo = 0;
335 w.ammoData = null;
336 }
338 }
339 }
340 Act.TC = _tc;
342 {
344 if (feint > 0 && 10f + 4f * Mathf.Sqrt(feint) > (float)
EClass.
rnd(100))
345 {
347 }
348 }
349 if (splash > 0)
350 {
352 {
354 {
355 return;
356 }
358 {
361 }
363 {
365 {
369 }
370 }
371 });
372 }
373 }
374 void AttackWithFlurry(
Card _tc,
Point _tp,
float mtp,
bool subAttack)
375 {
376 int num6 = 1;
377 if (flurry > 0)
378 {
379 for (
int l = 0; l < 10 && flurry >
EClass.
rnd(25 + (
int)Mathf.Pow(5f, l + 2)); l++)
380 {
381 num6++;
382 }
383 }
384 for (int m = 0; m < num6; m++)
385 {
387 {
388 break;
389 }
391 {
392 break;
393 }
394 if (m > 0)
395 {
397 }
398 Attack(_tc, _tp, mtp, subAttack);
399 }
400 }
401 int GetWeaponEnc(int ele, bool addSelfEnc)
402 {
404 }
405 }
406 }
static Act Create(int id)
virtual bool UseWeaponDist
static bool TryReload(Thing weapon, Thing ammo=null)
void Prepare(Chara _CC, Thing _weapon, Card _TC=null, Point _TP=null, int _attackIndex=0, bool _isThrow=false)
bool Perform(int count, bool hasHit, float dmgMulti=1f, bool maxRoll=false, bool subAttack=false)
static AttackProcess Current
int GetRawDamage(float dmgMulti, bool crit, bool maxRoll)
static int GetWeaponEnc(Chara CC, Thing w, int ele, bool addSelfEnc=false)
void PlayAnime(AnimeID id, bool force)
ElementContainerCard elements
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
bool HasElement(int ele, int req=1)
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual int ApplyProtection(int dmg, int mod=100)
virtual bool IsAliveInCurrentZone
void ModExp(string alias, int a)
void Say(string lang, string ref1=null, string ref2=null)
override bool IsAliveInCurrentZone
Condition AddCondition(string id, int p=100, bool force=false)
bool HasCondition(string alias)
void DoHostileAction(Card _tg, bool immediate=false)
void RequestProtection(Chara attacker, Action< Chara > action)
override void LookAt(Card c)
static void Wait(float a, Card c)
int GetSpellExp(Chara c, Element e, int costMod=100)
Element GetElement(string alias)
static void SetDirty(Thing t)
List< Point > ListPointsInLine(Point center, Point to, int radius)
List< Card > ListCards(bool includeMasked=false)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
bool Equals(int _x, int _z)
Effect PlayEffect(string id)
void Animate(AnimeID id, bool animeBlock=false)
virtual bool CanBeAttacked