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);
345 toHit += 25 + (int)Mathf.Sqrt(Mathf.Max(0,
CC.
Evalue(130)) * 2);
350 int num5 = ((num4 >= 50) ? 10 : ((num4 >= 25) ? 12 : 15));
367 if (
TC.isChara &&
TC.Chara.isBlind)
375 if (
TC.isChara &&
TC.Chara.HasHigherGround(
CC))
402 if (enumerable.Count() > 0)
404 Element element = enumerable.RandomItem();
408 for (
int i = 0; i <
numFire; i++)
410 TweenUtil.Delay((
float)i * data.delay + delay, delegate
422 case "gun_laser_assault":
430 effect.sr.color = effColor;
447 _weapon.
PlayEffect(data.
idEffect.IsEmpty(
"gunfire"), useRenderPos:
true, 0f, firePos);
472 if (
ammo !=
null && !flag)
479 if (
ammo !=
null && !flag)
490 if (condition !=
null)
498 num = (long)(
dMulti * (
float)num * dmgMulti);
499 return (
long)Mathf.Clamp(num, 0f, 100000000f);
531 int num = (10 + e.Value / 5) * mtpChance / 100;
532 int power =
EClass.
curve((100 + e.
Value * 10) * (100 + bonus) / 100, 400, 100);
543 string text = ((e.source.proc.Length >= 2) ? e.
source.proc[1] :
"");
544 string text2 = obj.
source.abilityType.TryGet(0);
576 if (
card.IsAliveInCurrentZone)
582 aliasEle = e.
source.aliasRef,
583 noFriendlyFire =
true
589 public bool Perform(
int count,
bool hasHit,
float dmgMulti = 1f,
bool maxRoll =
false,
bool subAttack =
false)
594 if (
CC.
id ==
"tsunami")
607 List<Element> list =
new List<Element>();
610 if ((
id ==
"stalker" ||
id ==
"stalker_shadow") &&
TC.isChara &&
TC.Chara.CanSee(
CC))
618 if (
ammo !=
null && !flag)
631 case "mantis_killer":
640 AddBane(valid:
true, 468, 50);
641 AddBane(
TC.Chara.IsUndead, 461, 100);
642 AddBane(
TC.Chara.IsAnimal, 463, 100);
643 AddBane(
TC.Chara.IsHuman, 464, 100);
644 AddBane(
TC.Chara.IsDragon, 460, 100);
645 AddBane(
TC.Chara.IsGod, 466, 100);
646 AddBane(
TC.Chara.IsMachine, 465, 100);
647 AddBane(
TC.Chara.IsFish, 467, 100);
648 AddBane(
TC.Chara.IsFairy, 462, 100);
651 num = num * (100 + bane * 3) / 100;
683 if (
hit &&
TC !=
null && !hasHit)
723 bool showEffect =
true;
732 if (value2.
source.categorySub ==
"eleConvert")
735 num5 = 50 + value2.Value * 2;
736 num6 = Mathf.Min(value2.
Value, 100);
747 num5 = conWeapon.power / 2;
748 num6 = (int)Mathf.Min(40f + MathF.Sqrt(conWeapon.
power), 80f);
764 if (enumerable.Count() > 0)
766 num4 = enumerable.RandomItem().id;
779 long num8 = num * num6 / 100;
783 num =
TC.ApplyProtection(num) + num9 + num8;
786 if (conWeapon !=
null && (weaponEnc <= 0 || !(Mathf.Min(10f + Mathf.Sqrt(weaponEnc) * 5f, 90f) > (
float)
EClass.
rnd(100))))
794 int mod2 = 100 / (count + 1);
798 ModExpAtk(flag3 ? 304 : (
IsRanged ? 133 : 132), mod2);
804 if (count == 0 && attackStyleElement != 0)
806 ModExpAtk(attackStyleElement, 100);
819 if (list.Count > 0 && !flag2)
823 if (!
TC.IsAliveInCurrentZone)
827 if (
item.IsActive(
weapon) && item.source.categorySub ==
"eleAttack")
830 int num11 =
EClass.
rnd(num * (100 +
item.Value * 10) / 500 + 5);
854 num = num7 * (Mathf.Min(50 + num12 + num13, 200) + (int)Mathf.Min(Mathf.Sqrt(num13), 100f)) / 100;
855 penetration = (int)Mathf.Sqrt(num13) + ((num13 != 0) ? 20 : 0);
862 num =
TC.ApplyProtection(num) + num9;
863 Debug.Log(
"Bash:" + num +
"/" + num7);
867 if (
TC.IsAliveInCurrentZone &&
TC.isChara)
871 TC.Chara.AddCondition<
ConDim>(50 + (int)Mathf.Sqrt(num12) * 10);
888 TC.pos.PlayEffect(
"vanish");
889 TC.PlaySound(
"push", 1.5f);
892 void AddBane(
bool valid,
int idEle,
int mod)
903 return TC.HasEditorTag(
EditorTag.InvulnerableToMobs);
907 void ModExpAtk(
int ele,
int mod)
909 if (!IgnoreExp() && (!
TC.isCopy ||
EClass.
rnd(10) == 0))
912 a = Mathf.Min(a, 200);
923 void ModExpDef(
int ele,
int mod)
927 int a2 = (Mathf.Clamp((
CC.
LV + 10 -
TC.elements.ValueWithoutLink(ele)) / 2, 1, 10) + Mathf.Min(
CC.
LV / 10, 10)) * mod / 100;
928 a2 = Mathf.Min(a2,
TC.isRestrained ? 10 : 200);
933 if (!
TC.IsPC && !
TC.isRestrained && !
TC.HasHost)
945 string id2 =
"hit_default";
946 string id3 =
"hit_default";
974 TC.PlayEffect(id3).SetScale(
crit ? 1.25f : 0.75f);
1009 if (
TC.IsDeadOrSleeping)
1013 int num =
TC.Evalue(151);
1014 if (num != 0 &&
toHit < num * 10)
1017 if (num2 > 300 &&
EClass.
rnd(num + 250) > 100)
1021 if (num2 > 200 &&
EClass.
rnd(num + 250) > 150)
1025 if (num2 > 150 &&
EClass.
rnd(num + 250) > 200)
1065 int num3 = Mathf.Min(100, 100 -
CC.
hp * 100 /
CC.
MaxHP) * (50 +
CC.
Evalue(1420) * 50) / 100;
1066 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
long GetRawDamage(float dmgMulti, bool crit, bool maxRoll)
static int GetTwoHandEncBonus(Chara CC)
static void ProcAbility(Element e, Chara CC, Card TC, int bonus, bool subAttack=false, int mtpChance=100)
int numFireWithoutDamageLoss
void PlayRangedAnime(int numFire, float delay=0f)
static int GetWeaponEnc(Chara CC, Thing w, int ele, bool addSelfEnc=false)
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)