Elin Decompiled Documentation EA 23.102 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 public static SourceObj.Row[] sourceSnowTree = new SourceObj.Row[2]
38 {
39 EClass.sources.objs.map[54],
40 EClass.sources.objs.map[55]
41 };
42
43 public const int DivStage = 30;
44
45 public static Cell cell;
46
47 public static Stage currentStage;
48
50
51 public Stage[] stages;
52
53 public int[] baseTiles;
54
55 public int harvestTile;
56
57 public int afterHarvestTile;
58
59 public string idHarvestThing;
60
61 public virtual RenderData RenderHarvest => source.renderData;
62
63 public virtual int Step => 5;
64
65 public virtual int StageLength => 5;
66
67 public virtual int DefaultStage => Mathf.Clamp(StageLength - 2, 0, StageLength - 1);
68
69 public virtual int HarvestStage => -1;
70
71 public virtual int AutoMineStage => HarvestStage;
72
73 protected virtual int HaltStage => HarvestStage;
74
75 protected virtual bool DrawHarvestOnTop => false;
76
77 protected virtual bool UseGenericFirstStageTile => true;
78
79 protected virtual bool WitherOnLastStage => true;
80
81 protected virtual bool CanRegrow => true;
82
83 public virtual bool CanLevelSeed => true;
84
85 public virtual int ShadowStage => 1;
86
87 public virtual bool IsTree => false;
88
89 public virtual bool IsCrimeToHarvest => false;
90
91 public virtual float MtpProgress => 1f;
92
93 public virtual bool NeedSunlight => true;
94
95 public virtual AnimeID AnimeProgress => AnimeID.HitObj;
96
97 public Stage stage => stages[cell.objVal / 30];
98
99 public virtual bool IsMature => false;
100
101 public bool IsLastStage()
102 {
103 return stage.idx == StageLength - 1;
104 }
105
106 protected virtual bool IsHarvestStage(int idx)
107 {
108 return idx == HarvestStage;
109 }
110
111 public virtual bool BlockSight(Cell cell)
112 {
113 return false;
114 }
115
116 public virtual bool BlockPass(Cell cell)
117 {
118 return false;
119 }
120
121 public virtual string GetSoundProgress()
122 {
123 return "Material/grass";
124 }
125
126 public virtual Stage CreateStage()
127 {
128 return new Stage();
129 }
130
131 public void Init(SourceObj.Row _row)
132 {
133 source = _row;
134 stages = new Stage[StageLength];
135 string[] growth = _row._growth;
136 string[] array = growth[1].Split('/');
137 baseTiles = new int[array.Length];
138 for (int i = 0; i < array.Length; i++)
139 {
140 baseTiles[i] = array[i].ToInt();
141 }
142 if (growth.Length > 2)
143 {
144 harvestTile = RenderHarvest.ConvertTile(growth[2].ToInt());
145 idHarvestThing = growth[3];
146 }
147 for (int j = 0; j < StageLength; j++)
148 {
150 stages[j] = stage;
151 stage.idx = j;
152 if (j == 0 && UseGenericFirstStageTile)
153 {
155 }
156 else
157 {
159 }
160 if (harvestTile != 0 && IsHarvestStage(j))
161 {
162 stage.harvest = true;
163 }
164 }
165 }
166
167 public virtual void SetGenericFirstStageTile(Stage s)
168 {
169 s.renderData = EClass.core.refs.renderers.objS_flat;
170 s.SetTile(0, 100, 101, 102);
171 }
172
173 public virtual void SetStageTile(Stage s)
174 {
175 s.renderData = source.renderData;
176 s.SetTile(s.idx + (UseGenericFirstStageTile ? (-1) : 0), baseTiles);
177 }
178
179 public virtual int GetStageTile()
180 {
181 return currentStage.tiles[cell.objDir % currentStage.tiles.Length];
182 }
183
184 public virtual int GetShadow(int index)
185 {
186 return -1;
187 }
188
189 public virtual void OnRenderTileMap(RenderParam p)
190 {
191 int num = cell.objVal / 30;
192 currentStage = stages[num];
193 SourceObj.Row row = source;
194 float y = p.y;
195 float z = p.z;
196 if (num != 0 || !UseGenericFirstStageTile)
197 {
198 p.y += row.pref.y;
199 p.z += row.pref.z;
200 }
202 {
203 if (cell.isHarvested || harvestTile == 0)
204 {
205 p.tile = ((afterHarvestTile != 0) ? afterHarvestTile : GetStageTile());
207 }
208 else
209 {
211 {
212 p.tile = GetStageTile();
214 p.liquidLv = 0;
215 }
216 p.tile = harvestTile;
218 }
219 }
220 else
221 {
222 p.tile = GetStageTile();
224 }
225 p.y = y;
226 p.z = z;
227 if (num >= ShadowStage)
228 {
229 int shadow = GetShadow(num);
230 if (shadow == -1)
231 {
232 shadow = row.pref.shadow;
233 }
234 if (shadow > 1 && !cell.ignoreObjShadow)
235 {
237 }
238 }
239 }
240
241 public void SetRandomStage()
242 {
243 int num = Rand.rnd(stages.Length);
244 if (num == 0 && EClass.rnd(5) != 0 && stages.Length >= 2)
245 {
246 num++;
247 }
248 else if (num == stages.Length - 1 && EClass.rnd(5) != 0 && stages.Length >= 2)
249 {
250 num--;
251 }
252 cell.objVal = (byte)(num * 30);
253 }
254
255 public void SetDefaultStage()
256 {
257 cell.objVal = (byte)(DefaultStage * 30);
258 }
259
260 public virtual void OnSetObj()
261 {
262 }
263
264 public bool CanGrow(VirtualDate date)
265 {
266 if (source.id == 0)
267 {
268 return false;
269 }
270 if (cell.HasBlock && !cell.sourceBlock.tileType.IsFence)
271 {
272 return false;
273 }
274 if (NeedSunlight)
275 {
276 if (date.sunMap == null)
277 {
278 date.BuildSunMap();
279 }
280 if ((cell.HasRoof || date.IsWinter || EClass._map.IsIndoor) && !date.sunMap.Contains(cell.index))
281 {
282 return false;
283 }
284 }
285 return true;
286 }
287
288 public void TryGrow(VirtualDate date)
289 {
290 if (CanGrow(date))
291 {
292 Grow();
293 }
294 }
295
296 public void EqualizePlants(Point pos)
297 {
299 if (p1 == null || p1.seed == null)
300 {
301 return;
302 }
303 pos.ForeachNeighbor(delegate(Point pos2)
304 {
305 Thing thing = EClass._map.TryGetPlant(pos2)?.seed;
306 if (thing == null)
307 {
309 if (installed != null && installed.id == p1.seed.id)
310 {
311 thing = installed;
312 }
313 }
314 if (thing != null && p1.seed.refVal == thing.refVal && thing.encLV >= p1.seed.encLV)
315 {
316 p1.seed = thing;
317 }
318 }, diagonal: false);
319 }
320
321 public void Grow(int mtp = 1)
322 {
323 bool flag = cell.isWatered || (cell.IsTopWater && source.tag.Contains("flood"));
324 PlantData plantData = EClass._map.TryGetPlant(cell);
325 if (plantData != null && flag)
326 {
327 plantData.water++;
328 }
329 int num = Step * mtp * ((!flag) ? 1 : 2);
330 int num2 = cell.objVal / 30;
331 int num3 = (cell.objVal + num) / 30;
332 if (num2 != num3)
333 {
335 {
336 PopHarvest(null);
337 }
339 {
340 Point point = cell.GetPoint();
341 EqualizePlants(point);
342 Thing thing = TryPopSeed(null);
343 PopMineObj();
344 if (thing != null)
345 {
346 point.SetObj();
347 EClass._zone.AddCard(thing, point).Install();
348 }
349 }
350 else if (num2 == StageLength - 1)
351 {
353 {
354 Point point2 = cell.GetPoint();
355 EqualizePlants(point2);
356 Thing thing2 = TryPopSeed(null);
357 if (thing2 != null)
358 {
359 point2.SetObj();
360 EClass._zone.AddCard(thing2, point2).Install();
361 }
362 }
363 else
364 {
366 }
367 }
368 else
369 {
371 }
372 }
373 else
374 {
375 cell.objVal += (byte)num;
376 }
377 cell.Refresh();
379 }
380
381 public virtual void OnReachNextStage()
382 {
383 SetStage(cell.objVal / 30 + 1);
384 }
385
386 public virtual void OnExceedLastStage()
387 {
388 cell.objVal = (byte)(stages.Length * 30 - 1);
389 if (!CanRegrow || Rand.rnd(2) != 0)
390 {
391 return;
392 }
393 Point point = cell.GetPoint();
394 if (point.IsFarmField)
395 {
396 return;
397 }
398 if (Rand.rnd(2) == 0)
399 {
400 Point randomNeighbor = point.GetRandomNeighbor();
401 if (randomNeighbor.cell.CanGrowWeed)
402 {
403 randomNeighbor.SetObj(cell.obj);
404 point.SetObj();
405 return;
406 }
407 }
408 cell.objVal = 0;
409 cell.isHarvested = false;
410 cell.isWatered = cell.HasLiquid;
411 }
412
413 public void SetStage(int idx, bool renewHarvest = false)
414 {
415 cell.objVal = (byte)(idx * 30);
416 cell.gatherCount = 0;
417 if (cell.HasLiquid)
418 {
419 cell.isWatered = true;
420 }
421 if (renewHarvest)
422 {
423 cell.isHarvested = true;
424 }
425 if (cell.sourceObj.id == 118)
426 {
427 EClass._zone.dirtyElectricity = true;
428 }
429 OnSetStage(idx);
430 }
431
432 public virtual void OnSetStage(int idx)
433 {
434 }
435
436 public bool HaltGrowth()
437 {
438 return stage.idx == HarvestStage;
439 }
440
441 public void Perish()
442 {
444 {
445 if (CanHarvest())
446 {
447 PopHarvest(null);
448 }
449 Thing thing = TryPopSeed(null);
450 if (thing != null)
451 {
453 }
455 return;
456 }
458 {
460 return;
461 }
462 if (EClass.rnd(3) == 0)
463 {
464 Thing thing2 = TryPopSeed(null);
465 if (thing2 != null)
466 {
468 }
469 }
471 }
472
473 public bool IsWithered()
474 {
476 {
477 return true;
478 }
479 return false;
480 }
481
482 public bool CanHarvest()
483 {
485 {
486 return false;
487 }
488 return true;
489 }
490
491 public virtual bool CanReapSeed()
492 {
493 return CanHarvest();
494 }
495
496 public virtual void OnHit(Chara c)
497 {
498 }
499
500 public virtual void OnHitFail(Chara c)
501 {
502 }
503
505 {
506 EClass._map.MineObj(cell.GetPoint(), null, c);
507 }
508
509 public void PopMineObj(Chara c = null)
510 {
512 {
513 OnMineObj(c);
514 TryPopSeed(c);
515 }
516 }
517
518 public virtual void OnMineObj(Chara c = null)
519 {
520 if (!IsWithered())
521 {
522 int num = cell.sourceObj.components.Length - 1;
523 Thing t = ThingGen.Create(cell.sourceObj.components[num].Split('/')[0], cell.matObj_fixed.alias);
524 TryPick(cell, t, c);
525 }
526 }
527
528 public void TryPick(Cell cell, Thing t, Chara c, bool applySeed = false)
529 {
530 if (applySeed)
531 {
532 ApplySeed(t);
533 }
535 {
536 if (EClass.rnd(4) != 0)
537 {
538 if (t.Num > 1)
539 {
540 t.SetNum(t.Num / 2);
541 }
542 else if (EClass.rnd(2) == 0)
543 {
544 return;
545 }
547 {
549 }
550 }
551 }
552 else
553 {
555 }
556 }
557
558 public void TryPick(Cell cell, string idThing, int idMat = -1, int num = 1, bool applySeed = false)
559 {
560 if (num > 0)
561 {
562 TryPick(cell, ThingGen.Create(idThing, idMat).SetNum(num), EClass.pc, applySeed);
563 }
564 }
565
567 {
568 if (source.HasTag(CTAG.seed))
569 {
570 int num = (cell.IsFarmField ? 400 : 1000);
571 int soilCost = EClass._zone.GetSoilCost();
572 int maxSoil = EClass._zone.MaxSoil;
573 if (soilCost > maxSoil)
574 {
575 num += (soilCost - maxSoil) * 10;
576 }
577 if (IsWithered())
578 {
579 num /= 5;
580 }
582 {
583 return null;
584 }
585 if (EClass.player.isAutoFarming || EClass.rnd(num) < EClass.rnd(source.chance))
586 {
589 {
590 return thing;
591 }
592 TryPick(cell, thing, c);
593 return thing;
594 }
595 }
596 return null;
597 }
598
599 public void Harvest(Chara c)
600 {
601 cell.isHarvested = true;
602 cell.gatherCount = 0;
603 PopHarvest(c);
604 }
605
606 public void PopHarvest(Chara c, string idThing, int num = -1)
607 {
608 PopHarvest(c, ThingGen.Create(idThing), num);
609 }
610
611 public void PopHarvest(Chara c, Thing t = null, int num = -1)
612 {
613 if (t == null)
614 {
615 t = ((!idHarvestThing.StartsWith('#')) ? ThingGen.Create(idHarvestThing.IsEmpty("apple")) : ThingGen.CreateFromCategory(idHarvestThing.Replace("#", "")));
616 }
617 ApplySeed(t);
618 PlantData plantData = EClass._map.TryGetPlant(cell);
619 if (plantData != null && plantData.size > 0)
620 {
621 t.c_weight = t.SelfWeight * (80 + plantData.size * plantData.size * 100) / 100;
622 t.SetBool(115, enable: true);
623 t.isWeightChanged = true;
624 }
625 t.SetBlessedState(BlessedState.Normal);
626 if (source._growth.Length > 4)
627 {
628 int num2 = EClass.rnd(source._growth[4].ToInt()) + 1;
629 int soilCost = EClass._zone.GetSoilCost();
630 int maxSoil = EClass._zone.MaxSoil;
631 if (soilCost > maxSoil && EClass.player.stats.days >= 5)
632 {
633 num2 -= EClass.rnd(2 + (soilCost - maxSoil) / 20);
634 }
635 if (num2 <= 0)
636 {
638 {
639 c?.Say("cropSpoiled", c, cell.GetObjName());
640 }
641 return;
642 }
643 t.SetNum(num2);
644 }
645 else
646 {
647 Debug.Log("harvest count not set:" + source.id + "/" + source.alias);
648 }
649 if (num > 0)
650 {
651 t.SetNum(num);
652 }
653 if (c == null || EClass.player.isAutoFarming)
654 {
655 TryPick(cell, t, c);
656 }
657 else
658 {
659 c.Pick(t);
660 }
661 }
662
663 public void ApplySeed(Thing t)
664 {
667 {
668 thing = null;
669 }
670 if (thing == null)
671 {
672 return;
673 }
674 int encLv = thing.encLV / 10 + ((thing.encLV > 0) ? 1 : 0);
675 bool flag = t.IsFood || t.Evalue(10) > 0 || t.id == "grass";
676 foreach (Element value in thing.elements.dict.Values)
677 {
678 if ((!value.IsFoodTrait || flag) && (value.IsFoodTrait || value.id == 2))
679 {
680 t.elements.ModBase(value.id, value.Value / 10 * 10);
681 }
682 }
683 t.SetEncLv(encLv);
684 t.c_refText = thing.c_refText;
685 t.isCrafted = true;
686 }
687
688 public virtual int GetHp()
689 {
690 return source.hp;
691 }
692}
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:31
Card AddCard(Card c)
Definition: Card.cs:2887
Thing SetNum(int a)
Definition: Card.cs:3242
int refVal
Definition: Card.cs:190
int encLV
Definition: Card.cs:310
int Evalue(int ele)
Definition: Card.cs:2431
Card Install()
Definition: Card.cs:3448
int Num
Definition: Card.cs:154
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
bool HasBlock
Definition: Cell.cs:643
bool isHarvested
Definition: Cell.cs:330
byte objVal
Definition: Cell.cs:40
void Refresh()
Definition: Cell.cs:1148
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:1600
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
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3920
RenderData objS_flat
Definition: CoreRef.cs:298
Renderers renderers
Definition: CoreRef.cs:341
CoreRef refs
Definition: Core.cs:51
bool IsWinter
Definition: Date.cs:186
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static int rnd(int a)
Definition: EClass.cs:50
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
static BaseGameScreen screen
Definition: EClass.cs:32
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
int id
Definition: ELEMENT.cs:240
int Value
Definition: ELEMENT.cs:282
bool IsFoodTrait
Definition: ELEMENT.cs:354
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:221
CardManager cards
Definition: Game.cs:155
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:558
void SetDefaultStage()
Definition: GrowSystem.cs:255
void PopHarvest(Chara c, Thing t=null, int num=-1)
Definition: GrowSystem.cs:611
void ApplySeed(Thing t)
Definition: GrowSystem.cs:663
virtual int GetStageTile()
Definition: GrowSystem.cs:179
virtual int StageLength
Definition: GrowSystem.cs:65
virtual bool IsHarvestStage(int idx)
Definition: GrowSystem.cs:106
virtual void OnReachNextStage()
Definition: GrowSystem.cs:381
int afterHarvestTile
Definition: GrowSystem.cs:57
virtual int AutoMineStage
Definition: GrowSystem.cs:71
static Stage currentStage
Definition: GrowSystem.cs:47
void TryPick(Cell cell, Thing t, Chara c, bool applySeed=false)
Definition: GrowSystem.cs:528
virtual int HarvestStage
Definition: GrowSystem.cs:69
virtual void OnHit(Chara c)
Definition: GrowSystem.cs:496
bool CanHarvest()
Definition: GrowSystem.cs:482
bool IsWithered()
Definition: GrowSystem.cs:473
int[] baseTiles
Definition: GrowSystem.cs:53
void Perish()
Definition: GrowSystem.cs:441
virtual int GetShadow(int index)
Definition: GrowSystem.cs:184
virtual int DefaultStage
Definition: GrowSystem.cs:67
void PopMineObj(Chara c=null)
Definition: GrowSystem.cs:509
static SourceObj.Row[] sourceSnowTree
Definition: GrowSystem.cs:37
string idHarvestThing
Definition: GrowSystem.cs:59
void SetStage(int idx, bool renewHarvest=false)
Definition: GrowSystem.cs:413
virtual RenderData RenderHarvest
Definition: GrowSystem.cs:61
void TryGrow(VirtualDate date)
Definition: GrowSystem.cs:288
SourceObj.Row source
Definition: GrowSystem.cs:49
virtual AnimeID AnimeProgress
Definition: GrowSystem.cs:95
virtual Stage CreateStage()
Definition: GrowSystem.cs:126
virtual void OnHitFail(Chara c)
Definition: GrowSystem.cs:500
virtual bool CanReapSeed()
Definition: GrowSystem.cs:491
void EqualizePlants(Point pos)
Definition: GrowSystem.cs:296
virtual bool IsMature
Definition: GrowSystem.cs:99
const int DivStage
Definition: GrowSystem.cs:43
virtual void OnSetStage(int idx)
Definition: GrowSystem.cs:432
virtual int Step
Definition: GrowSystem.cs:63
void Grow(int mtp=1)
Definition: GrowSystem.cs:321
virtual bool IsCrimeToHarvest
Definition: GrowSystem.cs:89
virtual int HaltStage
Definition: GrowSystem.cs:73
virtual void SetStageTile(Stage s)
Definition: GrowSystem.cs:173
Stage stage
Definition: GrowSystem.cs:97
virtual bool WitherOnLastStage
Definition: GrowSystem.cs:79
virtual void OnRenderTileMap(RenderParam p)
Definition: GrowSystem.cs:189
virtual void OnSetObj()
Definition: GrowSystem.cs:260
void OnProgressComplete(Chara c)
Definition: GrowSystem.cs:504
virtual string GetSoundProgress()
Definition: GrowSystem.cs:121
void Init(SourceObj.Row _row)
Definition: GrowSystem.cs:131
virtual bool DrawHarvestOnTop
Definition: GrowSystem.cs:75
virtual bool NeedSunlight
Definition: GrowSystem.cs:93
virtual void OnExceedLastStage()
Definition: GrowSystem.cs:386
void SetRandomStage()
Definition: GrowSystem.cs:241
virtual void OnMineObj(Chara c=null)
Definition: GrowSystem.cs:518
bool IsLastStage()
Definition: GrowSystem.cs:101
virtual float MtpProgress
Definition: GrowSystem.cs:91
virtual bool BlockSight(Cell cell)
Definition: GrowSystem.cs:111
virtual int ShadowStage
Definition: GrowSystem.cs:85
bool HaltGrowth()
Definition: GrowSystem.cs:436
virtual bool UseGenericFirstStageTile
Definition: GrowSystem.cs:77
void PopHarvest(Chara c, string idThing, int num=-1)
Definition: GrowSystem.cs:606
void Harvest(Chara c)
Definition: GrowSystem.cs:599
virtual bool CanRegrow
Definition: GrowSystem.cs:81
Thing TryPopSeed(Chara c)
Definition: GrowSystem.cs:566
virtual int GetHp()
Definition: GrowSystem.cs:688
Stage[] stages
Definition: GrowSystem.cs:51
bool CanGrow(VirtualDate date)
Definition: GrowSystem.cs:264
static Cell cell
Definition: GrowSystem.cs:45
virtual bool BlockPass(Cell cell)
Definition: GrowSystem.cs:116
virtual bool IsTree
Definition: GrowSystem.cs:87
virtual void SetGenericFirstStageTile(Stage s)
Definition: GrowSystem.cs:167
int harvestTile
Definition: GrowSystem.cs:55
virtual bool CanLevelSeed
Definition: GrowSystem.cs:83
bool IsIndoor
Definition: Map.cs:131
PlantData TryGetPlant(Point p)
Definition: Map.cs:1920
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1791
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
Definition: Map.cs:923
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1827
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1522
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:68
Stats stats
Definition: Player.cs:817
bool isAutoFarming
Definition: Player.cs:982
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:303
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:892
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1361
bool IsFarmField
Definition: Point.cs:127
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:731
Definition: Rand.cs:4
static int rnd(int max)
Definition: Rand.cs:52
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
List< Item > items
Definition: ShadowData.cs:101
static ShadowData Instance
Definition: ShadowData.cs:99
SourceObj objs
int shadow
Definition: SourcePref.cs:35
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(SourceObj.Row obj, PlantData plant=null)
Definition: TraitSeed.cs:77
void BuildSunMap()
Definition: VirtualDate.cs:54
HashSet< int > sunMap
Definition: VirtualDate.cs:9
virtual int MaxSoil
Definition: Zone.cs:507
virtual bool IsUserZone
Definition: Zone.cs:264
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2036
int GetSoilCost()
Definition: Zone.cs:3433
Card AddCard(Card t, Point point)
Definition: Zone.cs:1893