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

Detailed Description

Definition at line 600 of file BiomeProfile.cs.

Member Function Documentation

◆ TryCreate()

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

Reimplemented from BiomeProfile.Cluster.

Definition at line 604 of file BiomeProfile.cs.

605 {
606 ItemThing itemThing = items.RandomItem();
607 if (Rand.Range(0f, 1f) > itemThing.chance)
608 {
609 return false;
610 }
611 Cell cell = p.cell;
612 if (cell.HasBlock)
613 {
614 if (!itemThing.IsSpawnOnBlock)
615 {
616 return false;
617 }
618 }
619 else if (itemThing.IsSpawnOnBlock)
620 {
621 return false;
622 }
623 if (cell.IsTopWater)
624 {
625 if (!itemThing.IsSpawnOnWater)
626 {
627 return false;
628 }
629 }
630 else if (itemThing.IsSpawnOnWater)
631 {
632 return false;
633 }
634 Thing thing = ThingGen.Create(itemThing.id, itemThing.GetIdMaterial());
635 int num = thing.TileType.GetDesiredDir(p, 0);
636 if (itemThing.alignDir)
637 {
638 if (cell.Back.HasBlock)
639 {
640 num = 0;
641 }
642 else if (cell.Left.HasBlock)
643 {
644 num = 1;
645 }
646 else if (cell.Front.HasBlock)
647 {
648 num = 2;
649 }
650 else if (cell.Right.HasBlock)
651 {
652 num = 3;
653 }
654 if (itemThing.id == "coffin_stone")
655 {
656 num++;
657 }
658 }
659 if (num != -1)
660 {
661 thing.dir = num;
662 }
663 EClass._zone.AddCard(thing, p).Install();
664 return true;
665 }
List< ItemThing > items
TileType TileType
Definition: Card.cs:2138
Card Install()
Definition: Card.cs:3770
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:643
Cell Back
Definition: Cell.cs:153
Cell Front
Definition: Cell.cs:129
bool IsTopWater
Definition: Cell.cs:700
Cell Left
Definition: Cell.cs:165
Cell Right
Definition: Cell.cs:141
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:21
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:382
Card AddCard(Card t, Point point)
Definition: Zone.cs:1992

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

Member Data Documentation

◆ items

List<ItemThing> BiomeProfile.ClusterThing.items

Definition at line 602 of file BiomeProfile.cs.

Referenced by BiomeProfile.ClusterThing.TryCreate().


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