Elin Decompiled Documentation EA 23.345.1 Nightly
Loading...
Searching...
No Matches
GrowSystem.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class GrowSystem : EClass
4{
5 public class Stage
6 {
7 public int[] tiles;
8
9 public int idx;
10
11 public int tileEx;
12
14
15 public bool harvest;
16
17 public void SetTile(int _tile)
18 {
19 tiles = new int[Convert(_tile)];
20 }
21
22 public void SetTile(int tileIdx, params int[] _tiles)
23 {
24 tiles = new int[_tiles.Length];
25 for (int i = 0; i < tiles.Length; i++)
26 {
27 tiles[i] = Convert(_tiles[i] + tileIdx);
28 }
29 }
30
31 public int Convert(int tile)
32 {
33 return renderData.ConvertTile(tile);
34 }
35 }
36
37 private static SourceObj.Row[] _sourceSnowTree;
38
39 public const int DivStage = 30;
40
41 public static Cell cell;
42
43 public static Stage currentStage;
44
46
47 public Stage[] stages;
48
49 public int[] baseTiles;
50
51 public int harvestTile;
52
53 public int afterHarvestTile;
54
55 public string idHarvestThing;
56
58 {
59 get
60 {
61 object obj = _sourceSnowTree;
62 if (obj == null)
63 {
64 obj = new SourceObj.Row[2]
65 {
68 };
70 }
71 return (SourceObj.Row[])obj;
72 }
73 }
74
75 public virtual RenderData RenderHarvest => source.renderData;
76
77 public virtual int Step => 5;
78
79 public virtual int StageLength => 5;
80
81 public virtual int DefaultStage => Mathf.Clamp(StageLength - 2, 0, StageLength - 1);
82
83 public virtual int HarvestStage => -1;
84
85 public virtual int AutoMineStage => HarvestStage;
86
87 protected virtual int HaltStage => HarvestStage;
88
89 protected virtual bool DrawHarvestOnTop => false;
90
91 protected virtual bool UseGenericFirstStageTile => true;
92
93 protected virtual bool WitherOnLastStage => true;
94
95 protected virtual bool CanRegrow => true;
96
97 public virtual bool CanLevelSeed => true;
98
99 public virtual int ShadowStage => 1;
100
101 public virtual bool IsTree => false;
102
103 public virtual bool IsCrimeToHarvest => false;
104
105 public virtual float MtpProgress => 1f;
106
107 public virtual bool NeedSunlight => true;
108
109 public virtual bool GrowOnLand => true;
110
111 public virtual bool GrowUndersea => false;
112
113 public virtual AnimeID AnimeProgress => AnimeID.HitObj;
114
115 public Stage stage => stages[cell.objVal / 30];
116
117 public virtual bool IsMature => false;
118
119 public bool IsLastStage()
120 {
121 return stage.idx == StageLength - 1;
122 }
123
124 protected virtual bool IsHarvestStage(int idx)
125 {
126 return idx == HarvestStage;
127 }
128
129 public virtual bool CanRotate()
130 {
131 return false;
132 }
133
134 public virtual bool BlockSight(Cell cell)
135 {
136 return false;
137 }
138
139 public virtual bool BlockPass(Cell cell)
140 {
141 return false;
142 }
143
144 public virtual string GetSoundProgress()
145 {
146 return "Material/grass";
147 }
148
149 public virtual Stage CreateStage()
150 {
151 return new Stage();
152 }
153
154 public void Init(SourceObj.Row _row)
155 {
156 source = _row;
157 stages = new Stage[StageLength];
158 string[] growth = _row._growth;
159 string[] array = growth[1].Split('/');
160 baseTiles = new int[array.Length];
161 for (int i = 0; i < array.Length; i++)
162 {
163 baseTiles[i] = array[i].ToInt();
164 }
165 if (growth.Length > 2)
166 {
167 harvestTile = RenderHarvest.ConvertTile(growth[2].ToInt());
168 idHarvestThing = growth[3];
169 }
170 for (int j = 0; j < StageLength; j++)
171 {
173 stages[j] = stage;
174 stage.idx = j;
175 if (j == 0 && UseGenericFirstStageTile)
176 {
178 }
179 else
180 {
182 }
183 if (harvestTile != 0 && IsHarvestStage(j))
184 {
185 stage.harvest = true;
186 }
187 }
188 }
189
190 public virtual void SetGenericFirstStageTile(Stage s)
191 {
192 s.renderData = EClass.core.refs.renderers.objS_flat;
193 s.SetTile(0, 100, 101, 102);
194 }
195
196 public virtual void SetStageTile(Stage s)
197 {
198 s.renderData = source.renderData;
199 s.SetTile(s.idx + (UseGenericFirstStageTile ? (-1) : 0), baseTiles);
200 }
201
202 public virtual int GetStageTile()
203 {
204 return currentStage.tiles[cell.objDir % currentStage.tiles.Length];
205 }
206
207 public virtual int GetShadow(int index)
208 {
209 return -1;
210 }
211
212 public virtual void OnRenderTileMap(RenderParam p, bool drawShadow = true)
213 {
214 int num = cell.objVal / 30;
215 currentStage = stages[num];
216 SourceObj.Row row = source;
217 float y = p.y;
218 float z = p.z;
219 if (num != 0 || !UseGenericFirstStageTile)
220 {
221 p.y += row.pref.y;
222 p.z += row.pref.z;
223 }
225 {
226 if (cell.isHarvested || harvestTile == 0)
227 {
228 p.tile = ((afterHarvestTile != 0) ? afterHarvestTile : GetStageTile());
230 }
231 else
232 {
234 {
235 p.tile = GetStageTile();
237 p.liquidLv = 0;
238 }
239 p.tile = harvestTile;
241 }
242 }
243 else
244 {
245 p.tile = GetStageTile();
247 }
248 p.y = y;
249 p.z = z;
250 if (cell.obj == 118 && Core.fixedFrame % 10f == 0f && IsMature)
251 {
252 EClass.scene.psFey.transform.position = new Vector3(p.x, p.y, p.z - 2f);
253 EClass.scene.psFey.Emit(1);
254 }
255 if (drawShadow && num >= ShadowStage)
256 {
257 int shadow = GetShadow(num);
258 if (shadow == -1)
259 {
260 shadow = row.pref.shadow;
261 }
262 if (shadow > 1 && !cell.ignoreObjShadow)
263 {
265 }
266 }
267 }
268
269 public void SetRandomStage()
270 {
271 int num = Rand.rnd(stages.Length);
272 if (num == 0 && EClass.rnd(5) != 0 && stages.Length >= 2)
273 {
274 num++;
275 }
276 else if (num == stages.Length - 1 && EClass.rnd(5) != 0 && stages.Length >= 2)
277 {
278 num--;
279 }
280 cell.objVal = (byte)(num * 30);
281 }
282
283 public void SetDefaultStage()
284 {
285 cell.objVal = (byte)(DefaultStage * 30);
286 }
287
288 public virtual void OnSetObj()
289 {
290 }
291
292 public bool CanGrow(VirtualDate date)
293 {
294 if (source.id == 0)
295 {
296 return false;
297 }
298 if (cell.HasBlock && !cell.sourceBlock.tileType.IsFence)
299 {
300 return false;
301 }
302 if (GrowUndersea)
303 {
304 if (EClass._zone.IsUnderwater || cell.sourceSurface.tileType.IsDeepWater)
305 {
306 return true;
307 }
308 }
309 else if (EClass._zone.IsUnderwater)
310 {
311 return false;
312 }
313 if (!GrowOnLand)
314 {
315 return false;
316 }
317 if (NeedSunlight)
318 {
319 if (date.sunMap == null)
320 {
321 date.BuildSunMap();
322 }
323 if ((cell.HasRoof || date.IsWinter || EClass._map.IsIndoor) && !date.sunMap.Contains(cell.index))
324 {
325 return false;
326 }
327 }
328 return true;
329 }
330
331 public void TryGrow(VirtualDate date)
332 {
333 if (CanGrow(date))
334 {
335 Grow();
336 }
337 }
338
339 public void EqualizePlants(Point pos)
340 {
342 if (p1 == null || p1.seed == null)
343 {
344 return;
345 }
346 pos.ForeachNeighbor(delegate(Point point)
347 {
348 Thing thing = EClass._map.TryGetPlant(point)?.seed;
349 if (thing == null)
350 {
351 Thing installed = point.Installed;
352 if (installed != null && installed.id == p1.seed.id)
353 {
354 thing = installed;
355 }
356 }
357 if (thing != null && p1.seed.refVal == thing.refVal && thing.encLV >= p1.seed.encLV)
358 {
359 p1.seed = thing;
360 }
361 }, diagonal: false);
362 }
363
364 public void Grow(int mtp = 1)
365 {
366 bool flag = cell.isWatered || (cell.IsTopWater && (source.tag.Contains("flood") || source.tag.Contains("undersea")));
367 PlantData plantData = EClass._map.TryGetPlant(cell);
368 if (plantData != null && flag)
369 {
370 plantData.water++;
371 }
372 int num = Step * mtp * ((!flag) ? 1 : 2);
373 int num2 = cell.objVal / 30;
374 int num3 = (cell.objVal + num) / 30;
375 if (num2 != num3)
376 {
378 {
379 PopHarvest(null);
380 }
382 {
383 Point point = cell.GetPoint();
384 EqualizePlants(point);
385 Thing thing = TryPopSeed(null);
386 PopMineObj();
387 if (thing != null)
388 {
389 point.SetObj();
390 EClass._zone.AddCard(thing, point).Install();
391 }
392 }
393 else if (num2 == StageLength - 1)
394 {
396 {
397 Point point2 = cell.GetPoint();
398 EqualizePlants(point2);
399 Thing thing2 = TryPopSeed(null);
400 if (thing2 != null)
401 {
402 point2.SetObj();
403 EClass._zone.AddCard(thing2, point2).Install();
404 }
405 }
406 else
407 {
409 }
410 }
411 else
412 {
414 }
415 }
416 else
417 {
418 cell.objVal += (byte)num;
419 }
420 cell.Refresh();
422 }
423
424 public virtual void OnReachNextStage()
425 {
426 SetStage(cell.objVal / 30 + 1);
427 }
428
429 public virtual void OnExceedLastStage()
430 {
431 cell.objVal = (byte)(stages.Length * 30 - 1);
432 if (!CanRegrow || Rand.rnd(2) != 0)
433 {
434 return;
435 }
436 Point point = cell.GetPoint();
437 if (point.IsFarmField)
438 {
439 return;
440 }
441 if (Rand.rnd(2) == 0)
442 {
443 Point randomNeighbor = point.GetRandomNeighbor();
444 if (randomNeighbor.cell.CanGrowWeed)
445 {
446 randomNeighbor.SetObj(cell.obj);
447 point.SetObj();
448 return;
449 }
450 }
451 cell.objVal = 0;
452 cell.isHarvested = false;
453 cell.isWatered = cell.HasLiquid;
454 }
455
456 public void SetStage(int idx, bool renewHarvest = false)
457 {
458 cell.objVal = (byte)(idx * 30);
459 cell.gatherCount = 0;
460 if (cell.HasLiquid)
461 {
462 cell.isWatered = true;
463 }
464 if (renewHarvest)
465 {
466 cell.isHarvested = true;
467 }
468 if (cell.sourceObj.id == 118)
469 {
470 EClass._zone.dirtyElectricity = true;
471 }
472 OnSetStage(idx);
473 }
474
475 public virtual void OnSetStage(int idx)
476 {
477 }
478
479 public bool HaltGrowth()
480 {
481 return stage.idx == HarvestStage;
482 }
483
484 public void Perish()
485 {
487 {
488 if (CanHarvest())
489 {
490 PopHarvest(null);
491 }
492 Thing thing = TryPopSeed(null);
493 if (thing != null)
494 {
496 }
498 return;
499 }
501 {
503 return;
504 }
505 if (EClass.rnd(3) == 0)
506 {
507 Thing thing2 = TryPopSeed(null);
508 if (thing2 != null)
509 {
511 }
512 }
514 }
515
516 public bool IsWithered()
517 {
519 {
520 return true;
521 }
522 return false;
523 }
524
525 public bool CanHarvest()
526 {
528 {
529 return false;
530 }
531 return true;
532 }
533
534 public virtual bool CanReapSeed()
535 {
536 return CanHarvest();
537 }
538
539 public virtual void OnHit(Chara c)
540 {
541 }
542
543 public virtual void OnHitFail(Chara c)
544 {
545 }
546
548 {
549 EClass._map.MineObj(cell.GetPoint(), null, c);
550 }
551
552 public void PopMineObj(Chara c = null)
553 {
555 {
556 OnMineObj(c);
557 TryPopSeed(c);
558 }
559 }
560
561 public virtual void OnMineObj(Chara c = null)
562 {
563 if (!IsWithered())
564 {
565 int num = cell.sourceObj.components.Length - 1;
566 Thing t = ThingGen.Create(cell.sourceObj.components[num].Split('/')[0], cell.matObj_fixed.alias);
567 TryPick(cell, t, c);
568 }
569 }
570
571 public void TryPick(Cell cell, Thing t, Chara c, bool applySeed = false)
572 {
573 if (applySeed)
574 {
575 ApplySeed(t);
576 }
578 {
579 if (EClass.rnd(4) != 0)
580 {
581 if (t.Num > 1)
582 {
583 t.SetNum(t.Num / 2);
584 }
585 else if (EClass.rnd(2) == 0)
586 {
587 return;
588 }
590 {
592 }
593 }
594 }
595 else
596 {
598 }
599 }
600
601 public void TryPick(Cell cell, string idThing, int idMat = -1, int num = 1, bool applySeed = false)
602 {
603 if (num > 0)
604 {
605 TryPick(cell, ThingGen.Create(idThing, idMat).SetNum(num), EClass.pc, applySeed);
606 }
607 }
608
610 {
611 if (source.HasTag(CTAG.seed))
612 {
614 {
615 return null;
616 }
618 {
619 return TraitSeed.MakeSeed(cell);
620 }
621 int num = (cell.IsFarmField ? 400 : 1000);
622 int soilCost = EClass._zone.GetSoilCost();
623 int maxSoil = EClass._zone.MaxSoil;
624 if (soilCost > maxSoil)
625 {
626 num += (soilCost - maxSoil) * 10;
627 }
628 if (IsWithered())
629 {
630 num /= 5;
631 }
632 if (EClass.rnd(num) < EClass.rnd(source.chance))
633 {
634 Thing thing = TraitSeed.MakeSeed(cell);
635 TryPick(cell, thing, c);
636 return thing;
637 }
638 }
639 return null;
640 }
641
642 public void Harvest(Chara c)
643 {
644 cell.isHarvested = true;
645 cell.gatherCount = 0;
646 PopHarvest(c);
647 }
648
649 public void PopHarvest(Chara c, string idThing, int num = -1)
650 {
651 PopHarvest(c, ThingGen.Create(idThing), num);
652 }
653
654 public void PopHarvest(Chara c, Thing t = null, int num = -1)
655 {
656 if (t == null)
657 {
658 t = ((!idHarvestThing.StartsWith('#')) ? ThingGen.Create(idHarvestThing.IsEmpty("apple")) : ThingGen.CreateFromCategory(idHarvestThing.Replace("#", "")));
659 }
660 ApplySeed(t);
661 if (cell.isObjDyed && source.ContainsTag("dyeable"))
662 {
663 t.Dye(cell.matObj);
664 }
665 PlantData plantData = EClass._map.TryGetPlant(cell);
666 bool flag = false;
667 if (plantData != null && plantData.size > 0)
668 {
669 t.c_weight = t.SelfWeight * (80 + plantData.size * plantData.size * 100) / 100;
670 t.SetBool(115, enable: true);
671 t.isWeightChanged = true;
672 flag = true;
673 }
674 t.SetBlessedState(BlessedState.Normal);
675 if (source._growth.Length > 4)
676 {
677 int num2 = EClass.rnd(source._growth[4].ToInt()) + 1;
678 int soilCost = EClass._zone.GetSoilCost();
679 int maxSoil = EClass._zone.MaxSoil;
680 if (soilCost > maxSoil && EClass.player.stats.days >= 5)
681 {
682 num2 -= EClass.rnd(2 + (soilCost - maxSoil) / 20);
683 }
684 if (num2 <= 0)
685 {
687 {
688 c?.Say("cropSpoiled", c, cell.GetObjName());
689 }
690 return;
691 }
692 t.SetNum(num2);
693 }
694 if (num > 0)
695 {
696 t.SetNum(num);
697 }
698 int num3 = t.Num;
699 TryPick(cell, t, c);
700 if (flag)
701 {
702 c.ModExpParty(207, Mathf.Min(t.c_weight * num3 / 125, 500));
703 }
704 }
705
706 public void ApplySeed(Thing t)
707 {
710 {
711 thing = null;
712 }
713 if (thing == null)
714 {
715 return;
716 }
717 int encLv = thing.encLV / 10 + ((thing.encLV > 0) ? 1 : 0);
718 bool flag = t.IsFood || t.Evalue(10) > 0 || t.id == "grass";
719 foreach (Element value in thing.elements.dict.Values)
720 {
721 if ((!value.IsFoodTrait || flag) && (value.IsFoodTrait || value.id == 2))
722 {
723 t.elements.ModBase(value.id, value.Value / 10 * 10);
724 }
725 }
726 t.SetEncLv(encLv);
727 t.c_refText = thing.c_refText;
728 t.isCrafted = true;
729 if (thing.isDyed)
730 {
731 t.Dye(thing.DyeMat);
732 }
733 }
734
735 public virtual int GetHp()
736 {
737 return source.hp;
738 }
739}
AnimeID
Definition: AnimeID.cs:2
BlessedState
Definition: BlessedState.cs:2
CTAG
Definition: CTAG.cs:2
@ seed
BaseTileMap tileMap
MeshPass passShadow
Definition: BaseTileMap.cs:133
Thing container_shipping
Definition: CardManager.cs:52
string id
Definition: Card.cs:36
Card AddCard(Card c)
Definition: Card.cs:3266
Thing SetNum(int a)
Definition: Card.cs:3676
void ModExpParty(int ele, int a)
Definition: Card.cs:2794
int refVal
Definition: Card.cs:209
int encLV
Definition: Card.cs:329
int Evalue(int ele)
Definition: Card.cs:2704
Card Install()
Definition: Card.cs:3922
int Num
Definition: Card.cs:161
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7323
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1098
bool HasBlock
Definition: Cell.cs:687
int obj
Definition: Cell.cs:50
bool isHarvested
Definition: Cell.cs:350
SourceMaterial.Row matObj
Definition: Cell.cs:1082
byte objVal
Definition: Cell.cs:68
void Refresh()
Definition: Cell.cs:1200
bool HasLiquid
Definition: Cell.cs:717
byte z
Definition: Cell.cs:78
bool HasRoof
Definition: Cell.cs:692
SourceObj.Row sourceObj
Definition: Cell.cs:1120
string GetObjName()
Definition: Cell.cs:1684
byte x
Definition: Cell.cs:76
Point GetPoint()
Definition: Cell.cs:1149
bool isObjDyed
Definition: Cell.cs:638
bool ignoreObjShadow
Definition: Cell.cs:398
bool CanGrowWeed
Definition: Cell.cs:786
int index
Definition: Cell.cs:134
SourceFloor.Row sourceSurface
Definition: Cell.cs:1105
SourceMaterial.Row matObj_fixed
Definition: Cell.cs:1085
Definition: Chara.cs:10
RenderData objS_flat
Definition: CoreRef.cs:307
Renderers renderers
Definition: CoreRef.cs:360
Definition: Core.cs:14
CoreRef refs
Definition: Core.cs:51
static float fixedFrame
Definition: Core.cs:25
bool IsWinter
Definition: Date.cs:192
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
static BaseGameScreen screen
Definition: EClass.cs:33
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
int id
Definition: ELEMENT.cs:259
int Value
Definition: ELEMENT.cs:301
bool IsFoodTrait
Definition: ELEMENT.cs:373
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:225
CardManager cards
Definition: Game.cs:156
int Convert(int tile)
Definition: GrowSystem.cs:31
RenderData renderData
Definition: GrowSystem.cs:13
void SetTile(int tileIdx, params int[] _tiles)
Definition: GrowSystem.cs:22
void SetTile(int _tile)
Definition: GrowSystem.cs:17
void TryPick(Cell cell, string idThing, int idMat=-1, int num=1, bool applySeed=false)
Definition: GrowSystem.cs:601
void SetDefaultStage()
Definition: GrowSystem.cs:283
void PopHarvest(Chara c, Thing t=null, int num=-1)
Definition: GrowSystem.cs:654
void ApplySeed(Thing t)
Definition: GrowSystem.cs:706
virtual int GetStageTile()
Definition: GrowSystem.cs:202
virtual int StageLength
Definition: GrowSystem.cs:79
virtual bool IsHarvestStage(int idx)
Definition: GrowSystem.cs:124
virtual void OnReachNextStage()
Definition: GrowSystem.cs:424
int afterHarvestTile
Definition: GrowSystem.cs:53
static SourceObj.Row[] _sourceSnowTree
Definition: GrowSystem.cs:37
virtual bool CanRotate()
Definition: GrowSystem.cs:129
virtual int AutoMineStage
Definition: GrowSystem.cs:85
static Stage currentStage
Definition: GrowSystem.cs:43
void TryPick(Cell cell, Thing t, Chara c, bool applySeed=false)
Definition: GrowSystem.cs:571
virtual int HarvestStage
Definition: GrowSystem.cs:83
virtual void OnHit(Chara c)
Definition: GrowSystem.cs:539
bool CanHarvest()
Definition: GrowSystem.cs:525
bool IsWithered()
Definition: GrowSystem.cs:516
int[] baseTiles
Definition: GrowSystem.cs:49
void Perish()
Definition: GrowSystem.cs:484
virtual int GetShadow(int index)
Definition: GrowSystem.cs:207
virtual int DefaultStage
Definition: GrowSystem.cs:81
void PopMineObj(Chara c=null)
Definition: GrowSystem.cs:552
string idHarvestThing
Definition: GrowSystem.cs:55
void SetStage(int idx, bool renewHarvest=false)
Definition: GrowSystem.cs:456
virtual RenderData RenderHarvest
Definition: GrowSystem.cs:75
void TryGrow(VirtualDate date)
Definition: GrowSystem.cs:331
SourceObj.Row source
Definition: GrowSystem.cs:45
virtual AnimeID AnimeProgress
Definition: GrowSystem.cs:113
virtual Stage CreateStage()
Definition: GrowSystem.cs:149
virtual void OnHitFail(Chara c)
Definition: GrowSystem.cs:543
virtual bool CanReapSeed()
Definition: GrowSystem.cs:534
virtual bool GrowOnLand
Definition: GrowSystem.cs:109
void EqualizePlants(Point pos)
Definition: GrowSystem.cs:339
virtual bool IsMature
Definition: GrowSystem.cs:117
const int DivStage
Definition: GrowSystem.cs:39
virtual void OnSetStage(int idx)
Definition: GrowSystem.cs:475
virtual int Step
Definition: GrowSystem.cs:77
void Grow(int mtp=1)
Definition: GrowSystem.cs:364
virtual bool IsCrimeToHarvest
Definition: GrowSystem.cs:103
virtual int HaltStage
Definition: GrowSystem.cs:87
virtual void SetStageTile(Stage s)
Definition: GrowSystem.cs:196
Stage stage
Definition: GrowSystem.cs:115
virtual bool WitherOnLastStage
Definition: GrowSystem.cs:93
virtual void OnSetObj()
Definition: GrowSystem.cs:288
void OnProgressComplete(Chara c)
Definition: GrowSystem.cs:547
virtual string GetSoundProgress()
Definition: GrowSystem.cs:144
void Init(SourceObj.Row _row)
Definition: GrowSystem.cs:154
virtual bool DrawHarvestOnTop
Definition: GrowSystem.cs:89
virtual bool NeedSunlight
Definition: GrowSystem.cs:107
virtual void OnExceedLastStage()
Definition: GrowSystem.cs:429
void SetRandomStage()
Definition: GrowSystem.cs:269
virtual void OnMineObj(Chara c=null)
Definition: GrowSystem.cs:561
bool IsLastStage()
Definition: GrowSystem.cs:119
virtual float MtpProgress
Definition: GrowSystem.cs:105
virtual void OnRenderTileMap(RenderParam p, bool drawShadow=true)
Definition: GrowSystem.cs:212
virtual bool BlockSight(Cell cell)
Definition: GrowSystem.cs:134
virtual int ShadowStage
Definition: GrowSystem.cs:99
bool HaltGrowth()
Definition: GrowSystem.cs:479
virtual bool UseGenericFirstStageTile
Definition: GrowSystem.cs:91
void PopHarvest(Chara c, string idThing, int num=-1)
Definition: GrowSystem.cs:649
void Harvest(Chara c)
Definition: GrowSystem.cs:642
virtual bool CanRegrow
Definition: GrowSystem.cs:95
Thing TryPopSeed(Chara c)
Definition: GrowSystem.cs:609
virtual int GetHp()
Definition: GrowSystem.cs:735
Stage[] stages
Definition: GrowSystem.cs:47
virtual bool GrowUndersea
Definition: GrowSystem.cs:111
bool CanGrow(VirtualDate date)
Definition: GrowSystem.cs:292
static Cell cell
Definition: GrowSystem.cs:41
virtual bool BlockPass(Cell cell)
Definition: GrowSystem.cs:139
virtual bool IsTree
Definition: GrowSystem.cs:101
virtual void SetGenericFirstStageTile(Stage s)
Definition: GrowSystem.cs:190
int harvestTile
Definition: GrowSystem.cs:51
static SourceObj.Row[] SourceSnowTree
Definition: GrowSystem.cs:58
virtual bool CanLevelSeed
Definition: GrowSystem.cs:97
bool IsIndoor
Definition: Map.cs:136
PlantData TryGetPlant(Point p)
Definition: Map.cs:2082
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1944
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
Definition: Map.cs:1035
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1980
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1675
void AddShadow(MeshPassParam p, ref Vector3 fix)
Definition: MeshPass.cs:195
int water
Definition: PlantData.cs:9
Thing seed
Definition: PlantData.cs:6
int size
Definition: PlantData.cs:15
int days
Definition: Player.cs:75
Stats stats
Definition: Player.cs:1086
bool isAutoFarming
Definition: Player.cs:1254
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:327
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:934
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1403
bool IsFarmField
Definition: Point.cs:127
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:764
Definition: Rand.cs:4
static int rnd(int max)
Definition: Rand.cs:59
void Draw(RenderParam p, int tile)
Definition: RenderData.cs:129
Vector3 offsetShadow
Definition: RenderData.cs:23
int ConvertTile(int tile)
Definition: RenderData.cs:111
RenderData renderData
Definition: RenderRow.cs:71
SourcePref pref
Definition: RenderRow.cs:68
ParticleSystem psFey
Definition: Scene.cs:119
List< Item > items
Definition: ShadowData.cs:101
static ShadowData Instance
Definition: ShadowData.cs:99
SourceObj objs
int shadow
Definition: SourcePref.cs:41
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
static Thing MakeSeed(string idSource)
Definition: TraitSeed.cs:105
void BuildSunMap()
Definition: VirtualDate.cs:54
HashSet< int > sunMap
Definition: VirtualDate.cs:9
virtual int MaxSoil
Definition: Zone.cs:523
virtual bool IsUserZone
Definition: Zone.cs:278
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2307
virtual bool IsUnderwater
Definition: Zone.cs:276
int GetSoilCost()
Definition: Zone.cs:4040
Card AddCard(Card t, Point point)
Definition: Zone.cs:2150