private void BrotherSpeechDriver_DoInitialSightResponse(On.RoR2.CharacterSpeech.BrotherSpeechDriver.orig_DoInitialSightResponse orig, RoR2.CharacterSpeech.BrotherSpeechDriver self) { bool isThereAPaladin = false; ReadOnlyCollection <CharacterBody> characterBodies = CharacterBody.readOnlyInstancesList; for (int i = 0; i < characterBodies.Count; i++) { BodyIndex bodyIndex = characterBodies[i].bodyIndex; isThereAPaladin |= (bodyIndex == BodyCatalog.FindBodyIndex(Modules.Prefabs.paladinPrefab)); } if (isThereAPaladin) { RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo[] responsePool = new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo[] { new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo { duration = 1f, maxWait = 4f, mustPlay = true, priority = 0f, token = "BROTHER_SEE_PALADIN_1" }, new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo { duration = 1f, maxWait = 4f, mustPlay = true, priority = 0f, token = "BROTHER_SEE_PALADIN_2" }, new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo { duration = 1f, maxWait = 4f, mustPlay = true, priority = 0f, token = "BROTHER_SEE_PALADIN_3" } }; self.SendReponseFromPool(responsePool); } orig(self); }
private void BrotherSpeechDriver_OnBodyKill(On.RoR2.CharacterSpeech.BrotherSpeechDriver.orig_OnBodyKill orig, RoR2.CharacterSpeech.BrotherSpeechDriver self, DamageReport damageReport) { if (damageReport.victimBody) { if (damageReport.victimBodyIndex == BodyCatalog.FindBodyIndex(Modules.Prefabs.paladinPrefab)) { RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo[] responsePool = new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo[] { new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo { duration = 1f, maxWait = 4f, mustPlay = true, priority = 0f, token = "BROTHER_KILL_PALADIN_1" }, new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo { duration = 1f, maxWait = 4f, mustPlay = true, priority = 0f, token = "BROTHER_KILL_PALADIN_2" }, new RoR2.CharacterSpeech.CharacterSpeechController.SpeechInfo { duration = 1f, maxWait = 4f, mustPlay = true, priority = 0f, token = "BROTHER_KILL_PALADIN_3" } }; self.SendReponseFromPool(responsePool); } } orig(self, damageReport); }