private void AffectEnemy(AIActor aiactor) { aiactor.ApplyEffect(StaticStatusEffects.charmingRoundsEffect); if (Owner.PlayerHasActiveSynergy("Regular Hottie")) { aiactor.ApplyEffect(StaticStatusEffects.hotLeadEffect); } }
protected override void DoEffect(PlayerController user) { if (base.LastOwner && base.LastOwner.CurrentRoom != null) { try { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("f38686671d524feda75261e469f30e0b"); IntVector2?intVector = new IntVector2?(base.LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1)); bool flag = intVector != null; if (flag) { AIActor aiactor = AIActor.Spawn(orLoadByGuid.aiActor, intVector.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(intVector.Value), true, AIActor.AwakenAnimationType.Default, true); aiactor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); aiactor.IgnoreForRoomClear = true; aiactor.bulletBank.OnProjectileCreated += this.NotDamagePlayer; aiactor.gameObject.AddComponent <KillOnRoomClear>(); } } catch (Exception ex) { ETGModConsole.Log(ex.Message, false); } } this.StartEffect(user); if (this.numberOfUses > 1) { base.StartCoroutine(this.Buff()); } else { base.StartCoroutine(ItemBuilder.HandleDuration(this, this.duration, user, new Action <PlayerController>(this.EndEffect))); } }
public void AIActorMods(AIActor target) { if (!target.healthHaver.IsBoss) { if (target.GetAbsoluteParentRoom().area.PrototypeRoomCategory == PrototypeDungeonRoom.RoomCategory.BOSS && (!target.IsHarmlessEnemy || target.EnemyGuid == EnemyGuidDatabase.Entries["mine_flayers_claymore"]) && target.GetAbsoluteParentRoom().IsSealed) { if (Owner.PlayerHasActiveSynergy("Frenemies")) { target.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); target.IsHarmlessEnemy = true; } else { target.EraseFromExistenceWithRewards(true); } if (Owner.PlayerHasActiveSynergy("Dirty Tricks")) { List <AIActor> activeEnemies = target.GetAbsoluteParentRoom().GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies != null) { for (int i = 0; i < activeEnemies.Count; i++) { AIActor aiactor = activeEnemies[i]; if (aiactor.healthHaver.IsBoss) { aiactor.healthHaver.ApplyDamage(50, Vector2.zero, "Dirty Tricks", CoreDamageTypes.None, DamageCategory.Unstoppable, true, null, true); } } } } } } }
protected override void DoEffect(PlayerController user) { base.DoEffect(user); AIActor actor = user.CurrentRoom.GetNearestEnemy(user.specRigidbody.UnitCenter, out _, false); actor.ApplyEffect(effect); }
protected override void OnBlank(Vector2 centerPoint, PlayerController user) { List <AIActor> activeEnemies = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(centerPoint.ToIntVector2(VectorConversions.Round)).GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies != null) { for (int j = 0; j < activeEnemies.Count; j++) { AIActor aiactor = activeEnemies[j]; AIActorDebuffEffect debuffEffect = null; foreach (AttackBehaviorBase attackBehaviour in EnemyDatabase.GetOrLoadByGuid((PickupObjectDatabase.GetById(492) as CompanionItem).CompanionGuid).behaviorSpeculator.AttackBehaviors) { if (attackBehaviour is WolfCompanionAttackBehavior) { debuffEffect = (attackBehaviour as WolfCompanionAttackBehavior).EnemyDebuff; } } if (debuffEffect != null && !aiactor.IsBlackPhantom) { aiactor.ApplyEffect(debuffEffect, 1, null); } if (user != null && user.PlayerHasActiveSynergy("#FORBIDDEN_AMMOLET_OF_CONFUSION")) { if (aiactor.behaviorSpeculator != null) { aiactor.behaviorSpeculator.Stun(3, true); } } } } }
public void OnActiveItemUsed(PlayerController user, PlayerItem item) { if (this.m_owner.IsInCombat) { RoomHandler currentroom = user.CurrentRoom; AIActor randomenemy = currentroom.GetRandomActiveEnemy(false); if (randomenemy != null) { randomenemy.Transmogrify(EnemyDatabase.GetOrLoadByGuid("76bc43539fc24648bff4568c75c686d1"), (GameObject)ResourceCache.Acquire("Global VFX/VFX_Item_Spawn_Poof")); } if (user.PlayerHasActiveSynergy("#GUNGEON_WIZARDRY_SCHOOL")) { RoomHandler currentroom2 = user.CurrentRoom; AIActor randomenemy2 = currentroom.GetRandomActiveEnemy(true); if (randomenemy2 != null) { randomenemy2.ApplyEffect((PickupObjectDatabase.GetById(295) as BulletStatusEffectItem).FireModifierEffect); } } } if (item.consumable) { GameManager.Instance.StartCoroutine(this.ItemUseCoroutine(user, item)); } }
private void HandleTriggerCollision(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData) { PlayerController player = specRigidbody.GetComponent <PlayerController>(); AIActor aiActor = specRigidbody.GetComponent <AIActor>(); if (player) { if (!player.IsOnFire && player.IsGrounded && !player.IsSlidingOverSurface && player.healthHaver && player.healthHaver.IsVulnerable) { player.IsOnFire = true; player.CurrentFireMeterValue += BraveTime.DeltaTime * 0.5f; player.ApplyEffect(m_GoopDefinition.fireEffect); } } else if (aiActor && aiActor.GetResistanceForEffectType(EffectResistanceType.Fire) < 1f) { float num = 0f; if (aiActor.GetResistanceForEffectType(EffectResistanceType.Fire) < 1f) { num += 1f * BraveTime.DeltaTime; } aiActor.ApplyEffect(m_GoopDefinition.fireEffect); if (num > 0f) { aiActor.healthHaver.ApplyDamage(num, Vector2.zero, StringTableManager.GetEnemiesString("#GOOP", -1), CoreDamageTypes.Fire, DamageCategory.Environment, false, null, false); } } }
private void SpawnExtraWaves(PlayerController user) { if (user.PlayerHasActiveSynergy(SynNames[0])) { IntVector2?spawnPos = user.CurrentRoom.GetRandomVisibleClearSpot(1, 1); int amount = 2; for (int i = 0; i < amount; i++) { AIActor HeavyKin = EnemyDatabase.GetOrLoadByGuid("df7fb62405dc4697b7721862c7b6b3cd"); AIActor TargetActor = AIActor.Spawn(HeavyKin, spawnPos.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(spawnPos.Value), true, AIActor.AwakenAnimationType.Default, true); (TargetActor.behaviorSpeculator.AttackBehaviors[0] as ShootGunBehavior).Range = (EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5").behaviorSpeculator.AttackBehaviors[0] as ShootGunBehavior).Range; TargetActor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(TargetActor.specRigidbody, null, false); TargetActor.gameObject.AddComponent <GoAwayAfterRoomClear>(); TargetActor.IsHarmlessEnemy = true; TargetActor.IgnoreForRoomClear = true; TargetActor.StartCoroutine(HandleTimer(TargetActor, duration)); float hpMax = TargetActor.healthHaver.GetMaxHealth(); TargetActor.healthHaver.SetHealthMaximum(hpMax * 3f); TargetActor.healthHaver.FullHeal(); TargetActor.CanTargetPlayers = false; CompanionisedEnemyBulletModifiers mod = TargetActor.gameObject.AddComponent <CompanionisedEnemyBulletModifiers>(); if (user.PlayerHasActiveSynergy("Great Leadership")) { mod.doPostProcess = true; } mod.TintBullets = true; mod.TintColor = new Color(252, 116, 216, 1); TargetActor.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.PlayerCollider)); GameObject gameObject = (GameObject)ResourceCache.Acquire("Global VFX/VFX_Teleport_Beam"); SpawnManager.SpawnVFX(gameObject, TargetActor.specRigidbody.UnitCenter, Quaternion.Euler(0, 0, 0)); } } }
protected override void DoEffect(PlayerController user) { base.DoEffect(user); base.StartCoroutine(ItemBuilder.HandleDuration(this, 15f, user, this.EndEffect)); AkSoundEngine.PostEvent("Play_ENM_darken_world_01", user.gameObject); GameManager.Instance.StartCoroutine(this.HandleColorLerp()); this.spriteAnimator.Play("melt"); this.LastOwner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All, ref this.m_enemyList); for (int i = 0; i < this.m_enemyList.Count; i++) { AIActor aiactor = this.m_enemyList[i]; if (!aiactor || !aiactor.IsNormalEnemy || !aiactor.healthHaver || aiactor.healthHaver.IsBoss || aiactor.IsHarmlessEnemy) { this.m_enemyList.RemoveAt(i); i--; } } if (this.m_enemyList.Count > 1) { this.EatCharmedEnemy(); AIActor aiactor2 = this.m_enemyList[UnityEngine.Random.Range(0, this.m_enemyList.Count)]; aiactor2.IgnoreForRoomClear = true; aiactor2.ParentRoom.ResetEnemyHPPercentage(); aiactor2.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); this.m_currentlyCharmedEnemy = aiactor2; } }
private static float DealSwordDamageToEnemy(PlayerController owner, AIActor targetEnemy, Vector2 arcOrigin, Vector2 contact, float angle, float damage, float knockback, List <GameActorEffect> statusEffects, float bossDMGMult, float jammedDMGMult) { if (targetEnemy.healthHaver) { float damageToDeal = damage; if (targetEnemy.healthHaver.IsBoss) { damageToDeal *= bossDMGMult; } if (targetEnemy.IsBlackPhantom) { damageToDeal *= jammedDMGMult; } targetEnemy.healthHaver.ApplyDamage(damageToDeal, contact - arcOrigin, owner.ActorName, CoreDamageTypes.None, DamageCategory.Normal, false, null, false); } if (targetEnemy.knockbackDoer) { targetEnemy.knockbackDoer.ApplyKnockback(contact - arcOrigin, knockback, false); } if (statusEffects != null && statusEffects.Count > 0) { foreach (GameActorEffect effect in statusEffects) { targetEnemy.ApplyEffect(effect); } } return(damage); }
private void PreSpawn(AIActor aIActor) { if (badMenGoByeBye.Contains(aIActor.EnemyGuid)) { aIActor.ApplyEffect(ERRORShellsDummyEffect); } }
protected override void DoEffect(PlayerController user) { for (int i = 0; i < 4; i++) { try { var BulletKin = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5"); //float radius = 5; //var random = UnityEngine.Random.insideUnitCircle * radius; //IntVector2 temp = random.ToIntVector2() + LastOwner.CurrentRoom.GetNearestCellToPosition(LastOwner.specRigidbody.UnitCenter).position; // or something like this to get the player's pos relative to the room //IntVector2? spawnPos = LastOwner.CurrentRoom.GetRandomAvailableCell(temp); IntVector2?spawnPos = LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1); if (spawnPos != null) { AIActor TargetActor = AIActor.Spawn(BulletKin.aiActor, spawnPos.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(spawnPos.Value), true, AIActor.AwakenAnimationType.Default, true); TargetActor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(TargetActor.specRigidbody, null, false); TargetActor.gameObject.AddComponent <KillOnRoomClear>(); TargetActor.IsHarmlessEnemy = true; TargetActor.IgnoreForRoomClear = true; TargetActor.HandleReinforcementFallIntoRoom(0f); } } catch (Exception e) { ETGModConsole.Log(e.Message); } } }
private IEnumerator Quake() { yield return(null); RoomHandler room = self.GetAbsoluteRoom(); if (room != null) { Exploder.DoRadialMinorBreakableBreak(base.transform.position, 20); List <AIActor> enemies = room.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (enemies != null && enemies.Count > 0) { for (int i = 0; i < enemies.Count; i++) { AIActor enemy = enemies[i]; if (enemy && enemy.healthHaver && enemy.healthHaver.IsAlive) { float knockback = 20; float dmg = self.baseData.damage; if (self.ProjectilePlayerOwner()) { knockback *= self.ProjectilePlayerOwner().stats.GetStatValue(PlayerStats.StatType.KnockbackMultiplier); if (enemy.healthHaver.IsBoss) { dmg *= self.ProjectilePlayerOwner().stats.GetStatValue(PlayerStats.StatType.DamageToBosses); } if (enemy.aiActor.IsBlackPhantom) { dmg *= self.BlackPhantomDamageMultiplier; } } enemy.healthHaver.ApplyDamage(dmg, UnityEngine.Random.insideUnitCircle, "Quake"); if (enemy.knockbackDoer) { enemy.knockbackDoer.ApplyKnockback(UnityEngine.Random.insideUnitCircle, knockback, false); } List <GameActorEffect> effects = self.GetFullListOfStatusEffects(); if (effects.Count > 0) { foreach (GameActorEffect effect in effects) { enemy.ApplyEffect(effect); } } if (enemy.behaviorSpeculator && self.AppliesStun && UnityEngine.Random.value <= self.StunApplyChance) { enemy.behaviorSpeculator.Stun(self.AppliedStunDuration); } } } } } UnityEngine.Object.Destroy(self.gameObject); yield break; }
private void AuraAction(AIActor aiactor, float d) { if (this.roshamboItem.fireMode) { BulletStatusEffectItem f = (BulletStatusEffectItem)PickupObjectDatabase.GetById(295); aiactor.ApplyEffect(f.FireModifierEffect, 1, null); } else if (this.roshamboItem.poisonMode) { BulletStatusEffectItem f = (BulletStatusEffectItem)PickupObjectDatabase.GetById(204); aiactor.ApplyEffect(f.HealthModifierEffect, 1, null); } else if (this.roshamboItem.electricMode) { aiactor.healthHaver.ApplyDamage(0.45f, Vector2.zero, "Electricity", CoreDamageTypes.Electric, DamageCategory.Normal, false, null, false); } }
private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherCollider) { PlayerController player = this.Owner; PhysicsEngine.SkipCollision = true; RoomHandler currentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom; AIActor component = otherRigidbody.GetComponent <AIActor>(); bool flag = component != null; if (flag) { if (component.healthHaver && component.CenterPosition.GetAbsoluteRoom() == currentRoom) { if (didDamage == false && !player.IsStealthed) { didDamage = true; GameManager.Instance.StartCoroutine(this.DamageTimer()); if (player.HasPickupID(822) || player.HasPickupID(457)) { Gun gun = PickupObjectDatabase.GetById(616) as Gun; GameActorHealthEffect bleedEffect = new GameActorHealthEffect { TintColor = Color.red, DeathTintColor = Color.red, AppliesTint = true, AppliesDeathTint = true, AffectsEnemies = true, AffectsPlayers = false, effectIdentifier = "sharpguonbleed", resistanceType = EffectResistanceType.None, duration = 3f, DamagePerSecondToEnemies = 3f, stackMode = GameActorEffect.EffectStackingMode.Refresh }; component.ApplyEffect(bleedEffect, 1, null); Vector3 vector = component.sprite.WorldBottomLeft.ToVector3ZisY(0); Vector3 vector2 = component.sprite.WorldTopRight.ToVector3ZisY(0); float num = (vector2.y - vector.y) * (vector2.x - vector.x); float num2 = 50f * num; int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime)); int num4 = num3; Vector3 minPosition = vector; Vector3 maxPosition = vector2; Vector3 direction = Vector3.up / 2f; float angleVariance = 120f; float magnitudeVariance = 3f; float? startLifetime = new float?(UnityEngine.Random.Range(12, 20f)); GlobalSparksDoer.DoRandomParticleBurst(num4, minPosition, maxPosition, direction, angleVariance, magnitudeVariance, null, startLifetime, null, GlobalSparksDoer.SparksType.BLOODY_BLOOD); } component.healthHaver.ApplyDamage(4f, Vector2.zero, "Sharp Guon", CoreDamageTypes.None, DamageCategory.Normal, false, null, false); } } } }
public void AIActorMods(AIActor target) { if (target && target.aiActor && target.aiActor.EnemyGuid != null) { string enemyGuid = target?.aiActor?.EnemyGuid; if (!string.IsNullOrEmpty(enemyGuid)) { try { //ETGModConsole.Log("This enemy's Guid is: " + enemyGuid); if (explosiveKin.Contains(enemyGuid)) { target.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); target.gameObject.AddComponent <KillOnRoomClear>(); target.IsHarmlessEnemy = true; target.IgnoreForRoomClear = true; if (target.gameObject.GetComponent <SpawnEnemyOnDeath>()) { Destroy(target.gameObject.GetComponent <SpawnEnemyOnDeath>()); } return; } else if (Owner.HasPickupID(Gungeon.Game.Items["nn:shutdown_shells"].PickupObjectId)) { if (shotgunEnemies.Contains(enemyGuid)) { target.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); target.gameObject.AddComponent <KillOnRoomClear>(); target.IsHarmlessEnemy = true; target.IgnoreForRoomClear = true; if (target.gameObject.GetComponent <SpawnEnemyOnDeath>()) { Destroy(target.gameObject.GetComponent <SpawnEnemyOnDeath>()); } return; } } } catch (Exception e) { ETGModConsole.Log(e.Message); } } } }
public static void AddPermanentCharm(this AIActor actor, GameActorCharmEffect charm = null) { if (charm == null) { actor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); } else { actor.ApplyEffect(charm, 1f, null); } actor.gameObject.AddComponent <KillOnRoomClear>(); actor.IsHarmlessEnemy = true; actor.IgnoreForRoomClear = true; if (actor.gameObject.GetComponent <SpawnEnemyOnDeath>()) { UnityEngine.Object.Destroy(actor.gameObject.GetComponent <SpawnEnemyOnDeath>()); } }
private void ProcessEnemy(AIActor a, float distance) { if (a && a.IsNormalEnemy && a.healthHaver && !a.IsGone && !a.healthHaver.IsBoss) { a.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); a.IgnoreForRoomClear = true; a.gameObject.AddComponent <KillOnRoomClear>(); } }
private void AuraAction(AIActor aiactor, float d) { BulletStatusEffectItem frostbullets = PickupObjectDatabase.GetById(278).GetComponent <BulletStatusEffectItem>(); GameActorFreezeEffect frostfreeze = frostbullets.FreezeModifierEffect; if (aiactor != null && aiactor.healthHaver.CanCurrentlyBeKilled) { aiactor.ApplyEffect(frostfreeze, 0.04f, null); } }
public void DoBigPoison(PlayerController player) { if (player.healthHaver.Armor > 0) { DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.PoisonDef); goopManagerForGoopType.AddGoopCircle(this.m_owner.specRigidbody.UnitCenter, 1f, -4, false, -4); RoomHandler absoluteRoom = base.transform.position.GetAbsoluteRoom(); AIActor randomActiveEnemy = absoluteRoom.GetRandomActiveEnemy(false); randomActiveEnemy.ApplyEffect(Gungeon.Game.Items["irradiated_lead"].GetComponent <BulletStatusEffectItem>().HealthModifierEffect); } }
protected void FreezeAll(AIActor target) { if (target != null) { if (target != null && target.healthHaver.CanCurrentlyBeKilled) { BulletStatusEffectItem frostbullets = PickupObjectDatabase.GetById(278).GetComponent <BulletStatusEffectItem>(); GameActorFreezeEffect frostfreeze = frostbullets.FreezeModifierEffect; target.ApplyEffect(frostfreeze, 5f, null); } } }
public void Greenify(AIActor target) { PlayerController playerController = gun.CurrentOwner as PlayerController; if (playerController.PlayerHasActiveSynergy("No Running Away!") && UnityEngine.Random.value <= 0.25f) { target.ApplyEffect(this.NoMoveDebuff, 1f, null); GameActorHealthEffect tint = new GameActorHealthEffect() { TintColor = Color.green, DeathTintColor = Color.green, AppliesTint = true, AppliesDeathTint = true, AffectsEnemies = true, DamagePerSecondToEnemies = 0f, duration = 10000000, effectIdentifier = "SpearOfJusticeGreening", }; target.ApplyEffect(tint); } }
private void HandleRadialEffects() { if (dealsRadialCurseDamage || Owner.PlayerHasActiveSynergy("Teapotto")) { List <AIActor> activeEnemies = base.transform.position.GetAbsoluteRoom().GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies != null) { for (int i = 0; i < activeEnemies.Count; i++) { AIActor aiactor = activeEnemies[i]; if (aiactor.IsNormalEnemy) { float num = Vector2.Distance(base.specRigidbody.UnitCenter, aiactor.CenterPosition); if (dealsRadialCurseDamage && num <= 4) { float dmgToDo = 0.35f; dmgToDo += (Owner.stats.GetStatValue(PlayerStats.StatType.Curse)) * 0.1f; if (dmgToDo > 1.2f) { dmgToDo = 1.2f; } if (aiactor.healthHaver) { aiactor.healthHaver.ApplyDamage(dmgToDo, Vector2.zero, "Cursed Ceramics", CoreDamageTypes.Magic, DamageCategory.DamageOverTime); } } if (Owner.PlayerHasActiveSynergy("Teapotto") && num <= 4) { aiactor.ApplyEffect(StaticStatusEffects.hotLeadEffect); } else if (Owner.PlayerHasActiveSynergy("Teapotto") && num <= 7 && Owner.CurrentGun && Owner.CurrentGun.PickupObjectId == 596) { aiactor.ApplyEffect(StaticStatusEffects.hotLeadEffect); } } } } } }
//---------------------------- //EXPLOSIVE/RISEN code private void HandleApplyEffect(AIActor aiActor) { if (perilMod == PerilousMods.EXPLOSIVE) { SpawnRPGOnDeath spawnRPG = new SpawnRPGOnDeath() { duration = 9999999999, AffectsEnemies = true, AffectsPlayers = false, // I cannot imagine why it would be applied to a player, but just in case. }; aiActor.ApplyEffect(spawnRPG); } else if (perilMod == PerilousMods.RISEN) //It's "else if" in case of some godforsaken reason that this method gets applied when it shouldn't, it won't accidentally happen. I hope. { SpawnSpentOnDeathEffect spawnSpent = new SpawnSpentOnDeathEffect() { duration = 9999999999, AffectsEnemies = true, AffectsPlayers = false, // I cannot imagine why it would be applied to a player, but just in case. }; aiActor.ApplyEffect(spawnSpent); } }
private void HandleRigidbodyCollision(CollisionData rigidbodyCollision) { if (Owner.healthHaver.Armor > 0) { if (Owner && rigidbodyCollision.OtherRigidbody) { AIActor aiActor = rigidbodyCollision.OtherRigidbody.aiActor; if (aiActor != null && aiActor.healthHaver.CanCurrentlyBeKilled) { aiActor.ApplyEffect(Gungeon.Game.Items["irradiated_lead"].GetComponent <BulletStatusEffectItem>().HealthModifierEffect); } } } }
private void HandleRigidbodyCollision(CollisionData rigidbodyCollision) { BulletStatusEffectItem frostbullets = PickupObjectDatabase.GetById(278).GetComponent <BulletStatusEffectItem>(); GameActorFreezeEffect frostfreeze = frostbullets.FreezeModifierEffect; if (Owner && rigidbodyCollision.OtherRigidbody) { AIActor aiActor = rigidbodyCollision.OtherRigidbody.aiActor; if (aiActor != null && aiActor.healthHaver.CanCurrentlyBeKilled) { aiActor.ApplyEffect(frostfreeze, 5f, null); } } }
private void OnNewEnemyAppeared(AIActor aiactor) { if (this.Owner.HasMTGConsoleID("shotga_cola") || this.Owner.HasMTGConsoleID("shotgun_coffee") || this.Owner.HasMTGConsoleID("double_vision") || this.Owner.HasMTGConsoleID("potion_of_gun_friendship") || this.Owner.HasMTGConsoleID("potion_of_lead_skin") || this.Owner.HasMTGConsoleID("old_knight's_flask") || this.Owner.HasMTGConsoleID("Orange")) { this.charmChance = 1f; } else { this.charmChance = 0.75f; } if (aiactor != null && aiactor.IsBlackPhantom && UnityEngine.Random.value <= this.charmChance) { aiactor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); aiactor.IgnoreForRoomClear = true; this.affectedEnemies.Add(aiactor); } }
public static void DoRadialIgnite(GameActorFireEffect fire, Vector3 position, float radius, VFXPool hitVFX = null) { List <HealthHaver> allHealthHavers = StaticReferenceManager.AllHealthHavers; if (allHealthHavers != null) { float num = radius * radius; for (int i = 0; i < allHealthHavers.Count; i++) { HealthHaver healthHaver = allHealthHavers[i]; if (healthHaver) { if (healthHaver.gameObject.activeSelf) { if (healthHaver.aiActor) { AIActor aiActor = healthHaver.aiActor; if (!aiActor.IsGone) { if (aiActor.isActiveAndEnabled) { if ((aiActor.CenterPosition - position.XY()).sqrMagnitude <= num) { aiActor.ApplyEffect(fire, 1f, null); if (hitVFX != null) { if (aiActor.specRigidbody.HitboxPixelCollider != null) { PixelCollider pixelCollider = aiActor.specRigidbody.GetPixelCollider(ColliderType.HitBox); Vector2 v = BraveMathCollege.ClosestPointOnRectangle(position, pixelCollider.UnitBottomLeft, pixelCollider.UnitDimensions); hitVFX.SpawnAtPosition(v, 0f, null, null, null, null, false, null, null, false); } else { hitVFX.SpawnAtPosition(aiActor.CenterPosition, 0f, null, null, null, null, false, null, null, false); } } } } } } } } } } }
protected override void DoEffect(PlayerController user) { if (base.LastOwner && base.LastOwner.CurrentRoom != null && this.x % 3 == 1) { base.StartCoroutine(this.cheeseWheel1()); base.StartCoroutine(this.cheeseWheel2()); } else if (base.LastOwner && base.LastOwner.CurrentRoom != null && this.x % 3 == 0) { this.crosshair(); } else if (base.LastOwner && this.x % 3 == 2) { for (int i = 0; i < 12; i++) { try { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("be0683affb0e41bbb699cb7125fdded6"); IntVector2?intVector = new IntVector2?(base.LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1)); bool flag = intVector != null; if (flag) { AIActor aiactor = AIActor.Spawn(orLoadByGuid.aiActor, intVector.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(intVector.Value), true, AIActor.AwakenAnimationType.Default, true); aiactor.OverrideHitEnemies = true; aiactor.CollisionDamage = 5f; aiactor.CollisionDamageTypes = CoreDamageTypes.Electric; aiactor.CollisionDamage = 5f; aiactor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null); aiactor.IgnoreForRoomClear = true; //aiactor.ApplyEffect(this.CharmEffect, 1f, null); aiactor.gameObject.AddComponent <KillOnRoomClear>(); } } catch (Exception ex) { ETGModConsole.Log(ex.Message, false); } } } this.x++; }
public void PostProjectile(Projectile proj, float f) { if (UnityEngine.Random.value <= 0.15f) { proj.AdjustPlayerProjectileTint(new Color(70f / 255f, 227f / 255f, 174f / 255f).WithAlpha(0.75f), 1, 0); proj.OnHitEnemy += this.OnProjectileHitEnemy; } if (this.m_owner.PlayerHasActiveSynergy("#HI_TECH")) { proj.OnHitEnemy += delegate(Projectile proj2, SpeculativeRigidbody enemyRigidbody, bool fatal) { if (enemyRigidbody.aiActor != null) { AIActor aiactor = enemyRigidbody.aiActor; if (aiactor.gameObject.GetComponent <SlicedBehavior>() != null) { aiactor.ApplyEffect((PickupObjectDatabase.GetById(204) as BulletStatusEffectItem).HealthModifierEffect); } } }; } }