private void OnGuonHitByBullet(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider) { if (Owner && this.m_extantOrbital) { if (Owner.IsDodgeRolling) { PhysicsEngine.SkipCollision = true; } else { if (other.projectile && !(other.projectile.Owner is PlayerController)) { float procChance = 0.35f; if (Owner.PlayerHasActiveSynergy("Indigoer Guon Stone")) { procChance = 0.6f; } if (UnityEngine.Random.value <= procChance) { EasyBlankType blankType = EasyBlankType.MINI; if (Owner.PlayerHasActiveSynergy("Indigoer Guon Stone") && UnityEngine.Random.value <= 0.2) { blankType = EasyBlankType.FULL; } Owner.DoEasyBlank(this.m_extantOrbital.transform.position, blankType); } } } } }
public static void DoEasyBlank(this PlayerController blankOwner, Vector2 blankPosition, EasyBlankType type) { if (type == EasyBlankType.MINI) { GameObject silencerVFX = (GameObject)ResourceCache.Acquire("Global VFX/BlankVFX_Ghost"); AkSoundEngine.PostEvent("Play_OBJ_silenceblank_small_01", blankOwner.gameObject); GameObject gameObject = new GameObject("silencer"); SilencerInstance silencerInstance = gameObject.AddComponent <SilencerInstance>(); float additionalTimeAtMaxRadius = 0.25f; silencerInstance.TriggerSilencer(blankPosition, 25f, 5f, silencerVFX, 0f, 3f, 3f, 3f, 250f, 5f, additionalTimeAtMaxRadius, blankOwner, false, false); } else if (type == EasyBlankType.FULL) { GameObject bigSilencerVFX = (GameObject)ResourceCache.Acquire("Global VFX/BlankVFX"); AkSoundEngine.PostEvent("Play_OBJ_silenceblank_use_01", blankOwner.gameObject); GameObject gameObject = new GameObject("silencer"); SilencerInstance silencerInstance = gameObject.AddComponent <SilencerInstance>(); silencerInstance.TriggerSilencer(blankPosition, 50f, 25f, bigSilencerVFX, 0.15f, 0.2f, 50f, 10f, 140f, 15f, 0.5f, blankOwner, true, false); } }
private void OnGuonHitByBullet(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider) { if (other.projectile && !(other.projectile.Owner is PlayerController)) { //ETGModConsole.Log("Orbital was hit by a bullet"); if (RandomlySelectedGuonState == GuonState.GOLD) { float procChance = 0.1f; if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone")) { procChance = 0.15f; } if (UnityEngine.Random.value <= procChance) { LootEngine.SpawnItem(PickupObjectDatabase.GetById(68).gameObject, other.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false); } } if (RandomlySelectedGuonState == GuonState.BLUE) { if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone")) { if (canDoBlueSynergyRoomDMG) { canDoBlueSynergyRoomDMG = false; List <AIActor> activeEnemies = Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies != null) { for (int i = 0; i < activeEnemies.Count; i++) { AIActor aiactor = activeEnemies[i]; aiactor.healthHaver.ApplyDamage(15, Vector2.zero, "Blue Guon Stone", CoreDamageTypes.None, DamageCategory.Normal, true, null, false); } } Invoke("resetBlueRoomDMG", 1f); } } } if (RandomlySelectedGuonState == GuonState.GREY) { if (canDoGreyCollisionDMG && other.projectile.Owner is AIActor) { float DMG = 5f; if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone")) { DMG *= 2f; } if ((other.projectile.Owner as AIActor).IsBlackPhantom) { DMG *= 3f; } DMG *= Owner.stats.GetStatValue(PlayerStats.StatType.Damage); (other.projectile.Owner as AIActor).healthHaver.ApplyDamage(DMG, Vector2.zero, "Guon Wrath", CoreDamageTypes.None, DamageCategory.Unstoppable, true, null, false); Invoke("resetGreyCollisionDMG", 0.15f); } } if (RandomlySelectedGuonState == GuonState.RED) { if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone")) { Owner.StartCoroutine(this.HandleMachoDamageBoost(Owner)); } } if (RandomlySelectedGuonState == GuonState.INDIGO) { if (Owner.IsDodgeRolling) { PhysicsEngine.SkipCollision = true; } else { float procChance = 0.35f; if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone")) { procChance = 0.6f; } if (UnityEngine.Random.value <= procChance) { EasyBlankType blankType = EasyBlankType.MINI; if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone") && UnityEngine.Random.value <= 0.2) { blankType = EasyBlankType.FULL; } Owner.DoEasyBlank(this.m_extantOrbital.transform.position, blankType); } } } } }