protected void AffectEnemy(AIActor randomActiveEnemy) { if (randomActiveEnemy && randomActiveEnemy.behaviorSpeculator) { randomActiveEnemy.Transmogrify(EnemyDatabase.GetOrLoadByName("chicken"), (GameObject)ResourceCache.Acquire("Global VFX/VFX_Item_Spawn_Poof")); } }
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 EnteredCombat() { if (Owner != null && Owner.CurrentRoom != null && Owner.CurrentRoom.HasActiveEnemies(RoomHandler.ActiveEnemyType.RoomClear)) { AIActor enemy = Owner.CurrentRoom.GetRandomActiveEnemy(false); enemy.Transmogrify(EnemyDatabase.GetOrLoadByGuid(EnemyGuidDatabase.Entries["chicken"]), (GameObject)ResourceCache.Acquire("Global VFX/VFX_Item_Spawn_Poof")); } }
public override void Update() { if (Owner && !Dungeon.IsGenerating && Owner.IsInCombat && base.transform.position.GetAbsoluteRoom() == Owner.CurrentRoom) { if (timer > 0) { timer -= BraveTime.DeltaTime; } if (timer <= 0) { //do stuff bool doAnim = false; if ((GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.HELLGEON) || Owner.PlayerHasActiveSynergy("They Grow Inside")) { float chance = 0.25f; if (Owner.PlayerHasActiveSynergy("They Grow Inside")) { chance = 0.50f; } if (UnityEngine.Random.value <= chance) { doAnim = true; VolleyReplacementSynergyProcessor shotgrubProcessor = (PickupObjectDatabase.GetById(347) as Gun).GetComponent <VolleyReplacementSynergyProcessor>(); Projectile bullet = shotgrubProcessor.SynergyVolley.projectiles[0].projectiles[0].projectile; GameObject spawnedProj = ProjSpawnHelper.SpawnProjectileTowardsPoint(bullet.gameObject, base.sprite.WorldCenter, base.specRigidbody.UnitCenter.GetPositionOfNearestEnemy(false, true), 0, 15); Projectile component = spawnedProj.GetComponent <Projectile>(); if (component != null) { component.Owner = Owner; component.Shooter = Owner.specRigidbody; //COMPANION SHIT component.TreatedAsNonProjectileForChallenge = true; component.baseData.damage *= Owner.stats.GetStatValue(PlayerStats.StatType.Damage); component.baseData.speed *= Owner.stats.GetStatValue(PlayerStats.StatType.ProjectileSpeed); component.baseData.force *= Owner.stats.GetStatValue(PlayerStats.StatType.KnockbackMultiplier); component.AdditionalScaleMultiplier *= Owner.stats.GetStatValue(PlayerStats.StatType.PlayerBulletScale); component.UpdateSpeed(); base.HandleCompanionPostProcessProjectile(component); } } } if (UnityEngine.Random.value <= 0.02f) { doAnim = true; bool shouldJam = false; if (Owner.PlayerHasActiveSynergy("Cursed Ceramics")) { shouldJam = true; } AIActor fairy = CompanionisedEnemyUtility.SpawnCompanionisedEnemy(Owner, "c182a5cb704d460d9d099a47af49c913", base.specRigidbody.UnitCenter.ToIntVector2(), false, ExtendedColours.brown, 10, 2, shouldJam, true); fairy.specRigidbody.CollideWithOthers = false; } if (UnityEngine.Random.value <= 0.05f && Owner.PlayerHasActiveSynergy("The Potter Boy")) { doAnim = true; AIActor randomActiveEnemy = base.transform.position.GetAbsoluteRoom().GetRandomActiveEnemy(false); if (randomActiveEnemy && randomActiveEnemy.IsNormalEnemy && randomActiveEnemy.healthHaver && !randomActiveEnemy.healthHaver.IsBoss) { randomActiveEnemy.Transmogrify(EnemyDatabase.GetOrLoadByGuid("76bc43539fc24648bff4568c75c686d1"), (GameObject)ResourceCache.Acquire("Global VFX/VFX_Item_Spawn_Poof")); } } if (doAnim && this.aiAnimator) { this.aiAnimator.PlayUntilFinished("spawnobject", false, null, -1f, false); } timer = 2f; } if (RadialTimer > 0) { RadialTimer -= BraveTime.DeltaTime; } if (RadialTimer <= 0) { HandleRadialEffects(); RadialTimer = 0.05f; } } base.Update(); }