2using System.Collections.Generic;
84 return weapon.category.skill == 100;
116 int num = w?.
Evalue(ele) ?? 0;
135 return Mathf.Clamp(
CC.
Evalue(130) / 15, 0, 2) * 25;
142 string @ref = (
IsMartial ?
"evalHand".lang() :
"evalWeapon".lang((
attackIndex + 1).ToString() ??
""));
143 return "attackEval".lang(@ref, text,
dMulti.ToString(
"F2") ??
"",
toHit.ToString() ??
"",
penetration.ToString() ??
"");
180 int num3 = Mathf.Clamp(
weapon.
material.hardness, flag ? 40 : 20, 200);
340 toHit += 25 + (int)Mathf.Sqrt(Mathf.Max(0,
CC.
Evalue(130)) * 2);
345 int num5 = ((num4 >= 50) ? 10 : ((num4 >= 25) ? 12 : 15));
362 if (
TC.isChara &&
TC.Chara.isBlind)
370 if (
TC.isChara &&
TC.Chara.HasHigherGround(
CC))
397 if (enumerable.Count() > 0)
399 Element element = enumerable.RandomItem();
403 for (
int i = 0; i <
numFire; i++)
405 TweenUtil.Delay((
float)i * data.
delay, delegate
409 if (_weapon.
id ==
"gun_rail")
418 effect.sr.color = effColor;
433 _weapon.
PlayEffect(data.
idEffect.IsEmpty(
"gunfire"), useRenderPos:
true, 0f, firePos);
453 if (
ammo !=
null && !flag)
460 if (
ammo !=
null && !flag)
471 if (condition !=
null)
479 num = Mathf.Clamp(num, 0, 9999999);
480 num = (int)(
dMulti * (
float)num * dmgMulti);
481 return Mathf.Clamp(num, 0, 9999999);
513 int num = (10 + e.Value / 5) * mtpChance / 100;
514 int power =
EClass.
curve((100 + e.
Value * 10) * (100 + bonus) / 100, 400, 100);
525 string text = ((e.source.proc.Length >= 2) ? e.
source.proc[1] :
"");
526 string text2 = obj.
source.abilityType.TryGet(0);
558 if (
card.IsAliveInCurrentZone)
564 aliasEle = e.
source.aliasRef,
565 noFriendlyFire =
true
571 public bool Perform(
int count,
bool hasHit,
float dmgMulti = 1f,
bool maxRoll =
false,
bool subAttack =
false)
576 if (
CC.
id ==
"tsunami")
589 List<Element> list =
new List<Element>();
592 if ((
id ==
"stalker" ||
id ==
"stalker_shadow") &&
TC.isChara &&
TC.Chara.CanSee(
CC))
600 if (
ammo !=
null && !flag)
610 if (
id ==
"rabbit_vopal" ||
id ==
"mantis_killer")
619 AddBane(valid:
true, 468, 50);
620 AddBane(
TC.Chara.IsUndead, 461, 100);
621 AddBane(
TC.Chara.IsAnimal, 463, 100);
622 AddBane(
TC.Chara.IsHuman, 464, 100);
623 AddBane(
TC.Chara.IsDragon, 460, 100);
624 AddBane(
TC.Chara.IsGod, 466, 100);
625 AddBane(
TC.Chara.IsMachine, 465, 100);
626 AddBane(
TC.Chara.IsFish, 467, 100);
627 AddBane(
TC.Chara.IsFairy, 462, 100);
630 num = num * (100 + bane * 3) / 100;
662 if (
hit &&
TC !=
null && !hasHit)
699 bool showEffect =
true;
708 if (value2.
source.categorySub ==
"eleConvert")
711 num5 = 50 + value2.Value * 2;
712 num6 = Mathf.Min(value2.
Value, 100);
723 num5 = conWeapon.power / 2;
724 num6 = (int)Mathf.Min(40f + MathF.Sqrt(conWeapon.
power), 80f);
740 if (enumerable.Count() > 0)
742 num4 = enumerable.RandomItem().id;
755 int num8 = num * num6 / 100;
759 num =
TC.ApplyProtection(num) + num9 + num8;
762 if (conWeapon !=
null && (weaponEnc <= 0 || !(Mathf.Min(10f + Mathf.Sqrt(weaponEnc) * 5f, 90f) > (
float)
EClass.
rnd(100))))
770 int mod2 = 100 / (count + 1);
774 ModExpAtk(flag3 ? 304 : (
IsRanged ? 133 : 132), mod2);
780 if (count == 0 && attackStyleElement != 0)
782 ModExpAtk(attackStyleElement, 100);
795 if (list.Count > 0 && !flag2)
799 if (!
TC.IsAliveInCurrentZone)
803 if (
item.IsActive(
weapon) && item.source.categorySub ==
"eleAttack")
806 int num11 =
EClass.
rnd(num * (100 +
item.Value * 10) / 500 + 5);
830 num = num7 * (Mathf.Min(50 + num12 + num13, 200) + (int)Mathf.Min(Mathf.Sqrt(num13), 100f)) / 100;
831 penetration = (int)Mathf.Sqrt(num13) + ((num13 != 0) ? 20 : 0);
838 num =
TC.ApplyProtection(num) + num9;
839 Debug.Log(
"Bash:" + num +
"/" + num7);
843 if (
TC.IsAliveInCurrentZone &&
TC.isChara)
847 TC.Chara.AddCondition<
ConDim>(50 + (int)Mathf.Sqrt(num12) * 10);
860 TC.pos.PlayEffect(
"vanish");
861 TC.PlaySound(
"push", 1.5f);
864 void AddBane(
bool valid,
int idEle,
int mod)
875 return TC.HasEditorTag(
EditorTag.InvulnerableToMobs);
879 void ModExpAtk(
int ele,
int mod)
881 if (!IgnoreExp() && (!
TC.isCopy ||
EClass.
rnd(10) == 0))
884 a = Mathf.Min(a, 200);
895 void ModExpDef(
int ele,
int mod)
899 int a2 = (Mathf.Clamp((
CC.
LV + 10 -
TC.elements.ValueWithoutLink(ele)) / 2, 1, 10) + Mathf.Min(
CC.
LV / 10, 10)) * mod / 100;
900 a2 = Mathf.Min(a2,
TC.isRestrained ? 10 : 200);
905 if (!
TC.IsPC && !
TC.isRestrained && !
TC.HasHost)
917 string id2 =
"hit_default";
918 string id3 =
"hit_default";
946 TC.PlayEffect(id3).SetScale(
crit ? 1.25f : 0.75f);
981 if (
TC.IsDeadOrSleeping)
985 int num =
TC.Evalue(151);
986 if (num != 0 &&
toHit < num * 10)
989 if (num2 > 300 &&
EClass.
rnd(num + 250) > 100)
993 if (num2 > 200 &&
EClass.
rnd(num + 250) > 150)
997 if (num2 > 150 &&
EClass.
rnd(num + 250) > 200)
1037 int num3 = Mathf.Min(100, 100 -
CC.
hp * 100 /
CC.
MaxHP) * (50 +
CC.
Evalue(1420) * 50) / 100;
1038 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 void ProcAbility(List< Element > list, Chara CC, Card TC, int bonus, bool subAttack=false, int mtpChance=100)
static AttackProcess Current
static int GetTwoHandEncBonus(Chara CC)
int GetRawDamage(float dmgMulti, bool crit, bool maxRoll)
static void ProcAbility(Element e, Chara CC, Card TC, int bonus, bool subAttack=false, int mtpChance=100)
int numFireWithoutDamageLoss
static int GetWeaponEnc(Chara CC, Thing w, int ele, bool addSelfEnc=false)
void PlayRangedAnime(int numFire)
static void ProcShieldEncs(Chara CC, Card TC, int mtpChance=100)
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)