Elin Modding Docs Doc
All Classes Namespaces
TraitBook.cs
1using System;
2
3// Token: 0x02000364 RID: 868
4public class TraitBook : TraitScroll
5{
6 // Token: 0x170007E4 RID: 2020
7 // (get) Token: 0x06001ADF RID: 6879 RVA: 0x000A6A2A File Offset: 0x000A4C2A
8 public bool IsParchment
9 {
10 get
11 {
12 return this is TraitParchment;
13 }
14 }
15
16 // Token: 0x170007E5 RID: 2021
17 // (get) Token: 0x06001AE0 RID: 6880 RVA: 0x000A6A35 File Offset: 0x000A4C35
18 public string IdItem
19 {
20 get
21 {
22 return this.owner.GetStr(53, null);
23 }
24 }
25
26 // Token: 0x170007E6 RID: 2022
27 // (get) Token: 0x06001AE1 RID: 6881 RVA: 0x000A6A45 File Offset: 0x000A4C45
28 public string IdCat
29 {
30 get
31 {
32 if (!this.IsParchment)
33 {
34 return "Book";
35 }
36 return "Scroll";
37 }
38 }
39
40 // Token: 0x170007E7 RID: 2023
41 // (get) Token: 0x06001AE2 RID: 6882 RVA: 0x000A6A5A File Offset: 0x000A4C5A
42 public BookList.Item Item
43 {
44 get
45 {
46 return BookList.GetItem(this.IdItem, this.IdCat);
47 }
48 }
49
50 // Token: 0x06001AE3 RID: 6883 RVA: 0x000A6A6D File Offset: 0x000A4C6D
51 public override bool CanStackTo(Thing to)
52 {
53 return to.GetStr(53, null) == this.IdItem;
54 }
55
56 // Token: 0x06001AE4 RID: 6884 RVA: 0x000A6A84 File Offset: 0x000A4C84
57 public override void OnCreate(int lv)
58 {
59 if (base.GetParam(1, null) != null)
60 {
61 this.owner.SetStr(53, base.GetParam(1, null));
62 return;
63 }
64 if (this.IdItem.IsEmpty())
65 {
66 this.owner.SetStr(53, BookList.GetRandomItem(this.IdCat).id);
67 }
68 }
69
70 // Token: 0x06001AE5 RID: 6885 RVA: 0x000A6ADB File Offset: 0x000A4CDB
71 public override void OnImportMap()
72 {
73 if (base.GetParam(1, null) != null)
74 {
75 this.owner.SetStr(53, base.GetParam(1, null));
76 }
77 }
78
79 // Token: 0x06001AE6 RID: 6886 RVA: 0x000A6AFC File Offset: 0x000A4CFC
80 public override void SetName(ref string s)
81 {
82 s = (this.IsParchment ? "_parchment" : "_book").lang(s, this.Item.title, null, null, null);
83 }
84
85 // Token: 0x06001AE7 RID: 6887 RVA: 0x000A6B2C File Offset: 0x000A4D2C
86 public override void OnRead(Chara c)
87 {
88 BookList.Item item = this.Item;
89 EClass.ui.AddLayer<LayerHelp>(this.IsParchment ? "LayerParchment" : "LayerBook").book.Show((this.IsParchment ? "Scroll/" : "Book/") + item.id, null, item.title, item);
90 }
91}
Definition Chara.cs:12
Definition Thing.cs:10