public override void PostProcessProjectile(Projectile projectile) { if (projectile && projectile.ProjectilePlayerOwner()) { if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Micro Aggressions")) { if (UnityEngine.Random.value <= 0.1f) { projectile.AdjustPlayerProjectileTint(ExtendedColours.vibrantOrange, 2); projectile.statusEffectsToApply.Add(StatusEffectHelper.GenerateSizeEffect(5, new Vector2(0.4f, 0.4f))); } } } base.PostProcessProjectile(projectile); }
private void PostProcessBeam(BeamController beam, SpeculativeRigidbody hitRigidBody, float tickrate) { float procChance = 0.09f; beam.AdjustPlayerBeamTint(ExtendedColours.vibrantOrange, 1, 0f); GameActor gameActor = hitRigidBody.gameActor; if (!gameActor) { return; } if (UnityEngine.Random.value < BraveMathCollege.SliceProbability(procChance, tickrate)) { hitRigidBody.gameActor.ApplyEffect(StatusEffectHelper.GenerateSizeEffect(10, new Vector2(0.4f, 0.4f))); } }
public void BlankModHook(Action <SilencerInstance, BlankModificationItem, Vector2, PlayerController> orig, SilencerInstance silencer, BlankModificationItem bmi, Vector2 centerPoint, PlayerController user) { orig(silencer, bmi, centerPoint, user); if (user.HasPickupID(BronzeAmmoletID)) { RoomHandler currentRoom = user.CurrentRoom; List <AIActor> activeEnemies = currentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies != null) { for (int i = 0; i < activeEnemies.Count; i++) { if (UnityEngine.Random.value <= 0.5f) { activeEnemies[i].ApplyEffect(StatusEffectHelper.GenerateSizeEffect(10, new Vector2(0.4f, 0.4f))); } } } } }
private void PostProcessProjectile(Projectile sourceProjectile, float effectChanceScalar) { float procChance = 0.09f; procChance *= effectChanceScalar; bool DoFirstShotOverrideSynergy = (Owner.CurrentGun.LastShotIndex == 0) && Owner.PlayerHasActiveSynergy("Added Effect - Shrink"); bool DoLastShotOverrideSynergy = (Owner.CurrentGun.LastShotIndex == Owner.CurrentGun.ClipCapacity - 1) && Owner.PlayerHasActiveSynergy("Topaz Weapon"); try { if (UnityEngine.Random.value <= procChance || DoFirstShotOverrideSynergy || DoLastShotOverrideSynergy) { sourceProjectile.RuntimeUpdateScale(0.7f); sourceProjectile.AdjustPlayerProjectileTint(ExtendedColours.vibrantOrange, 2); sourceProjectile.statusEffectsToApply.Add(StatusEffectHelper.GenerateSizeEffect(10, new Vector2(0.4f, 0.4f))); } } catch (Exception e) { ETGModConsole.Log(e.Message); } }