Elin Decompiled Documentation EA 23.270 Nightly Patch 1
Loading...
Searching...
No Matches
TraitTape.cs
Go to the documentation of this file.
1public class TraitTape : TraitItem
2{
3 public bool IsCollected
4 {
5 get
6 {
7 if (owner.refVal != 0)
8 {
9 return EClass.player.knownBGMs.Contains(owner.refVal);
10 }
11 return true;
12 }
13 }
14
15 public override void SetName(ref string s)
16 {
17 s = "_tape".lang(owner.refVal.ToString() ?? "", s, EClass.core.refs.dictBGM[owner.refVal]._name);
18 }
19
20 public override void OnCreate(int lv)
21 {
22 if (EClass.core.IsGameStarted && EClass._map.plDay != null && EClass._map.plDay.list.Count > 0)
23 {
24 owner.refVal = EClass._map.plDay.list[0].data.id;
25 }
26 else
27 {
28 owner.refVal = EClass.core.refs.dictBGM.RandomItem().id;
29 }
30 }
31
32 public override bool OnUse(Chara c)
33 {
35 {
37 return false;
38 }
39 if (IsCollected)
40 {
41 Msg.Say("songAlreayKnown");
42 }
43 else
44 {
45 Msg.Say("songAdded", EClass.core.refs.dictBGM[owner.refVal]._name, owner.refVal.ToString() ?? "");
47 }
48 EClass.Sound.Play("tape");
49 owner.ModNum(-1);
50 return true;
51 }
52
53 public override void WriteNote(UINote n, bool identified)
54 {
55 if (IsCollected)
56 {
57 n.AddText("NoteText_enc", "isCollected", FontColor.Warning);
58 }
59 }
60}
FontColor
Definition: FontColor.cs:2
int refVal
Definition: Card.cs:207
void ModNum(int a, bool notify=true)
Definition: Card.cs:3540
Definition: Chara.cs:10
Dictionary< int, BGMData > dictBGM
Definition: CoreRef.cs:385
CoreRef refs
Definition: Core.cs:51
bool IsGameStarted
Definition: Core.cs:84
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static Player player
Definition: EClass.cs:13
static SoundManager Sound
Definition: EClass.cs:47
Playlist plDay
Definition: Map.cs:77
Definition: Msg.cs:5
static string SayCannotUseHere()
Definition: Msg.cs:101
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
HashSet< int > knownBGMs
Definition: Player.cs:1064
bool IsCollected
Definition: TraitTape.cs:4
override void OnCreate(int lv)
Definition: TraitTape.cs:20
override void SetName(ref string s)
Definition: TraitTape.cs:15
override void WriteNote(UINote n, bool identified)
Definition: TraitTape.cs:53
override bool OnUse(Chara c)
Definition: TraitTape.cs:32
Card owner
Definition: Trait.cs:28
Definition: UINote.cs:6
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
virtual bool IsUserZone
Definition: Zone.cs:271