Elin Decompiled Documentation EA 23.102 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 ()
 
virtual bool CanPerform ()
 
bool Perform (Chara _cc, Card _tc=null, Point _tp=null)
 
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 int GetSourceValue (int 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)
 
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)
 
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)
 
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 int GetResistDamage (int dmg, int v, int power=0)
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
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 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]
 
virtual bool IsCrime [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 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:538
Point pos
Definition: Card.cs:55
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2003
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1059
bool HasCondition(string alias)
Definition: Chara.cs:8568

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 bool flag = weapon.trait is TraitToolRangeGun;
100 bool flag2 = weapon.trait is TraitToolRangeCane;
101 GameSetting.EffectData effectData = EClass.setting.effect.guns.TryGetValue(weapon.id) ?? EClass.setting.effect.guns[flag2 ? "cane" : (flag ? "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 += num / 10 + ((num % 10 > EClass.rnd(10)) ? 1 : 0);
112 }
113 numFire += Act.CC.Evalue(1652);
114 int num2 = numFire;
115 int num3 = 1 + weapon.material.hardness / 30 + EClass.rnd(3);
116 int num4 = weapon.Evalue(604);
117 if (num4 > 0)
118 {
119 for (int i = 0; i < numFire; i++)
120 {
121 if (Mathf.Sqrt(num4) * 5f + 10f > (float)EClass.rnd(100))
122 {
123 num2--;
124 }
125 }
126 num3 = Mathf.Max(1, num3 * 100 / (100 + num4 * 5));
127 }
128 string missSound = ((weapon.trait is TraitToolRangeGun) ? "miss_bullet" : "miss_arrow");
129 if (weapon.trait is TraitToolRangeCane)
130 {
131 foreach (Element item in weapon.elements.dict.Values.Where((Element e) => e.source.categorySub == "eleAttack"))
132 {
133 num3 += item.source.LV / 15;
134 }
135 if (Act.CC.IsPC)
136 {
137 if (Act.CC.mana.value < num3)
138 {
139 if (!Act.CC.ai.IsNoGoal)
140 {
141 return false;
142 }
144 {
145 ActPlan.warning = true;
146 Dialog.TryWarnMana(delegate
147 {
148 if (Perform())
149 {
151 }
152 });
153 return false;
154 }
155 }
156 EClass.ui.CloseLayers();
157 }
158 }
159 else
160 {
161 if (IsReload)
162 {
163 return TryReload(weapon);
164 }
165 if (weapon.c_ammo <= 0)
166 {
167 if (!TryReload(weapon))
168 {
169 if (Act.CC.IsPC)
170 {
171 EInput.Consume();
172 }
173 return false;
174 }
176 {
177 return true;
178 }
179 }
180 if (Act.CC.HasCondition<ConFear>())
181 {
182 Act.CC.Say("fear", Act.CC, Act.TC);
183 if (Act.CC.IsPC)
184 {
185 EInput.Consume(consumeAxis: true);
186 }
187 return true;
188 }
189 }
190 Act.CC.LookAt(Act.TP);
191 int index = 0;
192 Point orgTP = Act.TP.Copy();
193 List<Point> points = new List<Point>();
194 if (drill > 0)
195 {
196 points = EClass._map.ListPointsInLine(Act.CC.pos, Act.TP, drill / 10 + ((drill % 10 > EClass.rnd(10)) ? 1 : 0) + 1);
197 }
198 else if (scatter > 0)
199 {
200 Act.TP.ForeachNeighbor(delegate(Point _p)
201 {
202 points.Add(_p.Copy());
203 });
204 }
206 {
207 EClass.Wait(0.25f, Act.CC);
208 }
209 Shoot(Act.TC, Act.TP);
210 if (points.Count > 0)
211 {
212 Point obj = Act.TP.Copy();
213 foreach (Point item2 in points)
214 {
215 if (!item2.Equals(obj))
216 {
217 Chara firstChara = item2.FirstChara;
218 if ((firstChara == null || firstChara.IsHostile(Act.CC)) && (firstChara != null || scatter != 0))
219 {
220 Shoot(item2.FirstChara, item2);
221 }
222 }
223 }
224 }
225 if (!(weapon.trait is TraitToolRangeCane))
226 {
227 weapon.c_ammo -= num2;
228 if (weapon.ammoData != null)
229 {
230 weapon.ammoData.Num = weapon.c_ammo;
231 }
232 if (weapon.c_ammo <= 0)
233 {
234 weapon.c_ammo = 0;
235 weapon.ammoData = null;
236 }
237 }
238 if (Act.CC.IsPC)
239 {
241 }
242 if (Act.TC != null && !hasHit)
243 {
244 Act.CC.PlaySound(missSound);
245 }
246 if (!Act.CC.isDead)
247 {
248 if (EClass.rnd(2) == 0)
249 {
250 Act.CC.RemoveCondition<ConInvisibility>();
251 }
252 if (weapon.trait is TraitToolRangeCane)
253 {
254 Act.CC.mana.Mod(-num3 * numFire);
255 }
256 }
257 return true;
258 int GetWeaponEnc(int ele)
259 {
260 return weapon.Evalue(ele) + (Act.CC.IsPCFactionOrMinion ? EClass.pc.faction.charaElements.Value(ele) : 0);
261 }
262 void Prepare()
263 {
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)
271 {
272 AttackProcess.Current.posRangedAnime = points.LastItem();
273 }
274 else if (scatter > 0)
275 {
276 AttackProcess.Current.ignoreAnime = false;
277 AttackProcess.Current.ignoreAttackSound = index > 1;
278 }
279 }
280 void Shoot(Card _tc, Point _tp)
281 {
282 float dmgMulti = 1f;
283 index++;
284 Act.TC = _tc;
285 Act.TP = _tp;
286 if (index == 1)
287 {
288 Act.TC?.Chara?.RequestProtection(Act.CC, delegate(Chara c)
289 {
290 Act.TC = c;
291 });
292 }
293 CellEffect effect = Act.TP.cell.effect;
294 if (effect != null && effect.id == 6 && EClass.rnd(2) == 0)
295 {
297 Act.CC.PlaySound(missSound);
298 Act.CC.Say("abMistOfDarkness_miss", Act.CC);
299 }
300 else
301 {
302 if (scatter > 0)
303 {
304 dmgMulti = Mathf.Clamp(1.2f - 0.2f * (float)Act.CC.Dist(Act.TP) - (Act.TP.Equals(orgTP) ? 0f : 0.4f), 0.2f, 1f);
305 }
306 for (int j = 0; j < numFire; j++)
307 {
308 Act.TC = _tc;
309 Prepare();
310 if (AttackProcess.Current.Perform(j, hasHit, dmgMulti))
311 {
312 hasHit = true;
313 }
314 else if (chaser > 0)
315 {
316 for (int k = 0; k < 10; k++)
317 {
318 if (chaser > EClass.rnd(4 + (int)Mathf.Pow(4f, k + 2 + j)))
319 {
320 Act.CC.Say("attack_chaser");
321 if (AttackProcess.Current.Perform(j, hasHit, dmgMulti))
322 {
323 hasHit = true;
324 break;
325 }
326 }
327 }
328 }
329 if (Act.TC == null || !Act.TC.IsAliveInCurrentZone)
330 {
331 break;
332 }
333 }
334 if (Act.TC != null)
335 {
337 }
338 }
339 }
340 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
override bool Perform()
Definition: ActRanged.cs:65
static bool TryReload(Thing weapon, Thing ammo=null)
Definition: ActRanged.cs:342
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
void PlayRangedAnime(int numFire)
virtual void NextFrame()
Definition: Card.cs:11
virtual Chara Chara
Definition: Card.cs:1946
bool IsRestrainedResident
Definition: Card.cs:2118
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
Trait trait
Definition: Card.cs:49
int Evalue(int ele)
Definition: Card.cs:2431
int Dist(Card c)
Definition: Card.cs:6777
CardRenderer renderer
Definition: Card.cs:57
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
CellEffect effect
Definition: Cell.cs:94
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156
Definition: Chara.cs:10
CharaBody body
Definition: Chara.cs:91
AIAct ai
Definition: Chara.cs:187
Faction faction
Definition: Chara.cs:412
override bool IsPC
Definition: Chara.cs:597
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
Thing ranged
Definition: Chara.cs:95
Stats mana
Definition: Chara.cs:963
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:5707
void RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:7623
bool IsHostile()
Definition: Chara.cs:5884
bool isDead
Definition: Chara.cs:374
override void LookAt(Card c)
Definition: Chara.cs:3219
bool TryEquipRanged()
Definition: Chara.cs:7081
new GameConfig game
Definition: CoreConfig.cs:596
bool godMode
Definition: CoreDebug.cs:172
CoreConfig config
Definition: Core.cs:70
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:49
static void TryWarnMana(Action action)
Definition: Dialog.cs:391
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
static Core core
Definition: EClass.cs:6
static void Wait(float a, Card c)
Definition: EClass.cs:89
static Map _map
Definition: EClass.cs:18
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
static GameSetting setting
Definition: EClass.cs:34
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:656
int Value(int ele)
ElementContainerFaction charaElements
Definition: FACTION.cs:144
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)
Definition: Map.cs:2304
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:1866
Definition: Point.cs:9
Point Copy()
Definition: Point.cs:467
Point Set(int _x, int _z)
Definition: Point.cs:479
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1361
bool Equals(int _x, int _z)
Definition: Point.cs:924
Card FindAttackTarget()
Definition: Point.cs:1062
Chara FirstChara
Definition: Point.cs:264
Cell cell
Definition: Point.cs:51
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
Definition: Thing.cs:8
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178

References EClass._map, Chara.ai, Chara.body, Act.CC, Point.cell, 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.FirstChara, Point.ForeachNeighbor(), CoreConfig.game, CoreDebug.godMode, GameSetting.EffectSetting.guns, Chara.HasCondition(), CellEffect.id, Card.IsAliveInCurrentZone, Chara.isDead, Chara.IsHostile(), AIAct.IsNoGoal, Chara.IsPC, IsReload, Card.IsRestrainedResident, CharaBody.IsTooHeavyToEquip(), item, Map.ListPointsInLine(), Chara.LookAt(), Chara.mana, Stats.Mod(), CardRenderer.NextFrame(), GameSetting.EffectData.num, EClass.pc, Perform(), AttackProcess.Perform(), EClass.player, AttackProcess.PlayRangedAnime(), Card.PlaySound(), Card.pos, AttackProcess.Prepare(), 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, 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 342 of file ActRanged.cs.

343 {
344 TraitToolRange traitToolRange = weapon.trait as TraitToolRange;
345 if (Act.CC.IsPC)
346 {
348 }
349 if (weapon.ammoData != null)
350 {
351 if (weapon.ammoData.Num > 0)
352 {
353 Act.CC.Pick(weapon.ammoData);
354 }
355 weapon.ammoData = null;
356 }
357 int num = 0;
358 if (ammo == null)
359 {
361 }
362 if (ammo == null)
363 {
364 if (Act.CC.IsPC)
365 {
366 if (!weapon.IsMeleeWithAmmo)
367 {
368 Msg.Say("noAmmo", weapon);
369 }
370 return false;
371 }
372 num = traitToolRange.MaxAmmo;
373 }
374 else
375 {
376 num = Mathf.Min(ammo.Num, traitToolRange.MaxAmmo);
377 Thing thing = ammo.Split(num);
378 Act.CC.Say("takeAmmo", thing);
379 if (thing.GetRootCard() == Act.CC)
380 {
381 thing.parent.RemoveCard(thing);
382 }
383 weapon.ammoData = thing;
384 }
385 weapon.c_ammo = num;
386 int reloadTurn = traitToolRange.ReloadTurn;
387 reloadTurn = reloadTurn * 100 / (100 + Act.CC.Evalue(1652) * 100);
388 if (traitToolRange.NeedReload && reloadTurn > 0)
389 {
390 Act.CC.AddCondition<ConReload>(reloadTurn * 10);
391 }
392 return true;
393 }
ICardParent parent
Definition: Card.cs:51
Card GetRootCard()
Definition: Card.cs:3173
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8415
Thing FindAmmo(Thing weapon)
Definition: Chara.cs:7051
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3920
virtual bool NeedReload
void RemoveCard(Card c)

References Chara.AddCondition(), ammo, 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:901

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: