Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
HotItemHeld Class Reference
Inheritance diagram for HotItemHeld:
HotItemThing HotItemGameAction HotItem UIButton.Item

Public Member Functions

 HotItemHeld ()
 
 HotItemHeld (Thing t)
 
override void OnSetCurrentItem ()
 
override void OnUnselect ()
 
Act GetAct ()
 
Act GetSelfAct ()
 
override bool TrySetAct (ActPlan p)
 
bool TrySetToolAct (ActPlan p)
 
override void OnRenderTile (Point point, HitResult result, int dir)
 
- Public Member Functions inherited from HotItemThing
override Sprite GetSprite ()
 
override void SetImage (Image icon)
 
override void SetSubText (UIText t)
 
- Public Member Functions inherited from HotItemGameAction
override void OnClick (ButtonHotItem b, Hotbar h)
 
override void OnRightClick (ButtonHotItem b)
 
override void OnMarkMapHighlights ()
 
- Public Member Functions inherited from HotItem
string TextHotkey ()
 
virtual void OnClick (ButtonHotItem b, Hotbar h)
 
virtual void OnRightClick (ButtonHotItem b)
 
virtual bool CanAutoFire (Chara tg)
 
virtual void OnSetCurrentItem ()
 
virtual void OnUnsetCurrentItem ()
 
virtual void OnUnselect ()
 
virtual void SetImage (Image icon)
 
virtual bool TrySetAct (ActPlan p)
 
virtual void OnMarkMapHighlights ()
 
virtual void OnRenderTile (Point point, HitResult result, int dir)
 
- Public Member Functions inherited from UIButton.Item
virtual Sprite GetSprite ()
 
virtual Sprite GetSprite (bool highlight)
 
virtual bool ShouldHighlight ()
 
virtual void OnAddedToBar ()
 
virtual void OnShowContextMenu (UIContextMenu m)
 
virtual void OnHover (UIButton b)
 
virtual void OnClick (UIButton b)
 
virtual void OnSetItem (UIButton b)
 
virtual void SetSubText (UIText t)
 

Static Public Member Functions

static bool CanChangeHeightByWheel ()
 
static bool CanRotate ()
 

Static Public Attributes

static Thing lastHeld
 
static TaskBuild taskBuild
 
static Recipe recipe
 
static bool disableTool
 

Properties

override Act act [get]
 
- Properties inherited from HotItemThing
override Act act [get]
 
override string Name [get]
 
override bool IsSelectable [get]
 
override Thing Thing [get]
 
override bool UseUIObjMaterial [get]
 
- Properties inherited from HotItemGameAction
virtual Act act [get]
 
override bool IsGameAction [get]
 
- Properties inherited from HotItem
override Sprite SpriteHighlight [get]
 
override bool IsSelectable [get]
 
override string TextTip [get]
 
virtual Thing RenderThing [get]
 
virtual Thing Thing [get]
 
virtual Thing Tool [get]
 
virtual bool IsTool [get]
 
virtual bool LookAtMouse [get]
 
virtual bool IsGameAction [get]
 
virtual bool UseUIObjMaterial [get]
 
- Properties inherited from UIButton.Item
virtual string TextTip [get]
 
virtual string Name [get]
 
virtual Sprite SpriteHighlight [get]
 
virtual string pathSprite [get]
 
virtual bool IsSelectable [get]
 
virtual bool AdjustImageSize [get]
 
virtual bool UseIconForHighlight [get]
 
virtual bool KeepVisibleWhenHighlighted [get]
 
virtual Color SpriteColor [get]
 
virtual Vector3 SpriteScale [get]
 
virtual bool Hidden [get]
 
virtual Transition Transition [get]
 

Additional Inherited Members

- Public Attributes inherited from HotItemThing
Thing thing
 
bool lost
 
Act _act
 
- Public Attributes inherited from HotItem
ButtonHotItem button
 
Hotbar hotbar
 
bool disabled
 
- Public Attributes inherited from UIButton.Item
bool always
 

Detailed Description

Definition at line 3 of file HotItemHeld.cs.

Constructor & Destructor Documentation

◆ HotItemHeld() [1/2]

HotItemHeld.HotItemHeld ( )
inline

Definition at line 58 of file HotItemHeld.cs.

59 {
60 }

◆ HotItemHeld() [2/2]

HotItemHeld.HotItemHeld ( Thing  t)
inline

Definition at line 62 of file HotItemHeld.cs.

63 {
64 thing = t;
65 }

References HotItemThing.thing.

Member Function Documentation

◆ CanChangeHeightByWheel()

static bool HotItemHeld.CanChangeHeightByWheel ( )
inlinestatic

Definition at line 15 of file HotItemHeld.cs.

16 {
18 {
19 return false;
20 }
22 {
23 return taskBuild.CanPerform();
24 }
25 return false;
26 }
virtual bool IsBuildMode
Definition: ActionMode.cs:181
Trait trait
Definition: Card.cs:49
Card held
Definition: Chara.cs:67
InputSetting input
Definition: CoreConfig.cs:602
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:5
static Scene scene
Definition: EClass.cs:30
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static Chara pc
Definition: EClass.cs:14
Definition: EInput.cs:8
static bool isShiftDown
Definition: EInput.cs:261
static Recipe recipe
Definition: HotItemHeld.cs:9
static TaskBuild taskBuild
Definition: HotItemHeld.cs:7
int MaxAltitude
Definition: Recipe.cs:212
ActionMode actionMode
Definition: Scene.cs:77
virtual bool IsRegion
Definition: Spatial.cs:501
override bool CanPerform()
Definition: TaskPoint.cs:42
virtual bool CanChangeHeight
Definition: Trait.cs:143

References EClass._zone, Scene.actionMode, CoreConfig.InputSetting.altChangeHeight, Trait.CanChangeHeight, TaskPoint.CanPerform(), Core.config, EClass.core, Chara.held, CoreConfig.input, ActionMode.IsBuildMode, Spatial.IsRegion, EInput.isShiftDown, Recipe.MaxAltitude, EClass.pc, recipe, EClass.scene, taskBuild, and Card.trait.

Referenced by AM_Adv._OnUpdateInput(), and AM_Adv.UpdateLangWheel().

◆ CanRotate()

static bool HotItemHeld.CanRotate ( )
inlinestatic

Definition at line 28 of file HotItemHeld.cs.

29 {
30 if (EClass._zone.IsRegion || EClass.pc.held == null)
31 {
32 return false;
33 }
35 {
36 return false;
37 }
39 {
40 return false;
41 }
42 if (taskBuild == null)
43 {
44 return false;
45 }
47 {
48 return true;
49 }
50 if (!taskBuild.CanPerform())
51 {
52 return false;
53 }
56 }
ActPlan planAll
Definition: AM_Adv.cs:147
void Update(PointTarget target)
Definition: ActPlan.cs:411
bool HasAct
Definition: ActPlan.cs:243
static AM_Adv Adv
Definition: ActionMode.cs:15
PointTarget mouseTarget
Definition: Scene.cs:129
virtual bool CanBuildInTown
Definition: Trait.cs:258
virtual bool CanBeOnlyBuiltInHome
Definition: Trait.cs:255
bool IsPCFactionOrTent
Definition: Zone.cs:467
virtual bool RestrictBuild
Definition: Zone.cs:283

References EClass._zone, ActionMode.Adv, Trait.CanBeOnlyBuiltInHome, Trait.CanBuildInTown, TaskPoint.CanPerform(), ActPlan.HasAct, Chara.held, Zone.IsPCFactionOrTent, Spatial.IsRegion, Scene.mouseTarget, EClass.pc, AM_Adv.planAll, Zone.RestrictBuild, EClass.scene, taskBuild, Card.trait, and ActPlan.Update().

Referenced by AM_Adv._OnUpdateInput(), and AM_Adv.UpdateLangWheel().

◆ GetAct()

Act HotItemHeld.GetAct ( )
inline

Definition at line 103 of file HotItemHeld.cs.

104 {
105 if (thing.trait is TraitRod)
106 {
107 return new ActZap();
108 }
110 {
111 return ACT.Ranged;
112 }
113 if (thing.HasElement(241))
114 {
115 return new AI_PlayMusic();
116 }
117 if (thing.HasElement(225))
118 {
119 return new TaskCut();
120 }
121 if (thing.HasElement(220))
122 {
123 return new TaskMine();
124 }
125 if (thing.HasElement(230))
126 {
127 return new TaskDig
128 {
129 mode = TaskDig.Mode.RemoveFloor
130 };
131 }
132 if (thing.HasElement(286))
133 {
134 return new TaskPlow();
135 }
136 if (thing.HasElement(245))
137 {
138 return new AI_Fish();
139 }
140 if (thing.HasElement(237))
141 {
142 return new AI_TendAnimal();
143 }
144 return _act;
145 }
Definition: ACT.cs:6
static ActRanged Ranged
Definition: ACT.cs:17
Definition: ActZap.cs:2
bool HasElement(int ele, int req=1)
Definition: Card.cs:5214

References HotItemThing._act, Card.HasElement(), ACT.Ranged, HotItemThing.thing, and Card.trait.

◆ GetSelfAct()

Act HotItemHeld.GetSelfAct ( )
inline

Definition at line 147 of file HotItemHeld.cs.

148 {
149 if (lost)
150 {
151 return null;
152 }
154 {
155 return new AI_Drink
156 {
157 target = thing
158 };
159 }
161 {
162 return new AI_Eat
163 {
164 cook = false
165 };
166 }
168 {
169 return new AI_Read
170 {
171 target = thing
172 };
173 }
174 return null;
175 }
@ cook
Definition: AI_Eat.cs:5
virtual bool CanRead(Chara c)
Definition: Trait.cs:919
virtual bool CanEat(Chara c)
Definition: Trait.cs:928
virtual bool CanDrink(Chara c)
Definition: Trait.cs:937

References Trait.CanDrink(), Trait.CanEat(), Trait.CanRead(), cook, HotItemThing.lost, EClass.pc, HotItemThing.thing, and Card.trait.

Referenced by TrySetAct().

◆ OnRenderTile()

override void HotItemHeld.OnRenderTile ( Point  point,
HitResult  result,
int  dir 
)
inlinevirtual

Reimplemented from HotItem.

Definition at line 427 of file HotItemHeld.cs.

428 {
430 {
431 for (int i = point.z - 1; i < point.z + 2; i++)
432 {
433 for (int j = point.x - 1; j < point.x + 2; j++)
434 {
436 }
437 }
438 }
439 if (taskBuild == null || !taskBuild.IsRunning || (!recipe.MultiSize && !taskBuild.CanProgress()) || !taskBuild.CanPerform(EClass.pc, null, point))
440 {
441 return;
442 }
443 EClass.screen.guide.isActive = false;
445 EClass.screen.guide.isActive = true;
446 if (recipe.MultiSize)
447 {
448 point.ForeachMultiSize(recipe.W, recipe.H, delegate(Point pos, bool main)
449 {
450 Vector3 v = pos.Position();
451 v.z -= 0.01f;
453 });
454 }
455 }
HitResult
Definition: HitResult.cs:2
virtual bool IsRunning
Definition: AIAct.cs:31
override void OnRenderTile(Point point, HitResult result, int dir)
Definition: AM_Build.cs:239
static AM_Build Build
Definition: ActionMode.cs:49
ScreenGuide guide
static Game game
Definition: EClass.cs:8
static BaseGameScreen screen
Definition: EClass.cs:32
bool showGuideGrid
Definition: Game.cs:45
Config config
Definition: Game.cs:215
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
Definition: Point.cs:9
static Point shared
Definition: Point.cs:20
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1349
ref Vector3 Position(int height)
Definition: Point.cs:524
Point Set(int _x, int _z)
Definition: Point.cs:479
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
virtual int H
Definition: Recipe.cs:252
bool MultiSize
Definition: Recipe.cs:266
int _dir
Definition: Recipe.cs:175
virtual int W
Definition: Recipe.cs:240
MeshPass passGuideFloor
Definition: ScreenGuide.cs:7
Recipe recipe
Definition: TaskBuild.cs:8
override bool CanProgress()
Definition: Task.cs:68

References Recipe._dir, MeshPass.Add(), ActionMode.Build, TaskPoint.CanPerform(), Task.CanProgress(), Game.config, Point.ForeachMultiSize(), EClass.game, BaseGameScreen.guide, Recipe.H, AIAct.IsRunning, Recipe.MultiSize, AM_Build.OnRenderTile(), ScreenGuide.passGuideFloor, EClass.pc, Point.Position(), recipe, TaskBuild.recipe, EClass.screen, Point.Set(), Point.shared, Game.Config.showGuideGrid, taskBuild, Recipe.W, Point.x, and Point.z.

◆ OnSetCurrentItem()

override void HotItemHeld.OnSetCurrentItem ( )
inlinevirtual

Reimplemented from HotItem.

Definition at line 67 of file HotItemHeld.cs.

68 {
69 ActionMode.Build.altitude = 0;
70 disableTool = false;
71 if (EClass.pc.held != thing)
72 {
74 }
75 taskBuild = null;
79 {
80 _act = (thing.trait as TraitCatalyst).CreateAct();
81 }
82 if (lastHeld != thing)
83 {
85 }
88 {
89 EClass.pc.ranged = thing;
90 }
91 }
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4084
static Thing lastHeld
Definition: HotItemHeld.cs:5
static bool disableTool
Definition: HotItemHeld.cs:11
static void BuildList()
virtual Recipe GetRecipe()
Definition: Trait.cs:758
virtual void OnHeld()
Definition: Trait.cs:996

References HotItemThing._act, RecipeManager.BuildList(), disableTool, Trait.GetRecipe(), Chara.held, Chara.HoldCard(), lastHeld, Trait.OnHeld(), EClass.pc, recipe, taskBuild, HotItemThing.thing, and Card.trait.

◆ OnUnselect()

override void HotItemHeld.OnUnselect ( )
inlinevirtual

Reimplemented from HotItem.

Definition at line 93 of file HotItemHeld.cs.

94 {
95 taskBuild = null;
96 recipe = null;
97 if (EClass.pc.held == thing)
98 {
100 }
101 }
void PickHeld(bool msg=false)
Definition: Chara.cs:4136

References Chara.held, EClass.pc, Chara.PickHeld(), recipe, taskBuild, and HotItemThing.thing.

◆ TrySetAct()

override bool HotItemHeld.TrySetAct ( ActPlan  p)
inlinevirtual

Reimplemented from HotItem.

Definition at line 177 of file HotItemHeld.cs.

178 {
179 taskBuild = null;
180 if (!disableTool)
181 {
182 if (p.IsSelf && thing.trait.CanUse(EClass.pc))
183 {
184 return p.TrySetAct(thing.trait.LangUse, () => thing.trait.OnUse(p.cc), thing, null, -1);
185 }
187 {
188 return p.TrySetAct(thing.trait.LangUse, () => thing.trait.OnUse(p.cc, EClass.scene.mouseTarget.target as Card), thing, null, -1);
189 }
190 if (thing.trait.CanUse(EClass.pc, p.pos))
191 {
192 return p.TrySetAct(thing.trait.LangUse, () => thing.trait.OnUse(p.cc, p.pos), thing, null, -1);
193 }
194 if (thing.trait.IsTool)
195 {
196 if (TrySetToolAct(p))
197 {
198 return true;
199 }
200 }
201 else
202 {
204 }
205 if (p.HasAct || thing.trait.IsTool)
206 {
207 return true;
208 }
209 }
210 if (p.pos.Equals(EClass.pc.pos))
211 {
212 Act selfAct = GetSelfAct();
213 if (selfAct != null)
214 {
215 p.TrySetAct(selfAct, thing);
216 return true;
217 }
218 }
219 bool flag = true;
221 {
222 flag = false;
223 }
225 {
226 flag = false;
227 }
228 Chara tg;
229 if (flag)
230 {
231 if (p.IsSelfOrNeighbor)
232 {
233 _ = p.pos.Installed?.trait;
234 tg = p.pos.FirstVisibleChara();
235 if (tg != null && tg != EClass.pc && !tg.IsDisabled && tg.IsNeutralOrAbove() && EClass.pc.held != null && tg.CanAcceptGift(EClass.pc, EClass.pc.held))
236 {
237 string lang = "actGive";
238 if (tg.Evalue(1232) > 0 && EClass.pc.held.trait is TraitDrinkMilkMother)
239 {
240 lang = "actMilk";
241 }
242 p.TrySetAct(lang, delegate
243 {
244 if (!tg.IsValidGiftWeight(EClass.pc.held, 1))
245 {
246 tg.Talk("tooHeavy");
247 return true;
248 }
250 {
251 Dialog.YesNo("dialogGive".lang(EClass.pc.held.GetName(NameStyle.Full, 1)), func);
252 }
253 else
254 {
255 func();
256 }
257 return true;
258 }, thing);
259 }
260 }
261 if (p.HasAct)
262 {
263 return true;
264 }
266 {
267 Chara chara = p.pos.FirstVisibleChara();
268 if ((chara == null || chara == EClass.pc || chara.IsNeutralOrAbove()) && recipe != null && (!thing.trait.IsThrowMainAction || EInput.isShiftDown || disableTool))
269 {
270 taskBuild = new TaskBuild
271 {
272 recipe = recipe,
273 held = EClass.pc.held,
274 pos = p.pos.Copy()
275 };
277 build.bridgeHeight = -1;
278 build.recipe = taskBuild.recipe;
279 build.mold = taskBuild;
280 build.SetAltitude(recipe.tileType.AltitudeAsDir ? recipe._dir : build.altitude);
282 }
283 }
284 }
285 if (p.HasAct)
286 {
287 return true;
288 }
289 if (ActThrow.CanThrow(EClass.pc, thing, null, p.pos) && p.TrySetAct(new ActThrow
290 {
291 target = thing,
292 pcTarget = p.pos.FindAttackTarget()?.Chara
293 }, thing))
294 {
295 return true;
296 }
297 return false;
298 void func()
299 {
301 }
302 }
@ build
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Chara cc
Definition: ActPlan.cs:201
Point pos
Definition: ActPlan.cs:149
bool IsSelfOrNeighbor
Definition: ActPlan.cs:175
bool IsSelf
Definition: ActPlan.cs:173
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition: ActPlan.cs:344
static bool CanThrow(Chara c, Thing t, Card target, Point p=null)
Definition: ActThrow.cs:60
Definition: ACT.cs:62
Definition: Card.cs:11
Point pos
Definition: Card.cs:55
bool c_isImportant
Definition: Card.cs:984
int Evalue(int ele)
Definition: Card.cs:2431
Definition: Chara.cs:10
bool CanAcceptGift(Chara c, Card t)
Definition: Chara.cs:7455
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:7424
override bool IsDisabled
Definition: Chara.cs:570
bool IsNeutralOrAbove()
Definition: Chara.cs:5928
void GiveGift(Chara c, Thing t)
Definition: Chara.cs:7480
Card SplitHeld(int a)
Definition: Chara.cs:4196
new GameConfig game
Definition: CoreConfig.cs:596
bool TrySetToolAct(ActPlan p)
Definition: HotItemHeld.cs:304
Act GetSelfAct()
Definition: HotItemHeld.cs:147
IInspect target
Definition: PointTarget.cs:16
Thing Installed
Definition: Point.cs:303
Point Copy()
Definition: Point.cs:467
bool Equals(int _x, int _z)
Definition: Point.cs:924
Chara FirstVisibleChara()
Definition: Point.cs:382
virtual TileType tileType
Definition: Recipe.cs:198
Definition: Thing.cs:8
virtual bool AltitudeAsDir
Definition: TileType.cs:205
virtual bool CanExtendBuild
Definition: Trait.cs:161
virtual bool CanUse(Chara c)
Definition: Trait.cs:950
virtual bool IsTool
Definition: Trait.cs:355
virtual void TrySetHeldAct(ActPlan p)
Definition: Trait.cs:992
virtual bool IsThrowMainAction
Definition: Trait.cs:174
virtual bool OnUse(Chara c)
Definition: Trait.cs:965
virtual string LangUse
Definition: Trait.cs:357

References Recipe._dir, EClass._zone, TileType.AltitudeAsDir, ActionMode.Build, build, Card.c_isImportant, Chara.CanAcceptGift(), Trait.CanExtendBuild, ActThrow.CanThrow(), Trait.CanUse(), ActPlan.cc, Core.config, CoreConfig.GameConfig.confirmGive, Point.Copy(), EClass.core, disableTool, Point.Equals(), Card.Evalue(), Point.FirstVisibleChara(), CoreConfig.game, GetSelfAct(), Chara.GiveGift(), ActPlan.HasAct, Chara.held, if(), Point.Installed, Chara.IsDisabled, Chara.IsNeutralOrAbove(), ActPlan.IsSelf, ActPlan.IsSelfOrNeighbor, EInput.isShiftDown, Trait.IsThrowMainAction, Trait.IsTool, Chara.IsValidGiftWeight(), Trait.LangUse, Scene.mouseTarget, Trait.OnUse(), EClass.pc, ActPlan.pos, Card.pos, recipe, TaskBuild.recipe, EClass.scene, Chara.SplitHeld(), PointTarget.target, taskBuild, HotItemThing.thing, Recipe.tileType, Card.trait, ActPlan.TrySetAct(), Trait.TrySetHeldAct(), and TrySetToolAct().

◆ TrySetToolAct()

bool HotItemHeld.TrySetToolAct ( ActPlan  p)
inline

Definition at line 304 of file HotItemHeld.cs.

305 {
307 if (p.HasAct)
308 {
309 return true;
310 }
311 Cell cell = p.pos.cell;
312 Point pos = p.pos;
313 if (cell.HasBlock && (!cell.HasObj || cell.sourceObj.tileType.IsMountBlock) && TaskMine.CanMine(pos, thing) && p.TrySetAct(new TaskMine
314 {
315 pos = pos.Copy()
316 }))
317 {
318 return true;
319 }
320 if (pos.IsHidden)
321 {
322 return true;
323 }
325 {
326 if (!EClass.pc.CanSeeSimple(pos))
327 {
328 return true;
329 }
330 Card tc = null;
331 foreach (Chara item in pos.ListVisibleCharas())
332 {
333 if (item.isSynced && item.IsAliveInCurrentZone)
334 {
335 tc = item;
336 break;
337 }
338 }
339 EClass.pc.ranged = thing;
340 p.TrySetAct(ACT.Ranged, tc);
341 return true;
342 }
343 if (cell.IsTopWaterAndNoSnow && thing.HasElement(245) && p.TrySetAct(new AI_Fish
344 {
345 pos = pos.Copy()
346 }))
347 {
348 return true;
349 }
350 if (p.IsNeighborBlocked)
351 {
352 return true;
353 }
354 TaskHarvest taskHarvest = TaskHarvest.TryGetAct(EClass.pc, pos);
355 if (taskHarvest != null && p.TrySetAct(taskHarvest))
356 {
357 return true;
358 }
359 TraitToolWaterPot traitToolWaterPot = thing.trait as TraitToolWaterPot;
360 if (cell.IsTopWaterAndNoSnow)
361 {
362 if (traitToolWaterPot != null && traitToolWaterPot.owner.c_charges < traitToolWaterPot.MaxCharge && p.TrySetAct(new TaskDrawWater
363 {
364 pot = traitToolWaterPot,
365 pos = pos.Copy()
366 }))
367 {
368 return true;
369 }
370 }
371 else
372 {
373 if (traitToolWaterPot != null && !p.pos.HasBridge && traitToolWaterPot.owner.c_charges > 0 && pos.cell.sourceSurface.tag.Contains("soil") && p.TrySetAct(new TaskPourWater
374 {
375 pot = traitToolWaterPot,
376 pos = pos.Copy()
377 }))
378 {
379 return true;
380 }
381 if (thing.HasElement(230) && p.TrySetAct(new TaskDig
382 {
383 pos = pos.Copy(),
384 mode = TaskDig.Mode.RemoveFloor
385 }))
386 {
387 return true;
388 }
389 if (thing.HasElement(286) && p.TrySetAct(new TaskPlow
390 {
391 pos = pos.Copy()
392 }))
393 {
394 return true;
395 }
396 }
397 if (TaskMine.CanMine(pos, thing) && p.TrySetAct(new TaskMine
398 {
399 pos = pos.Copy()
400 }))
401 {
402 return true;
403 }
404 if (thing.HasElement(225) && p.TrySetAct(new TaskChopWood
405 {
406 pos = pos.Copy()
407 }))
408 {
409 return true;
410 }
411 if (pos.HasChara)
412 {
413 _ = pos.FirstChara;
414 _ = EClass.pc;
415 }
416 if (thing.HasTag(CTAG.throwWeapon) && ActThrow.CanThrow(EClass.pc, thing, null, p.pos) && p.TrySetAct(new ActThrow
417 {
418 target = thing,
419 pcTarget = p.pos.FindAttackTarget()?.Chara
420 }, thing))
421 {
422 return true;
423 }
424 return false;
425 }
CTAG
Definition: CTAG.cs:2
bool IsNeighborBlocked
Definition: ActPlan.cs:178
bool HasTag(CTAG tag)
Definition: Card.cs:2455
int c_charges
Definition: Card.cs:1205
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:643
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
SourceObj.Row sourceObj
Definition: Cell.cs:1072
bool HasObj
Definition: Cell.cs:641
SourceFloor.Row sourceSurface
Definition: Cell.cs:1059
bool CanSeeSimple(Point p)
Definition: Chara.cs:1010
bool HasBridge
Definition: Point.cs:209
bool IsHidden
Definition: Point.cs:323
Chara FirstChara
Definition: Point.cs:264
Cell cell
Definition: Point.cs:51
List< Chara > ListVisibleCharas()
Definition: Point.cs:1148
bool HasChara
Definition: Point.cs:226
static TaskHarvest TryGetAct(Chara c, Point p)
Definition: TaskHarvest.cs:114
static bool CanMine(Point pos, Card t)
Definition: TaskMine.cs:31
Card owner
Definition: Trait.cs:26

References Card.c_charges, TaskMine.CanMine(), Chara.CanSeeSimple(), ActThrow.CanThrow(), Point.cell, Point.FirstChara, ActPlan.HasAct, Cell.HasBlock, Point.HasBridge, Point.HasChara, Card.HasElement(), Cell.HasObj, Card.HasTag(), Point.IsHidden, ActPlan.IsNeighborBlocked, Cell.IsTopWaterAndNoSnow, item, Point.ListVisibleCharas(), TraitToolWaterPot.MaxCharge, Trait.owner, EClass.pc, ActPlan.pos, ACT.Ranged, Cell.sourceObj, Cell.sourceSurface, HotItemThing.thing, Card.trait, TaskHarvest.TryGetAct(), ActPlan.TrySetAct(), and Trait.TrySetHeldAct().

Referenced by TrySetAct().

Member Data Documentation

◆ disableTool

◆ lastHeld

Thing HotItemHeld.lastHeld
static

Definition at line 5 of file HotItemHeld.cs.

Referenced by OnSetCurrentItem().

◆ recipe

Recipe HotItemHeld.recipe
static

◆ taskBuild

Property Documentation

◆ act

override Act HotItemHeld.act
get

Definition at line 13 of file HotItemHeld.cs.


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