Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
BiomeProfile.ClusterObj Class Reference
Inheritance diagram for BiomeProfile.ClusterObj:
BiomeProfile.Cluster

Public Member Functions

override bool TryCreate (Point p)
 
virtual bool TryCreate (Point p)
 

Public Attributes

List< Itemitems
 
- Public Attributes inherited from BiomeProfile.Cluster
Type type
 
float density
 

Additional Inherited Members

- Public Types inherited from BiomeProfile.Cluster
enum  Type {
  Scatter = 0 , ScatterExterior = 1 , ScatterInterior = 2 , ScatterNonObstacle = 3 ,
  ByWall = 10
}
 

Detailed Description

Definition at line 538 of file BiomeProfile.cs.

Member Function Documentation

◆ TryCreate()

override bool BiomeProfile.ClusterObj.TryCreate ( Point  p)
inlinevirtual

Reimplemented from BiomeProfile.Cluster.

Definition at line 542 of file BiomeProfile.cs.

543 {
544 Item item = items.RandomItem();
545 if (Rand.Range(0f, 1f) > item.chance)
546 {
547 return false;
548 }
549 Cell cell = p.cell;
550 if (cell.HasBlock)
551 {
552 if (!item.IsSpawnOnBlock)
553 {
554 return false;
555 }
556 }
557 else if (item.IsSpawnOnBlock)
558 {
559 return false;
560 }
561 p.SetObj(item.idObj);
562 cell.objDir = EScriptable.rnd(8);
563 if (cell.sourceObj.HasGrowth && cell.sourceObj.id != 103)
564 {
565 cell.growth.SetRandomStage();
566 }
567 return true;
568 }
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:643
GrowSystem growth
Definition: Cell.cs:225
SourceObj.Row sourceObj
Definition: Cell.cs:1072
static int rnd(int a)
Definition: EScriptable.cs:5
void SetRandomStage()
Definition: GrowSystem.cs:241
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:892
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42

References Point.cell, Cell.growth, Cell.HasBlock, item, BiomeProfile.ClusterObj.items, Rand.Range(), EScriptable.rnd(), Point.SetObj(), GrowSystem.SetRandomStage(), and Cell.sourceObj.

Member Data Documentation

◆ items

List<Item> BiomeProfile.ClusterObj.items

Definition at line 540 of file BiomeProfile.cs.

Referenced by BiomeProfile.ClusterObj.TryCreate().


The documentation for this class was generated from the following file: