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

Public Member Functions

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

Public Attributes

List< ItemThingitems
 
- 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 572 of file BiomeProfile.cs.

Member Function Documentation

◆ TryCreate()

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

Reimplemented from BiomeProfile.Cluster.

Definition at line 576 of file BiomeProfile.cs.

577 {
578 ItemThing itemThing = items.RandomItem();
579 if (Rand.Range(0f, 1f) > itemThing.chance)
580 {
581 return false;
582 }
583 Cell cell = p.cell;
584 if (cell.HasBlock)
585 {
586 if (!itemThing.IsSpawnOnBlock)
587 {
588 return false;
589 }
590 }
591 else if (itemThing.IsSpawnOnBlock)
592 {
593 return false;
594 }
595 if (cell.IsTopWater)
596 {
597 if (!itemThing.IsSpawnOnWater)
598 {
599 return false;
600 }
601 }
602 else if (itemThing.IsSpawnOnWater)
603 {
604 return false;
605 }
606 Thing thing = ThingGen.Create(itemThing.id);
607 int desiredDir = thing.TileType.GetDesiredDir(p, 0);
608 if (desiredDir != -1)
609 {
610 thing.dir = desiredDir;
611 }
612 EClass._zone.AddCard(thing, p).Install();
613 return true;
614 }
List< ItemThing > items
TileType TileType
Definition: Card.cs:2011
Card Install()
Definition: Card.cs:3448
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:643
bool IsTopWater
Definition: Cell.cs:700
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
virtual int GetDesiredDir(Point p, int d)
Definition: TileType.cs:362
Card AddCard(Card t, Point point)
Definition: Zone.cs:1893

References EClass._zone, Zone.AddCard(), Point.cell, BiomeProfile.Cluster.BaseItem.chance, ThingGen.Create(), TileType.GetDesiredDir(), Cell.HasBlock, BiomeProfile.Cluster.ItemThing.id, Card.Install(), BiomeProfile.Cluster.BaseItem.IsSpawnOnBlock, BiomeProfile.Cluster.BaseItem.IsSpawnOnWater, Cell.IsTopWater, BiomeProfile.ClusterThing.items, Rand.Range(), and Card.TileType.

Member Data Documentation

◆ items

List<ItemThing> BiomeProfile.ClusterThing.items

Definition at line 574 of file BiomeProfile.cs.

Referenced by BiomeProfile.ClusterThing.TryCreate().


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