Elin Modding Docs Doc
Loading...
Searching...
No Matches
HitSummary.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x020001AF RID: 431
6public class HitSummary : EClass
7{
8 // Token: 0x06000C5C RID: 3164 RVA: 0x0005C5C4 File Offset: 0x0005A7C4
9 public void Clear()
10 {
11 this.hasFactory = true;
12 this.money = (this.count = (this.countValid = 0));
13 this.targets.Clear();
14 this.groups.Clear();
15 }
16
17 // Token: 0x06000C5D RID: 3165 RVA: 0x0005C608 File Offset: 0x0005A808
18 public void SetRecipe(Recipe r)
19 {
20 this.recipe = r;
21 this.hasFactory = true;
22 if (r != null && !r.UseStock && r.source.NeedFactory)
23 {
24 PropSet propSet = EClass._map.Installed.cardMap.TryGetValue(r.source.idFactory, null);
25 if (propSet == null || propSet.Count == 0)
26 {
27 this.hasFactory = false;
28 }
29 }
30 }
31
32 // Token: 0x06000C5E RID: 3166 RVA: 0x0005C670 File Offset: 0x0005A870
33 public bool CanExecute()
34 {
35 if (EClass.debug.ignoreBuildRule)
36 {
37 return true;
38 }
39 if (!this.hasFactory || EClass.pc.GetCurrency("money") < this.money)
40 {
41 return false;
42 }
43 if (EClass.screen.tileSelector.processing)
44 {
45 return true;
46 }
47 if (this.recipe != null)
48 {
49 foreach (Recipe.Ingredient ingredient in this.recipe.ingredients)
50 {
51 if (!ingredient.optional)
52 {
53 if (ingredient.thing == null)
54 {
55 return false;
56 }
57 if (ingredient.thing.Num < ingredient.req * this.countValid)
58 {
59 return false;
60 }
61 }
62 }
63 return true;
64 }
65 return true;
66 }
67
68 // Token: 0x06000C5F RID: 3167 RVA: 0x0005C740 File Offset: 0x0005A940
69 public void Execute()
70 {
71 if (!EClass.debug.ignoreBuildRule)
72 {
73 EClass.pc.ModCurrency(-this.money, "money");
74 }
75 if (this.recipe == null || (this.recipe.UseStock && !this.recipe.VirtualBlock))
76 {
77 return;
78 }
79 if (this.recipe.RequireIngredients)
80 {
81 BuildMenu.Instance.info1.lastMats[this.recipe.id] = this.recipe.ingredients[0].mat;
82 }
83 if (this.recipe.tileType.CanInstaComplete || EClass.player.instaComplete)
84 {
85 foreach (Recipe.Ingredient ingredient in this.recipe.ingredients)
86 {
87 Thing thing = this.recipe.UseStock ? this.recipe.ingredients[0].thing : ingredient.RefreshThing();
88 if (thing == null)
89 {
90 if (!EClass.debug.enable)
91 {
92 Debug.LogError("no ing");
93 }
94 break;
95 }
96 int num = ingredient.req * this.countValid;
97 int num2 = (thing.Num >= num) ? num : thing.Num;
98 if (!EClass.debug.godBuild || this.recipe.UseStock)
99 {
100 thing.ModNum(-num2, true);
101 }
102 }
103 }
104 }
105
106 // Token: 0x04000C1E RID: 3102
107 public int money;
108
109 // Token: 0x04000C1F RID: 3103
110 public int count;
111
112 // Token: 0x04000C20 RID: 3104
113 public int countValid;
114
115 // Token: 0x04000C21 RID: 3105
116 public Recipe recipe;
117
118 // Token: 0x04000C22 RID: 3106
119 public List<IInspect> targets = new List<IInspect>();
120
121 // Token: 0x04000C23 RID: 3107
122 public List<InspectGroup> groups = new List<InspectGroup>();
123
124 // Token: 0x04000C24 RID: 3108
125 public Thing factory;
126
127 // Token: 0x04000C25 RID: 3109
128 public bool hasFactory;
129}
Definition Thing.cs:10