Пример #1
0
        public void PlaceBomb(Vector3 position)
        {
            SpawnObjectPlayerItem playerItem = PickupObjectDatabase.GetById(LastOwner.PlayerHasActiveSynergy("Cold as Ice") ? 109 : 108).GetComponent <SpawnObjectPlayerItem>();
            GameObject            bombPrefab = playerItem.objectToSpawn.gameObject;
            GameObject            BombObject = Object.Instantiate <GameObject>(bombPrefab, position, Quaternion.identity);
            tk2dBaseSprite        bombSprite = BombObject.GetComponent <tk2dBaseSprite>();

            if (bombSprite)
            {
                bombSprite.PlaceAtPositionByAnchor(position, tk2dBaseSprite.Anchor.MiddleCenter);
            }
        }
 public override void Update()
 {
     if (LastOwner)
     {
         if (LastOwner.PlayerHasActiveSynergy("Golden Apple") && !WasGoldenLastChecked)
         {
             base.sprite.SetSprite(AppleActive.spriteIDs[1]);
             WasGoldenLastChecked = true;
         }
         else if (!LastOwner.PlayerHasActiveSynergy("Golden Apple") && WasGoldenLastChecked)
         {
             base.sprite.SetSprite(AppleActive.spriteIDs[0]);
             WasGoldenLastChecked = false;
         }
     }
     base.Update();
 }
Пример #3
0
 public override void Update()
 {
     base.Update();
     if (LastOwner)
     {
         bool NewSynergyCheck = LastOwner.PlayerHasActiveSynergy("Bloody D12");
         if (NewSynergyCheck != SynergyExists)
         {
             SynergyExists = NewSynergyCheck;
             if (SynergyExists)
             {
                 this.sprite.SetSprite(D12SpriteID);
             }
             else
             {
                 this.sprite.SetSprite(BloodyDiceSpriteID);
             }
         }
     }
 }
Пример #4
0
 private IEnumerator BombsAway()
 {
     for (int i = 0; i < 30; i++)
     {
         if (LastOwner != null)
         {
             if (LastOwner.CurrentRoom != null)
             {
                 Vector3 position = LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1).ToVector3();
                 PlaceBomb(position);
                 if (LastOwner.PlayerHasActiveSynergy("Bomb Buds") && BoxOTools.BasicRandom(0.5f))
                 {
                     Vector3 position2 = LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1).ToVector3();
                     PlaceBomb(position2); // i should probably use a for here but im too lazy to set it up
                 }
             }
             yield return(new WaitForSeconds(0.5f));
         }
     }
     yield break;
 }
Пример #5
0
        private void Pandamoment(PlayerController user)
        {
            if (LastOwner.PlayerHasActiveSynergy("Agent of Chaos"))

            {
                string header = "You feel sick.";
                string text   = "You drank a potion.";
                AkSoundEngine.PostEvent("Play_WPN_Bubbler_Drink_01", gameObject);
                int bighead = UnityEngine.Random.Range(1, 19);
                if (bighead == 1)
                {
                    header = "Damage up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.Damage, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 2)
                {
                    header = "Projectile speed up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.ProjectileSpeed, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 3)
                {
                    header = "Movement speed up.";
                    text   = "Lucky you!.";
                    this.ApplyStat(user, PlayerStats.StatType.MovementSpeed, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 4)
                {
                    header = "Damage to bosses up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.DamageToBosses, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 5)
                {
                    header = "Blanks up.";
                    text   = "Lucky you!";
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(224).gameObject, LastOwner);
                }
                if (bighead == 6)
                {
                    header = "Curse up.";
                    text   = "Unlucky.";

                    this.ApplyStat(user, PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 7)
                {
                    header = "Ammo Capacity up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.AmmoCapacityMultiplier, 1.05f, StatModifier.ModifyMethod.MULTIPLICATIVE);
                }
                if (bighead == 8)
                {
                    header = "Coolness up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.Coolness, 3f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 9)
                {
                    header = "Armour up.";
                    text   = "Lucky you!";
                    LastOwner.healthHaver.Armor = LastOwner.healthHaver.Armor + 1;
                }
                if (bighead == 10)
                {
                    header = "Money up.";
                    text   = "Lucky you!";
                    LastOwner.carriedConsumables.Currency = LastOwner.carriedConsumables.Currency + 15;
                }
                if (bighead == 11)
                {
                    header = "Damage.";
                    text   = "Unlucky.";
                    LastOwner.healthHaver.ApplyDamage(1, Vector2.zero, "Chaotic Forces", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                }
                if (bighead == 12)
                {
                    header = "Keys up.";
                    text   = "Lucky you!";
                    LastOwner.carriedConsumables.KeyBullets = LastOwner.carriedConsumables.KeyBullets + 1;
                }
                if (bighead == 13)
                {
                    header = "Mapped out.";
                    text   = "Lucky you!";
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(137).gameObject, LastOwner);
                }
                if (bighead == 14)
                {
                    header = "Lead Embrace.";
                    text   = "Unlucky.";
                    AIActor    orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("cd4a4b7f612a4ba9a720b9f97c52f38c");
                    IntVector2?intVector    = new IntVector2?(base.LastOwner.CurrentRoom.GetRandomVisibleClearSpot(2, 2));

                    AIActor aiactor = AIActor.Spawn(orLoadByGuid.aiActor, intVector.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(intVector.Value), true, AIActor.AwakenAnimationType.Default, true);
                }
                if (bighead == 15)
                {
                    header = "Glass blessing.";
                    text   = "Lucky you!";
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, LastOwner);
                }
                if (bighead == 16)
                {
                    header = "Green fire.";
                    text   = "Lucky you!";
                    DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.GreenFireDef);
                    goopManagerForGoopType.TimedAddGoopCircle(LastOwner.sprite.WorldCenter, 5f, 0.35f, false);
                }
                if (bighead == 17)
                {
                    header = "Poison!";
                    text   = "Unlucky.";
                    DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.PoisonDef);
                    goopManagerForGoopType.TimedAddGoopCircle(LastOwner.sprite.WorldCenter, 5f, 0.35f, false);
                }
                if (bighead == 18)
                {
                    header = "Fire!";
                    text   = "Unlucky.";
                    DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.FireDef);
                    goopManagerForGoopType.TimedAddGoopCircle(LastOwner.sprite.WorldCenter, 5f, 0.35f, false);
                }
                this.Notify(header, text);
            }
        }