Elin Decompiled Documentation EA 23.306 Nightly
Loading...
Searching...
No Matches
ActRanged Class Reference
Inheritance diagram for ActRanged:
ActThrow ActBaseAttack Act Element EClass

Public Member Functions

override string GetText (string str="")
 
override bool CanPerform ()
 
override bool Perform ()
 
- Public Member Functions inherited from ActThrow
override string GetText (string str="")
 
override bool CanPerform ()
 
override bool Perform ()
 
- Public Member Functions inherited from Act
virtual CursorInfo GetCursorIcon (Card c)
 
virtual MultiSprite GetStateIcon ()
 
override Sprite GetSprite ()
 
virtual bool ShowMouseHint (Card c)
 
virtual bool IsValidTC (Card c)
 
virtual string GetHintText (string str="")
 
virtual string GetText (string str="")
 
virtual string GetTextSmall (Card c)
 
bool IsTargetHostileParty ()
 
virtual Color GetActPlanColor ()
 
virtual bool Perform ()
 
bool Perform (Chara _cc, Card _tc=null, Point _tp=null)
 
virtual bool ValidatePerform (Chara _cc, Card _tc, Point _tp)
 
virtual bool CanPerform ()
 
bool CanPerform (Chara _cc, Card _tc=null, Point _tp=null)
 
virtual bool IsToolValid ()
 
new void SetImage (Image image)
 
virtual void OnMarkMapHighlights ()
 
virtual bool ShouldMapHighlight (Point p)
 
- Public Member Functions inherited from Element
virtual SourceElement.Row GetSource ()
 
virtual int GetSourcePotential (int v)
 
virtual Sprite GetSprite ()
 
int GetMaterialSourceValue (Thing t, int v)
 
virtual long GetSourceValue (long v, int lv, SourceValueType type)
 
virtual Sprite GetIcon (string suffix="")
 
bool IsActive (Card c)
 
int SortVal (bool charaSheet=false)
 
virtual bool CanLink (ElementContainer owner)
 
bool HasTag (string tag)
 
void SetImage (Image i)
 
virtual string GetDetail ()
 
bool IsFactionElement (Chara c)
 
Element GetParent (Card c)
 
void WriteNote (UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
 
void WriteNoteWithRef (UINote n, ElementContainer owner, Action< UINote > onWriteNote, Element refEle)
 
void _WriteNote (UINote n, Chara c, Act act)
 
void AddHeaderAbility (UINote n)
 
void _WriteNote (UINote n, ElementContainer owner, Action< UINote > onWriteNote, bool isRef, bool addHeader=true)
 
void AddEncNote (UINote n, Card Card, ElementContainer.NoteMode mode=ElementContainer.NoteMode.Default, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
 
virtual void OnWriteNote (UINote n, ElementContainer owner)
 
virtual void OnChangeValue ()
 
void CheckLevelBonus (ElementContainer owner, UINote n=null)
 
int GetSortVal (UIList.SortMode m)
 
virtual Act.Cost GetCost (Chara c)
 
virtual int GetPower (Card c)
 
virtual void SetTextValue (UIText text, bool shorten=false)
 
virtual bool IsPurchaseFeatReqMet (ElementContainer owner, int lv=-1)
 
virtual void WritePurchaseReq (UINote n, int lv=1)
 

Static Public Member Functions

static bool TryReload (Thing weapon, Thing ammo=null)
 
- Static Public Member Functions inherited from ActThrow
static bool CanThrow (Chara c, Thing t, Card target, Point p=null)
 
static EffectIRenderer Throw (Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
 
static EffectIRenderer Throw (Card c, Point p, Card target, Thing t, ThrowMethod method=ThrowMethod.Default)
 
- Static Public Member Functions inherited from Act
static void SetReference (Chara _cc, Card _tc=null, Point _tp=null)
 
static void SetTool (Thing t)
 
- Static Public Member Functions inherited from Element
static string GetName (string alias)
 
static SourceElement.Row Get (int id)
 
static Dictionary< int, int > GetElementMap (int[] list)
 
static Dictionary< int, int > GetElementMap (int[] list, Dictionary< int, int > map)
 
static SourceElement.Row GetRandomElement (int lv=1, bool useWeight=true)
 
static Element Create (int id, int v=0)
 
static Element Create (string id, int v=1)
 
static int GetId (string alias)
 
static int GetResistLv (int v)
 
static long GetResistDamage (long dmg, int v, int power=0)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Properties

bool IsReload [get]
 
override CursorInfo CursorIcon [get]
 
override int PerformDistance [get]
 
override string Name [get]
 
- Properties inherited from ActThrow
override bool CanPressRepeat [get]
 
override TargetType TargetType [get]
 
override int PerformDistance [get]
 
- Properties inherited from Act
override bool ShowPotential [get]
 
override bool UsePotential [get]
 
override bool ShowRelativeAttribute [get]
 
virtual CursorInfo CursorIcon [get]
 
virtual string ID [get]
 
virtual bool IsAct [get]
 
virtual bool WillEndTurn [get]
 
virtual bool CloseLayers [get]
 
virtual int LeftHand [get]
 
virtual int RightHand [get]
 
virtual int ElementPowerMod [get]
 
virtual bool ShowMapHighlight [get]
 
virtual bool ShowMapHighlightBlock [get]
 
virtual bool PickHeldOnStart [get]
 
virtual bool DropHeldOnStart [get]
 
virtual bool CanPressRepeat [get]
 
virtual bool CanAutofire [get]
 
virtual bool ResetAxis [get]
 
virtual bool RequireTool [get]
 
virtual bool IsHostileAct [get]
 
virtual bool HideRightInfo [get]
 
virtual bool ShouldEndMimicry [get]
 
virtual bool HaveLongPressAction [get]
 
virtual float Radius [get]
 
virtual int PerformDistance [get]
 
virtual int MaxRadius [get]
 
virtual TargetType TargetType [get]
 
virtual bool LocalAct [get]
 
virtual bool CanRapidFire [get]
 
virtual float RapidDelay [get]
 
virtual bool ShowAuto [get]
 
- Properties inherited from Element
SourceElement.Row source [get]
 
virtual int DisplayValue [get]
 
virtual int MinValue [get]
 
int Value [get]
 
int ValueWithoutLink [get]
 
virtual int MinPotential [get]
 
int Potential [get]
 
virtual bool CanGainExp [get]
 
bool IsFlag [get]
 
virtual string Name [get]
 
virtual string FullName [get]
 
virtual int ExpToNext [get]
 
virtual bool UseExpMod [get]
 
virtual int CostTrain [get]
 
virtual int CostLearn [get]
 
virtual bool ShowXP [get]
 
virtual bool ShowMsgOnValueChanged [get]
 
virtual bool ShowValue [get]
 
virtual bool ShowPotential [get]
 
virtual bool UsePotential [get]
 
virtual bool PotentialAsStock [get]
 
virtual bool ShowRelativeAttribute [get]
 
virtual bool ShowBonuses [get]
 
virtual string ShortName [get]
 
bool IsGlobalElement [get]
 
bool IsFactionWideElement [get]
 
bool IsPartyWideElement [get]
 
virtual bool ShowEncNumber [get]
 
bool IsTrait [get]
 
bool IsFoodTrait [get]
 
bool IsFoodTraitMain [get]
 
bool IsMainAttribute [get]
 
Act act [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Public Types inherited from Act
enum  CostType { None , MP , SP }
 
- Public Attributes inherited from ActThrow
Thing target
 
Chara pcTarget
 
- Public Attributes inherited from Element
SourceElement.Row _source
 
int id
 
int vBase
 
int vExp
 
int vPotential
 
int vTempPotential
 
int vLink
 
int vSource
 
int vSourcePotential
 
ElementContainer owner
 
- Static Public Attributes inherited from Act
static Chara CC
 
static Card TC
 
static Point TP = new Point()
 
static Thing TOOL
 
static int powerMod = 100
 
static bool forcePt
 
static Act CurrentAct
 
- Static Public Attributes inherited from Element
const int Div = 5
 
static Element Void = new Element()
 
static int[] List_MainAttributes = new int[9] { 70, 72, 71, 77, 74, 75, 76, 73, 79 }
 
static int[] List_MainAttributesMajor = new int[8] { 70, 72, 71, 77, 74, 75, 76, 73 }
 
static int[] List_Body = new int[4] { 70, 72, 71, 77 }
 
static int[] List_Mind = new int[4] { 74, 75, 76, 73 }
 
static List< SourceElement.RowListElements = new List<SourceElement.Row>()
 
static List< SourceElement.RowListAttackElements = new List<SourceElement.Row>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 5 of file ActRanged.cs.

Member Function Documentation

◆ CanPerform()

override bool ActRanged.CanPerform ( )
inlinevirtual

Reimplemented from Act.

Definition at line 44 of file ActRanged.cs.

45 {
47 {
48 return false;
49 }
51 {
52 return false;
53 }
54 if (Act.TC == null)
55 {
56 return Act.CC.CanSeeLos(Act.TP);
57 }
59 {
60 return false;
61 }
62 return Act.CC.CanSeeLos(Act.TC.pos);
63 }
Definition: ACT.cs:62
static Card TC
Definition: ACT.cs:79
static Point TP
Definition: ACT.cs:81
static Chara CC
Definition: ACT.cs:77
bool isRestrained
Definition: Card.cs:569
Point pos
Definition: Card.cs:60
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2167
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1276
bool HasCondition(string alias)
Definition: Chara.cs:9687

References Chara.CanSeeLos(), Act.CC, Chara.HasCondition(), Card.IsAliveInCurrentZone, Card.isRestrained, Card.pos, Act.TC, and Act.TP.

Referenced by AM_Adv._OnUpdateInput(), and AI_PracticeDummy.CreateProgress().

◆ GetText()

override string ActRanged.GetText ( string  str = "")
inlinevirtual

Reimplemented from Act.

Definition at line 35 of file ActRanged.cs.

36 {
37 if (!IsReload)
38 {
39 return base.GetText(str);
40 }
41 return Name;
42 }
override string Name
Definition: ActRanged.cs:24
bool IsReload
Definition: ActRanged.cs:8

References IsReload, and Name.

◆ Perform()

override bool ActRanged.Perform ( )
inlinevirtual

Reimplemented from Act.

Definition at line 65 of file ActRanged.cs.

66 {
67 if (Act.TC == null)
68 {
69 Act.TC = Act.TP.FindAttackTarget();
70 }
71 if (Act.TC != null)
72 {
73 Act.TP.Set(Act.TC.pos);
74 }
76 {
78 {
79 target = Act.TC,
80 range = true
81 });
82 return true;
83 }
85 if (!Act.CC.IsPC)
86 {
88 }
90 if (weapon != null && Act.CC.IsPC && Act.CC.body.IsTooHeavyToEquip(weapon))
91 {
92 Msg.Say("tooHeavyToEquip", weapon);
93 return false;
94 }
95 if (weapon == null || !weapon.CanAutoFire(Act.CC, Act.TC))
96 {
97 return false;
98 }
99 TraitToolRange traitRange = weapon.trait as TraitToolRange;
100 bool flag = weapon.trait is TraitToolRangeCane;
101 GameSetting.EffectData effectData = EClass.setting.effect.guns.TryGetValue(weapon.id) ?? EClass.setting.effect.guns[flag ? "cane" : ((weapon.trait is TraitToolRangeGun) ? "gun" : "bow")];
102 bool hasHit = false;
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);
109 if (num > 0)
110 {
111 numFire += Mathf.Min(num / 10 + ((num % 10 > EClass.rnd(10)) ? 1 : 0), 10);
112 numFireWithoutDamageLoss += num / 100 + ((num % 100 > EClass.rnd(100)) ? 1 : 0);
113 }
114 numFire += Act.CC.Evalue(1652);
115 int num2 = numFire;
116 int num3 = 1 + weapon.material.hardness / 30 + EClass.rnd(3);
117 int num4 = weapon.Evalue(604);
118 if (num4 > 0)
119 {
120 for (int i = 0; i < numFire; i++)
121 {
122 if (Mathf.Sqrt(num4) * 5f + 10f > (float)EClass.rnd(100))
123 {
124 num2--;
125 }
126 }
127 num3 = Mathf.Max(1, num3 * 100 / (100 + num4 * 5));
128 }
129 string missSound = ((weapon.trait is TraitToolRangeGun) ? "miss_bullet" : "miss_arrow");
130 if (flag)
131 {
132 foreach (Element item in weapon.elements.dict.Values.Where((Element e) => e.source.categorySub == "eleAttack"))
133 {
134 num3 += item.source.LV / 15;
135 }
136 if (Act.CC.IsPC)
137 {
138 if (Act.CC.mana.value < num3)
139 {
140 if (!Act.CC.ai.IsNoGoal)
141 {
142 return false;
143 }
145 {
146 ActPlan.warning = true;
147 Dialog.TryWarnMana(delegate
148 {
149 if (Perform())
150 {
152 }
153 });
154 return false;
155 }
156 }
157 EClass.ui.CloseLayers();
158 }
159 }
160 else
161 {
162 if (IsReload)
163 {
164 return TryReload(weapon);
165 }
166 if (weapon.c_ammo <= 0)
167 {
168 if (!TryReload(weapon))
169 {
170 if (Act.CC.IsPC)
171 {
172 EInput.Consume();
173 }
174 return false;
175 }
177 {
178 return true;
179 }
180 }
181 if (Act.CC.HasCondition<ConFear>())
182 {
183 Act.CC.Say("fear", Act.CC, Act.TC);
184 if (Act.CC.IsPC)
185 {
186 EInput.Consume(consumeAxis: true);
187 }
188 return true;
189 }
190 }
191 Act.TC?.Chara?.RequestProtection(Act.CC, delegate(Chara c)
192 {
193 Act.TC = c;
194 });
195 Act.CC.LookAt(Act.TP);
196 int index = 0;
197 Point orgTP = Act.TP.Copy();
198 List<Point> points = new List<Point>();
199 if (drill > 0)
200 {
201 points = EClass._map.ListPointsInLine(Act.CC.pos, Act.TP, drill / 10 + ((drill % 10 > EClass.rnd(10)) ? 1 : 0) + 1);
202 }
203 else if (scatter > 0)
204 {
205 Act.TP.ForeachNeighbor(delegate(Point _p)
206 {
207 points.Add(_p.Copy());
208 });
209 }
211 {
212 EClass.Wait(0.25f, Act.CC);
213 }
214 Shoot(Act.TC, Act.TP, subAttack: false);
215 if (points.Count > 0)
216 {
217 Point obj = Act.TP.Copy();
218 foreach (Point item2 in points)
219 {
220 if (item2.Equals(obj))
221 {
222 continue;
223 }
224 Chara firstChara = item2.FirstChara;
225 if (firstChara != null && !firstChara.IsHostile(Act.CC))
226 {
227 continue;
228 }
229 if (scatter > 0)
230 {
231 if (EClass.rnd(EClass.rnd(100) + 1) > scatter)
232 {
233 continue;
234 }
235 }
236 else if (firstChara == null)
237 {
238 continue;
239 }
240 Shoot(item2.FirstChara ?? item2.FindThing<TraitTrainingDummy>()?.owner, item2, subAttack: true);
241 }
242 }
243 if (!(weapon.trait is TraitToolRangeCane))
244 {
245 weapon.c_ammo -= num2;
246 if (weapon.ammoData != null)
247 {
248 weapon.ammoData.Num = weapon.c_ammo;
249 }
250 if (weapon.c_ammo <= 0)
251 {
252 weapon.c_ammo = 0;
253 weapon.ammoData = null;
254 }
255 }
256 if (Act.CC.IsPC)
257 {
259 }
260 if (Act.TC != null && !hasHit)
261 {
262 Act.CC.PlaySound(missSound);
263 }
264 if (!Act.CC.isDead)
265 {
266 if (EClass.rnd(2) == 0)
267 {
268 Act.CC.RemoveCondition<ConInvisibility>();
269 Act.CC.RemoveCondition<ConDark>();
270 }
271 if (weapon.trait is TraitToolRangeCane)
272 {
273 Act.CC.mana.Mod(-num3 * numFire);
274 }
275 }
276 return true;
277 int GetWeaponEnc(int ele)
278 {
279 return weapon.Evalue(ele) + (Act.CC.IsPCFactionOrMinion ? EClass.pc.faction.charaElements.Value(ele) : 0);
280 }
281 void Prepare()
282 {
284 AttackProcess.Current.numFire = numFire;
285 AttackProcess.Current.numFireWithoutDamageLoss = numFireWithoutDamageLoss;
286 AttackProcess.Current.posRangedAnime = Act.TP.Copy();
287 AttackProcess.Current.ignoreAnime = index > 1;
288 AttackProcess.Current.ignoreAttackSound = false;
289 if (drill > 0 && points.Count > 0)
290 {
291 AttackProcess.Current.posRangedAnime = points.LastItem();
292 }
293 else if (scatter > 0)
294 {
295 AttackProcess.Current.ignoreAnime = false;
296 AttackProcess.Current.ignoreAttackSound = index > 1;
297 }
298 }
299 void Shoot(Card _tc, Point _tp, bool subAttack)
300 {
301 float dmgMulti = 1f;
302 index++;
303 Act.TC = _tc;
304 Act.TP = _tp;
305 CellEffect effect = Act.TP.cell.effect;
306 if (effect != null && effect.id == 6 && EClass.rnd(2) == 0)
307 {
308 Prepare();
310 Act.CC.PlaySound(missSound);
311 Act.CC.Say("abMistOfDarkness_miss", Act.CC);
312 }
313 else
314 {
315 if (scatter > 0)
316 {
317 dmgMulti = Mathf.Clamp(1.2f - 0.2f * (float)Act.CC.Dist(Act.TP) - (Act.TP.Equals(orgTP) ? 0f : 0.4f), 0.2f, 1f);
318 }
319 for (int j = 0; j < numFire; j++)
320 {
321 Act.TC = _tc;
322 Card tC = Act.TC;
323 Chara cC = Act.CC;
324 Point point = Act.TP.Copy();
325 if (traitRange.ChanceMissAim > 0 && EClass.rnd(traitRange.ChanceMissAim) == 0)
326 {
328 }
329 Prepare();
330 int num5 = 0;
331 if (weapon.trait is TraitToolRangeGunEnergy && Act.TC != null && Act.TC.isChara && Act.TC.HasElement(383))
332 {
333 if (weapon.id == "gun_laser")
334 {
335 num5 = 50;
336 }
337 num5 += Mathf.Max(25 * Act.TC.PER / Mathf.Max(1, Act.CC.PER), 50);
338 if (Act.CC.IsPowerful)
339 {
340 num5 /= 2;
341 }
342 }
343 if (num5 > EClass.rnd(100))
344 {
345 List<Chara> list = Act.TC.pos.ListCharasInRadius(Act.TC.Chara, Act.TC.GetSightRadius(), (Chara c) => c.IsHostile(Act.TC.Chara));
346 Chara chara = ((list.Count > 0) ? list.RandomItem() : Act.CC?.Chara);
347 Act.TC.Say((Act.TC.isChara && Act.TC.Chara.IsHostile()) ? "attack_reflect_enemy" : "attack_reflect");
348 Act.TC.PlaySound("attack_gun_laser_parry");
350 AttackProcess.Current.CC = Act.TC?.Chara;
351 AttackProcess.Current.TC = chara;
353 AttackProcess.Current.posRangedAnime = chara.pos;
354 AttackProcess.Current.Perform(j, hasHit, chara.IsPCFactionOrMinion ? 0.1f : 2.5f, maxRoll: true, subAttack: true);
355 }
356 else if (AttackProcess.Current.Perform(j, hasHit, dmgMulti, maxRoll: false, subAttack))
357 {
358 hasHit = true;
359 }
360 else if (chaser > 0)
361 {
362 for (int k = 0; k < 10; k++)
363 {
364 if (chaser > EClass.rnd(4 + (int)Mathf.Pow(4f, k + 2 + j)))
365 {
366 Act.CC.Say(Act.CC.IsHostile() ? "attack_chaser_enemy" : "attack_chaser");
367 if (AttackProcess.Current.Perform(j, hasHit, dmgMulti, maxRoll: false, subAttack))
368 {
369 hasHit = true;
370 break;
371 }
372 }
373 }
374 }
375 switch (traitRange.GroundHitEffect)
376 {
377 case TraitToolRange.HitEffect.Rocket:
378 ActEffect.ProcAt(EffectId.Rocket, AttackProcess.Current.GetRocketPower(), BlessedState.Normal, Act.CC, null, Act.TP, isNeg: true, new ActRef
379 {
380 origin = Act.CC.Chara,
381 refThing = weapon,
382 aliasEle = "eleImpact"
383 });
384 break;
385 case TraitToolRange.HitEffect.Gravity:
386 ActEffect.ProcAt(EffectId.GravityGun, AttackProcess.Current.GetRocketPower() / 2, BlessedState.Normal, Act.CC, null, Act.TP, isNeg: true, new ActRef
387 {
388 origin = Act.CC.Chara,
389 refThing = weapon,
390 aliasEle = "eleImpact",
391 refVal = j
392 });
393 break;
394 }
395 Act.TC = tC;
396 Act.CC = cC;
397 Act.TP.Set(point);
398 if (traitRange.GroundHitEffect == TraitToolRange.HitEffect.None && (Act.TC == null || !Act.TC.IsAliveInCurrentZone))
399 {
400 break;
401 }
402 }
403 if (Act.TC != null)
404 {
406 }
407 }
408 }
409 }
BlessedState
Definition: BlessedState.cs:2
EffectId
Definition: EffectId.cs:2
virtual bool IsNoGoal
Definition: AIAct.cs:74
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:493
override bool Perform()
Definition: ActRanged.cs:65
static bool TryReload(Thing weapon, Thing ammo=null)
Definition: ActRanged.cs:411
Thing target
Definition: ActThrow.cs:5
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
Definition: AttackProcess.cs:8
int GetRocketPower()
void PlayRangedAnime(int numFire, float delay=0f)
virtual void NextFrame()
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2314
virtual Chara Chara
Definition: Card.cs:2110
int GetSightRadius()
Definition: Card.cs:6726
bool IsRestrainedResident
Definition: Card.cs:2300
int PER
Definition: Card.cs:2381
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6472
Trait trait
Definition: Card.cs:54
bool IsPowerful
Definition: Card.cs:2134
virtual bool isChara
Definition: Card.cs:2123
int Evalue(int ele)
Definition: Card.cs:2613
int Dist(Card c)
Definition: Card.cs:8025
CardRenderer renderer
Definition: Card.cs:64
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6214
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7150
CellEffect effect
Definition: Cell.cs:102
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:168
Definition: Chara.cs:10
CharaBody body
Definition: Chara.cs:94
AIAct ai
Definition: Chara.cs:204
Faction faction
Definition: Chara.cs:429
override bool IsPC
Definition: Chara.cs:626
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:8622
AIAct SetAI(AIAct g)
Definition: Chara.cs:9156
Thing ranged
Definition: Chara.cs:98
Stats mana
Definition: Chara.cs:1180
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6509
bool IsHostile()
Definition: Chara.cs:6690
bool isDead
Definition: Chara.cs:391
override void LookAt(Card c)
Definition: Chara.cs:3606
bool TryEquipRanged()
Definition: Chara.cs:8061
new GameConfig game
Definition: CoreConfig.cs:613
bool godMode
Definition: CoreDebug.cs:188
CoreConfig config
Definition: Core.cs:70
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:50
static void TryWarnMana(Action action)
Definition: Dialog.cs:399
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static void Wait(float a, Card c)
Definition: EClass.cs:112
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
static UI ui
Definition: EClass.cs:17
static GameSetting setting
Definition: EClass.cs:35
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:667
int Value(int ele)
ElementContainerFaction charaElements
Definition: FACTION.cs:146
UD_String_EffectData guns
Definition: GameSetting.cs:276
EffectSetting effect
Definition: GameSetting.cs:299
static void SetDirty(Thing t)
List< Point > ListPointsInLine(Point center, Point to, int radius, bool returnOnBlocked=true)
Definition: Map.cs:2347
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
void EndTurn(bool consume=true)
Definition: Player.cs:2153
Definition: Point.cs:9
Point Copy()
Definition: Point.cs:491
Point Set(int _x, int _z)
Definition: Point.cs:503
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1398
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1221
bool Equals(int _x, int _z)
Definition: Point.cs:961
Card FindAttackTarget()
Definition: Point.cs:1099
Chara FirstChara
Definition: Point.cs:288
Cell cell
Definition: Point.cs:51
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1141
Point GetRandomNeighbor()
Definition: Point.cs:759
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
Definition: Thing.cs:8
virtual HitEffect GroundHitEffect
virtual int ChanceMissAim
Card owner
Definition: Trait.cs:28
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178
Definition: ActRef.cs:2

References EClass._map, Chara.ai, Chara.body, Act.CC, Point.cell, TraitToolRange.ChanceMissAim, Card.Chara, Faction.charaElements, Core.config, EInput.Consume(), Point.Copy(), EClass.core, AttackProcess.Current, EClass.debug, Card.Dist(), Chara.DoHostileAction(), Cell.effect, GameSetting.effect, Player.EndTurn(), Point.Equals(), Card.Evalue(), Chara.faction, Point.FindAttackTarget(), Point.FindThing(), Point.FirstChara, Point.ForeachNeighbor(), CoreConfig.game, Point.GetRandomNeighbor(), AttackProcess.GetRocketPower(), Card.GetSightRadius(), CoreDebug.godMode, TraitToolRange.GroundHitEffect, GameSetting.EffectSetting.guns, Chara.HasCondition(), Card.HasElement(), CellEffect.id, Card.IsAliveInCurrentZone, Card.isChara, Chara.isDead, Chara.IsHostile(), AIAct.IsNoGoal, Chara.IsPC, Card.IsPCFactionOrMinion, Card.IsPowerful, IsReload, Card.IsRestrainedResident, CharaBody.IsTooHeavyToEquip(), item, Point.ListCharasInRadius(), Map.ListPointsInLine(), Chara.LookAt(), Chara.mana, Stats.Mod(), CardRenderer.NextFrame(), GameSetting.EffectData.num, Trait.owner, EClass.pc, Card.PER, Perform(), AttackProcess.Perform(), EClass.player, AttackProcess.PlayRangedAnime(), Card.PlaySound(), Card.pos, AttackProcess.Prepare(), ActEffect.ProcAt(), Chara.ranged, Card.renderer, Chara.RequestProtection(), EClass.rnd(), Msg.Say(), Card.Say(), Point.Set(), Chara.SetAI(), LayerInventory.SetDirty(), EClass.setting, ActThrow.target, Act.TC, Act.TP, AttackProcess.TP, Card.trait, Chara.TryEquipRanged(), UDictionary< TKey, TValue >.TryGetValue(), TryReload(), Dialog.TryWarnMana(), EClass.ui, ElementContainer.Value(), Stats.value, EClass.Wait(), CoreConfig.GameConfig.waitOnRange, Dialog.warned, and weapon.

Referenced by AM_Adv._OnUpdateInput(), AI_PracticeDummy.CreateProgress(), TraitTrainingDummy.IdleUse(), Perform(), GoalAutoCombat.TryUseRanged(), and GoalCombat.TryUseRanged().

◆ TryReload()

static bool ActRanged.TryReload ( Thing  weapon,
Thing  ammo = null 
)
inlinestatic

Definition at line 411 of file ActRanged.cs.

412 {
413 TraitToolRange traitToolRange = weapon.trait as TraitToolRange;
414 if (Act.CC.IsPC)
415 {
417 }
418 if (weapon.ammoData != null)
419 {
420 if (weapon.ammoData.Num > 0)
421 {
422 Act.CC.Pick(weapon.ammoData);
423 }
424 weapon.ammoData = null;
425 }
426 int num = 0;
427 if (ammo == null)
428 {
430 }
431 if (ammo == null)
432 {
433 if (Act.CC.IsPC && !traitToolRange.AutoRefillAmmo)
434 {
435 if (!weapon.IsMeleeWithAmmo)
436 {
437 Msg.Say("noAmmo", weapon);
438 }
439 return false;
440 }
441 num = traitToolRange.MaxAmmo;
442 }
443 else
444 {
445 num = Mathf.Min(ammo.Num, traitToolRange.MaxAmmo);
446 Thing thing = ammo.Split(num);
447 Act.CC.Say("takeAmmo", thing);
448 if (thing.GetRootCard() == Act.CC)
449 {
450 thing.parent.RemoveCard(thing);
451 }
452 weapon.ammoData = thing;
453 }
454 weapon.c_ammo = num;
455 int reloadTurn = traitToolRange.ReloadTurn;
456 reloadTurn = reloadTurn * 100 / (100 + Act.CC.Evalue(1652) * 100);
457 if (traitToolRange.NeedReload && reloadTurn > 0)
458 {
459 Act.CC.AddCondition<ConReload>(reloadTurn * 10);
460 }
461 return true;
462 }
ICardParent parent
Definition: Card.cs:56
Card GetRootCard()
Definition: Card.cs:3510
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9526
Thing FindAmmo(Thing weapon)
Definition: Chara.cs:8031
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4392
virtual bool AutoRefillAmmo
virtual bool NeedReload
void RemoveCard(Card c)

References Chara.AddCondition(), ammo, TraitToolRange.AutoRefillAmmo, Act.CC, Card.Evalue(), Chara.FindAmmo(), Card.GetRootCard(), Chara.IsPC, TraitToolRange.MaxAmmo, TraitToolRange.NeedReload, Card.parent, Chara.Pick(), TraitToolRange.ReloadTurn, ICardParent.RemoveCard(), Msg.Say(), Card.Say(), LayerInventory.SetDirty(), and weapon.

Referenced by ActMelee.Attack(), TraitAmmo.OnUse(), and Perform().

Property Documentation

◆ CursorIcon

override CursorInfo ActRanged.CursorIcon
get

Definition at line 19 of file ActRanged.cs.

◆ IsReload

bool ActRanged.IsReload
get

Definition at line 7 of file ActRanged.cs.

8 {
9 get
10 {
12 {
13 return !(EClass.player.currentHotItem.Thing.trait is TraitToolRangeCane);
14 }
15 return false;
16 }
17 }
virtual Thing Thing
Definition: HotItem.cs:38
HotItem currentHotItem
Definition: Player.cs:1167

Referenced by GetText(), and Perform().

◆ Name

override string ActRanged.Name
get

Definition at line 23 of file ActRanged.cs.

24 {
25 get
26 {
27 if (!IsReload)
28 {
29 return base.Name;
30 }
31 return "ActReload".lang();
32 }
33 }

Referenced by GetText().

◆ PerformDistance

override int ActRanged.PerformDistance
get

Definition at line 21 of file ActRanged.cs.


The documentation for this class was generated from the following file: