Elin Decompiled Documentation EA 23.324 Nightly
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 444 of file GameUpdater.cs.

445 {
448 {
449 if (all == null)
450 {
451 all = new Updater[8] { area, surface, surfaceFast, fire, chara, condition, sensor, thing };
452 }
453 delta = Core.delta;
462 }
463 }
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:292
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:325
ConditionUpdater condition
Definition: GameUpdater.cs:365
AreaUpdater area
Definition: GameUpdater.cs:355
FireUpdater fire
Definition: GameUpdater.cs:361
CharaUpdater chara
Definition: GameUpdater.cs:363
SurfaceUpdater surface
Definition: GameUpdater.cs:357
Updater[] all
Definition: GameUpdater.cs:373
static float delta
Definition: GameUpdater.cs:353
SensorUpdater sensor
Definition: GameUpdater.cs:369
RecipeUpdater recipe
Definition: GameUpdater.cs:371
ThingUpdater thing
Definition: GameUpdater.cs:367
FastSurfaceUpdater surfaceFast
Definition: GameUpdater.cs:359
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 565 of file GameUpdater.cs.

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

References all.

Referenced by WidgetDebug.UpdateText().

◆ Reset()

void GameUpdater.Reset ( )
inline

Definition at line 383 of file GameUpdater.cs.

384 {
385 area = new AreaUpdater();
386 surface = new SurfaceUpdater();
387 surfaceFast = new FastSurfaceUpdater();
388 fire = new FireUpdater();
389 chara = new CharaUpdater();
390 condition = new ConditionUpdater();
391 thing = new ThingUpdater();
392 sensor = new SensorUpdater();
393 }

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

Referenced by Scene.Init().

◆ Update()

void GameUpdater.Update ( )
inline

Definition at line 465 of file GameUpdater.cs.

466 {
467 if (EClass.game.activeZone == null)
468 {
469 return;
470 }
472 if (EClass.debug.testLOS)
473 {
475 {
476 Zone zone = EClass.game.spatials.Find("palmia");
478 if (pathProgress.HasPath)
479 {
480 Debug.Log(pathProgress.nodes.Count);
481 foreach (PathFinderNode node in pathProgress.nodes)
482 {
483 Point point2 = new Point(node.X, node.Z);
485 }
486 }
487 }
488 Point hit2 = Scene.HitPoint;
489 if (hit2.IsValid)
490 {
491 for (int i = 0; i < EClass._map.charas.Count; i++)
492 {
493 Chara tg = EClass._map.charas[i];
494 if (!Los.IsVisible(hit2, tg.pos))
495 {
496 continue;
497 }
498 Los.IsVisible(hit2, tg.pos, delegate(Point point, bool blocked)
499 {
501 if (Input.GetKey(KeyCode.LeftControl))
502 {
503 Debug.Log(tg.Name + ": Distance:" + hit2.Distance(tg.pos));
504 }
505 });
506 }
507 }
508 }
510 {
511 Point hit = Scene.HitPoint;
512 if (hit.IsValid)
513 {
514 EClass._map.ForeachSphere(hit.x, hit.z, 6f, delegate(Point p)
515 {
516 if (p.IsValid && Los.IsVisible(hit, p))
517 {
518 EClass.screen.tileMap.passGuideFloor.Add(p, 20f);
519 }
520 });
521 }
522 }
523 if (EClass.scene.paused)
524 {
525 return;
526 }
528 EClass.player.renderExtraTime -= delta;
530 {
531 return;
532 }
534 dateTimer += delta;
536 {
537 dateTimer = 0f;
539 }
541 if (!(counterTimer > 0.1f))
542 {
543 return;
544 }
545 counterTimer = 0f;
546 counter++;
547 if (counter == 10)
548 {
549 counter = 0;
550 }
551 switch (counter)
552 {
553 case 1:
555 break;
556 case 5:
557 if ((bool)EClass.Sound.currentAmbience)
558 {
559 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());
560 }
561 break;
562 }
563 }
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:321
float dateTimer
Definition: GameUpdater.cs:375
float counterTimer
Definition: GameUpdater.cs:377
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:2438
void RefreshSunMap()
Definition: Map.cs:2800
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:553
Point Set(int _x, int _z)
Definition: Point.cs:503
ref Vector3 PositionTopdown()
Definition: Point.cs:574
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:1014
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 395 of file GameUpdater.cs.

396 {
398 {
400 }
401 bool flag = EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy;
402 bool flag2 = EClass._map.config.indoor || (EClass.pc.IsInActiveZone && (EClass.pc.pos.cell.room?.HasRoof ?? false));
403 bool flag3 = EClass.pc.pos.cell.room?.data.atrium ?? false;
404 float mtpVolume = ((EClass._zone.lv <= -2) ? 0f : ((flag2 && !flag3) ? 0.5f : 1f));
406 {
407 for (int i = 0; i < EClass.setting.weather.splashCount * ((!flag) ? 1 : 2); i++)
408 {
409 Point randomPoint = EClass.screen.GetRandomPoint();
410 if (!randomPoint.IsValid)
411 {
412 continue;
413 }
414 Cell cell = randomPoint.cell;
415 if (!cell.HasRoof && cell._block == 0 && !randomPoint.IsSky)
416 {
417 if (cell.IsTopWaterAndNoSnow)
418 {
419 EClass.scene.psRainSplash.Emit(randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
420 }
421 else
422 {
423 EClass.scene.psRainSplashWater.Emit(randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
424 }
425 }
426 }
427 }
428 if (!flag)
429 {
430 return;
431 }
432 timerThunder += 0.1f;
434 {
436 {
437 ScreenFlash.Play("storm" + (EClass.rnd(2) + 1), (flag2 && !flag3) ? 0.3f : 1f);
438 }
439 EClass.Sound.Play("Ambience/Random/storm", mtpVolume);
441 }
442 }
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:615
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:315
float timerThunder
Definition: GameUpdater.cs:381
bool IsIndoor
Definition: Map.cs:131
bool IsSky
Definition: Point.cs:224
ref Vector3 PositionCenter()
Definition: Point.cs:592
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:477

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 373 of file GameUpdater.cs.

Referenced by FixedUpdate(), and GetText().

◆ area

AreaUpdater GameUpdater.area

Definition at line 355 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ chara

◆ condition

ConditionUpdater GameUpdater.condition

Definition at line 365 of file GameUpdater.cs.

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

◆ counter

int GameUpdater.counter
private

Definition at line 379 of file GameUpdater.cs.

Referenced by Update().

◆ counterTimer

float GameUpdater.counterTimer
private

Definition at line 377 of file GameUpdater.cs.

Referenced by Update().

◆ dateTimer

float GameUpdater.dateTimer
private

Definition at line 375 of file GameUpdater.cs.

Referenced by Update().

◆ delta

float GameUpdater.delta
static

Definition at line 353 of file GameUpdater.cs.

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

◆ fire

FireUpdater GameUpdater.fire

Definition at line 361 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ recipe

◆ sensor

SensorUpdater GameUpdater.sensor

Definition at line 369 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ surface

SurfaceUpdater GameUpdater.surface

Definition at line 357 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ surfaceFast

FastSurfaceUpdater GameUpdater.surfaceFast

Definition at line 359 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ thing

ThingUpdater GameUpdater.thing

Definition at line 367 of file GameUpdater.cs.

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

◆ timerThunder

float GameUpdater.timerThunder
private

Definition at line 381 of file GameUpdater.cs.

Referenced by Update100ms().


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