102 Value = valuesDictionary.GetValue<
int>(
"Value");
103 Count = valuesDictionary.GetValue<
int>(
"Count");
106 CreationTime = valuesDictionary.GetValue(
"CreationTime", 0.0);
110 int ownerEntityID = valuesDictionary.GetValue(
"OwnerID", 0);
111 if (ownerEntityID != 0
186 int remainPickables = SubsystemPickables.m_pickables.Count -
SubsystemPickables.m_pickablesToRemove.Count;
187 maxTimeExist = category ==
"Terrain" ? remainPickables > 80 ? 60 : 120 :
189 !(block is
EggBlock) ? remainPickables > 80 ? 120 : 480 : 240f;
191 double timeExisted = SubsystemPickables.m_subsystemGameInfo.TotalElapsedGameTime -
CreationTime;
192 if (timeExisted > maxTimeExist) {
200 float? surfaceHeight =
null;
219 positionAtdt +
new Vector3(0f, 0.25f, 0f),
223 bool isMovingRaycastDominant =
false;
225 if (movingBlocksRaycastResult.HasValue
226 && movingBlocksRaycastResult.Value.
MovingBlock !=
null
227 && (!terrainRaycastResult.HasValue || terrainRaycastResult.
Value.Distance >= movingBlocksRaycastResult.Value.
Distance)) {
228 isMovingRaycastDominant =
true;
231 else if (terrainRaycastResult.HasValue
232 && (!movingBlocksRaycastResult.HasValue || terrainRaycastResult.
Value.Distance < movingBlocksRaycastResult.Value.
Distance)) {
236 terrainRaycastResult.
Value.CellFace.X,
237 terrainRaycastResult.
Value.CellFace.Y,
238 terrainRaycastResult.
Value.CellFace.Z
244 for (
int i = 0; i < blockBehaviors.Length; i++) {
245 if (isMovingRaycastDominant) {
248 else if (terrainRaycastResult.HasValue) {
253 if (terrainRaycastResult.HasValue) {
269 for (
int j = -3; j <= 3; j++) {
270 for (
int k = -3; k <= 3; k++) {
271 for (
int l = -3; l <= 3; l++) {
272 int value =
CurrnetTerrain().GetCellContents(j + num8, k + num9, l + num10);
274 int num15 = j * j + k * k + l * l;
276 || num15 < num14.Value) {
286 if (num14.HasValue) {
294 Plane plane = terrainRaycastResult.
Value.CellFace.CalculatePlane();
295 bool flag2 = vector2.HasValue && vector2.Value !=
Vector2.
Zero;
304 Velocity.Y += 0.1f * plane.
Normal.
Y;
330 if (surfaceBlock !=
null
366 else if (surfaceBlock ==
null) {
372 &&
SubsystemPickables.m_subsystemTime.PeriodicGameTimeEvent(1.0, GetHashCode() % 100 / 100.0)
405 && surfaceHeight.HasValue) {
406 float num19 = surfaceHeight.Value -
Position.Y;
408 Velocity.X += 4f * dt * (vector2.Value.X -
Velocity.X);
409 Velocity.Y -= 10f * dt;
411 Velocity.Z += 4f * dt * (vector2.Value.Y -
Velocity.Z);
412 Velocity.Y *= MathF.Pow(0.001f, dt);
415 Velocity.Y -= 10f * dt;
473 public virtual void Draw(
Camera camera,
int drawOrder,
double totalElapsedGameTime,
Matrix rotationMatrix) {
486 float num5 = (float)(totalElapsedGameTime -
CreationTime);
494 if (chunkAtCell !=
null
501 float f =
MathUtils.
Max(position.
Y - num6 - 0.75f, 0f) / 0.25f;
514 rotationMatrix.Translation = position +
new Vector3(0f, 0.04f * MathF.Sin(3f * num5), 0f);
515 drawMatrix = rotationMatrix;
517 bool shouldDrawBlock =
true;
518 float drawBlockSize = 0.3f;
524 loader.OnPickableDraw(
537 if (shouldDrawBlock) {
544 valuesDictionary.SetValue(
"Class", GetType().FullName);
545 valuesDictionary.SetValue(
"Value",
Value);
546 valuesDictionary.SetValue(
"Count",
Count);
547 valuesDictionary.SetValue(
"Position",
Position);
548 valuesDictionary.SetValue(
"Velocity",
Velocity);
549 valuesDictionary.SetValue(
"CreationTime",
CreationTime);
551 valuesDictionary.SetValue(
"StuckMatrix",
StuckMatrix.Value);
555 valuesDictionary.SetValue(
"OwnerID",
OwnerEntity.Id);