1using System.Collections.Generic;
23 public override string Name
31 return "ActReload".lang();
35 public override string GetText(
string str =
"")
39 return base.GetText(str);
103 int numFire = effectData.
num;
104 int numFireWithoutDamageLoss = numFire;
105 int num = GetWeaponEnc(602);
106 int drill = GetWeaponEnc(606);
107 int scatter = GetWeaponEnc(607);
108 int chaser = GetWeaponEnc(620);
111 numFire += num / 10 + ((num % 10 >
EClass.
rnd(10)) ? 1 : 0);
115 int num3 = 1 + weapon.material.hardness / 30 +
EClass.
rnd(3);
116 int num4 =
weapon.Evalue(604);
119 for (
int i = 0; i < numFire; i++)
121 if (Mathf.Sqrt(num4) * 5f + 10f > (float)
EClass.
rnd(100))
126 num3 = Mathf.Max(1, num3 * 100 / (100 + num4 * 5));
128 string missSound = ((weapon.trait is
TraitToolRangeGun) ?
"miss_bullet" :
"miss_arrow");
133 num3 += item.source.LV / 15;
145 ActPlan.warning =
true;
193 List<Point> points =
new List<Point>();
198 else if (scatter > 0)
202 points.Add(_p.
Copy());
210 if (points.Count > 0)
213 foreach (
Point item2
in points)
218 if ((firstChara ==
null || firstChara.
IsHostile(
Act.
CC)) && (firstChara !=
null || scatter != 0))
227 weapon.c_ammo -= num2;
228 if (
weapon.ammoData !=
null)
230 weapon.ammoData.Num =
weapon.c_ammo;
235 weapon.ammoData =
null;
242 if (
Act.
TC !=
null && !hasHit)
258 int GetWeaponEnc(
int ele)
265 AttackProcess.Current.numFire = numFire;
266 AttackProcess.Current.numFireWithoutDamageLoss = numFireWithoutDamageLoss;
267 AttackProcess.Current.posRangedAnime =
Act.
TP.
Copy();
268 AttackProcess.Current.ignoreAnime = index > 1;
269 AttackProcess.Current.ignoreAttackSound =
false;
270 if (drill > 0 && points.Count > 0)
272 AttackProcess.Current.posRangedAnime = points.LastItem();
274 else if (scatter > 0)
276 AttackProcess.Current.ignoreAnime =
false;
277 AttackProcess.Current.ignoreAttackSound = index > 1;
294 if (effect !=
null && effect.
id == 6 &&
EClass.
rnd(2) == 0)
306 for (
int j = 0; j < numFire; j++)
316 for (
int k = 0; k < 10; k++)
318 if (chaser >
EClass.
rnd(4 + (
int)Mathf.Pow(4f, k + 2 + j)))
349 if (
weapon.ammoData !=
null)
351 if (
weapon.ammoData.Num > 0)
355 weapon.ammoData =
null;
366 if (!
weapon.IsMeleeWithAmmo)
383 weapon.ammoData = thing;
387 reloadTurn = reloadTurn * 100 / (100 +
Act.
CC.
Evalue(1652) * 100);
388 if (traitToolRange.
NeedReload && reloadTurn > 0)
override CursorInfo CursorIcon
override int PerformDistance
static bool TryReload(Thing weapon, Thing ammo=null)
override string GetText(string str="")
override bool CanPerform()
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)
static AttackProcess Current
void PlayRangedAnime(int numFire)
bool IsRestrainedResident
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual bool IsAliveInCurrentZone
void Say(string lang, string ref1=null, string ref2=null)
bool IsTooHeavyToEquip(Thing thing)
Condition AddCondition(string id, int p=100, bool force=false)
Thing FindAmmo(Thing weapon)
bool CanSeeLos(Card c, int dist=-1)
bool HasCondition(string alias)
void DoHostileAction(Card _tg, bool immediate=false)
void RequestProtection(Chara attacker, Action< Chara > action)
override void LookAt(Card c)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
static CursorInfo IconRange
static void TryWarnMana(Action action)
static void Wait(float a, Card c)
static GameSetting setting
ElementContainerFaction charaElements
UD_String_EffectData guns
static void SetDirty(Thing t)
List< Point > ListPointsInLine(Point center, Point to, int radius)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
void EndTurn(bool consume=true)
Point Set(int _x, int _z)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
bool Equals(int _x, int _z)
bool TryGetValue(TKey key, out TValue value)