Elin Decompiled Documentation EA 23.250 Nightly Patch 1
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 , ByWallFace = 11 , Space = 20 , SpaceByWall = 21
}
 

Detailed Description

Definition at line 561 of file BiomeProfile.cs.

Member Function Documentation

◆ TryCreate()

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

Reimplemented from BiomeProfile.Cluster.

Definition at line 565 of file BiomeProfile.cs.

566 {
567 Item item = items.RandomItem();
568 if (Rand.Range(0f, 1f) > item.chance)
569 {
570 return false;
571 }
572 Cell cell = p.cell;
573 if (cell.HasBlock)
574 {
575 if (!item.IsSpawnOnBlock)
576 {
577 return false;
578 }
579 }
580 else if (item.IsSpawnOnBlock)
581 {
582 return false;
583 }
584 p.SetObj(item.idObj);
585 int idMaterial = item.GetIdMaterial();
586 if (idMaterial != -1)
587 {
588 cell.objMat = (byte)idMaterial;
589 }
590 cell.objDir = EScriptable.rnd(8);
591 if (cell.sourceObj.HasGrowth && !EClass._zone.IsPCFactionOrTent && cell.sourceObj.id != 103)
592 {
593 cell.growth.SetRandomStage();
594 }
595 return true;
596 }
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:643
GrowSystem growth
Definition: Cell.cs:225
SourceObj.Row sourceObj
Definition: Cell.cs:1072
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:21
static int rnd(int a)
Definition: EScriptable.cs:5
void SetRandomStage()
Definition: GrowSystem.cs:245
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42
bool IsPCFactionOrTent
Definition: Zone.cs:476

References EClass._zone, Point.cell, Cell.growth, Cell.HasBlock, Zone.IsPCFactionOrTent, 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 563 of file BiomeProfile.cs.

Referenced by BiomeProfile.ClusterObj.TryCreate().


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