Elin Decompiled Documentation EA 23.187 Stable
Loading...
Searching...
No Matches
TraitFakeBlock.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
3public class TraitFakeBlock : Trait
4{
5 public override TileMode tileMode => TileMode.FakeBlock;
6
7 public override void OnCreate(int lv)
8 {
9 if (owner.refVal == 0)
10 {
11 owner.refVal = 1;
12 }
13 }
14
15 public override void OnCrafted(Recipe recipe, List<Thing> ings)
16 {
17 if (ings == null || ings.Count == 0)
18 {
19 owner.refVal = 1;
20 return;
21 }
22 TraitBlock traitBlock = ings[0].trait as TraitBlock;
23 owner.refVal = traitBlock.source.id;
24 }
25
26 public override void TrySetHeldAct(ActPlan p)
27 {
28 if (p.pos.cell._block != 0 && !p.pos.sourceBlock.ContainsTag("noFake"))
29 {
30 p.TrySetAct("actCopyBlock", delegate
31 {
34 SE.Play("offering");
37 return false;
38 });
39 }
40 }
41}
Point pos
Definition: ActPlan.cs:150
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition: ActPlan.cs:366
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:5670
void Dye(string idMat)
Definition: Card.cs:5708
int refVal
Definition: Card.cs:192
byte _block
Definition: Cell.cs:30
static Recipe recipe
Definition: HotItemHeld.cs:9
SourceMaterial.Row matBlock
Definition: Point.cs:55
SourceBlock.Row sourceBlock
Definition: Point.cs:63
Cell cell
Definition: Point.cs:51
Definition: Recipe.cs:7
int id
Definition: TileRow.cs:8
override TileRow source
Definition: TraitBlock.cs:3
override TileMode tileMode
override void OnCreate(int lv)
override void TrySetHeldAct(ActPlan p)
override void OnCrafted(Recipe recipe, List< Thing > ings)
Definition: Trait.cs:7
virtual Recipe GetRecipe()
Definition: Trait.cs:799
TileMode
Definition: Trait.cs:9
Card owner
Definition: Trait.cs:27