22 public void SetTile(
int tileIdx, params
int[] _tiles)
24 tiles =
new int[_tiles.Length];
25 for (
int i = 0; i <
tiles.Length; i++)
63 public virtual int Step => 5;
127 return "Material/grass";
139 string[] growth = _row._growth;
140 string[] array = growth[1].Split(
'/');
142 for (
int i = 0; i < array.Length; i++)
146 if (growth.Length > 2)
166 stage.harvest =
true;
179 s.renderData =
source.renderData;
195 int num = cell.objVal / 30;
256 cell.objVal = (byte)(num * 30);
318 if (p1 ==
null || p1.
seed ==
null)
342 bool flag = cell.isWatered || (cell.IsTopWater && (
source.tag.Contains(
"flood") ||
source.tag.Contains(
"undersea")));
344 if (plantData !=
null && flag)
348 int num =
Step * mtp * ((!flag) ? 1 : 2);
349 int num2 = cell.objVal / 30;
350 int num3 = (cell.objVal + num) / 30;
394 cell.objVal += (byte)num;
407 cell.objVal = (byte)(
stages.Length * 30 - 1);
428 cell.isHarvested =
false;
432 public void SetStage(
int idx,
bool renewHarvest =
false)
434 cell.objVal = (byte)(idx * 30);
435 cell.gatherCount = 0;
438 cell.isWatered =
true;
442 cell.isHarvested =
true;
446 EClass._zone.dirtyElectricity =
true;
541 int num = cell.sourceObj.components.Length - 1;
577 public void TryPick(
Cell cell,
string idThing,
int idMat = -1,
int num = 1,
bool applySeed =
false)
589 int num = (cell.IsFarmField ? 400 : 1000);
592 if (soilCost > maxSoil)
594 num += (soilCost - maxSoil) * 10;
620 cell.isHarvested =
true;
621 cell.gatherCount = 0;
641 if (text ==
"potato" &&
EClass.
rnd(3) == 0)
650 if (plantData !=
null && plantData.
size > 0)
652 t.c_weight = t.SelfWeight * (80 + plantData.size * plantData.size * 100) / 100;
653 t.SetBool(115, enable:
true);
654 t.isWeightChanged =
true;
657 if (
source._growth.Length > 4)
664 num2 -=
EClass.
rnd(2 + (soilCost - maxSoil) / 20);
676 else if (Application.isEditor)
705 int encLv = thing.encLV / 10 + ((thing.encLV > 0) ? 1 : 0);
706 bool flag = t.IsFood || t.
Evalue(10) > 0 || t.id ==
"grass";
707 foreach (
Element value
in thing.elements.dict.Values)
709 if ((!value.
IsFoodTrait || flag) && (value.IsFoodTrait || value.id == 2))
711 t.elements.ModBase(value.
id, value.
Value / 10 * 10);
715 t.c_refText = thing.c_refText;
void Say(string lang, string ref1=null, string ref2=null)
SourceBlock.Row sourceBlock
SourceFloor.Row sourceFloor
SourceMaterial.Row matObj_fixed
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
static SourceManager sources
static BaseGameScreen screen
bool disableUsermapBenefit
void SetTile(int tileIdx, params int[] _tiles)
void TryPick(Cell cell, string idThing, int idMat=-1, int num=1, bool applySeed=false)
void PopHarvest(Chara c, Thing t=null, int num=-1)
virtual int GetStageTile()
virtual bool IsHarvestStage(int idx)
virtual void OnReachNextStage()
virtual int AutoMineStage
static Stage currentStage
void TryPick(Cell cell, Thing t, Chara c, bool applySeed=false)
virtual void OnHit(Chara c)
virtual int GetShadow(int index)
void PopMineObj(Chara c=null)
static SourceObj.Row[] sourceSnowTree
void SetStage(int idx, bool renewHarvest=false)
virtual RenderData RenderHarvest
void TryGrow(VirtualDate date)
virtual AnimeID AnimeProgress
virtual Stage CreateStage()
virtual void OnHitFail(Chara c)
virtual bool CanReapSeed()
void EqualizePlants(Point pos)
virtual void OnSetStage(int idx)
virtual bool IsCrimeToHarvest
virtual void SetStageTile(Stage s)
virtual bool WitherOnLastStage
virtual void OnRenderTileMap(RenderParam p)
void OnProgressComplete(Chara c)
virtual string GetSoundProgress()
void Init(SourceObj.Row _row)
virtual bool DrawHarvestOnTop
virtual bool NeedSunlight
virtual void OnExceedLastStage()
virtual void OnMineObj(Chara c=null)
virtual float MtpProgress
virtual bool BlockSight(Cell cell)
virtual bool UseGenericFirstStageTile
void PopHarvest(Chara c, string idThing, int num=-1)
Thing TryPopSeed(Chara c)
virtual bool GrowUndersea
bool CanGrow(VirtualDate date)
virtual bool BlockPass(Cell cell)
virtual void SetGenericFirstStageTile(Stage s)
virtual bool CanLevelSeed
PlantData TryGetPlant(Point p)
void TrySmoothPick(Cell cell, Thing t, Chara c)
void RefreshFOV(int x, int z, int radius=6, bool recalculate=false)
void MineObj(Point point, Task task=null, Chara c=null)
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
void AddShadow(MeshPassParam p, ref Vector3 fix)
void SetObj(int id=0, int value=1, int dir=0)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Point GetRandomNeighbor()
void Draw(RenderParam p, int tile)
int ConvertTile(int tile)
static ShadowData Instance
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing Create(string id, int idMat=-1, int lv=-1)
static Thing MakeSeed(SourceObj.Row obj, PlantData plant=null)
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
virtual bool IsUnderwater
Card AddCard(Card t, Point point)