public void knightPlacer(PlayerController owner) { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("ec8ea75b557d4e7b8ceeaacdf6f8238c"); IntVector2 aim = Vector2Extensions.ToIntVector2(owner.unadjustedAimPoint, VectorConversions.Round); RoomHandler room = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(aim); if (room != null && room == owner.CurrentRoom && owner.IsInCombat) { AIActor aiActor = AIActor.Spawn(orLoadByGuid.aiActor, owner.CenterPosition, room, true, AIActor.AwakenAnimationType.Default, true); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(aiActor.specRigidbody, null, false); aiActor.CanTargetEnemies = true; aiActor.CanTargetPlayers = false; aiActor.IsHarmlessEnemy = true; aiActor.CanDropCurrency = false; aiActor.IgnoreForRoomClear = true; aiActor.MovementSpeed = 6.3f; aiActor.gameObject.AddComponent <KillOnRoomClear>(); aiActor.reinforceType = AIActor.ReinforceType.Instant; aiActor.HandleReinforcementFallIntoRoom(.1f); nut = aiActor; MindControlEffect orAddComponent = aiActor.gameObject.GetOrAddComponent <MindControlEffect>(); orAddComponent.owner = (this.gun.CurrentOwner as PlayerController); } }
// Token: 0x06000056 RID: 86 RVA: 0x00004194 File Offset: 0x00002394 public void KnightPlacer(PlayerController owner) { try { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("ec8ea75b557d4e7b8ceeaacdf6f8238c"); IntVector2 intVector = Vector2Extensions.ToIntVector2(owner.unadjustedAimPoint, (VectorConversions)2); RoomHandler absoluteRoomFromPosition = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(intVector); bool flag = absoluteRoomFromPosition != null && absoluteRoomFromPosition == owner.CurrentRoom && owner.IsInCombat; if (flag) { AIActor aiactor = AIActor.Spawn(orLoadByGuid.aiActor, owner.CenterPosition, absoluteRoomFromPosition, true, (AIActor.AwakenAnimationType) 2, true); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(aiactor.specRigidbody, null, false); aiactor.CanTargetEnemies = true; aiactor.CanTargetPlayers = false; aiactor.IsHarmlessEnemy = true; aiactor.CanDropCurrency = false; aiactor.IgnoreForRoomClear = true; aiactor.MovementSpeed = 5.95f; aiactor.CompanionOwner = owner; aiactor.IsBuffEnemy = true; aiactor.isPassable = true; aiactor.gameObject.AddComponent <KillOnRoomClear>(); aiactor.reinforceType = (AIActor.ReinforceType) 2; aiactor.HandleReinforcementFallIntoRoom(0.1f); //added this so the player doesn't collide with the nut when dodge rolling, he goes through companions aiactor.gameObject.AddComponent <CompanionController>(); CompanionController component = aiactor.gameObject.GetComponent <CompanionController>(); component.Initialize(owner); this.nut = aiactor; MindControlEffect orAddComponent = GameObjectExtensions.GetOrAddComponent <MindControlEffect>(aiactor.gameObject); orAddComponent.owner = (this.gun.CurrentOwner as PlayerController); // to make the nut invincible against the player effects or any other damage effects if (aiactor.healthHaver != null) { aiactor.healthHaver.PreventAllDamage = true; } // to prevent the attacks of the nut from damaging the player if (aiactor.bulletBank != null) { AIBulletBank bulletBank = aiactor.bulletBank; bulletBank.OnProjectileCreated = (Action <Projectile>)Delegate.Combine(bulletBank.OnProjectileCreated, new Action <Projectile>(CopperChariot.OnPostProcessProjectile)); } if (aiactor.aiShooter != null) { AIShooter aiShooter = aiactor.aiShooter; aiShooter.PostProcessProjectile = (Action <Projectile>)Delegate.Combine(aiShooter.PostProcessProjectile, new Action <Projectile>(CopperChariot.OnPostProcessProjectile)); } } } catch (Exception e) { Tools.Print("Copper KnightPlacer", "FFFFFF", true); Tools.PrintException(e); } }
void Start() { mainCamera = Camera.main; input = GetComponent <IAgentInput>(); mindControl = GetComponent <MindControlEffect>(); currentAgent = startAgent; currentAgent.input = input; //currentAgent.defaultInput = input; }
private void HandleHitEnemy(Projectile arg1, SpeculativeRigidbody arg2, bool arg3) { if (arg2 && arg2.aiActor) { AIActor aiActor = arg2.aiActor; if (aiActor.IsNormalEnemy && !aiActor.healthHaver.IsBoss && !aiActor.IsHarmlessEnemy && !aiActor.gameObject.GetComponent <MindControlEffect>()) { MindControlEffect orAddComponent = aiActor.gameObject.GetOrAddComponent <MindControlEffect>(); orAddComponent.owner = (arg1.Owner as PlayerController); } } }
private IEnumerator HandleSwing(PlayerController user, Vector2 aimVec, float rayDamage, float rayLength) { float elapsed = 0f; while (elapsed < .1) { elapsed += BraveTime.DeltaTime; SpeculativeRigidbody hitRigidbody = this.IterativeRaycast(user.CenterPosition, aimVec, rayLength, int.MaxValue, user.specRigidbody); if (hitRigidbody && hitRigidbody.aiActor && !hitRigidbody.aiActor.healthHaver.IsBoss && hitRigidbody.aiActor.IsNormalEnemy) { hitRigidbody.aiActor.healthHaver.ApplyDamage(rayDamage, aimVec, "Hero's Sword", CoreDamageTypes.None, DamageCategory.Normal, false, null, false); user.IsEthereal = true; user.SetIsStealthed(true, "cause they just are"); PassiveItem.IncrementFlag(user, typeof(LiveAmmoItem)); if (modifierController == 0) { user.MovementModifiers += this.NoMotionModifier; user.IsStationary = true; modifierController++; } user.CurrentStoneGunTimer = 9999999f; this.LastOwner.stats.RecalculateStats(LastOwner, true); host = hitRigidbody.aiActor; vangaurd = true; MindControlEffect orAddComponent = host.gameObject.GetOrAddComponent <MindControlEffect>(); orAddComponent.owner = user; host.CompanionOwner = user; host.aiActor.SetAIMovementContribution(Vector2.zero); host.BaseMovementSpeed = 15; host.IsWorthShootingAt = true; host.IgnoreForRoomClear = true; host.HitByEnemyBullets = true; host.UniquePlayerTargetFlag = true; CompanionisedEnemyBulletModifiers friend = host.gameObject.GetOrAddComponent <CompanionisedEnemyBulletModifiers>(); friend.Start(); host.Update(); TargetNumber1(host, user); CamToggle = 1; } yield return(null); } yield break; }
public void knightPlacer(PlayerController owner) { IntVector2 aim = Vector2Extensions.ToIntVector2(owner.unadjustedAimPoint, VectorConversions.Round); RoomHandler room = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(aim); if (room != null && room == owner.CurrentRoom && owner.IsInCombat) { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("ec8ea75b557d4e7b8ceeaacdf6f8238c"); AIActor aiActor = AIActor.Spawn(orLoadByGuid.aiActor, owner.CenterPosition, room, true, AIActor.AwakenAnimationType.Spawn, true); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(aiActor.specRigidbody, null, false); aiActor.CanTargetEnemies = true; aiActor.CanTargetPlayers = false; aiActor.IsHarmlessEnemy = true; aiActor.CanDropCurrency = false; aiActor.IgnoreForRoomClear = true; aiActor.MovementSpeed = 6.1f; aiActor.CompanionOwner = owner; aiActor.IsBuffEnemy = true; aiActor.isPassable = true; aiActor.gameObject.AddComponent <KillOnRoomClear>(); aiActor.reinforceType = AIActor.ReinforceType.Instant; aiActor.HandleReinforcementFallIntoRoom(.1f); nut = aiActor; MindControlEffect mindControl = aiActor.gameObject.GetOrAddComponent <MindControlEffect>(); mindControl.owner = (this.gun.CurrentOwner as PlayerController); aiActor.aiShooter.IsReallyBigBoy = true; aiActor.aiShooter.customShootCooldownPeriod = .25f; aiActor.Update(); if (nut.bulletBank != null) { AIBulletBank bulletBank = nut.bulletBank; bulletBank.OnProjectileCreated = (Action <Projectile>)Delegate.Combine(bulletBank.OnProjectileCreated, new Action <Projectile>(CopperChariot.OnPostProcessProjectile)); } if (nut.aiShooter != null) { AIShooter aiShooter = nut.aiShooter; aiShooter.PostProcessProjectile = (Action <Projectile>)Delegate.Combine(aiShooter.PostProcessProjectile, new Action <Projectile>(CopperChariot.OnPostProcessProjectile)); } } }
//private void BossHelp() //{ // AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5"); // IntVector2? intVector = new IntVector2?(this.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.CanTargetEnemies = true; // aiactor.CanTargetPlayers = false; // PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(aiactor.specRigidbody, null, false); // aiactor.gameObject.AddComponent<KillOnRoomClear>(); // aiactor.IgnoreForRoomClear = true; // aiactor.HandleReinforcementFallIntoRoom(0f); // if (aiactor.IsNormalEnemy && !aiactor.healthHaver.IsBoss && !aiactor.gameObject.GetComponent<MindControlEffect>()) // { // MindControlEffect orAddComponent = aiactor.gameObject.GetOrAddComponent<MindControlEffect>(); // orAddComponent.owner = this.LastOwner; // } // } //} protected void AffectEnemy(AIActor target) { if (target != null) { //if (target.healthHaver.IsBoss) //{ // this.BossHelp(); //} if (target.IsNormalEnemy && !target.healthHaver.IsBoss && !target.gameObject.GetComponent <MindControlEffect>()) { target.behaviorSpeculator.Stun(0.2f, true); MindControlEffect orAddComponent = target.gameObject.GetOrAddComponent <MindControlEffect>(); orAddComponent.owner = this.LastOwner; } } }
protected override void DoEffect(PlayerController player) { if (numberOfUses == 2 && host == null) { //head IntVector2 aim = Vector2Extensions.ToIntVector2(player.unadjustedAimPoint, VectorConversions.Round); RoomHandler room = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(aim); AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("c2f902b7cbe745efb3db4399927eab34"); AIActor aiActor = AIActor.Spawn(orLoadByGuid.aiActor, player.CenterPosition, room, true, AIActor.AwakenAnimationType.Spawn, true); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(aiActor.specRigidbody, null, false); aiActor.CanTargetEnemies = true; aiActor.CanTargetPlayers = false; aiActor.IgnoreForRoomClear = true; aiActor.MovementSpeed = 10f; aiActor.CompanionOwner = player; aiActor.reinforceType = AIActor.ReinforceType.Instant; aiActor.HandleReinforcementFallIntoRoom(.1f); host = aiActor; MindControlEffect mindControl = aiActor.gameObject.GetOrAddComponent <MindControlEffect>(); mindControl.owner = player; player.IsEthereal = true; player.SetIsStealthed(true, "cause they just are"); PassiveItem.IncrementFlag(player, typeof(LiveAmmoItem)); if (modifierController == 0) { player.MovementModifiers += this.NoMotionModifier; player.IsStationary = true; modifierController++; } player.CurrentStoneGunTimer = 9999999f; this.LastOwner.stats.RecalculateStats(LastOwner, true); CamToggle = 1; } if (numberOfUses == 1) { player.CurrentStoneGunTimer = 1f; player.MovementModifiers -= this.NoMotionModifier; player.IsStationary = false; modifierController = 0; player.IsEthereal = false; if (host != null) { host.healthHaver.ApplyDamage(99999, Vector2.zero, "unbound", CoreDamageTypes.Magic, DamageCategory.Unstoppable, true, null, false); host = null; } player.SetIsStealthed(false, "cause they just are"); CamToggle = 0; GameManager.Instance.MainCameraController.StartTrackingPlayer(); GameManager.Instance.MainCameraController.SetManualControl(false, true); } }
// Token: 0x06000056 RID: 86 RVA: 0x00004194 File Offset: 0x00002394 public void KnightPlacer(PlayerController owner) { try { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("ec8ea75b557d4e7b8ceeaacdf6f8238c"); IntVector2 intVector = Vector2Extensions.ToIntVector2(owner.unadjustedAimPoint, (VectorConversions)2); RoomHandler absoluteRoomFromPosition = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(intVector); bool flag = absoluteRoomFromPosition != null && absoluteRoomFromPosition == owner.CurrentRoom && owner.IsInCombat; if (flag) { AIActor aiactor = AIActor.Spawn(orLoadByGuid.aiActor, owner.CenterPosition, absoluteRoomFromPosition, true, (AIActor.AwakenAnimationType) 2, true); PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(aiactor.specRigidbody, null, false); aiactor.CanTargetEnemies = true; aiactor.CanTargetPlayers = false; aiactor.IsHarmlessEnemy = true; aiactor.CanDropCurrency = false; aiactor.IgnoreForRoomClear = true; aiactor.MovementSpeed = 5.95f; aiactor.CompanionOwner = owner; aiactor.IsBuffEnemy = true; aiactor.isPassable = true; aiactor.gameObject.AddComponent <KillOnRoomClear>(); aiactor.reinforceType = (AIActor.ReinforceType) 2; aiactor.HandleReinforcementFallIntoRoom(0.1f); aiactor.specRigidbody.AddCollisionLayerIgnoreOverride( CollisionMask.LayerToMask(CollisionLayer.EnemyHitBox, CollisionLayer.EnemyCollider, CollisionLayer.PlayerHitBox, CollisionLayer.Projectile, CollisionLayer.PlayerCollider, CollisionLayer.PlayerBlocker, CollisionLayer.BeamBlocker) ); aiactor.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.BulletBlocker, CollisionLayer.BulletBreakable, CollisionLayer.Trap)); /* * aiactor.gameObject.AddComponent<CompanionController>(); * CompanionController component = aiactor.gameObject.GetComponent<CompanionController>(); * component.Initialize(owner); */ this.nut = aiactor; MindControlEffect orAddComponent = GameObjectExtensions.GetOrAddComponent <MindControlEffect>(aiactor.gameObject); orAddComponent.owner = (this.gun.CurrentOwner as PlayerController); if (aiactor.healthHaver != null) { aiactor.healthHaver.PreventAllDamage = true; } if (aiactor.bulletBank != null) { AIBulletBank bulletBank = aiactor.bulletBank; bulletBank.OnProjectileCreated = (Action <Projectile>)Delegate.Combine(bulletBank.OnProjectileCreated, new Action <Projectile>(this.OnPostProcessProjectile)); } if (aiactor.aiShooter != null) { AIShooter aiShooter = aiactor.aiShooter; aiShooter.PostProcessProjectile = (Action <Projectile>)Delegate.Combine(aiShooter.PostProcessProjectile, new Action <Projectile>(this.OnPostProcessProjectile)); } aiactor.LocalTimeScale = 3; } } catch (Exception e) { Tools.Print("Copper KnightPlacer", "FFFFFF", true); Tools.PrintException(e); } }