protected override void DoEffect(PlayerController user) { base.DoEffect(user); AIActor actor = user.CurrentRoom.GetNearestEnemy(Camera.main.ScreenToWorldPoint(Input.mousePosition), out _); if (actor && actor.healthHaver && !actor.healthHaver.IsBoss) { BoxOTools.AddPermanentCharm(actor); if (user.PlayerHasActiveSynergy("Flock Together") && user.CurrentRoom != null) { List <AIActor> synergyActors = user.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); for (int i = 0; i < synergyActors.Count; i++) { if (Vector2.Distance(synergyActors[i].specRigidbody.UnitCenter, actor.specRigidbody.UnitCenter) < 5) { BoxOTools.AddPermanentCharm(synergyActors[i]); } } } } if (user.PlayerHasActiveSynergy("Birds of a Feather") && user.CurrentRoom != null) { AIActor bird = BoxOTools.SummonAtRandomPosition("ed37fa13e0fa4fcf8239643957c51293", user); BoxOTools.AddPermanentCharm(bird); } }
protected override void DoEffect(PlayerController user) { base.DoEffect(user); if (user.CurrentRoom != null && user) { List <AIActor> activeEnemies = user.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies.Count != 0 && activeEnemies != null) { for (int counter = 0; counter < activeEnemies.Count; counter++) { AIActor actor = activeEnemies[counter]; if (actor && actor.healthHaver && !actor.healthHaver.IsBoss && actor.gameObject.GetComponent <GhostAllyComponent>() == null && actor.healthHaver.IsVulnerable && actor.IsNormalEnemy && !actor.IsMimicEnemy && actor.GetResistanceForEffectType(EffectResistanceType.Charm) != 1) { List <int> Colors = new List <int> { 7, 141, 222 }; GameActorCharmEffect ghostCharm = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect; ghostCharm.OverheadVFX = null; ghostCharm.TintColor = new Color(Colors[0], Colors[1], Colors[2]); ghostCharm.TintColor.a /= 100; string guid = actor.EnemyGuid; AIActor aiactor = BoxOTools.SummonAtRandomPosition(guid, user); aiactor.AddPermanentCharm(ghostCharm); aiactor.gameObject.AddComponent <GhostAllyComponent>(); aiactor.HandleReinforcementFallIntoRoom(counter / 10); } } } } }
public void MineSynergy() { if (Owner.PlayerHasActiveSynergy("Into the Depths")) { if (Owner.CurrentRoom != null) { AIActor actor = BoxOTools.SummonAtRandomPosition("3cadf10c489b461f9fb8814abc1a09c1", Owner); actor.AddPermanentCharm(); } } }
private void OnEnemyDamaged(float damage, bool fatal, HealthHaver enemy) { if (!Owner.PlayerHasActiveSynergy("REANIMATE")) { if (fatal && enemy && enemy.aiActor && enemy.aiActor.EnemyGuid != "699cd24270af4cd183d671090d8323a1") { if (Owner.CurrentRoom != null) { if (BoxOTools.BasicRandom(0.975f) && DoneKill) { try { AIActor aiactor = BoxOTools.SummonAtRandomPosition("699cd24270af4cd183d671090d8323a1", Owner); if (base.Owner.PlayerHasActiveSynergy("keysight")) { aiactor.IsHarmlessEnemy = true; aiactor.BecomeBlackPhantom(); } if (!base.Owner.PlayerHasActiveSynergy("keysight")) { aiactor.PreventBlackPhantom = true; } aiactor.HandleReinforcementFallIntoRoom(0f); DoneKill = false; } catch (Exception Error) { ETGModConsole.Log(Error.Message); } } } } } else { if (BoxOTools.BasicRandom(0.8f) && enemy && enemy.aiActor && Owner.CurrentRoom != null && fatal) { if (BoxOTools.BasicRandom(0.3f) || base.Owner.PlayerHasActiveSynergy("keysight")) { AIActor aiactor = BoxOTools.SummonAtRandomPosition("336190e29e8a4f75ab7486595b700d4a", Owner); BoxOTools.AddPermanentCharm(aiactor); aiactor.HandleReinforcementFallIntoRoom(0f); } else { AIActor aiactor = BoxOTools.SummonAtRandomPosition("95ec774b5a75467a9ab05fa230c0c143", Owner); BoxOTools.AddPermanentCharm(aiactor); aiactor.HandleReinforcementFallIntoRoom(0f); } } } }
public void OnNewRoom() { List <AIActor> activeEnemies = base.Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); if (activeEnemies != null && (base.Owner.CurrentRoom.area.PrototypeRoomCategory != PrototypeDungeonRoom.RoomCategory.SPECIAL)) { int count = activeEnemies.Count; for (int i = 0; i < count; i++) { if (activeEnemies[i] && activeEnemies[i].HasBeenEngaged && activeEnemies[i].healthHaver && activeEnemies[i].IsNormalEnemy && !activeEnemies[i].healthHaver.IsDead && !activeEnemies[i].healthHaver.IsBoss && !activeEnemies[i].IsTransmogrified && activeEnemies[i].EnemyGuid != "22fc2c2c45fb47cf9fb5f7b043a70122") { AIActor actor2 = BoxOTools.SummonAtRandomPosition(activeEnemies[i].EnemyGuid, base.Owner); actor2.CanDropCurrency = true; actor2.AssignedCurrencyToDrop = activeEnemies[i].AssignedCurrencyToDrop; actor2.HandleReinforcementFallIntoRoom(); } } } }