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))
412 bool isRail = isLaser && (weapon.id ==
"gun_rail" || data.
forceRail);
413 Vector3 muzzleFix = (data.fireFromMuzzle ? ((Vector3)firePos) : Vector3.zero);
414 for (
int num = 0; num <
numFire; num++)
416 TweenUtil.Delay((
float)num * data.delay + delay, delegate
420 Vector3 fromV = (_CC.isSynced ? _CC.renderer.position : _CC.
pos.
Position()) + muzzleFix;
429 case "gun_laser_assault":
435 string id = (isRail ?
"laser_rail" :
"laser");
443 effect.sr.color = effColor;
460 _weapon.
PlayEffect(data.
idEffect.IsEmpty(
"gunfire"), useRenderPos:
true, 0f, firePos);
485 if (
ammo !=
null && !flag)
492 if (
ammo !=
null && !flag)
505 num = (long)(
dMulti * (
float)num * dmgMulti);
506 long num2 = 99999999L;
508 if (condition !=
null)
510 num = num * (100 + condition.lv * 10) / 100;
511 num2 = num2 * (100 + condition.lv * 5) / 100;
513 return (
long)Mathf.Clamp(num, 0f, num2);
545 int num = (10 + e.Value / 5) * mtpChance / 100;
546 int power =
EClass.
curve((100 + e.
Value * 10) * (100 + bonus) / 100, 400, 100);
557 string text = ((e.source.proc.Length >= 2) ? e.
source.proc[1] :
"");
558 string text2 = obj.
source.abilityType.TryGet(0);
590 if (
card.IsAliveInCurrentZone)
596 aliasEle = e.
source.aliasRef,
597 noFriendlyFire =
true
603 public bool Perform(
int count,
bool hasHit,
float dmgMulti = 1f,
bool maxRoll =
false,
bool subAttack =
false)
608 if (
CC.
id ==
"tsunami")
621 List<Element> list =
new List<Element>();
624 if ((
id ==
"stalker" ||
id ==
"stalker_shadow") &&
TC.isChara &&
TC.Chara.CanSee(
CC))
632 if (
ammo !=
null && !flag)
654 AddBane(valid:
true, 468, 50);
655 AddBane(
TC.Chara.IsUndead, 461, 100);
656 AddBane(
TC.Chara.IsAnimal, 463, 100);
657 AddBane(
TC.Chara.IsHuman, 464, 100);
658 AddBane(
TC.Chara.IsDragon, 460, 100);
659 AddBane(
TC.Chara.IsGod, 466, 100);
660 AddBane(
TC.Chara.IsMachine, 465, 100);
661 AddBane(
TC.Chara.IsFish, 467, 100);
662 AddBane(
TC.Chara.IsFairy, 462, 100);
665 num = num * (100 + bane * 3) / 100;
672 if (value2.
Value > 0)
697 if (
hit &&
TC !=
null && !hasHit)
737 bool showEffect =
true;
746 if (value3.
source.categorySub ==
"eleConvert")
749 num5 = 50 + value3.Value * 2;
750 num6 = Mathf.Min(value3.
Value, 100);
761 num5 = conWeapon.power / 2;
762 num6 = (int)Mathf.Min(40f + MathF.Sqrt(conWeapon.
power), 80f);
778 if (enumerable.Count() > 0)
780 num4 = enumerable.RandomItem().id;
793 long num8 = num * num6 / 100;
797 num =
TC.ApplyProtection(num) + num9 + num8;
800 if (conWeapon !=
null && (weaponEnc <= 0 || !(Mathf.Min(10f + Mathf.Sqrt(weaponEnc) * 5f, 90f) > (
float)
EClass.
rnd(100))))
808 int mod = 100 / (count + 1);
812 ModExpAtk(flag3 ? 304 : (
IsRanged ? 133 : 132), mod);
818 if (count == 0 && attackStyleElement != 0)
820 ModExpAtk(attackStyleElement, 100);
833 if (list.Count > 0 && !flag2)
837 if (!
TC.IsAliveInCurrentZone)
841 if (!
item.IsActive(
weapon) || !(item.source.categorySub ==
"eleAttack"))
846 long num11 =
EClass.
rnd(num * (100 +
item.Value * 10) / 500 + 5);
872 num = num7 * (Mathf.Min(50 + num12 + num13, 200) + (int)Mathf.Min(Mathf.Sqrt(num13), 100f)) / 100;
873 penetration = (int)Mathf.Sqrt(num13) + ((num13 != 0) ? 20 : 0);
880 num =
TC.ApplyProtection(num) + num9;
881 Debug.Log(
"Bash:" + num +
"/" + num7);
885 if (
TC.IsAliveInCurrentZone &&
TC.isChara)
889 TC.Chara.AddCondition<
ConDim>(50 + (int)Mathf.Sqrt(num12) * 10);
893 if (!
TC.isRestrained)
917 TC.pos.PlayEffect(
"vanish");
918 TC.PlaySound(
"push", 1.5f);
921 void AddBane(
bool valid,
int idEle,
int num14)
932 return TC.HasEditorTag(
EditorTag.InvulnerableToMobs);
936 void ModExpAtk(
int ele,
int num14)
938 if (!IgnoreExp() && (!
TC.isCopy ||
EClass.
rnd(10) == 0))
941 a = Mathf.Min(a, 200);
952 void ModExpDef(
int ele,
int num14)
956 int a = (Mathf.Clamp((
CC.
LV + 10 -
TC.elements.ValueWithoutLink(ele)) / 2, 1, 10) + Mathf.Min(
CC.
LV / 10, 10)) * num14 / 100;
957 a = Mathf.Min(a,
TC.isRestrained ? 10 : 200);
962 if (!
TC.IsPC && !
TC.isRestrained && !
TC.HasHost)
974 string id2 =
"hit_default";
975 string id3 =
"hit_default";
1003 TC.PlayEffect(id3).SetScale(
crit ? 1.25f : 0.75f);
1041 if (
TC.IsDeadOrSleeping)
1045 int num =
TC.Evalue(151);
1046 if (num != 0 &&
toHit < num * 10)
1049 if (num2 > 300f &&
EClass.
rnd(num + 250) > 100)
1053 if (num2 > 200f &&
EClass.
rnd(num + 250) > 150)
1057 if (num2 > 150f &&
EClass.
rnd(num + 250) > 200)
1062 int num3 =
TC.Evalue(57);
1070 else if (num3 < 0 && num3 * -1 >
EClass.
rnd(100))
1105 int num4 = Mathf.Min(100, 100 -
CC.
hp * 100 /
CC.
MaxHP) * (50 +
CC.
Evalue(1420) * 50) / 100;
1106 if (num4 >= 50 && num4 * num4 * num4 * num4 / 3 >
EClass.
rnd(100000000))
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 void ProcAbility(Element e, Chara CC, Card TC, int bonus, bool subAttack=false, int mtpChance=100)
static int GetTwoHandEncBonus(Chara CC, Thing w)
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
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
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
AttackStyle GetAttackStyle()
int GetAttackStyleElement(AttackStyle style)
override bool IsAliveInCurrentZone
BaseCondition GetCondition(string idCon)
bool HasCondition(string alias)
override bool IsPCFaction
bool HasHigherGround(Card c)
UD_String_Color elementColors
static long RollMax(int num, int sides, int bonus=0)
static long Roll(int num, int sides, int bonus=0, Card card=null)
static int curve(long _a, int start, int step, int rate=75)
static ColorProfile Colors
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)