Elin Decompiled Documentation EA 23.287 Stable Patch 3
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 {
66 EClass.sources.objs.map[54],
67 EClass.sources.objs.map[55]
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 BlockSight(Cell cell)
130 {
131 return false;
132 }
133
134 public virtual bool BlockPass(Cell cell)
135 {
136 return false;
137 }
138
139 public virtual string GetSoundProgress()
140 {
141 return "Material/grass";
142 }
143
144 public virtual Stage CreateStage()
145 {
146 return new Stage();
147 }
148
149 public void Init(SourceObj.Row _row)
150 {
151 source = _row;
152 stages = new Stage[StageLength];
153 string[] growth = _row._growth;
154 string[] array = growth[1].Split('/');
155 baseTiles = new int[array.Length];
156 for (int i = 0; i < array.Length; i++)
157 {
158 baseTiles[i] = array[i].ToInt();
159 }
160 if (growth.Length > 2)
161 {
162 harvestTile = RenderHarvest.ConvertTile(growth[2].ToInt());
163 idHarvestThing = growth[3];
164 }
165 for (int j = 0; j < StageLength; j++)
166 {
168 stages[j] = stage;
169 stage.idx = j;
170 if (j == 0 && UseGenericFirstStageTile)
171 {
173 }
174 else
175 {
177 }
178 if (harvestTile != 0 && IsHarvestStage(j))
179 {
180 stage.harvest = true;
181 }
182 }
183 }
184
185 public virtual void SetGenericFirstStageTile(Stage s)
186 {
187 s.renderData = EClass.core.refs.renderers.objS_flat;
188 s.SetTile(0, 100, 101, 102);
189 }
190
191 public virtual void SetStageTile(Stage s)
192 {
193 s.renderData = source.renderData;
194 s.SetTile(s.idx + (UseGenericFirstStageTile ? (-1) : 0), baseTiles);
195 }
196
197 public virtual int GetStageTile()
198 {
199 return currentStage.tiles[cell.objDir % currentStage.tiles.Length];
200 }
201
202 public virtual int GetShadow(int index)
203 {
204 return -1;
205 }
206
207 public virtual void OnRenderTileMap(RenderParam p, bool drawShadow = true)
208 {
209 int num = cell.objVal / 30;
210 currentStage = stages[num];
211 SourceObj.Row row = source;
212 float y = p.y;
213 float z = p.z;
214 if (num != 0 || !UseGenericFirstStageTile)
215 {
216 p.y += row.pref.y;
217 p.z += row.pref.z;
218 }
220 {
221 if (cell.isHarvested || harvestTile == 0)
222 {
223 p.tile = ((afterHarvestTile != 0) ? afterHarvestTile : GetStageTile());
225 }
226 else
227 {
229 {
230 p.tile = GetStageTile();
232 p.liquidLv = 0;
233 }
234 p.tile = harvestTile;
236 }
237 }
238 else
239 {
240 p.tile = GetStageTile();
242 }
243 p.y = y;
244 p.z = z;
245 if (cell.obj == 118 && Core.fixedFrame % 10f == 0f && IsMature)
246 {
247 EClass.scene.psFey.transform.position = new Vector3(p.x, p.y, p.z - 2f);
248 EClass.scene.psFey.Emit(1);
249 }
250 if (drawShadow && num >= ShadowStage)
251 {
252 int shadow = GetShadow(num);
253 if (shadow == -1)
254 {
255 shadow = row.pref.shadow;
256 }
257 if (shadow > 1 && !cell.ignoreObjShadow)
258 {
260 }
261 }
262 }
263
264 public void SetRandomStage()
265 {
266 int num = Rand.rnd(stages.Length);
267 if (num == 0 && EClass.rnd(5) != 0 && stages.Length >= 2)
268 {
269 num++;
270 }
271 else if (num == stages.Length - 1 && EClass.rnd(5) != 0 && stages.Length >= 2)
272 {
273 num--;
274 }
275 cell.objVal = (byte)(num * 30);
276 }
277
278 public void SetDefaultStage()
279 {
280 cell.objVal = (byte)(DefaultStage * 30);
281 }
282
283 public virtual void OnSetObj()
284 {
285 }
286
287 public bool CanGrow(VirtualDate date)
288 {
289 if (source.id == 0)
290 {
291 return false;
292 }
293 if (cell.HasBlock && !cell.sourceBlock.tileType.IsFence)
294 {
295 return false;
296 }
297 if (GrowUndersea)
298 {
299 if (EClass._zone.IsUnderwater || cell.sourceFloor.tileType.IsDeepWater)
300 {
301 return true;
302 }
303 }
304 else if (EClass._zone.IsUnderwater)
305 {
306 return false;
307 }
308 if (!GrowOnLand)
309 {
310 return false;
311 }
312 if (NeedSunlight)
313 {
314 if (date.sunMap == null)
315 {
316 date.BuildSunMap();
317 }
318 if ((cell.HasRoof || date.IsWinter || EClass._map.IsIndoor) && !date.sunMap.Contains(cell.index))
319 {
320 return false;
321 }
322 }
323 return true;
324 }
325
326 public void TryGrow(VirtualDate date)
327 {
328 if (CanGrow(date))
329 {
330 Grow();
331 }
332 }
333
334 public void EqualizePlants(Point pos)
335 {
337 if (p1 == null || p1.seed == null)
338 {
339 return;
340 }
341 pos.ForeachNeighbor(delegate(Point pos2)
342 {
343 Thing thing = EClass._map.TryGetPlant(pos2)?.seed;
344 if (thing == null)
345 {
347 if (installed != null && installed.id == p1.seed.id)
348 {
349 thing = installed;
350 }
351 }
352 if (thing != null && p1.seed.refVal == thing.refVal && thing.encLV >= p1.seed.encLV)
353 {
354 p1.seed = thing;
355 }
356 }, diagonal: false);
357 }
358
359 public void Grow(int mtp = 1)
360 {
361 bool flag = cell.isWatered || (cell.IsTopWater && (source.tag.Contains("flood") || source.tag.Contains("undersea")));
362 PlantData plantData = EClass._map.TryGetPlant(cell);
363 if (plantData != null && flag)
364 {
365 plantData.water++;
366 }
367 int num = Step * mtp * ((!flag) ? 1 : 2);
368 int num2 = cell.objVal / 30;
369 int num3 = (cell.objVal + num) / 30;
370 if (num2 != num3)
371 {
373 {
374 PopHarvest(null);
375 }
377 {
378 Point point = cell.GetPoint();
379 EqualizePlants(point);
380 Thing thing = TryPopSeed(null);
381 PopMineObj();
382 if (thing != null)
383 {
384 point.SetObj();
385 EClass._zone.AddCard(thing, point).Install();
386 }
387 }
388 else if (num2 == StageLength - 1)
389 {
391 {
392 Point point2 = cell.GetPoint();
393 EqualizePlants(point2);
394 Thing thing2 = TryPopSeed(null);
395 if (thing2 != null)
396 {
397 point2.SetObj();
398 EClass._zone.AddCard(thing2, point2).Install();
399 }
400 }
401 else
402 {
404 }
405 }
406 else
407 {
409 }
410 }
411 else
412 {
413 cell.objVal += (byte)num;
414 }
415 cell.Refresh();
417 }
418
419 public virtual void OnReachNextStage()
420 {
421 SetStage(cell.objVal / 30 + 1);
422 }
423
424 public virtual void OnExceedLastStage()
425 {
426 cell.objVal = (byte)(stages.Length * 30 - 1);
427 if (!CanRegrow || Rand.rnd(2) != 0)
428 {
429 return;
430 }
431 Point point = cell.GetPoint();
432 if (point.IsFarmField)
433 {
434 return;
435 }
436 if (Rand.rnd(2) == 0)
437 {
438 Point randomNeighbor = point.GetRandomNeighbor();
439 if (randomNeighbor.cell.CanGrowWeed)
440 {
441 randomNeighbor.SetObj(cell.obj);
442 point.SetObj();
443 return;
444 }
445 }
446 cell.objVal = 0;
447 cell.isHarvested = false;
448 cell.isWatered = cell.HasLiquid;
449 }
450
451 public void SetStage(int idx, bool renewHarvest = false)
452 {
453 cell.objVal = (byte)(idx * 30);
454 cell.gatherCount = 0;
455 if (cell.HasLiquid)
456 {
457 cell.isWatered = true;
458 }
459 if (renewHarvest)
460 {
461 cell.isHarvested = true;
462 }
463 if (cell.sourceObj.id == 118)
464 {
465 EClass._zone.dirtyElectricity = true;
466 }
467 OnSetStage(idx);
468 }
469
470 public virtual void OnSetStage(int idx)
471 {
472 }
473
474 public bool HaltGrowth()
475 {
476 return stage.idx == HarvestStage;
477 }
478
479 public void Perish()
480 {
482 {
483 if (CanHarvest())
484 {
485 PopHarvest(null);
486 }
487 Thing thing = TryPopSeed(null);
488 if (thing != null)
489 {
491 }
493 return;
494 }
496 {
498 return;
499 }
500 if (EClass.rnd(3) == 0)
501 {
502 Thing thing2 = TryPopSeed(null);
503 if (thing2 != null)
504 {
506 }
507 }
509 }
510
511 public bool IsWithered()
512 {
514 {
515 return true;
516 }
517 return false;
518 }
519
520 public bool CanHarvest()
521 {
523 {
524 return false;
525 }
526 return true;
527 }
528
529 public virtual bool CanReapSeed()
530 {
531 return CanHarvest();
532 }
533
534 public virtual void OnHit(Chara c)
535 {
536 }
537
538 public virtual void OnHitFail(Chara c)
539 {
540 }
541
543 {
544 EClass._map.MineObj(cell.GetPoint(), null, c);
545 }
546
547 public void PopMineObj(Chara c = null)
548 {
550 {
551 OnMineObj(c);
552 TryPopSeed(c);
553 }
554 }
555
556 public virtual void OnMineObj(Chara c = null)
557 {
558 if (!IsWithered())
559 {
560 int num = cell.sourceObj.components.Length - 1;
561 Thing t = ThingGen.Create(cell.sourceObj.components[num].Split('/')[0], cell.matObj_fixed.alias);
562 TryPick(cell, t, c);
563 }
564 }
565
566 public void TryPick(Cell cell, Thing t, Chara c, bool applySeed = false)
567 {
568 if (applySeed)
569 {
570 ApplySeed(t);
571 }
573 {
574 if (EClass.rnd(4) != 0)
575 {
576 if (t.Num > 1)
577 {
578 t.SetNum(t.Num / 2);
579 }
580 else if (EClass.rnd(2) == 0)
581 {
582 return;
583 }
585 {
587 }
588 }
589 }
590 else
591 {
593 }
594 }
595
596 public void TryPick(Cell cell, string idThing, int idMat = -1, int num = 1, bool applySeed = false)
597 {
598 if (num > 0)
599 {
600 TryPick(cell, ThingGen.Create(idThing, idMat).SetNum(num), EClass.pc, applySeed);
601 }
602 }
603
605 {
606 if (source.HasTag(CTAG.seed))
607 {
608 int num = (cell.IsFarmField ? 400 : 1000);
609 int soilCost = EClass._zone.GetSoilCost();
610 int maxSoil = EClass._zone.MaxSoil;
611 if (soilCost > maxSoil)
612 {
613 num += (soilCost - maxSoil) * 10;
614 }
615 if (IsWithered())
616 {
617 num /= 5;
618 }
620 {
621 return null;
622 }
623 if (EClass.player.isAutoFarming || EClass.rnd(num) < EClass.rnd(source.chance))
624 {
627 {
628 return thing;
629 }
630 TryPick(cell, thing, c);
631 return thing;
632 }
633 }
634 return null;
635 }
636
637 public void Harvest(Chara c)
638 {
639 cell.isHarvested = true;
640 cell.gatherCount = 0;
641 PopHarvest(c);
642 }
643
644 public void PopHarvest(Chara c, string idThing, int num = -1)
645 {
646 PopHarvest(c, ThingGen.Create(idThing), num);
647 }
648
649 public void PopHarvest(Chara c, Thing t = null, int num = -1)
650 {
651 if (t == null)
652 {
653 if (idHarvestThing.StartsWith('#'))
654 {
655 t = ThingGen.CreateFromCategory(idHarvestThing.Replace("#", ""));
656 }
657 else
658 {
659 string text = idHarvestThing;
660 if (text == "potato" && EClass.rnd(3) == 0)
661 {
662 text = "784";
663 }
664 t = ThingGen.Create(text.IsEmpty("apple"));
665 }
666 }
667 ApplySeed(t);
668 PlantData plantData = EClass._map.TryGetPlant(cell);
669 bool flag = false;
670 if (plantData != null && plantData.size > 0)
671 {
672 t.c_weight = t.SelfWeight * (80 + plantData.size * plantData.size * 100) / 100;
673 t.SetBool(115, enable: true);
674 t.isWeightChanged = true;
675 flag = true;
676 }
677 t.SetBlessedState(BlessedState.Normal);
678 if (source._growth.Length > 4)
679 {
680 int num2 = EClass.rnd(source._growth[4].ToInt()) + 1;
681 int soilCost = EClass._zone.GetSoilCost();
682 int maxSoil = EClass._zone.MaxSoil;
683 if (soilCost > maxSoil && EClass.player.stats.days >= 5)
684 {
685 num2 -= EClass.rnd(2 + (soilCost - maxSoil) / 20);
686 }
687 if (num2 <= 0)
688 {
690 {
691 c?.Say("cropSpoiled", c, cell.GetObjName());
692 }
693 return;
694 }
695 t.SetNum(num2);
696 }
697 else if (Application.isEditor)
698 {
699 Debug.Log("harvest count not set:" + source.id + "/" + source.alias);
700 }
701 if (num > 0)
702 {
703 t.SetNum(num);
704 }
705 int num3 = t.Num;
706 TryPick(cell, t, c);
707 if (flag)
708 {
709 c.ModExpParty(207, Mathf.Min(t.c_weight * num3 / 125, 500));
710 }
711 }
712
713 public void ApplySeed(Thing t)
714 {
717 {
718 thing = null;
719 }
720 if (thing == null)
721 {
722 return;
723 }
724 int encLv = thing.encLV / 10 + ((thing.encLV > 0) ? 1 : 0);
725 bool flag = t.IsFood || t.Evalue(10) > 0 || t.id == "grass";
726 foreach (Element value in thing.elements.dict.Values)
727 {
728 if ((!value.IsFoodTrait || flag) && (value.IsFoodTrait || value.id == 2))
729 {
730 t.elements.ModBase(value.id, value.Value / 10 * 10);
731 }
732 }
733 t.SetEncLv(encLv);
734 t.c_refText = thing.c_refText;
735 t.isCrafted = true;
736 }
737
738 public virtual int GetHp()
739 {
740 return source.hp;
741 }
742}
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:3166
Thing SetNum(int a)
Definition: Card.cs:3577
void ModExpParty(int ele, int a)
Definition: Card.cs:2701
int refVal
Definition: Card.cs:207
int encLV
Definition: Card.cs:327
int Evalue(int ele)
Definition: Card.cs:2611
Card Install()
Definition: Card.cs:3823
int Num
Definition: Card.cs:159
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7052
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
bool HasBlock
Definition: Cell.cs:643
SourceFloor.Row sourceFloor
Definition: Cell.cs:1054
bool isHarvested
Definition: Cell.cs:330
byte objVal
Definition: Cell.cs:40
void Refresh()
Definition: Cell.cs:1152
bool HasLiquid
Definition: Cell.cs:673
byte z
Definition: Cell.cs:58
bool HasRoof
Definition: Cell.cs:648
byte obj
Definition: Cell.cs:38
SourceObj.Row sourceObj
Definition: Cell.cs:1072
string GetObjName()
Definition: Cell.cs:1604
byte x
Definition: Cell.cs:56
Point GetPoint()
Definition: Cell.cs:1101
bool ignoreObjShadow
Definition: Cell.cs:378
bool CanGrowWeed
Definition: Cell.cs:742
int index
Definition: Cell.cs:114
SourceMaterial.Row matObj_fixed
Definition: Cell.cs:1039
Definition: Chara.cs:10
RenderData objS_flat
Definition: CoreRef.cs:304
Renderers renderers
Definition: CoreRef.cs:357
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:255
int Value
Definition: ELEMENT.cs:297
bool IsFoodTrait
Definition: ELEMENT.cs:369
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:596
void SetDefaultStage()
Definition: GrowSystem.cs:278
void PopHarvest(Chara c, Thing t=null, int num=-1)
Definition: GrowSystem.cs:649
void ApplySeed(Thing t)
Definition: GrowSystem.cs:713
virtual int GetStageTile()
Definition: GrowSystem.cs:197
virtual int StageLength
Definition: GrowSystem.cs:79
virtual bool IsHarvestStage(int idx)
Definition: GrowSystem.cs:124
virtual void OnReachNextStage()
Definition: GrowSystem.cs:419
int afterHarvestTile
Definition: GrowSystem.cs:53
static SourceObj.Row[] _sourceSnowTree
Definition: GrowSystem.cs:37
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:566
virtual int HarvestStage
Definition: GrowSystem.cs:83
virtual void OnHit(Chara c)
Definition: GrowSystem.cs:534
bool CanHarvest()
Definition: GrowSystem.cs:520
bool IsWithered()
Definition: GrowSystem.cs:511
int[] baseTiles
Definition: GrowSystem.cs:49
void Perish()
Definition: GrowSystem.cs:479
virtual int GetShadow(int index)
Definition: GrowSystem.cs:202
virtual int DefaultStage
Definition: GrowSystem.cs:81
void PopMineObj(Chara c=null)
Definition: GrowSystem.cs:547
string idHarvestThing
Definition: GrowSystem.cs:55
void SetStage(int idx, bool renewHarvest=false)
Definition: GrowSystem.cs:451
virtual RenderData RenderHarvest
Definition: GrowSystem.cs:75
void TryGrow(VirtualDate date)
Definition: GrowSystem.cs:326
SourceObj.Row source
Definition: GrowSystem.cs:45
virtual AnimeID AnimeProgress
Definition: GrowSystem.cs:113
virtual Stage CreateStage()
Definition: GrowSystem.cs:144
virtual void OnHitFail(Chara c)
Definition: GrowSystem.cs:538
virtual bool CanReapSeed()
Definition: GrowSystem.cs:529
virtual bool GrowOnLand
Definition: GrowSystem.cs:109
void EqualizePlants(Point pos)
Definition: GrowSystem.cs:334
virtual bool IsMature
Definition: GrowSystem.cs:117
const int DivStage
Definition: GrowSystem.cs:39
virtual void OnSetStage(int idx)
Definition: GrowSystem.cs:470
virtual int Step
Definition: GrowSystem.cs:77
void Grow(int mtp=1)
Definition: GrowSystem.cs:359
virtual bool IsCrimeToHarvest
Definition: GrowSystem.cs:103
virtual int HaltStage
Definition: GrowSystem.cs:87
virtual void SetStageTile(Stage s)
Definition: GrowSystem.cs:191
Stage stage
Definition: GrowSystem.cs:115
virtual bool WitherOnLastStage
Definition: GrowSystem.cs:93
virtual void OnSetObj()
Definition: GrowSystem.cs:283
void OnProgressComplete(Chara c)
Definition: GrowSystem.cs:542
virtual string GetSoundProgress()
Definition: GrowSystem.cs:139
void Init(SourceObj.Row _row)
Definition: GrowSystem.cs:149
virtual bool DrawHarvestOnTop
Definition: GrowSystem.cs:89
virtual bool NeedSunlight
Definition: GrowSystem.cs:107
virtual void OnExceedLastStage()
Definition: GrowSystem.cs:424
void SetRandomStage()
Definition: GrowSystem.cs:264
virtual void OnMineObj(Chara c=null)
Definition: GrowSystem.cs:556
bool IsLastStage()
Definition: GrowSystem.cs:119
virtual float MtpProgress
Definition: GrowSystem.cs:105
virtual void OnRenderTileMap(RenderParam p, bool drawShadow=true)
Definition: GrowSystem.cs:207
virtual bool BlockSight(Cell cell)
Definition: GrowSystem.cs:129
virtual int ShadowStage
Definition: GrowSystem.cs:99
bool HaltGrowth()
Definition: GrowSystem.cs:474
virtual bool UseGenericFirstStageTile
Definition: GrowSystem.cs:91
void PopHarvest(Chara c, string idThing, int num=-1)
Definition: GrowSystem.cs:644
void Harvest(Chara c)
Definition: GrowSystem.cs:637
virtual bool CanRegrow
Definition: GrowSystem.cs:95
Thing TryPopSeed(Chara c)
Definition: GrowSystem.cs:604
virtual int GetHp()
Definition: GrowSystem.cs:738
Stage[] stages
Definition: GrowSystem.cs:47
virtual bool GrowUndersea
Definition: GrowSystem.cs:111
bool CanGrow(VirtualDate date)
Definition: GrowSystem.cs:287
static Cell cell
Definition: GrowSystem.cs:41
virtual bool BlockPass(Cell cell)
Definition: GrowSystem.cs:134
virtual bool IsTree
Definition: GrowSystem.cs:101
virtual void SetGenericFirstStageTile(Stage s)
Definition: GrowSystem.cs:185
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:131
PlantData TryGetPlant(Point p)
Definition: Map.cs:1942
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1804
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
Definition: Map.cs:929
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1840
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1535
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:1071
bool isAutoFarming
Definition: Player.cs:1239
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:327
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1397
bool IsFarmField
Definition: Point.cs:127
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:759
Definition: Rand.cs:4
static int rnd(int max)
Definition: Rand.cs:59
void Draw(RenderParam p, int tile)
Definition: RenderData.cs:128
Vector3 offsetShadow
Definition: RenderData.cs:22
int ConvertTile(int tile)
Definition: RenderData.cs:110
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:39
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 id, PlantData plant=null)
Definition: TraitSeed.cs:88
void BuildSunMap()
Definition: VirtualDate.cs:54
HashSet< int > sunMap
Definition: VirtualDate.cs:9
virtual int MaxSoil
Definition: Zone.cs:518
virtual bool IsUserZone
Definition: Zone.cs:273
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2157
virtual bool IsUnderwater
Definition: Zone.cs:271
int GetSoilCost()
Definition: Zone.cs:3810
Card AddCard(Card t, Point point)
Definition: Zone.cs:2014