16 return EMono.player.hoard;
26 return this.bgs[this.hoard.bg];
31 public void Activate()
33 this.passShadow.Init();
37 RigidUpdate.leftX = -5f;
38 RigidUpdate.rightX = 5f;
39 if (this.actors.Count > 0)
43 this.angryEhe = (
EMono.rnd(2) == 0);
44 Vector3 zero = Vector3.zero;
46 foreach (
Hoard.
Item item in
this.hoard.items.Values)
50 IEnumerable<
Hoard.
Item> enumerable =
new List<
Hoard.
Item>(this.hoard.items.Values).Shuffle<Hoard.Item>();
51 string b = this.hoard.mode.ToString();
54 string filter = item2.Source.filter;
55 if (this.hoard.mode ==
Hoard.Mode.all || filter.IsEmpty() || !(filter != b))
57 bool flag = item2.Source.tag.Contains(
"god");
58 int num2 = item2.show;
61 num2 = Rand.rnd(num2 + 1);
62 if (num2 > 2 && num2 < 50)
64 num2 = Rand.rnd(num2 + 1) + 1;
69 GameObject actor = this.hoard.GetActor(item2.id);
71 SpriteRenderer component2 = actor.GetComponent<SpriteRenderer>();
72 Vector3 extents = component2.bounds.extents;
73 int num3 = (int)(extents.x * extents.y * 10f);
79 float z = flag ? -0.1f : 0f;
80 bool hasSound = !item2.Source.sound.IsEmpty();
85 Vector3 vector = extents;
86 Debug.Log(
id + str + vector.ToString());
88 float num4 = Mathf.Sqrt(actor.GetComponent<Rigidbody2D>().mass);
93 BoxCollider2D component3 = actor.GetComponent<BoxCollider2D>();
96 component3.size = extents * this.sizeMod;
100 actor.GetComponent<CircleCollider2D>().radius = (extents.x + extents.y) * this.sizeModCircle * this.sizeModCircle;
102 string id2 = item2.id;
103 uint num5 = <PrivateImplementationDetails>.ComputeStringHash(id2);
104 if (num5 <= 2580362002U)
106 if (num5 <= 1166849410U)
108 if (num5 <= 622086627U)
110 if (num5 != 595338019U)
112 if (num5 != 622086627U)
116 if (!(id2 ==
"renton"))
120 this.renton = component;
123 Util.Instantiate<SpriteRenderer>(
"UI/Layer/Hoard/Effect/sister", component);
124 component.paired =
true;
125 this.MakeSteady(component);
130 else if (!(id2 ==
"mine_dog"))
135 else if (num5 != 1111712579U)
137 if (num5 != 1166849410U)
141 if (!(id2 ==
"hat_magic"))
149 if (!(id2 ==
"tentacle"))
156 else if (num5 <= 2122968502U)
158 if (num5 != 1891070888U)
160 if (num5 != 2122968502U)
164 if (!(id2 ==
"mine"))
178 else if (num5 != 2273286343U)
180 if (num5 != 2580362002U)
184 if (!(id2 ==
"mine_rock"))
195 this.ehe = component;
198 actor.AddComponent<
RigidExplode>().particle = this.psExplode;
200 else if (num5 <= 3274701990U)
202 if (num5 <= 3222636880U)
204 if (num5 != 2973714812U)
206 if (num5 == 3222636880U)
208 if (id2 ==
"tentacle3")
214 else if (id2 ==
"pet_mani")
217 rigidExplode.particle = this.psExplode;
218 rigidExplode.chance = 0.1f;
219 rigidExplode.intervalMin *= 2f;
222 else if (num5 != 3239414499U)
224 if (num5 == 3274701990U)
228 if (!this.hoard.voice)
235 else if (id2 ==
"tentacle2")
240 else if (num5 <= 3516364402U)
242 if (num5 != 3340080213U)
244 if (num5 == 3516364402U)
248 if (
EMono.rnd(2) == 0)
252 if (
EMono.rnd(2) == 0)
254 component2.material = this.matMani;
255 UnityEngine.Object.DestroyImmediate(actor.GetComponent<
RigidExplode>());
260 rigidExplode2.particle = this.psExplode;
261 rigidExplode2.radius *= 10f;
262 rigidExplode2.force *= 10f;
263 rigidExplode2.chance = 0.1f;
264 rigidExplode2.intervalMin *= 2f;
269 else if (id2 ==
"tentacle4")
274 else if (num5 != 3610891294U)
276 if (num5 == 4049731356U)
278 if (id2 ==
"chicken")
284 else if (id2 ==
"hat_feather")
293 component.updates = actor.GetComponents<
RigidUpdate>();
294 for (
int i = 0; i < num2; i++)
296 object obj = (i == 0) ? actor : UnityEngine.Object.Instantiate<GameObject>(actor);
297 float num6 = this.radiusX;
298 zero.x = this.posCenter.x + UnityEngine.Random.Range(-num6, num6);
299 zero.y = this.posCenter.y + UnityEngine.Random.Range(0f, this.radiusY + 0.1f * (
float)num) / num4;
302 obj2.transform.position = zero;
304 Rigidbody2D component5 = obj2.GetComponent<Rigidbody2D>();
305 component4.item = item2;
306 component4.hasSound = hasSound;
307 component4.rb = component5;
308 this.actors.Add(component4);
309 if (component4.updates.Length != 0)
311 foreach (
RigidUpdate rigidUpdate
in component4.updates)
313 rigidUpdate.rb = component5;
314 this.updates.Add(rigidUpdate);
317 component4.shadow = num3;
318 component4.shadowY = y;
331 IEnumerable<CollectibleActor> enumerable2 = from a in this.actors
332 where a.item.Source.tag.Contains(
"god")
334 IEnumerable<CollectibleActor> enumerable3 = from a in this.actors
335 where a.item.Source.tag.Contains(
"chara")
339 if (!collectibleActor.paired)
341 string id2 = collectibleActor.item.id;
342 uint num5 = <PrivateImplementationDetails>.ComputeStringHash(id2);
343 if (num5 <= 2988676833U)
345 if (num5 <= 1150570096U)
347 if (num5 != 460777894U)
349 if (num5 != 1111712579U)
351 if (num5 != 1150570096U)
355 if (!(id2 ==
"qulu"))
359 if (this.<Activate>g__FindPair|25_2(collectibleActor,
"dragon", 0.3f))
361 this.MakeSteady(collectibleActor);
366 else if (!(id2 ==
"tentacle"))
373 if (!(id2 ==
"vesda"))
377 HoardActor.<Activate>g__DisableParticle|25_3(collectibleActor, 50);
378 using (IEnumerator<CollectibleActor> enumerator4 = enumerable3.GetEnumerator())
380 while (enumerator4.MoveNext())
383 if (!collectibleActor2.paired && !(collectibleActor2 == collectibleActor))
385 this.MakePair(collectibleActor, collectibleActor2,
new Vector3(0f, -0.25f, -0.01f));
386 collectibleActor2.transform.localEulerAngles =
new Vector3(0f, 0f, 90f);
387 collectibleActor2.GetComponent<SpriteRenderer>().flipX =
false;
396 else if (num5 != 1382054340U)
398 if (num5 != 2281206494U)
400 if (num5 != 2988676833U)
404 if (!(id2 ==
"jure"))
408 if (this.<Activate>g__FindPair|25_2(collectibleActor,
"odina", 0.3f))
410 this.MakeSteady(collectibleActor);
421 if (
EMono.rnd(2) == 0)
425 if (!collectibleActor3.paired && !(collectibleActor3 == collectibleActor) && collectibleActor3.item.Source.tag.Contains(
"fem"))
427 this.MakePair(collectibleActor, collectibleActor3,
new Vector3(0.02f, 0f, -0.01f));
428 collectibleActor3.transform.localEulerAngles =
new Vector3(0f, 0f, -90f);
429 collectibleActor3.GetComponent<SpriteRenderer>().flipX =
true;
430 this.MakeSteady(collectibleActor);
434 if (collectibleActor.paired)
439 collectibleActor.GetComponentInChildren<ParticleSystem>().SetActive(
false);
452 else if (num5 <= 3340080213U)
454 if (num5 != 3222636880U)
456 if (num5 != 3239414499U)
458 if (num5 != 3340080213U)
462 if (!(id2 ==
"tentacle4"))
467 else if (!(id2 ==
"tentacle2"))
472 else if (!(id2 ==
"tentacle3"))
477 else if (num5 != 3842579285U)
479 if (num5 != 3907705998U)
481 if (num5 != 4161811998U)
485 if (!(id2 ==
"dragon"))
489 if (this.<Activate>g__FindPair|25_2(collectibleActor,
"qulu", 0.3f))
491 this.MakeSteady(collectibleActor);
498 if (!(id2 ==
"lomi"))
502 if (this.<Activate>g__FindPair|25_2(collectibleActor,
"lar", 0.15f))
504 this.MakeSteady(collectibleActor);
512 if (!(id2 ==
"lulu"))
518 using (IEnumerator<CollectibleActor> enumerator4 = enumerable3.GetEnumerator())
520 while (enumerator4.MoveNext())
523 if (!collectibleActor4.paired && !(collectibleActor4 == collectibleActor))
525 this.MakePair(collectibleActor, collectibleActor4,
new Vector3(0f, 0.25f, -0.01f));
526 collectibleActor.GetComponent<SpriteAnimation>().link = collectibleActor4.transform;
527 if (
EMono.rnd(2) == 0)
529 collectibleActor4.GetComponent<SpriteRenderer>().flipX =
true;
531 if (
EMono.rnd(2) == 0)
533 collectibleActor.transform.SetLocalScaleX(collectibleActor.transform.localScale.x * -1f);
542 if (this.<Activate>g__FindPair|25_2(collectibleActor,
"lomi", 0.15f))
544 this.MakeSteady(collectibleActor);
549 if (
EMono.rnd(2) != 0 && collectibleActor.item.Source.tag.Contains(
"pair"))
553 if (!collectibleActor5.paired && !(collectibleActor5 == collectibleActor))
555 this.MakePair(collectibleActor, collectibleActor5, 0.26f);
563 HoardActor.<Activate>g__DisableParticle|25_3(collectibleActor, 50);
569 if (!collectibleActor6.paired &&
EMono.rnd(3) != 0)
571 collectibleActor6.GetComponent<SpriteRenderer>().flipX =
true;
577 public void RefreshZoom()
579 if (this.hoard.pixelPerfect)
581 this.cam.orthographicSize = (float)Screen.height * 0.5f * 0.01f * 2f;
584 this.cam.orthographicSize = 5f;
590 (a.rb ?? a.GetComponent<Rigidbody2D>()).freezeRotation =
true;
597 if (a.item.id !=
"lulu")
599 z = ((Rand.rnd(2) == 0) ? 0.01f : -0.01f);
601 this.MakePair(a, b,
new Vector3(dist, 0f, z));
607 b.transform.SetParent(a.transform,
true);
608 b.transform.localPosition = v;
609 b.GetComponent<SpriteRenderer>().flipX =
true;
610 b.rb.isKinematic =
true;
611 b.GetComponent<Collider2D>().enabled =
false;
612 a.paired = (b.paired =
true);
616 public void RefreshBG()
618 this.srBG.sprite = (this.srReflection.sprite = this.bg.sprite);
619 this.matReflection.SetColor(
"_GrabColor",
new Color(1f, 1f, 1f, this.bg.reflection * (0.01f * (
float)
this.hoard.reflection)));
620 this.srReflection.SetActive(this.hoard.reflection > 0);
628 if (collectibleActor && collectibleActor.gameObject)
630 UnityEngine.Object.DestroyImmediate(collectibleActor.gameObject);
634 this.updates.Clear();
638 private void Update()
641 this.matMani.SetFloat(
"_Space", this.curveMani.Evaluate(Time.timeSinceLevelLoad % 10f / 10f));
642 float value = (this.cam.orthographicSize <= 5f) ? 0f : ((this.cam.orthographicSize - 5f) * this.reflectMod);
643 this.matReflection.SetFloat(
"_Offset", value);
644 EMono.scene.transAudio.position =
new Vector3(0f, this.groundY, 0f);
645 if (!this.hoard.shadow)
649 float shadow = this.bg.shadow;
652 if (collectibleActor.active)
654 float num = (collectibleActor.transform.position.y - this.alphaFix1) * this.alphaFix2;
655 num = 1f - num * num * this.alphaFix4;
658 if (num > this.maxAplha)
663 float num2 = (collectibleActor.transform.position.y + this.groundY) * 0.05f;
664 if (num2 > this.shdowLimitY)
666 num2 = this.shdowLimitY;
668 this.passShadow.Add(collectibleActor.transform.position.x, collectibleActor.shadowY *
this.sizeFixY +
this.groundY + num2, 0.8f, (
float)((
int)(num * 1000f) * 1000 + collectibleActor.shadow), 0f);
672 this.passShadow.Draw();
676 private void FixedUpdate()
678 float num = RigidUpdate.delta = Time.fixedDeltaTime;
679 if (this.angryEhe && this.renton && this.ehe && !this.ehe.rb.isKinematic && (Mathf.Abs(
this.renton.transform.position.x -
this.ehe.transform.position.x) > 0.6f ||
this.renton.transform.position.y >
this.ehe.transform.position.y))
681 this.eheTimer += num;
682 if (this.eheTimer > 2f)
684 this.ehe.rb.position =
new Vector3(this.renton.transform.position.x,
this.renton.transform.position.y + 4f,
this.ehe.transform.position.z);
685 this.ehe.PlaySound(
"teleport");
688 if (this.eheCount > 5)
690 this.renton.rb.constraints = RigidbodyConstraints2D.FreezePositionX;
691 this.renton.rb.gravityScale = 3f;
701 if (rigidUpdate.active)
703 rigidUpdate.OnFixedUpdate();
710 private bool <Activate>g__FindPair|25_2(
CollectibleActor taker,
string id,
float dist)
714 if (collectibleActor.item.id ==
id && !collectibleActor.paired)
716 this.MakePair(taker, collectibleActor, dist);
725 internal static void <Activate>g__DisableParticle|25_3(
CollectibleActor a,
int chance)
727 if (
EMono.rnd(100) < chance)
729 ParticleSystem[] componentsInChildren = a.GetComponentsInChildren<ParticleSystem>();
730 for (
int i = 0; i < componentsInChildren.Length; i++)
732 componentsInChildren[i].SetActive(
false);
741 public Vector3 posCenter;
744 public float radiusX;
747 public float radiusY;
750 public float sizeMod;
753 public float sizeModCircle;
756 public float reflectMod;
759 public new bool debug;
762 public List<CollectibleActor> actors;
765 public List<RigidUpdate> updates;
771 public Material matReflection;
774 public Material matMani;
777 public AnimationCurve curveMani;
780 public SpriteRenderer srBG;
783 public SpriteRenderer srReflection;
786 public ParticleSystem psExplode;
798 private bool angryEhe;
801 private float eheTimer = -5f;
804 private int eheCount;
807 public float groundY = -4f;
810 public float shdowLimitY = 1f;
813 public float alphaFix1 = 0.3f;
816 public float alphaFix2 = 0.5f;
819 public float alphaFix4 = 0.15f;
822 public float maxAplha = 0.6f;
825 public float sizeFixY = -0.1f;
832 public Sprite sprite;
835 public float reflection;