2using System.Collections.Generic;
84 return weapon.category.skill == 100;
118 string @ref = (
IsMartial ?
"evalHand".lang() :
"evalWeapon".lang((
attackIndex + 1).ToString() ??
""));
119 return "attackEval".lang(@ref, text,
dMulti.ToString(
"F2") ??
"",
toHit.ToString() ??
"",
penetration.ToString() ??
"");
156 int num3 = Mathf.Clamp(
weapon.
material.hardness, flag ? 40 : 20, 200);
159 dBonus = CC.DMG + (CC.IsPCParty ? 3 : 7);
301 toHit += 25 + (int)Mathf.Sqrt(Mathf.Max(0,
CC.
Evalue(130)) * 2);
318 if (
TC.isChara &&
TC.Chara.isBlind)
326 if (
TC.isChara &&
TC.Chara.HasHigherGround(
CC))
349 if (enumerable.Count() > 0)
351 Element element = enumerable.RandomItem();
355 for (
int i = 0; i <
numFire; i++)
357 TweenUtil.Delay((
float)i * data.
delay, delegate
361 if (_weapon.
id ==
"gun_rail")
370 effect.sr.color = effColor;
385 _weapon.
PlayEffect(data.
idEffect.IsEmpty(
"gunfire"), useRenderPos:
true, 0f, firePos);
405 if (
ammo !=
null && !flag)
412 if (
ammo !=
null && !flag)
423 if (condition !=
null)
431 num = Mathf.Clamp(num, 0, 9999999);
432 num = (int)(
dMulti * (
float)num * dmgMulti);
433 return Mathf.Clamp(num, 0, 9999999);
436 public bool Perform(
int count,
bool hasHit,
float dmgMulti = 1f,
bool maxRoll =
false,
bool subAttack =
false)
449 List<Element> list2 =
new List<Element>();
455 if (
ammo !=
null && !flag)
462 else if (
CC.
id ==
"rabbit_vopal")
471 AddBane(valid:
true, 468, 50);
474 AddBane(race.
IsHuman, 464, 100);
476 AddBane(race.
IsGod, 466, 100);
478 AddBane(race.
IsFish, 467, 100);
479 AddBane(race.
IsFairy, 462, 100);
482 num = num * (100 + bane * 3) / 100;
514 if (
hit &&
TC !=
null && !hasHit)
551 bool showEffect =
true;
560 if (value2.
source.categorySub ==
"eleConvert")
563 num5 = 50 + value2.Value * 2;
564 num6 = Mathf.Min(value2.
Value, 100);
575 num5 = conWeapon.power / 2;
576 num6 = (int)Mathf.Min(40f + MathF.Sqrt(conWeapon.
power), 80f);
592 if (enumerable.Count() > 0)
594 num4 = enumerable.RandomItem().id;
607 int num8 = num * num6 / 100;
611 num =
TC.ApplyProtection(num) + num9 + num8;
618 int mod2 = 100 / (count + 1);
622 ModExpAtk(flag2 ? 304 : (
IsRanged ? 133 : 132), mod2);
628 if (count == 0 && attackStyleElement != 0)
630 ModExpAtk(attackStyleElement, 100);
647 if (!
TC.IsAliveInCurrentZone)
651 if (
item.IsActive(
weapon) && item.source.categorySub ==
"eleAttack")
654 int dmg =
EClass.
rnd(num * (100 +
item.Value * 10) / 500 + 5);
676 num = num7 * Mathf.Min(50 + num11, 200) / 100;
677 num =
TC.ApplyProtection(num);
678 Debug.Log(
"Bash:" + num +
"/" + num7);
682 if (
TC.IsAliveInCurrentZone &&
TC.isChara)
686 TC.Chara.AddCondition<
ConDim>(50 + (int)Mathf.Sqrt(num11) * 10);
698 TC.pos.PlayEffect(
"vanish");
699 TC.PlaySound(
"push", 1.5f);
702 void AddBane(
bool valid,
int idEle,
int mod)
713 return TC.HasEditorTag(
EditorTag.InvulnerableToMobs);
717 void ModExpAtk(
int ele,
int mod)
719 if (!IgnoreExp() && (!
TC.isCopy ||
EClass.
rnd(10) == 0))
722 a = Mathf.Min(a, 200);
733 void ModExpDef(
int ele,
int mod)
737 int a2 = (Mathf.Clamp((
CC.
LV + 10 -
TC.elements.ValueWithoutLink(ele)) / 2, 1, 10) + Mathf.Min(
CC.
LV / 10, 10)) * mod / 100;
738 a2 = Mathf.Min(a2,
TC.isRestrained ? 10 : 200);
743 if (!
TC.IsPC && !
TC.isRestrained && !
TC.HasHost)
755 string id =
"hit_default";
756 string id2 =
"hit_default";
784 TC.PlayEffect(id2).SetScale(
crit ? 1.25f : 0.75f);
788 void Proc(List<Element> list)
794 foreach (
Element item2
in list)
798 int num12 = 10 + item2.Value / 5;
804 string text = ((item2.source.proc.Length >= 2) ? item2.
source.proc[1] :
"");
805 string text2 = obj.
source.abilityType.TryGet(0);
836 if (
card.IsAliveInCurrentZone)
842 aliasEle = item2.
source.aliasRef,
843 noFriendlyFire =
true
878 if (
TC.IsDeadOrSleeping)
882 int num =
TC.Evalue(151);
883 if (num != 0 &&
toHit < num * 10)
886 if (num2 > 300 &&
EClass.
rnd(num + 250) > 100)
890 if (num2 > 200 &&
EClass.
rnd(num + 250) > 150)
894 if (num2 > 150 &&
EClass.
rnd(num + 250) > 200)
934 int num3 = Mathf.Min(100, 100 -
CC.
hp * 100 /
CC.
MaxHP);
935 if (num3 >= 50 && num3 * num3 * num3 * num3 / 3 >
EClass.
rnd(100000000))
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
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)
string GetAttackText(AttackType type, int id)
static AttackProcess Current
int GetRawDamage(float dmgMulti, bool crit, bool maxRoll)
int numFireWithoutDamageLoss
void PlayRangedAnime(int numFire)
void Mod(int a, bool force=false)
SourceElement.Row sourceElement
int EvalueMax(int ele, int min=0)
ElementContainerCard elements
bool HasElement(int ele, int req=1)
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
bool HasEditorTag(EditorTag tag)
void ModExp(string alias, int a)
SourceCategory.Row category
void Say(string lang, string ref1=null, string ref2=null)
AttackStyle GetAttackStyle()
int GetAttackStyleElement(AttackStyle style)
override bool IsAliveInCurrentZone
bool HasCondition(string alias)
override bool IsPCFaction
bool HasHigherGround(Card c)
UD_String_Color elementColors
static int RollMax(int num, int sides, int bonus=0)
static int Roll(int num, int sides, int bonus=0, Card card=null)
static ColorProfile Colors
static int curve(int a, int start, int step, int rate=75)
static SourceManager sources
static GameSetting setting
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
static Effect Get(Effect original)
Dictionary< int, Element > dict
int ValueWithoutLink(int ele)
Element GetOrCreateElement(Element ele)
static Element Create(int id, int v=0)
Element GetParent(Card c)
ElementContainerFaction charaElements
UD_String_EffectData guns
static string[] GetList(string id)
ref Vector3 Position(int height)
ref Vector3 PositionCenter()
bool TryGetValue(TKey key, out TValue value)