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)
450 if (
CC.
id ==
"tsunami")
463 List<Element> list2 =
new List<Element>();
469 if (
ammo !=
null && !flag)
476 else if (
CC.
id ==
"rabbit_vopal")
485 AddBane(valid:
true, 468, 50);
488 AddBane(race.
IsHuman, 464, 100);
490 AddBane(race.
IsGod, 466, 100);
492 AddBane(race.
IsFish, 467, 100);
493 AddBane(race.
IsFairy, 462, 100);
496 num = num * (100 + bane * 3) / 100;
528 if (
hit &&
TC !=
null && !hasHit)
565 bool showEffect =
true;
574 if (value2.
source.categorySub ==
"eleConvert")
577 num5 = 50 + value2.Value * 2;
578 num6 = Mathf.Min(value2.
Value, 100);
589 num5 = conWeapon.power / 2;
590 num6 = (int)Mathf.Min(40f + MathF.Sqrt(conWeapon.
power), 80f);
606 if (enumerable.Count() > 0)
608 num4 = enumerable.RandomItem().id;
621 int num8 = num * num6 / 100;
625 num =
TC.ApplyProtection(num) + num9 + num8;
628 if (conWeapon !=
null && (weaponEnc <= 0 || !(Mathf.Min(10f + Mathf.Sqrt(weaponEnc) * 5f, 90f) > (
float)
EClass.
rnd(100))))
636 int mod2 = 100 / (count + 1);
640 ModExpAtk(flag3 ? 304 : (
IsRanged ? 133 : 132), mod2);
646 if (count == 0 && attackStyleElement != 0)
648 ModExpAtk(attackStyleElement, 100);
661 if (list2.Count > 0 && !flag2)
665 if (!
TC.IsAliveInCurrentZone)
669 if (
item.IsActive(
weapon) && item.source.categorySub ==
"eleAttack")
672 int dmg =
EClass.
rnd(num * (100 +
item.Value * 10) / 500 + 5);
694 num = num7 * Mathf.Min(50 + num11, 200) / 100;
695 num =
TC.ApplyProtection(num);
696 Debug.Log(
"Bash:" + num +
"/" + num7);
700 if (
TC.IsAliveInCurrentZone &&
TC.isChara)
704 TC.Chara.AddCondition<
ConDim>(50 + (int)Mathf.Sqrt(num11) * 10);
716 TC.pos.PlayEffect(
"vanish");
717 TC.PlaySound(
"push", 1.5f);
720 void AddBane(
bool valid,
int idEle,
int mod)
731 return TC.HasEditorTag(
EditorTag.InvulnerableToMobs);
735 void ModExpAtk(
int ele,
int mod)
737 if (!IgnoreExp() && (!
TC.isCopy ||
EClass.
rnd(10) == 0))
740 a = Mathf.Min(a, 200);
751 void ModExpDef(
int ele,
int mod)
755 int a2 = (Mathf.Clamp((
CC.
LV + 10 -
TC.elements.ValueWithoutLink(ele)) / 2, 1, 10) + Mathf.Min(
CC.
LV / 10, 10)) * mod / 100;
756 a2 = Mathf.Min(a2,
TC.isRestrained ? 10 : 200);
761 if (!
TC.IsPC && !
TC.isRestrained && !
TC.HasHost)
773 string id =
"hit_default";
774 string id2 =
"hit_default";
802 TC.PlayEffect(id2).SetScale(
crit ? 1.25f : 0.75f);
806 void Proc(List<Element> list)
812 foreach (
Element item2
in list)
816 int num12 = 10 + item2.Value / 5;
822 string text = ((item2.source.proc.Length >= 2) ? item2.
source.proc[1] :
"");
823 string text2 = obj.
source.abilityType.TryGet(0);
854 if (
card.IsAliveInCurrentZone)
860 aliasEle = item2.
source.aliasRef,
861 noFriendlyFire =
true
896 if (
TC.IsDeadOrSleeping)
900 int num =
TC.Evalue(151);
901 if (num != 0 &&
toHit < num * 10)
904 if (num2 > 300 &&
EClass.
rnd(num + 250) > 100)
908 if (num2 > 200 &&
EClass.
rnd(num + 250) > 150)
912 if (num2 > 150 &&
EClass.
rnd(num + 250) > 200)
952 int num3 = Mathf.Min(100, 100 -
CC.
hp * 100 /
CC.
MaxHP) * (50 +
CC.
Evalue(1420) * 50) / 100;
953 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)