Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ActorEx Class Reference
Inheritance diagram for ActorEx:
Actor SceneObject EMono

Public Types

enum  Type { Default , JukeBox }
 

Public Member Functions

void SetOwner (Card c)
 
float GetVolume ()
 
void Refresh ()
 
void Kill ()
 

Public Attributes

Type type
 
Card owner
 
bool alwaysOn
 
float outsideRoomVolume = 0.5f
 
float outsideLotVolume = 0.5f
 
int maxDistance
 
int minInterval = 1
 
int randomInterval
 
AudioSource audioSource
 
SoundData data
 

Private Attributes

int next
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 3 of file ActorEx.cs.

Member Enumeration Documentation

◆ Type

Enumerator
Default 
JukeBox 

Definition at line 5 of file ActorEx.cs.

6 {
9 }

Member Function Documentation

◆ GetVolume()

float ActorEx.GetVolume ( )
inline

Definition at line 48 of file ActorEx.cs.

49 {
51 {
52 return 0f;
53 }
54 Room room = EMono.pc.Cell.room;
55 Room room2 = owner.Cell.room;
56 bool flag = room2 == null || room2.data.atrium || !room2.HasRoof;
57 bool flag2 = room == room2 || (room2 == null && (room.data.atrium || !room.HasRoof));
58 bool num = flag2 || room?.lot == room2?.lot;
59 float num2 = ((alwaysOn || owner.isOn) ? 1f : 0f);
60 if (!num)
61 {
62 num2 *= outsideLotVolume;
63 }
64 if (!flag2 && room2 != null)
65 {
66 num2 *= outsideRoomVolume;
67 }
68 if (num2 <= 0f)
69 {
70 return 0f;
71 }
72 if (type == Type.JukeBox)
73 {
74 num2 *= 0.5f + (flag ? 0.25f : 0f);
75 if (flag2)
76 {
77 int num3 = EMono.pc.Dist(owner);
78 if (num3 < 8)
79 {
80 float num4 = (float)(8 - num3) * SoundManager.current.jukeboxMod - 0.2f;
81 if (num4 < SoundManager.bgmDumpMod)
82 {
83 SoundManager.bgmDumpMod = num4;
84 }
85 }
86 }
87 }
88 return num2;
89 }
Type
Definition: ActorEx.cs:6
Card owner
Definition: ActorEx.cs:13
float outsideRoomVolume
Definition: ActorEx.cs:17
bool alwaysOn
Definition: ActorEx.cs:15
Type type
Definition: ActorEx.cs:11
float outsideLotVolume
Definition: ActorEx.cs:19
bool IsInstalled
Definition: Card.cs:2241
int Dist(Card c)
Definition: Card.cs:6777
bool isOn
Definition: Card.cs:514
Cell Cell
Definition: Card.cs:1931
Room room
Definition: Cell.cs:102
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13
static Zone _zone
Definition: EMono.cs:19
Definition: Room.cs:4
bool HasRoof
Definition: Room.cs:29
Lot lot
Definition: Room.cs:21
bool isStarted
Definition: Zone.cs:70

References EMono._zone, alwaysOn, Card.Cell, Card.Dist(), Room.HasRoof, Card.IsInstalled, Card.isOn, Zone.isStarted, Room.lot, outsideLotVolume, outsideRoomVolume, owner, EMono.pc, Cell.room, and type.

Referenced by Refresh().

◆ Kill()

void ActorEx.Kill ( )
inline

Definition at line 153 of file ActorEx.cs.

154 {
155 Object.Destroy(base.gameObject);
156 }

Referenced by Scene.ClearActorEx(), and Scene.RemoveActorEx().

◆ Refresh()

void ActorEx.Refresh ( )
inline

Definition at line 91 of file ActorEx.cs.

92 {
94 {
95 Debug.LogWarning(owner);
96 return;
97 }
98 next--;
99 if (next > 0)
100 {
101 return;
102 }
104 if (maxDistance != 0)
105 {
106 int num = EMono.pc.Dist(owner);
107 if (base.gameObject.activeSelf)
108 {
109 if (num > maxDistance)
110 {
111 base.gameObject.SetActive(value: false);
112 return;
113 }
114 }
115 else
116 {
117 if (num > maxDistance)
118 {
119 return;
120 }
121 base.gameObject.SetActive(value: true);
122 }
123 }
124 float volume = GetVolume();
125 if (maxDistance != 0)
126 {
127 base.gameObject.SetActive(volume > 0f);
128 }
129 if ((bool)audioSource)
130 {
131 audioSource.volume = data.volume * volume;
132 if (!audioSource.isPlaying && volume > 0f)
133 {
134 audioSource.Play();
135 }
136 }
137 if (!(volume <= 0f))
138 {
139 Vector3 vector = owner.pos.PositionCenter();
140 vector.z = 0f;
141 vector.x -= 0.64f;
142 if ((bool)audioSource)
143 {
144 base.transform.position = vector;
145 }
146 else
147 {
148 SoundManager.current.Play(data, vector, volume);
149 }
150 }
151 }
int next
Definition: ActorEx.cs:27
AudioSource audioSource
Definition: ActorEx.cs:29
int randomInterval
Definition: ActorEx.cs:25
SoundData data
Definition: ActorEx.cs:31
int minInterval
Definition: ActorEx.cs:23
float GetVolume()
Definition: ActorEx.cs:48
int maxDistance
Definition: ActorEx.cs:21
ICardParent parent
Definition: Card.cs:51
Point pos
Definition: Card.cs:55
Zone currentZone
Definition: Chara.cs:240
ref Vector3 PositionCenter()
Definition: Point.cs:563
Definition: Rand.cs:4
static int rnd(int max)
Definition: Rand.cs:52

References audioSource, Chara.currentZone, data, Debug, Card.Dist(), GetVolume(), maxDistance, minInterval, next, owner, Card.parent, EMono.pc, Card.pos, Point.PositionCenter(), randomInterval, and Rand.rnd().

Referenced by Scene.RefreshActorEx(), and SetOwner().

◆ SetOwner()

void ActorEx.SetOwner ( Card  c)
inline

Definition at line 33 of file ActorEx.cs.

34 {
35 owner = c;
36 if (type == Type.JukeBox)
37 {
38 data = EMono.core.refs.dictBGM.TryGetValue(owner.refVal);
39 }
40 if ((bool)audioSource)
41 {
42 audioSource.clip = data.clip;
43 audioSource.pitch = data.pitch * (1f + ((data.randomPitch == 0f) ? 0f : Rand.Range(0f - data.randomPitch, data.randomPitch)));
44 }
45 Refresh();
46 }
void Refresh()
Definition: ActorEx.cs:91
int refVal
Definition: Card.cs:190
Dictionary< int, BGMData > dictBGM
Definition: CoreRef.cs:369
CoreRef refs
Definition: Core.cs:51
static Core core
Definition: EMono.cs:5
static int Range(int min, int max)
Definition: Rand.cs:42

References audioSource, EMono.core, data, CoreRef.dictBGM, owner, Rand.Range(), Refresh(), Core.refs, Card.refVal, and type.

Referenced by Scene.AddActorEx().

Member Data Documentation

◆ alwaysOn

bool ActorEx.alwaysOn

Definition at line 15 of file ActorEx.cs.

Referenced by GetVolume().

◆ audioSource

AudioSource ActorEx.audioSource

Definition at line 29 of file ActorEx.cs.

Referenced by Refresh(), and SetOwner().

◆ data

SoundData ActorEx.data

Definition at line 31 of file ActorEx.cs.

Referenced by Refresh(), and SetOwner().

◆ maxDistance

int ActorEx.maxDistance

Definition at line 21 of file ActorEx.cs.

Referenced by Refresh().

◆ minInterval

int ActorEx.minInterval = 1

Definition at line 23 of file ActorEx.cs.

Referenced by Refresh().

◆ next

int ActorEx.next
private

Definition at line 27 of file ActorEx.cs.

Referenced by Refresh().

◆ outsideLotVolume

float ActorEx.outsideLotVolume = 0.5f

Definition at line 19 of file ActorEx.cs.

Referenced by GetVolume().

◆ outsideRoomVolume

float ActorEx.outsideRoomVolume = 0.5f

Definition at line 17 of file ActorEx.cs.

Referenced by GetVolume().

◆ owner

Card ActorEx.owner

Definition at line 13 of file ActorEx.cs.

Referenced by GetVolume(), Refresh(), and SetOwner().

◆ randomInterval

int ActorEx.randomInterval

Definition at line 25 of file ActorEx.cs.

Referenced by Refresh().

◆ type

Type ActorEx.type

Definition at line 11 of file ActorEx.cs.

Referenced by GetVolume(), and SetOwner().


The documentation for this class was generated from the following file: