Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
AM_Deconstruct.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UnityEngine;
3
5{
6 public bool useRange;
7
8 public bool ignoreInstalled;
9
10 public override bool IsBuildMode => true;
11
13
15 {
16 get
17 {
18 if (!useRange)
19 {
20 return BaseTileSelector.SelectType.Single;
21 }
22 return BaseTileSelector.SelectType.Multiple;
23 }
24 }
25
27
28 public override bool ShowMouseoverTarget => true;
29
30 public override bool UseSubMenu => true;
31
32 public override bool IsRoofEditMode(Card c = null)
33 {
34 return Input.GetKey(KeyCode.LeftAlt);
35 }
36
37 public override MeshPass GetGuidePass(Point point)
38 {
39 if (Perform(point) <= 0)
40 {
41 return base.GetGuidePass(point);
42 }
44 }
45
46 public override void OnUpdateCursor()
47 {
49 }
50
51 public override HitResult HitTest(Point point, Point start)
52 {
53 if (Perform(point) > 0)
54 {
55 return HitResult.Valid;
56 }
57 return base.HitTest(point, start);
58 }
59
60 public override void OnProcessTiles(Point point, int dir)
61 {
62 if (Perform(point) == 0)
63 {
64 SE.Beep();
65 }
66 else
67 {
68 Perform(point, perform: true);
69 }
70 }
71
72 public int Perform(Point point, bool perform = false)
73 {
74 List<Card> list = point.ListCards();
75 int num = 0;
76 list.Reverse();
77 foreach (Card item in list.Copy())
78 {
79 if ((!EClass.debug.ignoreBuildRule && (!item.isThing || !item.trait.CanPutAway)) || (ignoreInstalled && item.IsInstalled) || item.IsPCParty)
80 {
81 continue;
82 }
83 if (perform)
84 {
85 item.PlaySound(item.material.GetSoundDead(item.sourceCard));
86 if (item.isThing)
87 {
88 EClass._map.PutAway(item.Thing);
89 }
90 else
91 {
92 item.Destroy();
93 }
94 BuildMenu.dirtyCat = true;
95 }
96 num++;
97 }
98 return num;
99 }
100
101 public override void OnClickSubMenu(int a)
102 {
103 switch (a)
104 {
105 case 0:
107 break;
108 case 1:
110 break;
111 }
112 }
113
114 public override string OnSetSubMenuButton(int a, UIButton b)
115 {
116 if (a < 2)
117 {
118 switch (a)
119 {
120 case 0:
122 break;
123 case 1:
125 break;
126 }
127 return "deconstructMenu" + a;
128 }
129 return null;
130 }
131}
HitResult
Definition: HitResult.cs:2
override BaseTileMap.CardIconMode cardIconMode
override void OnUpdateCursor()
override HitResult HitTest(Point point, Point start)
override bool ShowMouseoverTarget
override BaseTileSelector.SelectType selectType
int Perform(Point point, bool perform=false)
override BaseTileSelector.HitType hitType
override MeshPass GetGuidePass(Point point)
override void OnProcessTiles(Point point, int dir)
override bool UseSubMenu
override bool IsRoofEditMode(Card c=null)
override bool IsBuildMode
override void OnClickSubMenu(int a)
override string OnSetSubMenuButton(int a, UIButton b)
void SetCursorOnMap(CursorInfo cursor)
Definition: ActionMode.cs:565
ScreenGuide guide
Definition: Card.cs:11
bool ignoreBuildRule
Definition: CoreDebug.cs:184
static CursorInfo Select
Definition: CursorSystem.cs:58
Definition: EClass.cs:5
static Map _map
Definition: EClass.cs:18
static BaseGameScreen screen
Definition: EClass.cs:32
static CoreDebug debug
Definition: EClass.cs:48
bool PutAway(Card c)
Definition: Map.cs:2510
Definition: Point.cs:9
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1015
MeshPass passGuideBlock
Definition: ScreenGuide.cs:5
void SetCheck(bool check)
Definition: UIButton.cs:332