Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitJukeBox.cs
Go to the documentation of this file.
2{
3 public override string IDActorEx
4 {
5 get
6 {
7 if (!owner.isOn || owner.refVal <= 1)
8 {
9 return null;
10 }
11 return "jukebox";
12 }
13 }
14
15 public override bool OnUse(Chara c)
16 {
17 EClass.ui.AddLayer<LayerEditPlaylist>().Activate(this);
18 return false;
19 }
20
21 public void OnSetBGM(BGMData d)
22 {
23 if (Electricity < 0 && !owner.isOn)
24 {
25 owner.PlaySound("electricity_insufficient");
26 return;
27 }
28 owner.PlaySound("tape");
29 owner.refVal = d.id;
30 OnToggle();
31 }
32
33 public override void OnToggle()
34 {
36 if (owner.isOn && owner.refVal > 1)
37 {
39 }
40 }
41}
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
int refVal
Definition: Card.cs:190
bool isOn
Definition: Card.cs:514
Definition: Chara.cs:10
Definition: EClass.cs:5
static Scene scene
Definition: EClass.cs:30
static UI ui
Definition: EClass.cs:16
Layer AddLayer(string id)
Definition: Layer.cs:337
void RemoveActorEx(Card c)
Definition: Scene.cs:1015
void AddActorEx(Card c, Action< ActorEx > onBeforeSetOwner=null)
Definition: Scene.cs:1003
void OnSetBGM(BGMData d)
Definition: TraitJukeBox.cs:21
override string IDActorEx
Definition: TraitJukeBox.cs:4
override void OnToggle()
Definition: TraitJukeBox.cs:33
override bool OnUse(Chara c)
Definition: TraitJukeBox.cs:15
virtual int Electricity
Definition: Trait.cs:97
Card owner
Definition: Trait.cs:26