Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
PointTarget Class Reference
Inheritance diagram for PointTarget:
EClass

Public Member Functions

void Update (Point _pos)
 
bool ShouldIgnore (Card c)
 
void CycleTarget (int a)
 
bool CanCycle ()
 
void Clear ()
 
void CheckLastTarget ()
 

Public Attributes

Card card
 
Area area
 
ObjInfo obj
 
BlockInfo block
 
TaskPoint task
 
IInspect target
 
IInspect lastTarget
 
bool hasTargetChanged
 
bool hasValidTarget
 
bool drawHighlight
 
bool mouse = true
 
bool hasInteraction
 
bool isValid
 
Point pos = new Point()
 
Point lastPos = new Point()
 
int index
 
List< Cardcards = new List<Card>()
 

Properties

Chara TargetChara [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

- 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)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file PointTarget.cs.

Member Function Documentation

◆ CanCycle()

bool PointTarget.CanCycle ( )
inline

Definition at line 215 of file PointTarget.cs.

216 {
217 return cards.Count >= 2;
218 }

Referenced by AM_Adv._OnUpdateInput(), AM_MoveInstalled.HitTest(), AM_MoveInstalled.InputWheel(), and AM_MoveInstalled.OnRenderTile().

◆ CheckLastTarget()

void PointTarget.CheckLastTarget ( )
inline

Definition at line 229 of file PointTarget.cs.

230 {
232 hasValidTarget = target != null;
234 lastPos.Set(pos);
235 }
bool hasTargetChanged
Definition: PointTarget.cs:20
IInspect lastTarget
Definition: PointTarget.cs:18
bool hasValidTarget
Definition: PointTarget.cs:22
IInspect target
Definition: PointTarget.cs:16
Point lastPos
Definition: PointTarget.cs:34
Point Set(int _x, int _z)
Definition: Point.cs:479
bool Equals(int _x, int _z)
Definition: Point.cs:924

References Point.Equals(), hasTargetChanged, hasValidTarget, lastPos, lastTarget, pos, Point.Set(), and target.

Referenced by Clear(), and Update().

◆ Clear()

void PointTarget.Clear ( )
inline

Definition at line 220 of file PointTarget.cs.

221 {
222 card = null;
223 area = null;
224 target = null;
225 hasInteraction = false;
227 }
bool hasInteraction
Definition: PointTarget.cs:28
void CheckLastTarget()
Definition: PointTarget.cs:229

References area, card, CheckLastTarget(), hasInteraction, and target.

Referenced by Scene.OnKillGame(), and Update().

◆ CycleTarget()

void PointTarget.CycleTarget ( int  a)
inline

Definition at line 204 of file PointTarget.cs.

205 {
206 SE.Rotate();
207 index += a;
209 if ((bool)WidgetMouseover.Instance)
210 {
212 }
213 }
void Update(Point _pos)
Definition: PointTarget.cs:52
Definition: Scene.cs:8
static Point HitPoint
Definition: Scene.cs:21
static WidgetMouseover Instance

References Scene.HitPoint, index, WidgetMouseover.Instance, WidgetMouseover.Refresh(), and Update().

Referenced by AM_Adv._OnUpdateInput(), and AM_MoveInstalled.InputWheel().

◆ ShouldIgnore()

bool PointTarget.ShouldIgnore ( Card  c)
inline

Definition at line 147 of file PointTarget.cs.

148 {
149 if (c.isChara)
150 {
151 if (c.Chara.host != null)
152 {
153 return true;
154 }
156 {
157 if (!EClass.debug.ignoreBuildRule && (c.IsPC || !c.IsPCFaction))
158 {
159 return true;
160 }
161 }
162 else
163 {
164 if ((!EClass.pc.hasTelepathy || !c.Chara.race.visibleWithTelepathy) && c.isHidden && !EClass.pc.canSeeInvisible)
165 {
166 return true;
167 }
168 if (c.IsPC)
169 {
170 return true;
171 }
172 if (!c.isSynced || !EClass.player.CanSee(c.Chara))
173 {
174 return true;
175 }
176 }
177 return false;
178 }
180 {
181 return true;
182 }
184 {
186 {
187 if (!c.isRoofItem)
188 {
189 return true;
190 }
191 }
192 else if (c.isRoofItem)
193 {
194 return true;
195 }
196 }
197 else if (c.isHidden || c.isRoofItem || c.isMasked)
198 {
199 return true;
200 }
201 return false;
202 }
virtual bool IsRoofEditMode(Card c=null)
Definition: ActionMode.cs:311
virtual bool IsBuildMode
Definition: ActionMode.cs:181
virtual Chara Chara
Definition: Card.cs:1946
bool isMasked
Definition: Card.cs:562
bool isRoofItem
Definition: Card.cs:550
Trait trait
Definition: Card.cs:49
virtual bool IsPC
Definition: Card.cs:2019
virtual bool isChara
Definition: Card.cs:1959
bool isHidden
Definition: Card.cs:502
virtual bool IsPCFaction
Definition: Card.cs:2129
Cell Cell
Definition: Card.cs:1931
virtual bool isSynced
Definition: Card.cs:1963
bool IsFloorWater
Definition: Cell.cs:727
bool canSeeInvisible
Definition: Chara.cs:133
Chara host
Definition: Chara.cs:33
bool hasTelepathy
Definition: Chara.cs:135
SourceRace.Row race
Definition: Chara.cs:449
bool ignoreBuildRule
Definition: CoreDebug.cs:184
Definition: EClass.cs:5
static Scene scene
Definition: EClass.cs:30
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
bool CanSee(Chara c)
Definition: Player.cs:2221
Cell cell
Definition: Point.cs:51
ActionMode actionMode
Definition: Scene.cs:77
virtual bool IsGround
Definition: Trait.cs:64

References Scene.actionMode, Player.CanSee(), Chara.canSeeInvisible, Card.Cell, Point.cell, Card.Chara, EClass.debug, Chara.hasTelepathy, Chara.host, CoreDebug.ignoreBuildRule, ActionMode.IsBuildMode, Card.isChara, Cell.IsFloorWater, Trait.IsGround, Card.isHidden, Card.isMasked, Card.IsPC, Card.IsPCFaction, ActionMode.IsRoofEditMode(), Card.isRoofItem, Card.isSynced, EClass.pc, EClass.player, pos, Chara.race, EClass.scene, and Card.trait.

Referenced by Update().

◆ Update()

void PointTarget.Update ( Point  _pos)
inline

Definition at line 52 of file PointTarget.cs.

53 {
54 pos.Set(_pos);
56 cards.Clear();
57 if (!isValid || pos.IsHidden || EClass.ui.BlockMouseOverUpdate || (mouse && (EClass.ui.isPointerOverUI || !EClass.scene.actionMode.ShowMouseoverTarget)))
58 {
59 Clear();
60 return;
61 }
62 card = null;
63 area = null;
64 task = null;
66 if (pos.sourceBlock.tileType.Invisible && !EClass.scene.actionMode.IsBuildMode)
67 {
68 block = null;
69 }
71 if (obj != null)
72 {
73 target = obj;
74 }
75 else if (block != null)
76 {
77 target = block;
78 }
79 else
80 {
81 target = null;
82 }
83 drawHighlight = target != null;
84 CellDetail detail = pos.detail;
85 if (detail != null)
86 {
87 area = detail.area;
88 task = detail.designation;
89 Thing thing = null;
90 Chara chara = null;
91 foreach (Chara chara2 in detail.charas)
92 {
93 if (!ShouldIgnore(chara2))
94 {
95 cards.Add(chara2);
96 if (chara == null || chara2.hostility < chara.hostility)
97 {
98 chara = chara2;
99 }
100 }
101 }
102 foreach (Thing thing2 in detail.things)
103 {
104 if (!ShouldIgnore(thing2))
105 {
106 cards.Add(thing2);
107 thing = thing2;
108 }
109 }
110 if (chara != null)
111 {
112 target = (card = chara);
113 drawHighlight = true;
114 }
115 else if (thing != null)
116 {
117 target = (card = thing);
118 drawHighlight = true;
119 }
120 else if (task != null)
121 {
122 target = task;
123 drawHighlight = true;
124 }
125 else if (area != null && EClass.scene.actionMode.AreaHihlight != 0)
126 {
127 target = area;
128 }
129 if (cards.Count > 0 && EClass.scene.actionMode.IsBuildMode)
130 {
131 target = (card = cards[Mathf.Abs(index) % cards.Count]);
132 drawHighlight = true;
133 }
134 }
135 if ((target == null || target is Chara) && EClass._zone.IsRegion)
136 {
138 if (zone != null)
139 {
140 target = zone;
141 }
142 }
143 hasInteraction = target != null;
145 }
virtual bool ShowMouseoverTarget
Definition: ActionMode.cs:167
virtual AreaHighlightMode AreaHihlight
Definition: ActionMode.cs:169
static bool _CanInspect(Point pos)
Definition: BlockInfo.cs:31
static BlockInfo GetTemp(Point _pos)
Definition: BlockInfo.cs:15
TaskDesignation designation
Definition: CellDetail.cs:19
List< Thing > things
Definition: CellDetail.cs:11
List< Chara > charas
Definition: CellDetail.cs:13
Area area
Definition: CellDetail.cs:15
Definition: Chara.cs:10
Hostility hostility
Definition: Chara.cs:276
static Zone _zone
Definition: EClass.cs:20
static UI ui
Definition: EClass.cs:16
Zone GetZone(Point p)
Definition: EloMap.cs:420
static ObjInfo GetTemp(Point _pos)
Definition: ObjInfo.cs:47
static bool _CanInspect(Point pos)
Definition: ObjInfo.cs:67
TaskPoint task
Definition: PointTarget.cs:14
bool ShouldIgnore(Card c)
Definition: PointTarget.cs:147
void Clear()
Definition: PointTarget.cs:220
bool drawHighlight
Definition: PointTarget.cs:24
bool isValid
Definition: PointTarget.cs:30
BlockInfo block
Definition: PointTarget.cs:12
ObjInfo obj
Definition: PointTarget.cs:10
List< Card > cards
Definition: PointTarget.cs:38
SourceBlock.Row sourceBlock
Definition: Point.cs:63
CellDetail detail
Definition: Point.cs:71
bool IsValid
Definition: Point.cs:88
bool IsHidden
Definition: Point.cs:323
EloMap elomap
Definition: Scene.cs:143
virtual bool IsRegion
Definition: Spatial.cs:501
Definition: Thing.cs:8
Definition: Zone.cs:12

References BlockInfo._CanInspect(), ObjInfo._CanInspect(), EClass._zone, Scene.actionMode, CellDetail.area, area, ActionMode.AreaHihlight, block, card, cards, CellDetail.charas, CheckLastTarget(), Clear(), CellDetail.designation, Point.detail, drawHighlight, Scene.elomap, BlockInfo.GetTemp(), ObjInfo.GetTemp(), EloMap.GetZone(), hasInteraction, Chara.hostility, index, ActionMode.IsBuildMode, Point.IsHidden, Spatial.IsRegion, Point.IsValid, isValid, mouse, obj, pos, EClass.scene, Point.Set(), ShouldIgnore(), ActionMode.ShowMouseoverTarget, Point.sourceBlock, target, task, CellDetail.things, and EClass.ui.

Referenced by AM_Adv.AxisMove(), CycleTarget(), and ActionMode.UpdateInput().

Member Data Documentation

◆ area

Area PointTarget.area

Definition at line 8 of file PointTarget.cs.

Referenced by Clear(), and Update().

◆ block

BlockInfo PointTarget.block

Definition at line 12 of file PointTarget.cs.

Referenced by Update().

◆ card

◆ cards

List<Card> PointTarget.cards = new List<Card>()

Definition at line 38 of file PointTarget.cs.

Referenced by WidgetMouseover.Refresh(), and Update().

◆ drawHighlight

bool PointTarget.drawHighlight

Definition at line 24 of file PointTarget.cs.

Referenced by AM_ViewZone.OnRenderTile(), and Update().

◆ hasInteraction

bool PointTarget.hasInteraction

Definition at line 28 of file PointTarget.cs.

Referenced by Clear(), and Update().

◆ hasTargetChanged

bool PointTarget.hasTargetChanged

Definition at line 20 of file PointTarget.cs.

Referenced by CheckLastTarget(), AM_Adv.OnUpdateCursor(), and WidgetMouseover.Refresh().

◆ hasValidTarget

bool PointTarget.hasValidTarget

Definition at line 22 of file PointTarget.cs.

Referenced by CheckLastTarget(), and WidgetInspector.OnUpdateInput().

◆ index

int PointTarget.index

Definition at line 36 of file PointTarget.cs.

Referenced by CycleTarget(), and Update().

◆ isValid

bool PointTarget.isValid

Definition at line 30 of file PointTarget.cs.

Referenced by AM_Adv._OnUpdateInput(), ActPlan.Item.Perform(), and Update().

◆ lastPos

Point PointTarget.lastPos = new Point()

Definition at line 34 of file PointTarget.cs.

Referenced by CheckLastTarget().

◆ lastTarget

IInspect PointTarget.lastTarget

Definition at line 18 of file PointTarget.cs.

Referenced by CheckLastTarget().

◆ mouse

bool PointTarget.mouse = true

Definition at line 26 of file PointTarget.cs.

Referenced by Update().

◆ obj

ObjInfo PointTarget.obj

Definition at line 10 of file PointTarget.cs.

Referenced by Update().

◆ pos

◆ target

IInspect PointTarget.target

◆ task

TaskPoint PointTarget.task

Definition at line 14 of file PointTarget.cs.

Referenced by Update().

Property Documentation

◆ TargetChara

Chara PointTarget.TargetChara
get

Definition at line 40 of file PointTarget.cs.

41 {
42 get
43 {
44 if (card != null)
45 {
46 return card.Chara;
47 }
48 return null;
49 }
50 }

Referenced by ActPlan._Update(), ActRush.CanPerform(), ActionMode.DoFunc(), ActRush.OnMarkMapHighlights(), ActRush.Perform(), and CoreDebug.UpdateInput().


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