Elin Modding Docs Doc
Loading...
Searching...
No Matches
ActPlan.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5using UnityEngine.UI;
6
7// Token: 0x020001DC RID: 476
8public class ActPlan : EClass
9{
10 // Token: 0x17000364 RID: 868
11 // (get) Token: 0x06000D67 RID: 3431 RVA: 0x0006828B File Offset: 0x0006648B
12 public bool IsSelf
13 {
14 get
15 {
16 return this.dist == 0;
17 }
18 }
19
20 // Token: 0x17000365 RID: 869
21 // (get) Token: 0x06000D68 RID: 3432 RVA: 0x00068296 File Offset: 0x00066496
22 public bool IsSelfOrNeighbor
23 {
24 get
25 {
26 return this._canInteractNeighbor;
27 }
28 }
29
30 // Token: 0x17000366 RID: 870
31 // (get) Token: 0x06000D69 RID: 3433 RVA: 0x0006829E File Offset: 0x0006649E
32 public bool IsNeighborBlocked
33 {
34 get
35 {
36 return !this._canInteractNeighbor && this.dist == 1;
37 }
38 }
39
40 // Token: 0x17000367 RID: 871
41 // (get) Token: 0x06000D6A RID: 3434 RVA: 0x000682B3 File Offset: 0x000664B3
42 public bool canRepeat
43 {
44 get
45 {
46 return this.list.Count == 1 && this.list[0].act.CanPressRepeat;
47 }
48 }
49
50 // Token: 0x17000368 RID: 872
51 // (get) Token: 0x06000D6B RID: 3435 RVA: 0x000682DB File Offset: 0x000664DB
52 public Chara cc
53 {
54 get
55 {
56 return EClass.pc;
57 }
58 }
59
60 // Token: 0x06000D6C RID: 3436 RVA: 0x000682E4 File Offset: 0x000664E4
61 public string GetText(bool showName)
62 {
63 if (this.list.Count == 0)
64 {
65 return "";
66 }
67 if (this.list.Count == 1)
68 {
69 return this.list[0].GetText(showName);
70 }
71 return "+" + this.list.Count.ToString() + ((this.HasMultipleTargets || this.list[0].tc == null) ? ("\n<size=28>(" + "multipleTargets".lang() + ")</size>") : ("\n<size=28>" + this.list[0].tc.Name + this.list[0].tc.GetExtraName() + "</size>"));
72 }
73
74 // Token: 0x17000369 RID: 873
75 // (get) Token: 0x06000D6D RID: 3437 RVA: 0x000683B4 File Offset: 0x000665B4
76 public CursorInfo CursorIcon
77 {
78 get
79 {
80 if (this.list.Count == 0)
81 {
82 return null;
83 }
84 if (this.list.Count <= 1)
85 {
86 return this.list[0].act.GetCursorIcon(this.list[0].tc);
87 }
88 return CursorSystem.Notice;
89 }
90 }
91
92 // Token: 0x1700036A RID: 874
93 // (get) Token: 0x06000D6E RID: 3438 RVA: 0x0006840B File Offset: 0x0006660B
94 public bool WillEndTurn
95 {
96 get
97 {
98 return this.list.Count > 0 && this.list[0].act.WillEndTurn;
99 }
100 }
101
102 // Token: 0x1700036B RID: 875
103 // (get) Token: 0x06000D6F RID: 3439 RVA: 0x00068433 File Offset: 0x00066633
104 public bool HideRightInfo
105 {
106 get
107 {
108 return this.list.Count > 0 && this.list[0].act.HideRightInfo;
109 }
110 }
111
112 // Token: 0x1700036C RID: 876
113 // (get) Token: 0x06000D70 RID: 3440 RVA: 0x0006845B File Offset: 0x0006665B
114 public bool HasAct
115 {
116 get
117 {
118 return this.list.Count > 0;
119 }
120 }
121
122 // Token: 0x1700036D RID: 877
123 // (get) Token: 0x06000D71 RID: 3441 RVA: 0x0006846C File Offset: 0x0006666C
124 public bool ShowAct
125 {
126 get
127 {
128 return this.HasAct && this.lastAct != this.list[0].act && this.list[0].act.ShowMouseHint(this.list[0].tc);
129 }
130 }
131
132 // Token: 0x1700036E RID: 878
133 // (get) Token: 0x06000D72 RID: 3442 RVA: 0x000684C5 File Offset: 0x000666C5
134 public bool HasMultipleTargets
135 {
136 get
137 {
138 return this.list.Count > 1 && this.list[0].tc != this.list.LastItem<ActPlan.Item>().tc;
139 }
140 }
141
142 // Token: 0x06000D73 RID: 3443 RVA: 0x00068500 File Offset: 0x00066700
143 public Func<bool> GetAction()
144 {
145 if (this.list.Count == 0)
146 {
147 return () => false;
148 }
149 if (this.list.Count > 1)
150 {
151 return delegate()
152 {
153 if (this.pos.Equals(EClass.pc.pos) && ActWait.SearchMedal(EClass.pc, this.pos))
154 {
155 return false;
156 }
157 this.ShowContextMenu();
158 return false;
159 };
160 }
161 ActPlan.Item item = this.list[0];
162 return delegate()
163 {
164 if (this.performed && !item.act.CanPressRepeat)
165 {
166 return false;
167 }
168 this.performed = true;
169 this.lastAct = item.act;
170 return item.Perform(this.performed);
171 };
172 }
173
174 // Token: 0x06000D74 RID: 3444 RVA: 0x00068580 File Offset: 0x00066780
175 public void ShowContextMenu()
176 {
177 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction();
178 int num = 1;
179 bool flag = this.showOrder;
180 using (List<ActPlan.Item>.Enumerator enumerator = this.list.GetEnumerator())
181 {
182 while (enumerator.MoveNext())
183 {
184 ActPlan.Item i = enumerator.Current;
185 string text = i.GetTextContext(this.HasMultipleTargets);
186 text = text.Replace("\n", " ").Replace(Environment.NewLine, " ");
187 uicontextMenu.AddButton(text, delegate()
188 {
189 this.performed = true;
190 if (i.Perform(false))
191 {
192 EClass.player.EndTurn(true);
193 }
194 }, true);
195 num++;
196 if (num >= 21)
197 {
198 break;
199 }
200 }
201 }
202 uicontextMenu.Show();
203 EClass.ui.hud.HideMouseInfo();
204 }
205
206 // Token: 0x06000D75 RID: 3445 RVA: 0x00068660 File Offset: 0x00066860
207 public bool TrySetAct(string lang, Func<bool> onPerform, Card tc, CursorInfo cursor = null, int dist = 1, bool isHostileAct = false, bool localAct = true, bool canRepeat = false)
208 {
209 return this.TrySetAct(new DynamicAct(lang, onPerform, false)
210 {
211 id = lang,
212 dist = dist,
213 isHostileAct = isHostileAct,
214 localAct = localAct,
215 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor),
216 canRepeat = (() => canRepeat)
217 }, tc);
218 }
219
220 // Token: 0x06000D76 RID: 3446 RVA: 0x000686CF File Offset: 0x000668CF
221 public bool TrySetAct(string lang, Func<bool> onPerform, CursorInfo cursor = null, int dist = 1)
222 {
223 return this.TrySetAct(new DynamicAct(lang, onPerform, false)
224 {
225 id = lang,
226 dist = dist,
227 cursor = ((cursor == CursorSystem.Arrow) ? null : cursor)
228 }, null);
229 }
230
231 // Token: 0x06000D77 RID: 3447 RVA: 0x00068704 File Offset: 0x00066904
232 public bool TrySetAct(Act _act, Card _tc = null)
233 {
234 if (!this.ignoreAdddCondition && !_act.CanPerform(this.cc, _tc, this.pos))
235 {
236 return false;
237 }
238 this.list.Add(new ActPlan.Item
239 {
240 act = _act,
241 tc = _tc,
242 pos = this.pos.Copy()
243 });
244 return true;
245 }
246
247 // Token: 0x06000D78 RID: 3448 RVA: 0x00068760 File Offset: 0x00066960
248 public void Clear()
249 {
250 this.list.Clear();
251 this.pos.IsValid = false;
252 }
253
254 // Token: 0x06000D79 RID: 3449 RVA: 0x0006877C File Offset: 0x0006697C
255 public void Update(PointTarget target)
256 {
257 if (ActPlan.warning)
258 {
259 return;
260 }
261 this._Update(target);
262 if (this.HasAct)
263 {
264 Color effectColor = (this.list.Count == 1) ? this.list[0].act.GetActPlanColor() : EClass.Colors.colorAct;
265 if (this.input == ActInput.LeftMouse || this.input == ActInput.Key)
266 {
267 EClass.ui.hud.textLeft.SetText(this.GetText(true));
268 Outline[] components = EClass.ui.hud.textLeft.GetComponents<Outline>();
269 for (int i = 0; i < components.Length; i++)
270 {
271 components[i].effectColor = effectColor;
272 }
273 return;
274 }
275 if (this.input == ActInput.RightMouse)
276 {
277 EClass.player.currentHotItem.SetImage(EClass.ui.hud.imageRight);
278 EClass.ui.hud.imageRight.rectTransform.localScale = new Vector3(2f, 2f, 1f);
279 EClass.ui.hud.textRight.SetText(this.GetText(true));
280 Outline[] components = EClass.ui.hud.textRight.GetComponents<Outline>();
281 for (int i = 0; i < components.Length; i++)
282 {
283 components[i].effectColor = effectColor;
284 }
285 }
286 }
287 }
288
289 // Token: 0x06000D7A RID: 3450 RVA: 0x000688CC File Offset: 0x00066ACC
290 public void _Update(PointTarget target)
291 {
292 this.showOrder = false;
293 this.performed = false;
294 this.list.Clear();
295 this.listPick.Clear();
296 if (!this.pos.Equals(target.pos))
297 {
298 this.lastAct = null;
299 }
300 this.pos.Set(target.pos);
301 this.dist = this.cc.pos.Distance(this.pos);
302 if (!this.pos.IsValid || EClass.pc.isDead)
303 {
304 return;
305 }
306 Point _pos = new Point(this.pos);
307 Cell cell = target.pos.cell;
308 bool flag = this.input == ActInput.Key;
309 this.altAction = ((EInput.isShiftDown && !EInput.isAltDown && !flag) || this.input == ActInput.AllAction);
310 this._canInteractNeighbor = (this.dist == 0 || (this.dist == 1 && this.cc.CanInteractTo(_pos)));
311 if (EClass.pc.isBlind && !_pos.Equals(EClass.pc.pos) && !flag && this.input != ActInput.LeftMouse)
312 {
313 return;
314 }
315 if (!flag && this.input != ActInput.LeftMouse && this.input != ActInput.AllAction)
316 {
317 if (this.input == ActInput.RightMouse)
318 {
319 if (this.pos.cell.outOfBounds || EClass.ui.IsDragging)
320 {
321 return;
322 }
323 HotItem hotItem = EClass.player.currentHotItem;
324 if (!hotItem.IsGameAction)
325 {
326 this.TrySetAct(hotItem.Name, delegate()
327 {
328 hotItem.OnClick(hotItem.button, hotItem.hotbar);
329 return false;
330 }, null, -1);
331 }
332 else
333 {
334 hotItem.TrySetAct(this);
335 }
336 bool flag2 = EClass.game.config.autoCombat.enable && EClass.scene.mouseTarget.TargetChara != null;
337 Thing thing = hotItem.Thing;
338 if (((thing != null) ? thing.trait : null) is TraitToolShears)
339 {
340 flag2 = false;
341 }
342 if (flag2)
343 {
344 Chara targetChara = EClass.scene.mouseTarget.TargetChara;
345 bool flag3 = true;
346 if (targetChara.hostility >= Hostility.Friend)
347 {
348 flag3 = false;
349 }
350 if (targetChara.hostility == Hostility.Neutral && EClass.game.config.autoCombat.bDontAutoAttackNeutral)
351 {
352 flag3 = false;
353 }
354 if (this.list.Count >= 2)
355 {
356 flag3 = false;
357 }
358 if (this.list.Count == 1)
359 {
360 if (targetChara.hostility >= Hostility.Neutral)
361 {
362 flag3 = false;
363 }
364 if (!this.list[0].act.ShowAuto)
365 {
366 flag3 = false;
367 }
368 if (EClass.player.currentHotItem is HotItemNoItem && targetChara.hostility <= Hostility.Enemy)
369 {
370 flag3 = true;
371 }
372 }
373 if (flag3)
374 {
375 this.list.Clear();
376 this.TrySetAct(new GoalAutoCombat(targetChara), null);
377 }
378 }
379 if (this.list.Count == 0)
380 {
381 HotItemNoItem._TrySetAct(this);
382 }
383 if (WidgetCurrentTool.Instance)
384 {
385 WidgetCurrentTool.Instance.placer.Refresh();
386 }
387 }
388 return;
389 }
390 if (EClass.ui.IsDragging)
391 {
392 return;
393 }
394 if (_pos.cell.outOfBounds)
395 {
396 if (EClass.player.CanExitBorder(_pos))
397 {
398 EClass.player.ExitBorder(this);
399 }
400 return;
401 }
402 if (!flag && _pos.Equals(this.cc.pos) && EClass._zone.IsRegion)
403 {
404 this.TrySetAct("actNewZone", delegate()
405 {
406 EClass.player.EnterLocalZone(false);
407 return false;
408 }, CursorSystem.MoveZone, 1);
409 if (this.input == ActInput.AllAction)
410 {
411 this.TrySetAct("LayerTravel", delegate()
412 {
413 EClass.ui.AddLayer<LayerTravel>();
414 return false;
415 }, null, CursorSystem.MoveZone, 1, false, false, false);
416 }
417 }
418 foreach (Card card in _pos.ListCards(false))
419 {
420 Chara chara = card.Chara;
421 if (chara != null && !chara.IsPC && EClass.pc.CanSee(chara))
422 {
423 int num = chara.Dist(EClass.pc);
424 if (num <= 1 || !EClass.pc.isBlind)
425 {
426 if (!EClass.pc.isBlind && !chara.IsHostile() && (this.input == ActInput.AllAction || (!chara.IsPCParty && !chara.IsMinion && !flag)) && (this.input == ActInput.AllAction || !chara.IsNeutral() || chara.quest != null || EClass.game.quests.IsDeliverTarget(chara)) && chara.isSynced && num <= 2 && ((!chara.HasCondition<ConSuspend>() && (!chara.isRestrained || !chara.IsPCFaction)) || this.altAction))
427 {
428 if (EClass.pc.HasElement(1216, 1) && chara.HasCondition<ConSleep>())
429 {
430 this.TrySetAct(new AI_Fuck
431 {
432 target = chara,
433 succubus = true
434 }, chara);
435 }
436 this.TrySetAct(ACT.Chat, chara);
437 }
438 if (chara.host != EClass.pc)
439 {
440 if (chara.IsRestrainedResident)
441 {
442 this.TrySetAct(new AI_PracticeDummy
443 {
444 target = chara
445 }, null);
446 }
447 else if ((chara.IsHostile() || this.altAction || chara.isRestrained) && chara.IsAliveInCurrentZone)
448 {
449 this.TrySetAct(ACT.Melee, chara);
450 }
451 }
452 }
453 }
454 }
455 if (_pos.IsHidden || !this.IsSelfOrNeighbor)
456 {
457 return;
458 }
459 foreach (Card card2 in _pos.ListCards(false))
460 {
461 Chara c = card2.Chara;
462 if (c != null)
463 {
464 bool flag4 = EClass.pc.CanSee(c);
465 if (flag4)
466 {
467 if (this.input == ActInput.LeftMouse && c.IsPCFaction && !c.IsPC && this.pos.FindThing<TraitHitchingPost>() != null)
468 {
469 Chara ride = c;
470 List<string> list = EClass.core.pccs.sets["ride"].map["body"].map.Keys.ToList<string>();
471 int index = list.IndexOf(ride.c_idRidePCC);
472 if (index == -1)
473 {
474 index = 0;
475 }
476 Func<float, string> <>9__14;
477 Action<float> <>9__15;
478 this.TrySetAct("ActChangeRideSkin", delegate()
479 {
480 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction();
481 string text = "rideSkin";
482 Func<float, string> textFunc;
483 if ((textFunc = <>9__14) == null)
484 {
485 textFunc = (<>9__14 = ((float a) => list[(int)a].Split('-', StringSplitOptions.None)[0] ?? ""));
486 }
487 float value = (float)index;
488 Action<float> action;
489 if ((action = <>9__15) == null)
490 {
491 action = (<>9__15 = delegate(float a)
492 {
493 ride.c_idRidePCC = list[(int)a];
494 ride._CreateRenderer();
495 });
496 }
497 uicontextMenu.AddSlider(text, textFunc, value, action, 0f, (float)(list.Count - 1), true, false, false);
498 uicontextMenu.Show();
499 return false;
500 }, c, null, 1, false, true, false);
501 }
502 if (!c.IsPC && ((c.IsPCFaction && !c.IsDisabled) || EClass.debug.enable) && this.input == ActInput.AllAction)
503 {
504 this.TrySetAct("actTrade", delegate()
505 {
506 LayerInventory.CreateContainer(c);
507 return false;
508 }, c, null, 1, false, true, false);
509 }
510 }
511 if (this.input == ActInput.AllAction && EClass.pc.held != null && EClass.pc.held.trait is TraitDrink)
512 {
513 this.TrySetAct(c.IsPC ? "actPour" : "ActThrow", delegate()
514 {
515 ActThrow.Throw(EClass.pc, c.pos, c, EClass.pc.held.Split(1), ThrowMethod.Default);
516 return true;
517 }, EClass.pc.held, null, 1, false, true, false);
518 }
519 if (!c.IsPC && c.host == null && ((!EClass.pc.isBlind && flag4) || this.input != ActInput.AllAction))
520 {
521 if (c.isRestrained && (this.input == ActInput.AllAction || (!c.IsRestrainedResident && !c.IsHostile())))
522 {
523 this.TrySetAct("ActUnrestrain", delegate()
524 {
525 c.TryUnrestrain(true, EClass.pc);
526 return true;
527 }, c, null, 1, false, true, false);
528 }
529 if (!EClass.pc.isBlind && flag4 && this.input == ActInput.AllAction)
530 {
531 this.TrySetAct(ACT.Kick, c);
532 if (c.IsMofuable)
533 {
534 this.TrySetAct("ActCuddle", delegate()
535 {
536 EClass.pc.Cuddle(c, false);
537 return true;
538 }, c, null, 1, false, true, false);
539 }
540 if (EClass.debug.showExtra)
541 {
542 this.TrySetAct("inspect", delegate()
543 {
544 c.Inspect();
545 return false;
546 }, c, null, 1, false, true, false);
547 }
548 if (c.IsPCPartyMinion && !c.Chara.IsEscorted())
549 {
550 this.TrySetAct("ActBanishSummon", delegate()
551 {
552 EClass.pc.Say("summon_vanish", c, null, null);
553 c.pos.PlayEffect("vanish");
554 c.pos.PlaySound("vanish", true, 1f, true);
555 c.pos.PlayEffect("teleport");
556 c.Destroy();
557 return true;
558 }, c, null, 1, false, true, false);
559 }
560 }
561 }
562 }
563 else if (card2.isThing)
564 {
565 if (!EClass.pc.isBlind)
566 {
567 Thing t = card2.Thing;
568 if (this.input == ActInput.AllAction)
569 {
570 if (EClass.debug.enable)
571 {
572 if (t.LightData != null)
573 {
574 if (t.c_lightColor != 0)
575 {
576 this.TrySetAct("(debug) Clear Light", delegate()
577 {
578 t.c_lightColor = 0;
579 t.RecalculateFOV();
580 TCExtra tc = t.renderer.GetTC<TCExtra>();
581 if (tc != null)
582 {
583 tc.RefreshColor();
584 }
585 return false;
586 }, t, null, 1, false, true, false);
587 }
588 Action<PickerState, Color> <>9__20;
589 this.TrySetAct("(debug) Set Light", delegate()
590 {
591 Color lightColor = t.LightColor;
592 LayerColorPicker layerColorPicker = EClass.ui.AddLayer<LayerColorPicker>();
593 Color startColor = lightColor;
594 Color resetColor = lightColor;
595 Action<PickerState, Color> onChangeColor;
596 if ((onChangeColor = <>9__20) == null)
597 {
598 onChangeColor = (<>9__20 = delegate(PickerState state, Color _c)
599 {
600 t.c_lightColor = (int)((byte)Mathf.Clamp(_c.r * 32f, 1f, 31f)) * 1024 + (int)((byte)Mathf.Clamp(_c.g * 32f, 1f, 31f) * 32) + (int)((byte)Mathf.Clamp(_c.b * 32f, 1f, 31f));
601 t.RecalculateFOV();
602 TCExtra tc = t.renderer.GetTC<TCExtra>();
603 if (tc == null)
604 {
605 return;
606 }
607 tc.RefreshColor();
608 });
609 }
610 layerColorPicker.SetColor(startColor, resetColor, onChangeColor);
611 return false;
612 }, t, null, 1, false, true, false);
613 }
614 if (this.pos.cell.IsTopWater)
615 {
616 this.TrySetAct("(debug) Toggle Float", delegate()
617 {
618 t.isFloating = !t.isFloating;
619 return false;
620 }, t, null, 1, false, true, false);
621 }
622 }
623 if (t.trait.CanEat(EClass.pc))
624 {
625 this.TrySetAct(new AI_Eat
626 {
627 target = t
628 }, t);
629 }
630 if (t.trait.CanDrink(EClass.pc))
631 {
632 this.TrySetAct(new AI_Drink
633 {
634 target = t
635 }, t);
636 }
637 if (t.trait.CanRead(EClass.pc))
638 {
639 this.TrySetAct(new AI_Read
640 {
641 target = t
642 }, t);
643 }
644 if (t.trait.IsBlendBase)
645 {
646 this.TrySetAct("invBlend", delegate()
647 {
648 LayerDragGrid.Create(new InvOwnerBlend(t, null, CurrencyType.None), false);
649 return true;
650 }, t, null, 1, false, true, false);
651 }
652 }
653 if (flag)
654 {
655 if (t.trait.CanBeAttacked)
656 {
657 }
658 }
659 else
660 {
661 if (t.placeState == PlaceState.roaming && (_pos.cell.blocked || t.ignoreAutoPick || this.altAction || this.input == ActInput.AllAction || _pos.Equals(EClass.pc.pos)) && EClass.pc.CanPick(t))
662 {
663 this.listPick.Add(t);
664 }
665 if (t.IsInstalled)
666 {
667 if (t.trait.IsFactory && !EClass.game.altCraft)
668 {
669 Thing _t = t;
670 this.TrySetAct("craft", delegate()
671 {
672 if (EClass.player.recipes.ListSources(_t, null).Count > 0)
673 {
674 EClass.ui.AddLayer<LayerCraft>().SetFactory(_t);
675 }
676 else
677 {
678 Msg.Say("noRecipes");
679 }
680 return false;
681 }, _t, CursorSystem.Craft, 1, false, true, false);
682 }
683 bool canBeAttacked = t.trait.CanBeAttacked;
684 t.trait.TrySetToggleAct(this);
685 t.trait.TrySetAct(this);
686 }
687 }
688 }
689 }
690 }
691 if (this.listPick.Count > 0)
692 {
693 if (this.listPick.Count == 1)
694 {
695 Thing _t = this.listPick[0];
696 if (!EClass._zone.IsRegion || (!_t.ignoreAutoPick && _t.pos.Equals(EClass.pc.pos)) || this.altAction)
697 {
698 this.TrySetAct("actPickOne", delegate()
699 {
700 EClass.pc.Pick(_t, true, true);
701 return true;
702 }, this.listPick[0], CursorSystem.Hand, 1, false, false, false);
703 }
704 }
705 else
706 {
707 this.TrySetAct("actPickAll", delegate()
708 {
709 foreach (Card card3 in _pos.ListCards(false))
710 {
711 if (card3.isThing && card3.placeState == PlaceState.roaming)
712 {
713 EClass.pc.Pick(card3.Thing, true, true);
714 }
715 }
716 return true;
717 }, null, CursorSystem.Hand, 1, false, false, false);
718 }
719 }
720 if (this.input == ActInput.AllAction && this.pos.IsSky)
721 {
722 this.TrySetAct("actSkyJump", delegate()
723 {
724 EClass.pc.FallFromZone();
725 return false;
726 }, null, 1);
727 }
728 if (_pos.Equals(this.cc.pos))
729 {
730 if (this.cc.held != null && !this.cc.held.IsHotItem)
731 {
732 this.TrySetAct("actPick", delegate()
733 {
734 Card held = this.cc.held;
735 this.cc.PickHeld(true);
736 return false;
737 }, this.cc.held, CursorSystem.Inventory, 1, false, false, false);
738 }
739 else if (!this.HasAct && !this.cc.isRestrained)
740 {
741 this.TrySetAct(ACT.Wait, null);
742 }
743 if (EClass.pc.party.members.Count > 1)
744 {
745 this.showOrder = true;
746 }
747 if (this.input == ActInput.AllAction && EClass.pc.held != null)
748 {
749 this.TrySetAct("actDrop", delegate()
750 {
751 EClass.pc.DropThing(EClass.pc.held.Thing, -1);
752 return true;
753 }, null, 1);
754 }
755 if (this.cc.isRestrained)
756 {
757 this.TrySetAct("ActUnrestrain", delegate()
758 {
759 this.cc.TryUnrestrain(true, EClass.pc);
760 return true;
761 }, this.cc, null, 1, false, true, false);
762 }
763 }
764 }
765
766 // Token: 0x04000D0A RID: 3338
767 public static bool warning;
768
769 // Token: 0x04000D0B RID: 3339
770 public Point pos = new Point();
771
772 // Token: 0x04000D0C RID: 3340
773 public ActInput input;
774
775 // Token: 0x04000D0D RID: 3341
776 public bool performed;
777
778 // Token: 0x04000D0E RID: 3342
779 public bool altAction;
780
781 // Token: 0x04000D0F RID: 3343
782 public bool ignoreAdddCondition;
783
784 // Token: 0x04000D10 RID: 3344
785 private bool _canInteractNeighbor;
786
787 // Token: 0x04000D11 RID: 3345
788 private bool showOrder;
789
790 // Token: 0x04000D12 RID: 3346
791 public ActPlan.List list = new ActPlan.List();
792
793 // Token: 0x04000D13 RID: 3347
794 public int dist;
795
796 // Token: 0x04000D14 RID: 3348
797 public Thing tool;
798
799 // Token: 0x04000D15 RID: 3349
800 public List<Thing> listPick = new List<Thing>();
801
802 // Token: 0x04000D16 RID: 3350
803 public Act lastAct;
804
805 // Token: 0x020008BE RID: 2238
806 public class List : List<ActPlan.Item>
807 {
808 // Token: 0x06003ADA RID: 15066 RVA: 0x00137944 File Offset: 0x00135B44
809 public void Add(Act a, string s = "")
810 {
811 base.Add(new ActPlan.Item
812 {
813 act = a
814 });
815 }
816 }
817
818 // Token: 0x020008BF RID: 2239
819 public class Item
820 {
821 // Token: 0x17001152 RID: 4434
822 // (get) Token: 0x06003ADC RID: 15068 RVA: 0x00137960 File Offset: 0x00135B60
823 public Chara cc
824 {
825 get
826 {
827 return EClass.pc;
828 }
829 }
830
831 // Token: 0x17001153 RID: 4435
832 // (get) Token: 0x06003ADD RID: 15069 RVA: 0x00137967 File Offset: 0x00135B67
833 public bool HideHint
834 {
835 get
836 {
837 return EClass.pc.isBlind || (this.tc != null && this.tc.isChara && !EClass.pc.CanSee(this.tc));
838 }
839 }
840
841 // Token: 0x06003ADE RID: 15070 RVA: 0x001379A4 File Offset: 0x00135BA4
842 public string GetText(bool showName)
843 {
844 return this.act.GetText("") + ((showName && this.act.GetTextSmall(this.tc) != null) ? ("\n<size=28>" + this.act.GetTextSmall(this.tc) + "</size>") : "");
845 }
846
847 // Token: 0x06003ADF RID: 15071 RVA: 0x00137A04 File Offset: 0x00135C04
848 public string GetTextContext(bool showName)
849 {
850 return this.act.GetText("") + ((showName && this.tc != null && !this.HideHint) ? ("<size=13> (" + this.tc.Name + ")</size>") : "");
851 }
852
853 // Token: 0x06003AE0 RID: 15072 RVA: 0x00137A5C File Offset: 0x00135C5C
854 public bool Perform(bool repeated = false)
855 {
856 if (AM_Adv.actCount == 0 && !Dialog.warned)
857 {
858 ActPlan.warning = true;
859 Chara _CC = Act.CC;
860 Card _TC = Act.TC;
861 Point _TP = new Point(Act.TP);
862 if (EClass._zone.IsCrime(EClass.pc, this.act) && this.act.ID != "actContainer")
863 {
864 Dialog.TryWarnCrime(delegate
865 {
866 Act.CC = _CC;
867 Act.TC = _TC;
868 Act.TP.Set(_TP);
869 if (this.Perform(false))
870 {
871 EClass.player.EndTurn(true);
872 }
873 });
874 return false;
875 }
876 if (this.act is TaskHarvest && (this.act as TaskHarvest).mode == BaseTaskHarvest.HarvestType.Disassemble)
877 {
878 Dialog.TryWarnDisassemble(delegate
879 {
880 Act.CC = _CC;
881 Act.TC = _TC;
882 Act.TP.Set(_TP);
883 if (this.Perform(false))
884 {
885 EClass.player.EndTurn(true);
886 }
887 });
888 return false;
889 }
890 }
891 ActPlan.warning = false;
892 int num = this.cc.pos.Distance(this.pos);
893 bool flag = num == 1 && this.cc.CanInteractTo(this.pos);
894 AIAct aiact = this.act as AIAct;
895 if (!this.act.IsAct)
896 {
897 if (repeated)
898 {
899 if (this.cc.ai.GetType() == this.act.GetType() && this.cc.ai.IsRunning)
900 {
901 return false;
902 }
903 aiact.Reset();
904 if (!this.act.CanPerform())
905 {
906 this.cc.SetAI(Chara._NoGoalRepeat);
907 return false;
908 }
909 Task task = aiact as Task;
910 if (task != null)
911 {
912 task.isDestroyed = false;
913 TaskPoint taskPoint = task as TaskPoint;
914 if (EClass.scene.mouseTarget.isValid && taskPoint != null)
915 {
916 taskPoint.isRepeated = true;
917 taskPoint.pos = EClass.scene.mouseTarget.pos.Copy();
918 }
919 }
920 }
921 this.cc.SetAIImmediate(aiact);
922 ActionMode.Adv.SetTurbo(aiact.UseTurbo ? -1 : 0);
923 return false;
924 }
925 if (this.act.PerformDistance != -1 && (num > this.act.PerformDistance || (num == 1 && !flag)))
926 {
927 this.cc.SetAIImmediate(new DynamicAIAct(this.act.GetText(""), () => this.act.Perform(this.cc, this.tc, this.pos), false)
928 {
929 pos = this.pos.Copy()
930 });
931 return false;
932 }
933 bool flag2 = this.act.Perform(this.cc, this.tc, this.pos);
934 if (flag2 && !EClass.pc.HasNoGoal)
935 {
936 ActionMode.Adv.SetTurbo(-1);
937 }
938 return flag2 && EClass.pc.HasNoGoal;
939 }
940
941 // Token: 0x04002535 RID: 9525
942 public Act act;
943
944 // Token: 0x04002536 RID: 9526
945 public Card tc;
946
947 // Token: 0x04002537 RID: 9527
948 public Point pos;
949 }
950}
Definition ACT.cs:6
Definition AIAct.cs:7
Definition Act.2.cs:7
Definition Card.cs:13
Definition Cell.cs:10
Definition Chara.cs:12
Definition Msg.cs:7
Definition Point.cs:11
Definition Task.cs:6
Definition Thing.cs:10