public static void LeafGolemThrowLeavesSpecialState_OnThrow(On.LeafGolemThrowLeavesSpecialState.orig_OnThrow orig, LeafGolemThrowLeavesSpecialState self) { specialState = self; specialStateData = new DynData <LeafGolemThrowLeavesSpecialState>(self); boss = specialStateData.Get <LeafGolemBoss>("boss"); boss.ClearOnThrowHandlers(); specialStateData.Set("attackSFX", Manager <AudioManager> .Instance.PlaySoundEffect(boss.groundAttackSFX)); boss.Projectile_1.gameObject.SetActive(true); boss.Projectile_2.gameObject.SetActive(true); projectile_3.gameObject.SetActive(true); projectile_4.gameObject.SetActive(true); boss.Projectile_1.transform.position = boss.downProjectileSpawnPos.position; boss.Projectile_2.transform.position = boss.downProjectileSpawnPos.position + Vector3.down * 0.75f; projectile_3.transform.position = boss.downProjectileSpawnPos.position; projectile_4.transform.position = boss.downProjectileSpawnPos.position + Vector3.down * 0.75f; Vector3 group1Target = boss.Projectile_1.transform.position + Vector3.left * 10f; float duration = Vector3.Distance(boss.Projectile_1.transform.position, group1Target) / (int)(self.projectileSpeed * 1.5f); boss.Projectile_1.GoToQuad(group1Target, duration); boss.Projectile_2.GoToQuad(group1Target + Vector3.down * 0.75f, duration); Vector3 group2Target = projectile_3.transform.position + Vector3.right * 10f; float duration2 = Vector3.Distance(projectile_3.transform.position, group2Target) / (int)(self.projectileSpeed * 1.5f); projectile_3.GoToQuad(group2Target, duration2); projectile_4.GoToQuad(group2Target + Vector3.down * 0.75f, duration2); boss.Projectile_1.onReachedPosition += OnProjectileReachedUpApart; boss.Projectile_2.onReachedPosition += OnProjectileReachedUpApart; projectile_3.onReachedPosition += OnProjectileReachedUpApart; projectile_4.onReachedPosition += OnProjectileReachedUpApart; }
public static void LeafGolemThrowLeavesSpecialState_StateExit(On.LeafGolemThrowLeavesSpecialState.orig_StateExit orig, LeafGolemThrowLeavesSpecialState self) { orig(self); if (projectile_3 != null && !boss.IsDead()) { projectile_3.gameObject.SetActive(false); } if (projectile_4 != null && !boss.IsDead()) { projectile_4.gameObject.SetActive(false); } }