Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerSleep.cs
Go to the documentation of this file.
1public class LayerSleep : ELayer
2{
3 public float repeatRate;
4
5 public float coverAlpha;
6
7 public float coverShow;
8
9 public float coverHide;
10
11 public float hideDelay;
12
13 private int hours;
14
15 private int min;
16
17 private int maxMin;
18
19 private Thing bed;
20
21 private Thing pillow;
22
23 public override void OnAfterInit()
24 {
26 }
27
28 public void Wait(float duration = 5f)
29 {
30 ELayer.Sound.Play("jingle_sleep");
31 TweenUtil.Tween(duration, null, delegate
32 {
34 {
35 Close();
36 });
37 });
38 }
39
40 public void Sleep(int _hours, Thing _bed, Thing _pillow = null)
41 {
42 ELayer.Sound.Play("jingle_sleep");
43 hours = _hours;
44 bed = _bed;
45 pillow = _pillow;
46 maxMin = hours * 60;
47 InvokeRepeating("Advance", repeatRate, repeatRate);
48 ELayer.pc.faith.Revelation("sleep");
50 }
51
52 public void Advance()
53 {
54 if (min > maxMin)
55 {
56 CancelInvoke();
58 {
60 }
61 foreach (Chara member in ELayer.pc.party.members)
62 {
63 member.OnSleep(bed);
64 }
65 Msg.Say("slept", hours.ToString() ?? "");
66 if (pillow != null && pillow.trait is TraitPillowOpatos)
67 {
69 }
71 {
73 }
75 {
77 }
79 TweenUtil.Delay(hideDelay, delegate
80 {
82 {
83 Close();
84 });
85 });
86 }
87 else
88 {
89 min += 10;
91 }
92 }
93}
Trait trait
Definition: Card.cs:49
Definition: Chara.cs:10
Party party
Definition: Chara.cs:43
Religion faith
Definition: Chara.cs:424
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:8825
bool ignoreAutoSave
Definition: CoreDebug.cs:125
Definition: ELayer.cs:4
static World world
Definition: ELayer.cs:39
static Chara pc
Definition: ELayer.cs:15
static Player player
Definition: ELayer.cs:13
static Game game
Definition: ELayer.cs:9
static CoreDebug debug
Definition: ELayer.cs:43
static UI ui
Definition: ELayer.cs:21
static SoundManager Sound
Definition: ELayer.cs:41
static Zone _zone
Definition: ELayer.cs:25
void AdvanceMin(int a)
Definition: GameDate.cs:22
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:960
float repeatRate
Definition: LayerSleep.cs:3
float coverShow
Definition: LayerSleep.cs:7
Thing bed
Definition: LayerSleep.cs:19
float coverAlpha
Definition: LayerSleep.cs:5
Thing pillow
Definition: LayerSleep.cs:21
void Wait(float duration=5f)
Definition: LayerSleep.cs:28
void Advance()
Definition: LayerSleep.cs:52
float coverHide
Definition: LayerSleep.cs:9
float hideDelay
Definition: LayerSleep.cs:11
override void OnAfterInit()
Definition: LayerSleep.cs:23
int maxMin
Definition: LayerSleep.cs:17
void Sleep(int _hours, Thing _bed, Thing _pillow=null)
Definition: LayerSleep.cs:40
virtual void Close()
Definition: Layer.cs:463
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
List< Chara > members
Definition: Party.cs:18
int slept
Definition: Player.cs:86
void SimulateFaction()
Definition: Player.cs:1612
Stats stats
Definition: Player.cs:817
void RenewRandomSites()
Definition: Region.cs:75
void UpdateRandomSites()
Definition: Region.cs:86
void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:145
virtual bool IsRegion
Definition: Spatial.cs:501
Definition: Thing.cs:8
void HideCover(float duration=0f, Action onComplete=null)
Definition: UI.cs:283
void ShowCover(float duration=0f, float dest=1f, Action onComplete=null, Color color=default(Color))
Definition: UI.cs:270
Region region
Definition: World.cs:23
GameDate date
Definition: World.cs:6
bool IsInstance
Definition: Zone.cs:480
bool IsPCFaction
Definition: Zone.cs:464
Region Region
Definition: Zone.cs:160