Elin Decompiled Documentation EA 23.307 Stable
Loading...
Searching...
No Matches
GameUpdater Class Reference
Inheritance diagram for GameUpdater:
EClass

Classes

class  AreaUpdater
 
class  CharaUpdater
 
class  ConditionUpdater
 
class  FastSurfaceUpdater
 
class  FireUpdater
 
class  LogicUpdater
 
class  SensorUpdater
 
class  SurfaceUpdater
 
class  ThingUpdater
 
class  Updater
 

Public Member Functions

void Reset ()
 
void Update100ms ()
 
void FixedUpdate ()
 
void Update ()
 
string GetText ()
 

Public Attributes

AreaUpdater area
 
SurfaceUpdater surface
 
FastSurfaceUpdater surfaceFast
 
FireUpdater fire
 
CharaUpdater chara
 
ConditionUpdater condition
 
ThingUpdater thing
 
SensorUpdater sensor
 
RecipeUpdater recipe = new RecipeUpdater()
 
Updater[] all
 

Static Public Attributes

static float delta
 
- Static Public Attributes inherited from EClass
static Core core
 

Private Attributes

float dateTimer
 
float counterTimer
 
int counter
 
float timerThunder
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Properties inherited from EClass
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 Faction Wilds [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 SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 5 of file GameUpdater.cs.

Member Function Documentation

◆ FixedUpdate()

void GameUpdater.FixedUpdate ( )
inline

Definition at line 440 of file GameUpdater.cs.

441 {
444 {
445 if (all == null)
446 {
447 all = new Updater[8] { area, surface, surfaceFast, fire, chara, condition, sensor, thing };
448 }
449 delta = Core.delta;
458 }
459 }
Definition: Core.cs:14
static float delta
Definition: Core.cs:17
Definition: EClass.cs:6
static Scene scene
Definition: EClass.cs:31
static Player player
Definition: EClass.cs:13
override void FixedUpdate()
Definition: GameUpdater.cs:42
override void FixedUpdate()
Definition: GameUpdater.cs:250
override void FixedUpdate()
Definition: GameUpdater.cs:288
override void FixedUpdate()
Definition: GameUpdater.cs:189
override void FixedUpdate()
Definition: GameUpdater.cs:228
override void FixedUpdate()
Definition: GameUpdater.cs:72
override void FixedUpdate()
Definition: GameUpdater.cs:321
ConditionUpdater condition
Definition: GameUpdater.cs:361
AreaUpdater area
Definition: GameUpdater.cs:351
FireUpdater fire
Definition: GameUpdater.cs:357
CharaUpdater chara
Definition: GameUpdater.cs:359
SurfaceUpdater surface
Definition: GameUpdater.cs:353
Updater[] all
Definition: GameUpdater.cs:369
static float delta
Definition: GameUpdater.cs:349
SensorUpdater sensor
Definition: GameUpdater.cs:365
RecipeUpdater recipe
Definition: GameUpdater.cs:367
ThingUpdater thing
Definition: GameUpdater.cs:363
FastSurfaceUpdater surfaceFast
Definition: GameUpdater.cs:355
float renderExtraTime
Definition: Player.cs:1273
void FixedUpdate()
bool paused
Definition: Scene.cs:140

References all, area, chara, condition, Core.delta, delta, fire, GameUpdater.AreaUpdater.FixedUpdate(), GameUpdater.SurfaceUpdater.FixedUpdate(), GameUpdater.FastSurfaceUpdater.FixedUpdate(), GameUpdater.LogicUpdater.FixedUpdate(), GameUpdater.SensorUpdater.FixedUpdate(), GameUpdater.CharaUpdater.FixedUpdate(), GameUpdater.ConditionUpdater.FixedUpdate(), GameUpdater.ThingUpdater.FixedUpdate(), RecipeUpdater.FixedUpdate(), Scene.paused, EClass.player, recipe, Player.renderExtraTime, EClass.scene, sensor, surface, surfaceFast, and thing.

Referenced by Game.OnUpdate(), and CoreDebug.UpdateInput().

◆ GetText()

string GameUpdater.GetText ( )
inline

Definition at line 561 of file GameUpdater.cs.

562 {
563 if (all == null)
564 {
565 return "";
566 }
567 string text = "";
568 Updater[] array = all;
569 foreach (Updater updater in array)
570 {
571 text = text + updater.GetType().Name + ": " + updater.updatesPerFrame + " / frame " + updater.maxCount + " in " + updater.duration + "sec \n";
572 }
573 return text;
574 }

References all.

Referenced by WidgetDebug.UpdateText().

◆ Reset()

void GameUpdater.Reset ( )
inline

Definition at line 379 of file GameUpdater.cs.

380 {
381 area = new AreaUpdater();
382 surface = new SurfaceUpdater();
383 surfaceFast = new FastSurfaceUpdater();
384 fire = new FireUpdater();
385 chara = new CharaUpdater();
386 condition = new ConditionUpdater();
387 thing = new ThingUpdater();
388 sensor = new SensorUpdater();
389 }

References area, chara, condition, fire, sensor, surface, surfaceFast, and thing.

Referenced by Scene.Init().

◆ Update()

void GameUpdater.Update ( )
inline

Definition at line 461 of file GameUpdater.cs.

462 {
463 if (EClass.game.activeZone == null)
464 {
465 return;
466 }
468 if (EClass.debug.testLOS)
469 {
471 {
472 Zone zone = EClass.game.spatials.Find("palmia");
474 if (pathProgress.HasPath)
475 {
476 Debug.Log(pathProgress.nodes.Count);
477 foreach (PathFinderNode node in pathProgress.nodes)
478 {
479 Point point2 = new Point(node.X, node.Z);
481 }
482 }
483 }
484 Point hit2 = Scene.HitPoint;
485 if (hit2.IsValid)
486 {
487 for (int i = 0; i < EClass._map.charas.Count; i++)
488 {
489 Chara tg = EClass._map.charas[i];
490 if (!Los.IsVisible(hit2, tg.pos))
491 {
492 continue;
493 }
494 Los.IsVisible(hit2, tg.pos, delegate(Point point, bool blocked)
495 {
497 if (Input.GetKey(KeyCode.LeftControl))
498 {
499 Debug.Log(tg.Name + ": Distance:" + hit2.Distance(tg.pos));
500 }
501 });
502 }
503 }
504 }
506 {
507 Point hit = Scene.HitPoint;
508 if (hit.IsValid)
509 {
510 EClass._map.ForeachSphere(hit.x, hit.z, 6f, delegate(Point p)
511 {
512 if (p.IsValid && Los.IsVisible(hit, p))
513 {
514 EClass.screen.tileMap.passGuideFloor.Add(p, 20f);
515 }
516 });
517 }
518 }
519 if (EClass.scene.paused)
520 {
521 return;
522 }
524 EClass.player.renderExtraTime -= delta;
526 {
527 return;
528 }
530 dateTimer += delta;
532 {
533 dateTimer = 0f;
535 }
537 if (!(counterTimer > 0.1f))
538 {
539 return;
540 }
541 counterTimer = 0f;
542 counter++;
543 if (counter == 10)
544 {
545 counter = 0;
546 }
547 switch (counter)
548 {
549 case 1:
551 break;
552 case 5:
553 if ((bool)EClass.Sound.currentAmbience)
554 {
555 EClass.Sound.currentAmbience.TryEmit(EClass.world.date.IsDay, ref Point.shared.Set(EClass.pc.pos.x + EClass.rnd(5) - EClass.rnd(5), EClass.pc.pos.z).Clamp().Position());
556 }
557 break;
558 }
559 }
BaseTileMap tileMap
MeshPass passGuideBlock
Definition: BaseTileMap.cs:137
MeshPass passGuideFloor
Definition: BaseTileMap.cs:139
Point pos
Definition: Card.cs:60
Definition: Chara.cs:10
bool testLOS2
Definition: CoreDebug.cs:165
bool testLOS
Definition: CoreDebug.cs:163
static float gameDelta
Definition: Core.cs:21
bool IsDay
Definition: Date.cs:109
static Game game
Definition: EClass.cs:9
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
static SoundManager Sound
Definition: EClass.cs:47
static GameSetting setting
Definition: EClass.cs:35
int minX
Definition: EloMap.cs:112
int minY
Definition: EloMap.cs:114
void AdvanceMin(int a)
Definition: GameDate.cs:22
float secsPerHour
Definition: GameSetting.cs:319
float dateTimer
Definition: GameUpdater.cs:371
float counterTimer
Definition: GameUpdater.cs:373
SpatialManager spatials
Definition: Game.cs:153
Zone activeZone
Definition: Game.cs:252
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
void ForeachSphere(int _x, int _z, float r, Action< Point > action)
Definition: Map.cs:2406
void RefreshSunMap()
Definition: Map.cs:2748
List< Chara > charas
Definition: Map.cs:81
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
static PathManager Instance
Definition: PathManager.cs:16
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Definition: Point.cs:9
static Point shared
Definition: Point.cs:20
ref Vector3 Position(int height)
Definition: Point.cs:548
Point Set(int _x, int _z)
Definition: Point.cs:503
ref Vector3 PositionTopdown()
Definition: Point.cs:569
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsValid
Definition: Point.cs:88
Point Clamp(bool useBounds=false)
Definition: Point.cs:1009
Definition: Scene.cs:8
static Point HitPoint
Definition: Scene.cs:21
EloMap elomap
Definition: Scene.cs:149
Zone Find(string id)
virtual bool IsRegion
Definition: Spatial.cs:515
int y
Definition: Spatial.cs:106
int x
Definition: Spatial.cs:94
static void Refresh()
GameDate date
Definition: World.cs:6
void Tick(float delta)
Definition: Zone.cs:12
ZoneEventManager events
Definition: Zone.cs:40

References EClass._map, EClass._zone, Game.activeZone, MeshPass.Add(), GameDate.AdvanceMin(), Map.charas, Point.Clamp(), counter, counterTimer, World.date, dateTimer, EClass.debug, Debug, delta, Scene.elomap, Zone.events, SpatialManager.Find(), Map.ForeachSphere(), EClass.game, Core.gameDelta, PathProgress.HasPath, Scene.HitPoint, PathManager.Instance, Date.IsDay, Spatial.IsRegion, Point.IsValid, Los.IsVisible(), EloMap.minX, EloMap.minY, PathProgress.nodes, BaseTileMap.passGuideBlock, BaseTileMap.passGuideFloor, Scene.paused, EClass.pc, EClass.player, Card.pos, Point.Position(), Point.PositionTopdown(), UIResourceTrack.Refresh(), Map.RefreshSunMap(), Player.renderExtraTime, PathManager.RequestPathImmediate(), EClass.rnd(), EClass.scene, EClass.screen, GameSetting.secsPerHour, Point.Set(), EClass.setting, Point.shared, EClass.Sound, Game.spatials, CoreDebug.testLOS, CoreDebug.testLOS2, ZoneEventManager.Tick(), BaseGameScreen.tileMap, EClass.world, Algorithms.PathFinderNode.X, Point.x, Spatial.x, Spatial.y, Algorithms.PathFinderNode.Z, and Point.z.

Referenced by Scene.OnUpdate().

◆ Update100ms()

void GameUpdater.Update100ms ( )
inline

Definition at line 391 of file GameUpdater.cs.

392 {
394 {
396 }
397 bool flag = EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy;
398 bool flag2 = EClass._map.config.indoor || (EClass.pc.IsInActiveZone && (EClass.pc.pos.cell.room?.HasRoof ?? false));
399 bool flag3 = EClass.pc.pos.cell.room?.data.atrium ?? false;
400 float mtpVolume = ((EClass._zone.lv <= -2) ? 0f : ((flag2 && !flag3) ? 0.5f : 1f));
402 {
403 for (int i = 0; i < EClass.setting.weather.splashCount * ((!flag) ? 1 : 2); i++)
404 {
405 Point randomPoint = EClass.screen.GetRandomPoint();
406 if (!randomPoint.IsValid)
407 {
408 continue;
409 }
410 Cell cell = randomPoint.cell;
411 if (!cell.HasRoof && cell._block == 0 && !randomPoint.IsSky)
412 {
413 if (cell.IsTopWaterAndNoSnow)
414 {
415 EClass.scene.psRainSplash.Emit(randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
416 }
417 else
418 {
419 EClass.scene.psRainSplashWater.Emit(randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
420 }
421 }
422 }
423 }
424 if (!flag)
425 {
426 return;
427 }
428 timerThunder += 0.1f;
430 {
432 {
433 ScreenFlash.Play("storm" + (EClass.rnd(2) + 1), (flag2 && !flag3) ? 0.3f : 1f);
434 }
435 EClass.Sound.Play("Ambience/Random/storm", mtpVolume);
437 }
438 }
bool atrium
Definition: AreaData.cs:66
AreaData data
Definition: BaseArea.cs:29
Point GetRandomPoint()
Definition: Cell.cs:7
byte _block
Definition: Cell.cs:32
Room room
Definition: Cell.cs:110
bool IsTopWaterAndNoSnow
Definition: Cell.cs:720
bool HasRoof
Definition: Cell.cs:656
GraphicSetting graphic
Definition: CoreConfig.cs:611
CoreConfig config
Definition: Core.cs:70
static Core core
Definition: EClass.cs:7
static FactionBranch Branch
Definition: EClass.cs:23
HomeResourceManager resources
WeatherSetting weather
Definition: GameSetting.cs:313
float timerThunder
Definition: GameUpdater.cs:377
bool IsIndoor
Definition: Map.cs:131
bool IsSky
Definition: Point.cs:224
ref Vector3 PositionCenter()
Definition: Point.cs:587
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:49
bool HasRoof
Definition: Room.cs:29
ParticleSystem psRainSplashWater
Definition: Scene.cs:117
ParticleSystem psRainSplash
Definition: Scene.cs:115
static void Play(string id, float mtp=1f)
Definition: ScreenFlash.cs:24
Condition
Definition: Weather.cs:16
bool IsRaining
Definition: Weather.cs:117
Weather weather
Definition: World.cs:12
bool IsPCFaction
Definition: Zone.cs:475

References Cell._block, EClass._map, Game.activeZone, AreaData.atrium, EClass.Branch, Point.cell, Color, Core.config, EClass.core, BaseArea.data, EClass.game, BaseGameScreen.GetRandomPoint(), CoreConfig.graphic, Cell.HasRoof, Room.HasRoof, HomeResourceManager.isDirty, Map.IsIndoor, Zone.IsPCFaction, Weather.IsRaining, Point.IsSky, Cell.IsTopWaterAndNoSnow, Point.IsValid, CoreConfig.GraphicSetting.noLightning, EClass.pc, ScreenFlash.Play(), Card.pos, Point.PositionCenter(), Scene.psRainSplash, Scene.psRainSplashWater, Rand.Range(), HomeResourceManager.Refresh(), FactionBranch.resources, EClass.rnd(), Cell.room, EClass.scene, EClass.screen, EClass.setting, EClass.Sound, GameSetting.WeatherSetting.thunerInterval, timerThunder, GameSetting.weather, World.weather, and EClass.world.

Referenced by Core.Update100ms().

Member Data Documentation

◆ all

Updater [] GameUpdater.all

Definition at line 369 of file GameUpdater.cs.

Referenced by FixedUpdate(), and GetText().

◆ area

AreaUpdater GameUpdater.area

Definition at line 351 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ chara

◆ condition

ConditionUpdater GameUpdater.condition

Definition at line 361 of file GameUpdater.cs.

Referenced by GameUpdater.ConditionUpdater.FixedUpdate(), FixedUpdate(), and Reset().

◆ counter

int GameUpdater.counter
private

Definition at line 375 of file GameUpdater.cs.

Referenced by Update().

◆ counterTimer

float GameUpdater.counterTimer
private

Definition at line 373 of file GameUpdater.cs.

Referenced by Update().

◆ dateTimer

float GameUpdater.dateTimer
private

Definition at line 371 of file GameUpdater.cs.

Referenced by Update().

◆ delta

float GameUpdater.delta
static

Definition at line 349 of file GameUpdater.cs.

Referenced by FixedUpdate(), GameUpdater.Updater.SetUpdatesPerFrame(), and Update().

◆ fire

FireUpdater GameUpdater.fire

Definition at line 357 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ recipe

◆ sensor

SensorUpdater GameUpdater.sensor

Definition at line 365 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ surface

SurfaceUpdater GameUpdater.surface

Definition at line 353 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ surfaceFast

FastSurfaceUpdater GameUpdater.surfaceFast

Definition at line 355 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ thing

ThingUpdater GameUpdater.thing

Definition at line 363 of file GameUpdater.cs.

Referenced by GameUpdater.ThingUpdater.FixedUpdate(), FixedUpdate(), and Reset().

◆ timerThunder

float GameUpdater.timerThunder
private

Definition at line 377 of file GameUpdater.cs.

Referenced by Update100ms().


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