23 public unsafe
void Update100ms()
25 if (
EClass.game.activeZone.IsPCFaction &&
EClass.Branch.resources.isDirty)
27 EClass.Branch.resources.Refresh();
29 bool flag = EClass.world.weather.CurrentCondition ==
Weather.Condition.RainHeavy;
31 if (!
EClass._map.config.indoor)
33 if (
EClass.pc.IsInActiveZone)
36 flag2 = (room !=
null && room.HasRoof);
49 bool flag4 = room2 !=
null && room2.data.atrium;
50 float mtpVolume = (EClass._zone.lv <= -2) ? 0f : ((flag3 && !flag4) ? 0.5f : 1f);
51 if (
EClass.world.weather.IsRaining && !
EClass._map.IsIndoor)
53 for (
int i = 0; i < EClass.setting.weather.splashCount * (flag ? 2 : 1); i++)
56 if (randomPoint.IsValid)
58 Cell cell = randomPoint.cell;
59 if (!cell.HasRoof && cell._block == 0 && !randomPoint.IsSky)
61 if (cell.IsTopWaterAndNoSnow)
63 EClass.scene.psRainSplash.Emit(*randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
67 EClass.scene.psRainSplashWater.Emit(*randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
75 this.timerThunder += 0.1f;
76 if (this.timerThunder >
EClass.setting.weather.thunerInterval)
80 ScreenFlash.Play(
"storm" + (
EClass.rnd(2) + 1).ToString(), (flag3 && !flag4) ? 0.3f : 1f);
82 EClass.Sound.Play(
"Ambience/Random/storm", mtpVolume);
83 this.timerThunder = 0f - Rand.Range(0f,
EClass.setting.weather.thunerInterval);
89 public void FixedUpdate()
91 this.recipe.FixedUpdate();
110 GameUpdater.delta = Core.delta;
111 this.area.FixedUpdate();
112 this.surface.FixedUpdate();
113 this.surfaceFast.FixedUpdate();
114 this.fire.FixedUpdate();
115 this.chara.FixedUpdate();
116 this.condition.FixedUpdate();
117 this.sensor.FixedUpdate();
118 this.thing.FixedUpdate();
124 if (
EClass.game.activeZone ==
null)
128 EClass._map.RefreshSunMap();
131 if (
EClass._zone.IsRegion)
133 Zone zone =
EClass.game.spatials.Find(
"palmia");
135 if (pathProgress.HasPath)
137 Debug.Log(pathProgress.nodes.Count);
140 Point point2 =
new Point(pathFinderNode.X, pathFinderNode.Z);
141 EClass.screen.tileMap.passGuideBlock.Add(point2.PositionTopdown(), 20f, 0f);
148 for (
int i = 0; i <
EClass._map.charas.Count; i++)
151 if (
Los.IsVisible(hit, tg.pos,
null))
153 Los.IsVisible(hit, tg.pos, delegate(
Point point,
bool blocked)
155 EClass.screen.tileMap.passGuideFloor.Add(point, 20f, 0f);
156 if (Input.GetKey(KeyCode.LeftControl))
158 Debug.Log(tg.Name +
": Distance:" + hit.Distance(tg.pos).ToString());
165 if (
EClass.debug.testLOS2)
170 EClass._map.ForeachSphere(hit.x, hit.z, 6f, delegate(
Point p)
172 if (p.IsValid &&
Los.IsVisible(hit, p,
null))
174 EClass.screen.tileMap.passGuideFloor.Add(p, 20f, 0f);
183 GameUpdater.delta = Core.gameDelta;
186 if (this.dateTimer >
EClass.setting.secsPerHour / 60f)
189 EClass.world.date.AdvanceMin(1);
192 if (this.counterTimer > 0.1f)
194 this.counterTimer = 0f;
196 if (this.counter == 10)
200 int num = this.counter;
210 if (
EClass.Sound.currentAmbience)
218 public string GetText()
220 if (this.all ==
null)
227 text =
string.Concat(
new string[]
230 updater.GetType().Name,
232 updater.updatesPerFrame.ToString(),
234 updater.maxCount.ToString(),
236 updater.duration.ToString(),
244 public static float delta;
277 private float dateTimer;
280 private float counterTimer;
286 private float timerThunder;
292 public virtual void FixedUpdate()
297 public void SetUpdatesPerFrame(
int _maxcount,
float _duration)
299 this.duration = _duration;
300 this.maxCount = _maxcount;
301 if (this.maxCount <= 0)
303 this.updatesPerFrame = 0;
306 this._updatesPerFrame += EClass.scene.actionMode.gameSpeed * (float)this.maxCount / (1f /
GameUpdater.delta) / this.duration;
307 this.updatesPerFrame = (int)this._updatesPerFrame;
308 this._updatesPerFrame -= (float)this.updatesPerFrame;
315 public int updatesPerFrame;
321 public float duration = 1f;
324 public float _updatesPerFrame;
334 public override void FixedUpdate()
336 List<Area> listArea =
EClass._map.rooms.listArea;
337 if (listArea.Count == 0)
341 base.SetUpdatesPerFrame(listArea.Count, 1f);
342 for (
int i = 0; i < this.updatesPerFrame; i++)
345 if (this.index >= listArea.Count)
349 listArea[this.index].Update();
363 return EClass._map.SizeXZ;
378 public override void FixedUpdate()
380 if (!this.pos.Set(
this.x,
this.z).IsValid)
382 this.x = (this.z = 0);
384 base.SetUpdatesPerFrame(this.SizeXZ, 20f);
385 PropSet propSet =
EClass._map.Roaming.raceMap.TryGetValue(
"fish",
null);
388 int num = propSet.num;
390 bool isRaining =
EClass.world.weather.IsRaining;
391 for (
int i = 0; i < this.updatesPerFrame; i++)
393 this.pos.Set(this.x, this.z);
395 bool flag = this.pos.sourceBlock.id != 0;
396 Cell cell = this.pos.cell;
397 bool flag2 = EClass._map.IsIndoor || cell.HasRoof;
398 if (cell.effect !=
null)
404 this.pos.ModFire(-5);
406 else if (
EClass.rnd(2) == 0)
408 this.pos.ModFire(-2);
411 else if (cell.HasLiquid && (!isRaining || cell.IsTopWater || cell.HasRoof))
413 EClass._map.ModLiquid(this.pos.x,
this.pos.z, -1);
420 if (cell.IsFarmField)
422 cell.isWatered =
true;
424 if (
EClass.rnd(500) == 0 && !flag && !cell.blocked && !cell.HasObj && !cell.IsTopWaterAndNoSnow && !
EClass._zone.IsRegion)
426 EClass._map.SetLiquid(this.pos.x,
this.pos.z, 1,
EClass.rnd(3) + 1);
429 if (
EClass.rnd(50) == 0 && cell.decal != 0)
435 if (this.x >= this.Size)
439 if (this.z >= this.Size)
458 public override void FixedUpdate()
460 if (!this.pos.Set(
this.x,
this.z).IsValid)
462 this.x = (this.z = 0);
464 base.SetUpdatesPerFrame(base.SizeXZ, 1f);
465 for (
int i = 0; i < this.updatesPerFrame; i++)
467 this.pos.Set(this.x, this.z);
468 Cell cell = this.pos.cell;
469 if (cell.effect !=
null && cell.effect.WillFade)
472 int amount = effect.amount;
473 effect.amount = amount - 1;
474 if (cell.effect.amount <= 0)
476 EClass._map.SetEffect(this.pos.x,
this.pos.z,
null);
480 if (this.x >= base.Size)
484 if (this.z >= base.Size)
508 public virtual float UpdateDuration
518 public virtual bool RefreshTile
527 public override void FixedUpdate()
529 List<LogicalPoint> list = this.manager.list;
534 base.SetUpdatesPerFrame(list.Count,
this.UpdateDuration);
535 for (
int i = 0; i < this.updatesPerFrame; i++)
538 if (this.index >= list.Count)
542 list[this.index].Update();
544 if (this.RefreshTile)
546 foreach (
Point point
in this.manager.refreshList)
548 EClass._map.RefreshSingleTile(point.x, point.z);
551 this.manager.refreshList.Clear();
564 return EClass._map.effectManager;
570 public override float UpdateDuration
583 public override void FixedUpdate()
585 List<Chara> charas =
EClass._map.charas;
586 base.SetUpdatesPerFrame(charas.Count, 1f);
587 for (
int i = 0; i < this.updatesPerFrame; i++)
590 if (this.index >= charas.Count)
594 Chara chara = charas[this.index];
595 if (chara.IsAliveInCurrentZone && !chara.IsPC)
597 chara.FindNewEnemy();
607 public override void FixedUpdate()
613 List<Chara> charas =
EClass._map.charas;
614 base.SetUpdatesPerFrame(charas.Count, 0.05f);
615 float gameDelta = Core.gameDelta;
616 for (
int i = 0; i < charas.Count; i++)
618 Chara chara = charas[i];
619 if (
Game.isPaused && !chara.IsPC)
623 chara.roundTimer += gameDelta;
624 float actTime = chara.actTime;
625 if (chara.roundTimer > actTime)
628 chara.roundTimer -= actTime;
634 if (i > charas.Count)
647 public override void FixedUpdate()
649 List<Chara> charas =
EClass._map.charas;
650 base.SetUpdatesPerFrame(charas.Count, 0.01f * (
float)
EClass.pc.Speed * (
EClass._zone.IsRegion ? 0.1f : 1f));
651 for (
int i = 0; i < this.updatesPerFrame; i++)
654 if (this.index >= charas.Count)
658 Chara chara = charas[this.index];
659 for (
int j = chara.conditions.Count - 1; j >= 0; j--)
661 Condition condition = chara.conditions[j];
662 if (condition.TimeBased)
679 public override void FixedUpdate()
681 List<Thing> things =
EClass._map.things;
682 base.SetUpdatesPerFrame(things.Count, 1f);
683 for (
int i = 0; i < this.updatesPerFrame; i++)
686 if (this.index >= things.Count)
690 Thing thing = things[this.index];
691 if (thing.fov !=
null)
693 thing.CalculateFOV();
695 if (thing.trait.HaveUpdate)
697 thing.trait.Update();
699 if ((thing.id ==
"snow" || thing.id ==
"flyer") &&
EClass.rnd(30) == 0 && !thing.IsInstalled && !
LayerDragGrid.Instance && !
LayerCraft.Instance)