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;
233 EClass.scene.psFey.transform.position =
new Vector3(p.
x, p.
y, p.
z - 2f);
261 cell.objVal = (byte)(num * 30);
323 if (p1 ==
null || p1.
seed ==
null)
347 bool flag = cell.isWatered || (cell.IsTopWater && (
source.tag.Contains(
"flood") ||
source.tag.Contains(
"undersea")));
349 if (plantData !=
null && flag)
353 int num =
Step * mtp * ((!flag) ? 1 : 2);
354 int num2 = cell.objVal / 30;
355 int num3 = (cell.objVal + num) / 30;
399 cell.objVal += (byte)num;
412 cell.objVal = (byte)(
stages.Length * 30 - 1);
433 cell.isHarvested =
false;
437 public void SetStage(
int idx,
bool renewHarvest =
false)
439 cell.objVal = (byte)(idx * 30);
440 cell.gatherCount = 0;
443 cell.isWatered =
true;
447 cell.isHarvested =
true;
451 EClass._zone.dirtyElectricity =
true;
546 int num = cell.sourceObj.components.Length - 1;
582 public void TryPick(
Cell cell,
string idThing,
int idMat = -1,
int num = 1,
bool applySeed =
false)
594 int num = (cell.IsFarmField ? 400 : 1000);
597 if (soilCost > maxSoil)
599 num += (soilCost - maxSoil) * 10;
625 cell.isHarvested =
true;
626 cell.gatherCount = 0;
646 if (text ==
"potato" &&
EClass.
rnd(3) == 0)
655 if (plantData !=
null && plantData.
size > 0)
657 t.c_weight = t.SelfWeight * (80 + plantData.size * plantData.size * 100) / 100;
658 t.SetBool(115, enable:
true);
659 t.isWeightChanged =
true;
662 if (
source._growth.Length > 4)
669 num2 -=
EClass.
rnd(2 + (soilCost - maxSoil) / 20);
681 else if (Application.isEditor)
703 int encLv = thing.encLV / 10 + ((thing.encLV > 0) ? 1 : 0);
704 bool flag = t.IsFood || t.
Evalue(10) > 0 || t.id ==
"grass";
705 foreach (
Element value
in thing.elements.dict.Values)
707 if ((!value.
IsFoodTrait || flag) && (value.IsFoodTrait || value.id == 2))
709 t.elements.ModBase(value.
id, value.
Value / 10 * 10);
713 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
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
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 void OnRenderTileMap(RenderParam p, bool drawShadow=true)
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(string id, 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)