106 {
107 Act.CC.combatCount = 10;
111 {
114 {
116 }
117 return true;
118 }
121 {
122 Act.TC = c;
123 })).GetValueOrDefault();
126 if (effect !=
null && effect.
id == 6 &&
EClass.
rnd(2) == 0)
127 {
130 return true;
131 }
132 bool hasHit = false;
133 bool hasMissed = false;
134 bool usedWeapon = false;
135 bool usedTalisman = false;
137 int count = 0;
143 bool parried = false;
145 {
146 _Attack(slot);
147 if (parried)
148 {
149 break;
150 }
151 }
152 if (!usedWeapon)
153 {
154 _Attack(null);
155 }
157 {
159 }
161 {
164 }
166 {
167 if (parried)
168 {
170 }
172 {
175 }
176 }
177 Act.TC = orgTC;
178 Act.CC = cC;
179 if (!hasHit)
180 {
182 }
183 return true;
185 {
186 Act.TC = orgTC;
187 Act.TP = orgPos;
189 int splash;
190 int chaser;
191 int flurry;
192 int frustration;
193 int feint;
194 int knockback;
195 int mod_talisman;
197 {
198 w = null;
199 if (slot != null)
200 {
202 {
203 return;
204 }
206 }
208 if (!
UseWeaponDist || dist <= 1 || dist <= num || intercepted)
209 {
210 int num2 = GetWeaponEnc(606, addSelfEnc: false);
211 int scatter = GetWeaponEnc(607, addSelfEnc: false);
212 splash = GetWeaponEnc(608, addSelfEnc: true);
213 chaser = GetWeaponEnc(620, addSelfEnc: true);
214 flurry = GetWeaponEnc(621, addSelfEnc: true);
215 frustration = GetWeaponEnc(624, addSelfEnc: true);
216 int num3 = GetWeaponEnc(622, addSelfEnc: true);
217 feint = GetWeaponEnc(623, addSelfEnc: true);
219 mod_talisman = GetWeaponEnc(609, addSelfEnc: true);
221 if (w != null)
222 {
224 {
226 {
227 return;
228 }
229 num2 = (scatter = (splash = (num3 = 0)));
230 }
231 usedWeapon = true;
233 {
235 }
236 }
237 AttackWithFlurry(
Act.
TC,
Act.
TP, 1f, subAttack:
false);
238 if (!parried)
239 {
240 if (num2 > 0)
241 {
243 {
244 if (!
item.Equals(orgPos))
245 {
248 {
249 AttackWithFlurry(firstChara,
item, 1f, subAttack:
false);
250 }
251 }
252 }
253 }
254 else if (scatter > 0)
255 {
257 {
259 {
260 Chara firstChara2 = p.FirstChara;
261 if (firstChara2 != null && firstChara2.IsHostile(Act.CC))
262 {
263 AttackWithFlurry(firstChara2, p, Mathf.Min(0.5f + 0.05f * Mathf.Sqrt(scatter), 1f + 0.01f * Mathf.Sqrt(scatter)), subAttack: true);
264 }
265 }
266 });
267 }
268 else if (num3 > 0)
269 {
270 List<Point> list = new List<Point>();
272 {
274 {
275 list.Add(p.Copy());
276 }
277 });
278 list.Shuffle();
279 int num4 = 0;
280 for (
int i = 0; i < 9 && num3 >
EClass.
rnd(10 + (
int)Mathf.Pow(3f, i + 2)); i++)
281 {
282 num4++;
283 }
284 foreach (
Point item2
in list)
285 {
287 {
289 {
290 break;
291 }
293 {
294 AttackWithFlurry(item3, item2, 1f, subAttack: true);
295 if (parried)
296 {
297 break;
298 }
299 num4--;
300 }
301 }
302 }
303 }
304 }
305 count++;
306 }
307 }
309 {
310 Act.TC = _tc;
311 Act.TP = _tp;
314 {
317 {
319 int ele2 = 123;
322 {
325 {
327 {
330 }
331 }
332 }
333 num6 = num6 * 100 / (int)Mathf.Clamp((float)AttackProcess.Current.weaponSkill.Value / (float)num7 * 100f, 50f, 150f);
335 {
339 parried = true;
340 return;
341 }
342 }
343 }
344 int num8 = 1;
345 if (chaser > 0)
346 {
347 for (int j = 0; j < 10; j++)
348 {
349 if (chaser >
EClass.
rnd(4 + (
int)Mathf.Pow(4f, j + 2)))
350 {
351 num8++;
352 }
353 }
354 }
355 bool flag = false;
356 for (int k = 0; k < num8; k++)
357 {
359 {
360 break;
361 }
363 {
364 break;
365 }
366 if (k > 0)
367 {
369 }
371 if (!flag && frustration > 0 && !
Act.
TC.
HasElement(439) && 10f + 2f * Mathf.Sqrt(frustration) > (float)
EClass.
rnd(100))
372 {
373 AttackProcess.Current.critFury = true;
375 AttackProcess.Current.critFury = false;
376 }
378 {
379 break;
380 }
381 }
382 if (flag)
383 {
384 hasHit = true;
385 }
386 else
387 {
388 hasMissed = true;
389 }
390 Act.TC = _tc;
391 Act.TP = _tp;
393 {
394 bool flag2 = true;
397 {
398 flag2 = false;
400 {
404 {
405 usedTalisman = true;
406 flag2 = true;
407 if (mod_talisman > 0 && Mathf.Min(10f + Mathf.Sqrt(mod_talisman) * 5f, 90f) > (
float)
EClass.
rnd(100))
408 {
409 flag2 = false;
410 }
413 }
414 Act.powerMod = 100;
415 }
416 }
417 if (flag2)
418 {
421 {
422 w.ammoData.Num = w.
c_ammo;
423 }
425 {
426 w.c_ammo = 0;
427 w.ammoData = null;
428 }
430 }
431 }
432 Act.TC = _tc;
434 {
436 if (feint > 0 && 10f + 4f * Mathf.Sqrt(feint) > (float)
EClass.
rnd(100))
437 {
439 }
440 }
441 if (splash > 0)
442 {
444 {
446 {
447 return;
448 }
450 {
453 }
455 {
457 {
461 }
462 }
463 });
464 }
466 {
468 bool flag3 = Act.CC.id == "tsunami";
470 {
473 if (flag3)
474 {
477 }
478 }
479 else if (flag3)
480 {
485 {
489 }
491 }
492 }
493 }
494 void AttackWithFlurry(
Card _tc,
Point _tp,
float mtp,
bool subAttack)
495 {
496 int num10 = 1;
497 if (flurry > 0)
498 {
499 for (
int l = 0; l < 10 && flurry >
EClass.
rnd(25 + (
int)Mathf.Pow(5f, l + 2)); l++)
500 {
501 num10++;
502 }
503 }
504 for (int m = 0; m < num10; m++)
505 {
507 {
508 break;
509 }
511 {
512 break;
513 }
514 if (m > 0)
515 {
517 }
518 Attack(_tc, _tp, mtp, subAttack);
519 if (parried)
520 {
521 break;
522 }
523 }
524 }
525 int GetWeaponEnc(int ele, bool addSelfEnc)
526 {
528 }
529 }
530 }
static Act Create(int id)
virtual bool ShouldRollMax
override bool CanPerform()
virtual bool AllowCounter
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
long 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)
virtual void SetFirst(bool first, Vector3 pos)
ElementContainerCard elements
bool IsRestrainedResident
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual long ApplyProtection(long dmg, int mod=100)
virtual bool IsAliveInCurrentZone
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
void ModExp(string alias, int a)
SourceCategory.Row category
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
AttackStyle GetAttackStyle()
override bool IsAliveInCurrentZone
MoveResult TryMoveFrom(Point p)
Condition AddCondition(string id, int p=100, bool force=false)
bool RequestProtection(Chara attacker, Action< Chara > action)
bool HasCondition(string alias)
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
void DoHostileAction(Card _tg, bool immediate=false)
override void LookAt(Card c)
static int curve(int _a, int start, int step, int rate=75)
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)
Point Set(int _x, int _z)
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