Esempio n. 1
0
        private void OnTriggerEnter2D(Collider2D collider)
        {
            if (validColliders.Any(@string => collider.name.Contains(@string)))
            {
                _anim.FlashWhite(0.25f);
            }
            else if (collider.name == "Hitbox")
            {
                string[] dnDialogue =
                {
                    "TISO_DIALOG_1", "TISO_DIALOG_1", "TISO_DIALOG_1",
                    "TISO_DIALOG_2", "TISO_DIALOG_2", "TISO_DIALOG_2",
                    "TISO_DIALOG_3", "TISO_DIALOG_3", "TISO_DIALOG_3",
                    "TISO_DIALOG_4", "TISO_DIALOG_4", "TISO_DIALOG_4",
                    "TISO_DIALOG_5",
                };

                _dnReaction.SetConvoTitle(dnDialogue[_rand.Next(dnDialogue.Length)]);
                _anim.FlashWhite(1.0f);
            }
        }
Esempio n. 2
0
        private void AddComponents()
        {
            _rb                        = gameObject.GetOrAddComponent <Rigidbody2D>();
            _rb.isKinematic            = true;
            _rb.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
            _collider                  = gameObject.GetOrAddComponent <BoxCollider2D>();
            _collider.enabled          = true;
            _collider.size             = new Vector2(1, 2);
            gameObject.AddComponent <DamageHero>();

            _recoil         = gameObject.GetOrAddComponent <Recoil>();
            _recoil.enabled = true;
            _recoil.SetAttr <bool>("freezeInPlace", false);
            _recoil.SetAttr <bool>("stopVelocityXWhenRecoilingUp", false);
            _recoil.SetAttr <bool>("preventRecoilUp", false);
            _recoil.SetAttr <float>("recoilSpeedBase", 15f);
            _recoil.SetAttr <float>("recoilDuration", 0.15f);

            _hitEff         = gameObject.AddComponent <EnemyHitEffectsUninfected>();
            _hitEff.enabled = true;

            _deathEff         = gameObject.AddComponent <EnemyDeathEffectsUninfected>();
            _deathEff.enabled = true;

            _dnReaction         = gameObject.AddComponent <EnemyDreamnailReaction>();
            _dnReaction.enabled = true;
            // Add extras to make meme dialog 5 less frequent
            string[] dnDialogue =
            {
                "TISO_DIALOG_1", "TISO_DIALOG_1", "TISO_DIALOG_1",
                "TISO_DIALOG_2", "TISO_DIALOG_2", "TISO_DIALOG_2",
                "TISO_DIALOG_3", "TISO_DIALOG_3", "TISO_DIALOG_3",
                "TISO_DIALOG_4", "TISO_DIALOG_4", "TISO_DIALOG_4",
                "TISO_DIALOG_5",
            };
            _dnReaction.SetConvoTitle(dnDialogue[_rand.Next(dnDialogue.Length)]);

            gameObject.AddComponent <ExtraDamageable>().enabled = true;
        }