public void CreateBossFight() { ScriptedCombatEncounter encounter = new ScriptedCombatEncounter(); }
public static bool Init() { On.RoR2.TeleporterInteraction.Awake += (orig, self) => { orig(self); if (NetworkServer.active) { if (Run.instance.stageRngGenerator.RangeFloat(0, 100) < 5) { self.shouldAttemptToSpawnGoldshoresPortal = true; } } }; //spawn extra beacons based on goldspawns On.RoR2.GoldshoresMissionController.SpawnBeacons += (orig, self) => { self.beaconsToSpawnOnMap += GoldSpawns; self.beaconsRequiredToSpawnBoss = 0; orig(self); }; //spawn the ally based on halcyon seeds On.RoR2.TeleporterInteraction.ChargingState.TrySpawnTitanGoldServer += (orig, self) => { SpawnTitanByCompletion(TeamIndex.Player); }; //logic for spawning the AI in goldshores On.EntityStates.Missions.Goldshores.GoldshoresBossfight.SpawnBoss += (orig, self) => { ScriptedCombatEncounter scriptedCombatEncounter = self.GetFieldValue <ScriptedCombatEncounter>("scriptedCombatEncounter"); if (!scriptedCombatEncounter) { scriptedCombatEncounter = UnityEngine.Object.Instantiate <GameObject>(GoldshoresBossfight.combatEncounterPrefab).GetComponent <ScriptedCombatEncounter>(); scriptedCombatEncounter.GetComponent <BossGroup>().dropPosition = self.GetFieldValue <GoldshoresMissionController>("missionController").bossSpawnPosition; NetworkServer.Spawn(scriptedCombatEncounter.gameObject); } CharacterBody tempBody = SpawnTitanByCompletion(TeamIndex.Monster); if (tempBody != null) { scriptedCombatEncounter.combatSquad.AddMember(tempBody.master); } self.SetFieldValue <ScriptedCombatEncounter>("scriptedCombatEncounter", scriptedCombatEncounter); orig(self); }; //handle super elite equipments On.RoR2.CharacterBody.OnEquipmentGained += (orig, self, def) => { if (def.equipmentIndex == EquipmentIndex.AffixGold) { self.AddBuff(BuffIndex.BugWings); self.AddBuff(BuffIndex.AffixBlue); self.AddBuff(BuffIndex.AffixWhite); self.AddBuff(BuffIndex.AffixRed); } if (def.equipmentIndex == EquipmentIndex.AffixYellow) { self.AddBuff(BuffIndex.AffixHaunted); self.AddBuff(BuffIndex.AffixHauntedRecipient); self.AddBuff(BuffIndex.AffixPoison); self.AddBuff(BuffIndex.AffixBlue); self.AddBuff(BuffIndex.AffixWhite); self.AddBuff(BuffIndex.AffixRed); } orig(self, def); }; //handle super elite equipments On.RoR2.CharacterBody.OnEquipmentLost += (orig, self, def) => { if (def.equipmentIndex == EquipmentIndex.AffixGold) { self.RemoveBuff(BuffIndex.BugWings); self.RemoveBuff(BuffIndex.AffixBlue); self.RemoveBuff(BuffIndex.AffixWhite); self.RemoveBuff(BuffIndex.AffixRed); } if (def.equipmentIndex == EquipmentIndex.AffixYellow) { self.RemoveBuff(BuffIndex.AffixHaunted); self.RemoveBuff(BuffIndex.AffixHauntedRecipient); self.RemoveBuff(BuffIndex.AffixPoison); self.RemoveBuff(BuffIndex.AffixBlue); self.RemoveBuff(BuffIndex.AffixWhite); self.RemoveBuff(BuffIndex.AffixRed); } orig(self, def); }; return(true); }