2using System.Collections.Generic;
84 return weapon.category.skill == 100;
123 string @ref = (
IsMartial ?
"evalHand".lang() :
"evalWeapon".lang((
attackIndex + 1).ToString() ??
""));
124 return "attackEval".lang(@ref, text,
dMulti.ToString(
"F2") ??
"",
toHit.ToString() ??
"",
penetration.ToString() ??
"");
161 int num3 = Mathf.Clamp(
weapon.
material.hardness, flag ? 40 : 20, 200);
164 dBonus = CC.DMG + (CC.IsPCParty ? 3 : 7);
306 toHit += 25 + (int)Mathf.Sqrt(Mathf.Max(0,
CC.
Evalue(130)) * 2);
323 if (
TC.isChara &&
TC.Chara.isBlind)
331 if (
TC.isChara &&
TC.Chara.HasHigherGround(
CC))
358 if (enumerable.Count() > 0)
360 Element element = enumerable.RandomItem();
364 for (
int i = 0; i <
numFire; i++)
366 TweenUtil.Delay((
float)i * data.
delay, delegate
370 if (_weapon.
id ==
"gun_rail")
379 effect.sr.color = effColor;
394 _weapon.
PlayEffect(data.
idEffect.IsEmpty(
"gunfire"), useRenderPos:
true, 0f, firePos);
414 if (
ammo !=
null && !flag)
421 if (
ammo !=
null && !flag)
432 if (condition !=
null)
440 num = Mathf.Clamp(num, 0, 9999999);
441 num = (int)(
dMulti * (
float)num * dmgMulti);
442 return Mathf.Clamp(num, 0, 9999999);
445 public bool Perform(
int count,
bool hasHit,
float dmgMulti = 1f,
bool maxRoll =
false,
bool subAttack =
false)
459 List<Element> list2 =
new List<Element>();
465 if (
ammo !=
null && !flag)
472 else if (
CC.
id ==
"rabbit_vopal")
481 AddBane(valid:
true, 468, 50);
484 AddBane(race.
IsHuman, 464, 100);
486 AddBane(race.
IsGod, 466, 100);
488 AddBane(race.
IsFish, 467, 100);
489 AddBane(race.
IsFairy, 462, 100);
492 num = num * (100 + bane * 3) / 100;
524 if (
hit &&
TC !=
null && !hasHit)
561 bool showEffect =
true;
570 if (value2.
source.categorySub ==
"eleConvert")
573 num5 = 50 + value2.Value * 2;
574 num6 = Mathf.Min(value2.
Value, 100);
585 num5 = conWeapon.power / 2;
586 num6 = (int)Mathf.Min(40f + MathF.Sqrt(conWeapon.
power), 80f);
602 if (enumerable.Count() > 0)
604 num4 = enumerable.RandomItem().id;
617 int num8 = num * num6 / 100;
621 num =
TC.ApplyProtection(num) + num9 + num8;
624 if (conWeapon !=
null && (weaponEnc <= 0 || !(Mathf.Min(10f + Mathf.Sqrt(weaponEnc) * 5f, 90f) > (
float)
EClass.
rnd(100))))
632 int mod2 = 100 / (count + 1);
636 ModExpAtk(flag3 ? 304 : (
IsRanged ? 133 : 132), mod2);
642 if (count == 0 && attackStyleElement != 0)
644 ModExpAtk(attackStyleElement, 100);
657 if (list2.Count > 0 && !flag2)
661 if (!
TC.IsAliveInCurrentZone)
665 if (
item.IsActive(
weapon) && item.source.categorySub ==
"eleAttack")
668 int dmg =
EClass.
rnd(num * (100 +
item.Value * 10) / 500 + 5);
690 num = num7 * Mathf.Min(50 + num11, 200) / 100;
691 num =
TC.ApplyProtection(num);
692 Debug.Log(
"Bash:" + num +
"/" + num7);
696 if (
TC.IsAliveInCurrentZone &&
TC.isChara)
700 TC.Chara.AddCondition<
ConDim>(50 + (int)Mathf.Sqrt(num11) * 10);
712 TC.pos.PlayEffect(
"vanish");
713 TC.PlaySound(
"push", 1.5f);
716 void AddBane(
bool valid,
int idEle,
int mod)
727 return TC.HasEditorTag(
EditorTag.InvulnerableToMobs);
731 void ModExpAtk(
int ele,
int mod)
733 if (!IgnoreExp() && (!
TC.isCopy ||
EClass.
rnd(10) == 0))
736 a = Mathf.Min(a, 200);
747 void ModExpDef(
int ele,
int mod)
751 int a2 = (Mathf.Clamp((
CC.
LV + 10 -
TC.elements.ValueWithoutLink(ele)) / 2, 1, 10) + Mathf.Min(
CC.
LV / 10, 10)) * mod / 100;
752 a2 = Mathf.Min(a2,
TC.isRestrained ? 10 : 200);
757 if (!
TC.IsPC && !
TC.isRestrained && !
TC.HasHost)
769 string id =
"hit_default";
770 string id2 =
"hit_default";
798 TC.PlayEffect(id2).SetScale(
crit ? 1.25f : 0.75f);
802 void Proc(List<Element> list)
808 foreach (
Element item2
in list)
812 int num12 = 10 + item2.Value / 5;
818 string text = ((item2.source.proc.Length >= 2) ? item2.
source.proc[1] :
"");
819 string text2 = obj.
source.abilityType.TryGet(0);
850 if (
card.IsAliveInCurrentZone)
856 aliasEle = item2.
source.aliasRef,
857 noFriendlyFire =
true
892 if (
TC.IsDeadOrSleeping)
896 int num =
TC.Evalue(151);
897 if (num != 0 &&
toHit < num * 10)
900 if (num2 > 300 &&
EClass.
rnd(num + 250) > 100)
904 if (num2 > 200 &&
EClass.
rnd(num + 250) > 150)
908 if (num2 > 150 &&
EClass.
rnd(num + 250) > 200)
948 int num3 = Mathf.Min(100, 100 -
CC.
hp * 100 /
CC.
MaxHP) * (50 +
CC.
Evalue(1420) * 50) / 100;
949 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
static int GetWeaponEnc(Chara CC, Thing w, int ele, bool addSelfEnc=false)
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)