2using System.Collections.Generic;
34 public List<CollectibleActor>
actors;
46 public SpriteRenderer
srBG;
88 RigidUpdate.leftX = -5f;
89 RigidUpdate.rightX = 5f;
95 Vector3 zero = Vector3.zero;
105 string filter =
item.Source.filter;
106 if (
hoard.
mode != 0 && !filter.IsEmpty() && filter != text)
110 bool flag =
item.Source.tag.Contains(
"god");
111 int num2 =
item.show;
115 if (num2 > 2 && num2 < 50)
126 SpriteRenderer component2 = actor.GetComponent<SpriteRenderer>();
127 Vector3 extents = component2.bounds.extents;
128 int num3 = (int)(extents.x * extents.y * 10f);
134 float z = (flag ? (-0.1f) : 0f);
135 bool hasSound = !
item.Source.sound.IsEmpty();
138 string id2 =
item.id;
139 Vector3 vector = extents;
140 Debug.Log(id2 +
"/" + vector.ToString());
142 float num4 = Mathf.Sqrt(actor.GetComponent<Rigidbody2D>().mass);
147 BoxCollider2D component3 = actor.GetComponent<BoxCollider2D>();
148 if ((
bool)component3)
150 component3.size = extents *
sizeMod;
162 Util.Instantiate<SpriteRenderer>(
"UI/Layer/Hoard/Effect/sister", component);
163 component.paired =
true;
193 UnityEngine.Object.DestroyImmediate(actor.GetComponent<
RigidExplode>());
198 rigidExplode2.radius *= 10f;
199 rigidExplode2.force *= 10f;
200 rigidExplode2.chance = 0.1f;
201 rigidExplode2.intervalMin *= 2f;
208 rigidExplode.chance = 0.1f;
209 rigidExplode.intervalMin *= 2f;
228 component.updates = actor.GetComponents<
RigidUpdate>();
229 for (
int i = 0; i < num2; i++)
231 GameObject obj = ((i == 0) ? actor : UnityEngine.Object.Instantiate(actor));
233 zero.x = posCenter.x + UnityEngine.Random.Range(0f - num5, num5);
234 zero.y = posCenter.y + UnityEngine.Random.Range(0f,
radiusY + 0.1f * (
float)num) / num4;
236 obj.transform.position = zero;
238 Rigidbody2D component5 = obj.GetComponent<Rigidbody2D>();
239 component4.item =
item;
240 component4.hasSound = hasSound;
241 component4.rb = component5;
243 if (component4.
updates.Length != 0)
248 rigidUpdate.rb = component5;
252 component4.shadow = num3;
253 component4.shadowY = y;
265 switch (actor2.
item.id)
268 if (FindPair(actor2,
"odina", 0.3f))
279 if (!item2.
paired && !(item2 == actor2) && item2.
item.Source.tag.Contains(
"fem"))
281 MakePair(actor2, item2,
new Vector3(0.02f, 0f, -0.01f));
282 item2.transform.localEulerAngles =
new Vector3(0f, 0f, -90f);
283 item2.GetComponent<SpriteRenderer>().flipX =
true;
293 actor2.GetComponentInChildren<ParticleSystem>().SetActive(enable:
false);
296 if (FindPair(actor2,
"dragon", 0.3f))
303 if (FindPair(actor2,
"qulu", 0.3f))
315 if (!item3.
paired && !(item3 == actor2))
317 MakePair(actor2, item3,
new Vector3(0f, 0.25f, -0.01f));
321 item3.GetComponent<SpriteRenderer>().flipX =
true;
325 actor2.transform.SetLocalScaleX(actor2.transform.localScale.x * -1f);
332 if (FindPair(actor2,
"lomi", 0.15f))
338 if (FindPair(actor2,
"lar", 0.15f))
344 DisableParticle(actor2, 50);
347 if (!item4.
paired && !(item4 == actor2))
349 MakePair(actor2, item4,
new Vector3(0f, -0.25f, -0.01f));
350 item4.transform.localEulerAngles =
new Vector3(0f, 0f, 90f);
351 item4.GetComponent<SpriteRenderer>().flipX =
false;
357 DisableParticle(actor2, 50);
360 if (
EMono.
rnd(2) == 0 || !actor2.
item.Source.tag.Contains(
"pair"))
366 if (!item5.
paired && !(item5 == actor2))
377 actor3.GetComponent<SpriteRenderer>().flipX =
true;
384 ParticleSystem[] componentsInChildren = a.GetComponentsInChildren<ParticleSystem>();
385 for (
int k = 0; k < componentsInChildren.Length; k++)
387 componentsInChildren[k].SetActive(enable:
false);
409 cam.orthographicSize = (float)Screen.height * 0.5f * 0.01f * 2f;
413 cam.orthographicSize = 5f;
419 (a.rb ?? a.GetComponent<Rigidbody2D>()).freezeRotation =
true;
425 if (a.
item.id !=
"lulu")
427 z = ((
Rand.
rnd(2) == 0) ? 0.01f : (-0.01f));
429 MakePair(a, b,
new Vector3(dist, 0f, z));
434 b.transform.SetParent(a.transform, worldPositionStays:
true);
435 b.transform.localPosition = v;
436 b.GetComponent<SpriteRenderer>().flipX =
true;
437 b.rb.isKinematic =
true;
438 b.GetComponent<Collider2D>().enabled =
false;
439 a.paired = (b.paired =
true);
444 SpriteRenderer spriteRenderer =
srBG;
445 Sprite sprite2 = (srReflection.sprite =
bg.
sprite);
446 spriteRenderer.sprite = sprite2;
455 if ((
bool)actor && (
bool)actor.gameObject)
457 UnityEngine.Object.DestroyImmediate(actor.gameObject);
467 matMani.SetFloat(
"_Space",
curveMani.Evaluate(Time.timeSinceLevelLoad % 10f / 10f));
468 float value = ((cam.orthographicSize <= 5f) ? 0f : ((
cam.orthographicSize - 5f) *
reflectMod));
470 EMono.scene.transAudio.position =
new Vector3(0f,
groundY, 0f);
491 float num2 = (actor.transform.position.y +
groundY) * 0.05f;
504 float num = (RigidUpdate.delta = Time.fixedDeltaTime);
505 if (
angryEhe && (
bool)
renton && (bool)
ehe && !
ehe.
rb.isKinematic && (Mathf.Abs(
renton.transform.position.x -
ehe.transform.position.x) > 0.6f || renton.transform.position.y >
ehe.transform.position.y))
510 ehe.rb.position =
new Vector3(
renton.transform.position.x,
renton.transform.position.y + 4f,
ehe.transform.position.z);
516 renton.rb.constraints = RigidbodyConstraints2D.FreezePositionX;
517 renton.rb.gravityScale = 3f;
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
void PlaySound(string id=null)
SpriteRenderer srReflection
void MakeSteady(CollectibleActor a)
List< CollectibleActor > actors
List< RigidUpdate > updates
void MakePair(CollectibleActor a, CollectibleActor b, Vector3 v)
void MakePair(CollectibleActor a, CollectibleActor b, float dist=0.26f)
GameObject GetActor(string id)
Dictionary< string, Item > items
void Add(Point point, float tile=0f, float color=0f)
virtual void OnFixedUpdate()