Exemplo n.º 1
0
        private void SpawnStanMinion(GameObject gameoObject, string masterName, Vector3 position)
        {
            CharacterBody characterBody = gameObject.GetComponent <CharacterBody>();

            if (NetworkServer.active)
            {
                CharacterMaster characterMaster = new MasterSummon
                {
                    masterPrefab          = MasterCatalog.FindMasterPrefab(masterName),
                    position              = position,
                    rotation              = characterBody.transform.rotation,
                    summonerBodyObject    = gameObject,
                    ignoreTeamMemberLimit = true,
                    teamIndexOverride     = new TeamIndex?(TeamIndex.Player)
                }.Perform();
                characterMaster.inventory.GiveItem(RoR2Content.Items.HealthDecay.itemIndex, 35);

                this.PlaySound(Assets.StrongStanSpawnSound, characterMaster.GetBodyObject());
            }
            else
            {
                NetworkIdentity networkIdentity = base.gameObject.GetComponent <NetworkIdentity>();
                if (networkIdentity)
                {
                    new NetMessages.SpawnStanMinonMessage(networkIdentity.netId, masterName, position, true, Assets.StrongStanSpawnSound)
                    .Send(NetworkDestination.Server);
                }
            }
        }
Exemplo n.º 2
0
        private void CharacterMaster_TransformBody1(On.RoR2.CharacterMaster.orig_TransformBody orig, CharacterMaster self, string bodyName)
        {
            if (bodyName == "HereticBody" && self.GetComponent <BaseAI>())
            {
                var newSummon = new MasterSummon()
                {
                    ignoreTeamMemberLimit = true,
                    inventoryToCopy       = self.inventory,
                    masterPrefab          = Resources.Load <GameObject>("prefabs/charactermasters/hereticmonstermaster"),
                    position          = self.GetBody()?.footPosition ?? Vector3.zero,
                    useAmbientLevel   = true,
                    teamIndexOverride = self.teamIndex
                };
                var newMaster = newSummon.Perform();

                return;
            }
            orig(self, bodyName);
            var body = self.GetBody();

            if (body)
            {
                TeleportHelper.TeleportBody(body, Vector3.zero);
                body.healthComponent?.Suicide();
            }
        }
Exemplo n.º 3
0
        public override void OnEnter()
        {
            base.OnEnter();
            float baseMaxDuration  = 2f;
            float autoFireDuration = baseMaxDuration / attackSpeedStat;
            Ray   aimRay           = base.GetAimRay();

            base.StartAimMode(aimRay, 2f, false);
            base.PlayAnimation("Gesture, Additive", "FireNovaBomb", "FireShotgun", autoFireDuration * 3f);
            base.PlayAnimation("Gesture, Override", "FireNovaBomb", "FireShotgun", autoFireDuration * 3f);

            bool isAuthority = base.isAuthority;

            if (NetworkServer.active)
            {
                CharacterMaster characterMaster = new MasterSummon
                {
                    masterPrefab          = MasterCatalog.FindMasterPrefab("ImpMaster"),
                    position              = base.characterBody.transform.position,
                    rotation              = base.transform.rotation,
                    summonerBodyObject    = base.characterBody.gameObject,
                    ignoreTeamMemberLimit = true,
                    teamIndexOverride     = TeamIndex.Player,
                }.Perform();

                characterMaster.GetBody().AddBuff(BuffIndex.AffixRed);
                characterMaster.GetBody().inventory.GiveRandomItems(base.characterBody.inventory.GetTotalItemCountOfTier(ItemTier.Tier1) + base.characterBody.inventory.GetTotalItemCountOfTier(ItemTier.Tier2) + base.characterBody.inventory.GetTotalItemCountOfTier(ItemTier.Tier3) + base.characterBody.inventory.GetTotalItemCountOfTier(ItemTier.Lunar) + base.characterBody.inventory.GetTotalItemCountOfTier(ItemTier.Boss));
                characterMaster.inventory.GiveItem(ItemIndex.HealthDecay, 30);
            }

            base.OnExit();
        }
Exemplo n.º 4
0
        public override void OnEnter()
        {
            base.OnEnter();
            if (base.isAuthority)
            {
                //this.targetTracker = base.GetComponent<TargetTracker>();
                this.ownerPrefab = base.gameObject;
                CharacterBody   targetBody      = this.targetPrefab.GetComponent <CharacterBody>();
                CharacterBody   ownerBody       = this.ownerPrefab.GetComponent <CharacterBody>();
                GameObject      bodyPrefab      = BodyCatalog.FindBodyPrefab(targetBody);
                CharacterMaster characterMaster = MasterCatalog.allAiMasters.FirstOrDefault((CharacterMaster master) => master.bodyPrefab == bodyPrefab);
                this.masterSummon         = new MasterSummon();
                masterSummon.masterPrefab = characterMaster.gameObject;
                masterSummon.position     = ownerBody.footPosition;
                CharacterDirection component = ownerBody.GetComponent <CharacterDirection>();
                masterSummon.rotation           = (component ? Quaternion.Euler(0f, component.yaw, 0f) : ownerBody.transform.rotation);
                masterSummon.summonerBodyObject = (ownerBody ? ownerBody.gameObject : null);

                CharacterMaster characterMaster2 = masterSummon.Perform();

                GameObject       trackingTargetAsGO = this.targetTracker.GetTrackingTargetAsGO();
                RoR2.Console.Log log = new RoR2.Console.Log();
                if (trackingTargetAsGO != null)
                {
                    log.message = "REEE";
                    RoR2.Console.logs.Add(log);
                }
                else
                {
                    log.message = "YEET";
                    RoR2.Console.logs.Add(log);
                }
            }
        }
            public void OnReceived()
            {
                GameObject    gameObject    = Util.FindNetworkObject(this.targetId);
                CharacterBody characterBody = gameObject.GetComponent <CharacterBody>();

                if (!gameObject)
                {
                    StanWorshipperPlugin.logger.LogMessage("Error spawning stan fragment on client: target id was not found!");
                    return;
                }

                CharacterMaster characterMaster = new MasterSummon
                {
                    masterPrefab          = MasterCatalog.FindMasterPrefab(masterName),
                    position              = position,
                    rotation              = characterBody.transform.rotation,
                    summonerBodyObject    = gameObject,
                    ignoreTeamMemberLimit = true,
                    teamIndexOverride     = new TeamIndex?(TeamIndex.Player)
                }.Perform();

                characterMaster.inventory.GiveItem(RoR2Content.Items.HealthDecay.itemIndex, 30);

                if (this.playSound & this.soundName != "")
                {
                    new NetMessages.SoundMessage(characterMaster.GetBodyObject().GetComponent <NetworkIdentity>().netId, soundName)
                    .Send(NetworkDestination.Clients);
                }
            }
Exemplo n.º 6
0
        private void SummonFriend(On.RoR2.CharacterBody.orig_FixedUpdate orig, CharacterBody self)
        {
            if (NetworkServer.active && self.master)
            {
                var LunarChimeraComponent = self.master.GetComponent <LunarChimeraComponent>();
                if (!LunarChimeraComponent)
                {
                    LunarChimeraComponent = self.masterObject.AddComponent <LunarChimeraComponent>();
                }

                var SummonerBodyMaster = self.master;
                if (SummonerBodyMaster) //Check if we're a minion or not. If we are, we don't summon a friend.
                {
                    if (SummonerBodyMaster.teamIndex == TeamIndex.Player && !self.isPlayerControlled)
                    {
                        orig(self);
                        return;
                    }
                }

                int InventoryCount = GetCount(self);
                if (InventoryCount > 0)
                {
                    if (LunarChimeraComponent.LastChimeraSpawned == null || !LunarChimeraComponent.LastChimeraSpawned.master || !LunarChimeraComponent.LastChimeraSpawned.master.hasBody)
                    {
                        LunarChimeraComponent.LastChimeraSpawned = null;
                        LunarChimeraComponent.ResummonCooldown  -= Time.fixedDeltaTime;
                        if (LunarChimeraComponent.ResummonCooldown <= 0f)
                        {
                            var minDistance = 10f;
                            var maxDistance = 20f;


                            MasterSummon masterSummon = new MasterSummon
                            {
                                masterPrefab = characterPrefab,
                                position     = self.transform.position + new Vector3(UnityEngine.Random.Range(minDistance, maxDistance),
                                                                                     5,
                                                                                     UnityEngine.Random.Range(minDistance, maxDistance)),
                                rotation              = self.transform.rotation,
                                summonerBodyObject    = self.gameObject,
                                ignoreTeamMemberLimit = true,
                                teamIndexOverride     = new TeamIndex?(TeamIndex.Player)
                            };
                            masterSummon.Perform();
                            RecentlySpawned = true;

                            if (RecentlySpawned)
                            {
                                LunarChimeraComponent.ResummonCooldown = lunarChimeraResummonCooldownDuration;
                                RecentlySpawned = false;
                            }
                        }
                    }
                }
            }
            orig(self);
        }
Exemplo n.º 7
0
        public CharacterMaster SummonHeretic(GameObject summonerBodyObject, Vector3 spawnPosition)
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'SummonHeretic(UnityEngine.GameObject)' called on client");
                return(null);
            }
            MasterSummon masterSummon = new MasterSummon
            {
                masterPrefab          = MasterCatalog.FindMasterPrefab("HereticMonsterMaster"),
                position              = spawnPosition,
                rotation              = Quaternion.identity,
                summonerBodyObject    = summonerBodyObject,
                ignoreTeamMemberLimit = true,
                useAmbientLevel       = new bool?(true),
            };
            CharacterMaster characterMaster = masterSummon.Perform();

            if (characterMaster)
            {
                GameObject bodyObject = characterMaster.GetBodyObject();
                if (bodyObject)
                {
                    ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                    if (component && component.modelTransform)
                    {
                        TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration              = 0.5f;
                        temporaryOverlay.animateShaderAlpha    = true;
                        temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                        temporaryOverlay.destroyComponentOnEnd = true;
                        temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matSummonDrone");
                        temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                    }
                    var inventory = characterMaster.inventory;
                    if (inventory)
                    {
                        inventory.CopyItemsFrom(summonerBodyObject.GetComponent <CharacterBody>().inventory);
                    }
                }
            }
            if (characterMaster && characterMaster.bodyInstanceObject)
            {
                characterMaster.GetBody().AddTimedBuff(RoR2Content.Buffs.Immune, 3f);
                GameObject gameObject = Resources.Load <GameObject>("Prefabs/Effects/HippoRezEffect");
                if (gameObject)
                {
                    EffectManager.SpawnEffect(gameObject, new EffectData
                    {
                        origin   = spawnPosition,
                        rotation = characterMaster.bodyInstanceObject.transform.rotation
                    }, true);
                }
            }
            return(characterMaster);
        }
Exemplo n.º 8
0
        public override void OnExit()
        {
            if (this.goodPlacement && base.characterBody.isPlayerControlled)
            {
                Util.PlaySound(CreatePounder.fireSoundString, base.gameObject);
                if (this.areaIndicatorInstance && NetworkServer.active)
                {
                    CharacterMaster characterMaster = new MasterSummon
                    {
                        masterPrefab          = MasterCatalog.FindMasterPrefab("MercMonsterMaster"),
                        position              = base.characterBody.transform.position,
                        rotation              = characterBody.transform.rotation,
                        summonerBodyObject    = base.gameObject,
                        ignoreTeamMemberLimit = true,
                        teamIndexOverride     = characterBody.teamComponent.teamIndex
                    }.Perform();

                    base.skillLocator.utility.DeductStock(1);

                    base.characterMotor.Motor.SetPosition(areaIndicatorInstance.transform.position);

                    EffectData effectData = new EffectData();
                    effectData.rotation = Util.QuaternionSafeLookRotation(areaIndicatorInstance.transform.position - base.characterMotor.transform.position);
                    effectData.origin   = base.characterMotor.transform.position;
                    EffectManager.SpawnEffect(EntityStates.Huntress.BlinkState.blinkPrefab, effectData, false);

                    EffectData effectData2 = new EffectData();
                    effectData.rotation = Util.QuaternionSafeLookRotation(areaIndicatorInstance.transform.position - base.characterMotor.transform.position);
                    effectData.origin   = areaIndicatorInstance.transform.position;
                    EffectManager.SpawnEffect(EntityStates.Huntress.BlinkState.blinkPrefab, effectData, false);


                    base.characterBody.AddTimedBuff(BuffIndex.Cloak, 5f);
                    base.characterBody.AddTimedBuff(BuffIndex.ElephantArmorBoost, 3f);
                    base.characterBody.AddTimedBuff(BuffIndex.Immune, 2f);

                    characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 0, (uint)Random.Range(0, characterBody.skillLocator.primary.skillFamily.variants.Length));
                    characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 1, (uint)Random.Range(0, characterBody.skillLocator.secondary.skillFamily.variants.Length));
                    characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 2, (uint)Random.Range(0, characterBody.skillLocator.utility.skillFamily.variants.Length));
                    characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 3, (uint)Random.Range(0, characterBody.skillLocator.special.skillFamily.variants.Length));
                    characterMaster.loadout.bodyLoadoutManager.SetSkinIndex(characterBody.bodyIndex, (uint)Random.Range(0, SkinCatalog.GetBodySkinCount(characterBody.bodyIndex)));
                    characterMaster.GetBody().baseDamage = 0f;

                    characterMaster.inventory.GiveItem(ItemIndex.HealthDecay, 10);
                    characterMaster.GetBody().inventory.SetEquipmentIndex(EquipmentIndex.AffixHaunted);
                }
            }

            EntityState.Destroy(this.areaIndicatorInstance.gameObject);
            base.characterBody.crosshairPrefab = this.cachedCrosshairPrefab;
            base.OnExit();
            this.outer.SetNextStateToMain();
        }
Exemplo n.º 9
0
 private void UnlockingMage_onOpenedsss(Interactor obj)
 {
     CharacterMaster characterMaster = new MasterSummon
     {
         masterPrefab          = MasterCatalog.FindMasterPrefab("MageMonsterMaster"),
         position              = obj.gameObject.transform.position,
         rotation              = Quaternion.identity,
         summonerBodyObject    = null,
         ignoreTeamMemberLimit = false,
         teamIndexOverride     = new TeamIndex?(TeamIndex.Player)
     }.Perform();
 }
Exemplo n.º 10
0
 private void SpawnGurren()
 {
     float           d = 0f;
     CharacterMaster characterMaster = new MasterSummon
     {
         masterPrefab          = Gurren.allyPrefab,
         position              = base.characterBody.transform.position + Vector3.up * d,
         rotation              = base.characterBody.transform.rotation,
         summonerBodyObject    = ((base.characterBody != null) ? base.characterBody.gameObject : null),
         ignoreTeamMemberLimit = true,
         useAmbientLevel       = new bool?(true),
         inventoryToCopy       = base.characterBody.inventory,
     }.Perform();
 }
Exemplo n.º 11
0
 private void SpawnGurren(Interactor interactor)
 {
     var             characterBody   = interactor.GetComponent <CharacterBody>();
     float           d               = 0f;
     CharacterMaster characterMaster = new MasterSummon
     {
         masterPrefab          = Gurren.allyPrefab,
         position              = base.transform.position + Vector3.up * d,
         rotation              = base.transform.rotation,
         summonerBodyObject    = characterBody.gameObject,
         ignoreTeamMemberLimit = true,
         useAmbientLevel       = new bool?(true),
         inventoryToCopy       = characterBody.inventory,
     }.Perform();
 }
            public void Start()
            {
                if (!bossMaster)
                {
                    var masterSummon = new MasterSummon()
                    {
                        ignoreTeamMemberLimit = true,
                        masterPrefab          = Enemies.LordofTheJammedMonster.masterPrefab,
                        position          = transform.position,
                        teamIndexOverride = TeamIndex.Monster
                    };

                    bossMaster = masterSummon.Perform();
                    bossBody   = bossMaster.GetBody();
                }
            }
Exemplo n.º 13
0
        public override void OnExit()
        {
            if (this.goodPlacement && base.characterBody.isPlayerControlled)
            {
                Util.PlaySound(CreatePounder.fireSoundString, base.gameObject);
                if (this.areaIndicatorInstance && NetworkServer.active)
                {
                    if (editedPounder == null)
                    {
                        editedPounder = CreatePounder.projectilePrefab;
                    }

                    bool crit = Util.CheckRoll(this.critStat, base.characterBody.master);

                    int cacheNumToSpawn = base.skillLocator.special.stock;

                    for (int i = 0; i < cacheNumToSpawn; i++)
                    {
                        CharacterMaster characterMaster = new MasterSummon
                        {
                            masterPrefab          = MasterCatalog.FindMasterPrefab("MercMonsterMaster"),
                            position              = areaIndicatorInstance.transform.position,
                            rotation              = characterBody.transform.rotation,
                            summonerBodyObject    = base.gameObject,
                            ignoreTeamMemberLimit = false,
                            teamIndexOverride     = characterBody.teamComponent.teamIndex
                        }.Perform();

                        base.skillLocator.special.DeductStock(1);

                        characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 0, (uint)Random.Range(0, characterBody.skillLocator.primary.skillFamily.variants.Length));
                        characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 1, (uint)Random.Range(0, characterBody.skillLocator.secondary.skillFamily.variants.Length));
                        characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 2, (uint)Random.Range(0, characterBody.skillLocator.utility.skillFamily.variants.Length));
                        characterMaster.loadout.bodyLoadoutManager.SetSkillVariant(characterBody.bodyIndex, 3, (uint)Random.Range(0, characterBody.skillLocator.special.skillFamily.variants.Length));
                        characterMaster.loadout.bodyLoadoutManager.SetSkinIndex(characterBody.bodyIndex, (uint)Random.Range(0, SkinCatalog.GetBodySkinCount(characterBody.bodyIndex)));
                        characterMaster.inventory.CopyItemsFrom(base.characterBody.inventory);

                        characterMaster.inventory.GiveItem(ItemIndex.HealthDecay, 15);
                    }
                }
            }

            EntityState.Destroy(this.areaIndicatorInstance.gameObject);
            base.characterBody.crosshairPrefab = this.cachedCrosshairPrefab;
            base.OnExit();
            this.outer.SetNextStateToMain();
        }
Exemplo n.º 14
0
        public CharacterMaster SummonMage(GameObject summonerBody, Vector3 spawnPosition)
        {
            if (!NetworkServer.active)
            {
                return(null);
            }
            Inventory    summonerInventory = summonerBody.GetComponent <CharacterBody>()?.inventory ? summonerBody.GetComponent <CharacterBody>().inventory : null;
            MasterSummon masterSummon      = new MasterSummon
            {
                masterPrefab          = MageMasterPrefab,
                position              = spawnPosition,
                rotation              = Quaternion.identity,
                summonerBodyObject    = summonerBody ?? null,
                ignoreTeamMemberLimit = true,
                useAmbientLevel       = new bool?(true),
                inventoryToCopy       = cfgCopyInventory.Value ? summonerInventory : null,
            };
            CharacterMaster characterMaster = masterSummon.Perform();

            if (characterMaster)
            {
                DontDestroyOnLoad(characterMaster);
                if (characterMaster.inventory)
                {
                    characterMaster.inventory.GiveItem(RoR2Content.Items.ExtraLife, cfgLives.Value);
                }

                GameObject bodyObject = characterMaster.GetBodyObject();
                if (bodyObject)
                {
                    ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                    if (component && component.modelTransform)
                    {
                        TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration              = 0.5f;
                        temporaryOverlay.animateShaderAlpha    = true;
                        temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                        temporaryOverlay.destroyComponentOnEnd = true;
                        temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matSummonDrone");
                        temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                    }
                }
            }
            return(characterMaster);
        }
Exemplo n.º 15
0
 public override void OnEnter()
 {
     base.OnEnter();
     this.duration = HEALINGPAIN.baseDuration / this.attackSpeedStat;
     if (isAuthority && NetworkServer.active)
     {
         CharacterMaster characterMaster;
         characterMaster = new MasterSummon
         {
             masterPrefab          = MasterCatalog.FindMasterPrefab("Drone2Master"),
             position              = base.characterBody.footPosition + base.transform.up,
             rotation              = base.transform.rotation,
             summonerBodyObject    = null,
             ignoreTeamMemberLimit = false,
             teamIndexOverride     = TeamIndex.Monster
         }.Perform();
     }
 }
 public void OnReceived()
 {
     if (_body && _body.master)
     {
         var dispMaster = new MasterSummon {
             masterPrefab          = MasterCatalog.GetMasterPrefab(_masterIndex),
             position              = _pos,
             rotation              = _rot,
             summonerBodyObject    = _body.gameObject,
             ignoreTeamMemberLimit = true,
             inventoryToCopy       = _body.inventory
         }.Perform();
         Deployable deployable = dispMaster.gameObject.AddComponent <Deployable>();
         deployable.onUndeploy = new UnityEvent();
         deployable.onUndeploy.AddListener(new UnityAction(dispMaster.TrueKill));
         _body.master.AddDeployable(deployable, EngiUtilitySpeedispenser.instance.deployableSlot);
     }
 }
Exemplo n.º 17
0
            public CharacterMaster SummonDrone(GameObject bodyPrefab, Vector3 spawnPosition, EquipmentIndex equipmentIndex = EquipmentIndex.None)
            {
                if (!NetworkServer.active)
                {
                    Debug.LogWarning("[Server] function 'RoR2.CharacterMaster RoR2.MithrixSpawnsDronesActivator::SummonMaster(UnityEngine.GameObject)' called on client");
                    return(null);
                }
                MasterSummon masterSummon = new MasterSummon
                {
                    masterPrefab          = masterPrefab,
                    position              = spawnPosition,
                    rotation              = Quaternion.identity,
                    summonerBodyObject    = bodyPrefab,
                    ignoreTeamMemberLimit = true,
                    useAmbientLevel       = new bool?(true),
                };
                CharacterMaster characterMaster = masterSummon.Perform();

                if (characterMaster)
                {
                    GameObject bodyObject = characterMaster.GetBodyObject();
                    if (bodyObject)
                    {
                        ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                        if (component && component.modelTransform)
                        {
                            TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                            temporaryOverlay.duration              = 0.5f;
                            temporaryOverlay.animateShaderAlpha    = true;
                            temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                            temporaryOverlay.destroyComponentOnEnd = true;
                            temporaryOverlay.originalMaterial      = Resources.Load <Material>("Materials/matSummonDrone");
                            temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                        }
                        var inventory = characterMaster.inventory;
                        if (inventory)
                        {
                            inventory.SetEquipmentIndex(equipmentIndex);
                        }
                    }
                }
                return(characterMaster);
            }
Exemplo n.º 18
0
        public override void OnEnter()
        {
            base.OnEnter();
            base.characterBody.isSprinting = true;
            this.dashVector = -base.characterDirection.forward;

            Util.PlaySound("HenryStinger", base.gameObject);
            base.PlayAnimation("Gesture, Override", "BufferEmpty");

            base.gameObject.layer = LayerIndex.fakeActor.intVal;
            base.characterMotor.Motor.RebuildCollidableLayers();

            if (NetworkServer.active)
            {
                //base.characterBody.AddBuff(BuffIndex.HiddenInvincibility);

                CharacterMaster newCloneMaster = new MasterSummon
                {
                    masterPrefab          = MasterCatalog.GetMasterPrefab(MasterCatalog.FindMasterIndex("MrGreenCloneMaster")),
                    position              = base.transform.position,
                    rotation              = base.modelLocator.modelBaseTransform.rotation,
                    summonerBodyObject    = base.gameObject,
                    ignoreTeamMemberLimit = true
                }.Perform();

                Inventory inventory = newCloneMaster.inventory;
                inventory.CopyItemsFrom(base.characterBody.master.inventory);

                /*inventory.ResetItem(ItemIndex.WardOnLevel);
                 * inventory.ResetItem(ItemIndex.BeetleGland);
                 * inventory.ResetItem(ItemIndex.CrippleWardOnLevel);
                 * inventory.ResetItem(ItemIndex.TPHealingNova);
                 * inventory.ResetItem(ItemIndex.FocusConvergence);
                 * inventory.ResetItem(ItemIndex.TitanGoldDuringTP);*/

                var delayedDamage = newCloneMaster.gameObject.AddComponent <Modules.Components.DelayedDamageOnSpawn>();
                delayedDamage.attacker = this.attacker;
                delayedDamage.damage   = this.storedDamage;
                delayedDamage.tracker  = this.tracker;
            }
        }
Exemplo n.º 19
0
        static bool Prefix(MasterSummon __instance)
        {
            __instance.ignoreTeamMemberLimit = RAC.RemoveCap.Value;
            TeamIndex teamIndex;

            if (__instance.teamIndexOverride != null)
            {
                teamIndex = __instance.teamIndexOverride.Value;
            }
            else
            {
                teamIndex = TeamComponent.GetObjectTeam(__instance.summonerBodyObject);
            }
            TeamDef teamDef = TeamCatalog.GetTeamDef(teamIndex);

            if (teamDef != null)
            {
                teamDef.softCharacterLimit = (int)RAC.ConfigToFloat(RAC.AllyCountCap.Value);
            }
            return(true);
        }
Exemplo n.º 20
0
        private void SummonDrone(CharacterBody ownerBody, GameObject droneMasterPrefab, int counter = 1)
        {
            if (!ownerBody || !droneMasterPrefab)
            {
                Log.Warning("Machines.SummonDrone: ownerBody or droneMasterPrefab is null. Cancel drone summon.");
                return;
            }
            CharacterMaster characterMaster = new MasterSummon
            {
                masterPrefab          = droneMasterPrefab,
                position              = ownerBody.transform.position - (ownerBody.transform.forward.normalized * counter) + (.25f * counter * Vector3.up),
                rotation              = ownerBody.transform.rotation,
                summonerBodyObject    = ownerBody.gameObject,
                ignoreTeamMemberLimit = true,
                useAmbientLevel       = true
            }.Perform();

            if (characterMaster)
            {
                GameObject bodyObject = characterMaster.GetBodyObject();
                if (bodyObject)
                {
                    ModelLocator component = bodyObject.GetComponent <ModelLocator>();
                    if (component && component.modelTransform)
                    {
                        TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>();
                        temporaryOverlay.duration              = 0.5f;
                        temporaryOverlay.animateShaderAlpha    = true;
                        temporaryOverlay.alphaCurve            = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
                        temporaryOverlay.destroyComponentOnEnd = true;
                        temporaryOverlay.originalMaterial      = summonDroneMaterial;
                        temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>());
                    }
                }
                RepositionGroundedDrones(characterMaster.GetBody(), ownerBody.transform.position);
            }
        }
Exemplo n.º 21
0
        public override GameObject DoSpawn(Vector3 position, Quaternion rotation, DirectorSpawnRequest directorSpawnRequest)
        {
            MasterSummon summon = new MasterSummon
            {
                masterPrefab          = this.prefab,
                position              = position,
                rotation              = rotation,
                summonerBodyObject    = directorSpawnRequest.summonerBodyObject,
                teamIndexOverride     = directorSpawnRequest.teamIndexOverride,
                ignoreTeamMemberLimit = directorSpawnRequest.ignoreTeamMemberLimit
            };

            if (playerbotName != null)
            {
                summon.preSpawnSetupCallback += OnPreSpawn;
            }
            CharacterMaster characterMaster = summon.Perform();

            if (characterMaster == null)
            {
                return(null);
            }
            return(characterMaster.gameObject);
        }
        public static bool Init()
        {
            On.RoR2.CharacterMaster.GetDeployableSameSlotLimit += (orig, self, slot) =>
            {
                if (slot == (DeployableSlot)7)
                {
                    return(self.inventory.GetItemCount(ItemIndex.EquipmentMagazine));
                }

                return(orig(self, slot));
            };

            On.RoR2.EquipmentSlot.PerformEquipmentAction += (orig, self, equipmentIndex) =>
            {
                CharacterBody characterBody   = self.characterBody;
                string        characterMaster = "";

                bool temp = orig(self, equipmentIndex);

                if (self.characterBody.inputBank.activateEquipment.justPressed)
                {
                    switch (equipmentIndex)
                    {
                    case EquipmentIndex.AffixWhite:
                    {
                        characterMaster = "BisonMaster";

                        temp = true;
                    }

                    break;

                    case EquipmentIndex.AffixGold:
                    {
                        characterMaster = "TitanGoldMaster";

                        temp = true;
                    }
                    break;

                    case EquipmentIndex.AffixHaunted:
                    {
                        characterMaster = "BellMaster";

                        temp = true;
                    }
                    break;

                    case EquipmentIndex.AffixPoison:
                    {
                        characterMaster = "ImpMaster";

                        temp = true;
                    }
                    break;

                    case EquipmentIndex.AffixRed:
                    {
                        characterMaster = "LemurianMaster";
                    }
                    break;

                    case EquipmentIndex.AffixBlue:
                    {
                        characterMaster = "WispMaster";
                    }
                    break;

                    case EquipmentIndex.AffixYellow:
                    {
                        characterMaster = "ElectricWormMaster";
                        temp            = true;
                    }
                    break;
                    }

                    if (characterMaster != "")
                    {
                        CharacterMaster newcharacterMaster = new MasterSummon
                        {
                            masterPrefab          = MasterCatalog.FindMasterPrefab(characterMaster),
                            position              = characterBody.footPosition + characterBody.transform.up,
                            rotation              = characterBody.transform.rotation,
                            summonerBodyObject    = null,
                            ignoreTeamMemberLimit = true,
                            teamIndexOverride     = characterBody.teamComponent.teamIndex
                        }.Perform();

                        newcharacterMaster.inventory.CopyItemsFrom(characterBody.inventory);
                        newcharacterMaster.inventory.ResetItem(ItemIndex.AutoCastEquipment);
                        newcharacterMaster.inventory.CopyEquipmentFrom(characterBody.inventory);
                        newcharacterMaster.GetBody().modelLocator.modelBaseTransform.localScale *= 0.25f;

                        Deployable deployable = newcharacterMaster.gameObject.GetComponent <Deployable>();
                        if (!deployable)
                        {
                            deployable = newcharacterMaster.gameObject.AddComponent <Deployable>();
                        }


                        int deployableCount = characterBody.master.GetDeployableCount((DeployableSlot)7);

                        self.characterBody.master.AddDeployable(deployable, (DeployableSlot)7);
                        deployable.onUndeploy = new UnityEngine.Events.UnityEvent();
                        deployable.onUndeploy.AddListener(() => newcharacterMaster.TrueKill());
                    }
                }
                return(temp);
            };

            return(true);
        }
Exemplo n.º 23
0
        private bool PerformEquipmentActionInternal(EquipmentSlot slot)
        {
            var candidates = CharacterMaster.readOnlyInstancesList.Where(x => x.IsDeadAndOutOfLivesServer() && x.teamIndex == TeamIndex.Player);

            GameObject obj;
            GameObject podPrefab = LegacyResourcesAPI.Load <GameObject>("Prefabs/NetworkedObjects/RoboCratePod");

            var        nodeGraph = SceneInfo.instance.GetNodeGraph(MapNodeGroup.GraphType.Ground);
            var        nodeInd   = nodeGraph.FindClosestNodeWithFlagConditions(slot.transform.position, HullClassification.Human, NodeFlags.None, NodeFlags.None, false);
            Vector3    nodePos   = slot.transform.position;
            Quaternion nodeRot   = Quaternion.identity;

            if (nodeGraph.GetNodePosition(nodeInd, out nodePos))
            {
                var targPos = slot.transform.position;
                targPos.y = nodePos.y;
                nodeRot   = Util.QuaternionSafeLookRotation(nodePos - targPos);
            }

            if (candidates.Count() > 0)
            {
                var which   = rng.NextElementUniform(candidates.ToArray());
                var newBody = which.Respawn(nodePos, nodeRot);
                if (!newBody)
                {
                    return(false);
                }
                obj = newBody.gameObject;
                string rezTargetName = Language.GetString(newBody.baseNameToken);
                var    newBodyUser   = Util.LookUpBodyNetworkUser(newBody);
                if (newBodyUser)
                {
                    rezTargetName = newBodyUser.userName;
                }
                var rezzerName = slot.characterBody ? Language.GetString(slot.characterBody.baseNameToken) : "Someone";
                var rezzerUser = Util.LookUpBodyNetworkUser(slot.characterBody);
                if (rezzerUser)
                {
                    rezzerName = rezzerUser.userName;
                }
                NetUtil.ServerSendGlobalChatMsg($"{rezzerName} called down a clone of {rezTargetName}!");
            }
            else
            {
                var whichName  = rng.NextElementUniform(droneMasterPrefabNames.ToArray());
                var whichIndex = MasterCatalog.FindMasterIndex(whichName);
                var which      = MasterCatalog.GetMasterPrefab(whichIndex);
                if (!which)
                {
                    return(false);
                }
                var summon = new MasterSummon {
                    masterPrefab          = which,
                    position              = nodePos,
                    rotation              = nodeRot,
                    summonerBodyObject    = slot.characterBody ? slot.characterBody.gameObject : null,
                    ignoreTeamMemberLimit = true,
                    useAmbientLevel       = new bool?(true)
                }.Perform();
                if (!summon)
                {
                    return(false);
                }
                obj = summon.GetBodyObject();
                if (!obj)
                {
                    return(false);
                }
                if (obj.name == "EquipmentDroneBody(Clone)")
                {
                    var droneInv = obj.GetComponent <Inventory>();
                    if (droneInv)
                    {
                        var randomEqp = rng.NextElementUniform(RoR2.Artifacts.EnigmaArtifactManager.validEquipment);
                        droneInv.SetEquipment(new EquipmentState(randomEqp, Run.FixedTimeStamp.negativeInfinity, 1), 0);
                    }
                }
                else if (which == ItemDrone.instance.itemDroneMasterPrefab)
                {
                    var wardPersist = summon.GetComponent <ItemDroneWardPersist>();

                    var drops = LegacyResourcesAPI.Load <BasicPickupDropTable>("DropTables/dtSmallChest");
                    var drop  = drops.GenerateDrop(rng);
                    var pdef  = PickupCatalog.GetPickupDef(drop);
                    if (wardPersist && pdef != null && pdef.itemIndex != ItemIndex.None)
                    {
                        int remCount = 1;
                        if (pdef.itemTier == ItemTier.Tier2 || pdef.itemTier == ItemTier.VoidTier2)
                        {
                            remCount = 3;
                        }
                        if (pdef.itemTier == ItemTier.Tier1 || pdef.itemTier == ItemTier.VoidTier1)
                        {
                            remCount = 5;
                        }
                        wardPersist.index = pdef.itemIndex;
                        wardPersist.count = remCount;
                    }
                }
            }

            if (!obj)
            {
                return(false);
            }
            var objBody = obj.GetComponent <CharacterBody>();

            var podObj  = GameObject.Instantiate(podPrefab, nodePos, nodeRot);
            var podSeat = podObj.GetComponent <VehicleSeat>();

            if (podSeat)
            {
                podSeat.AssignPassenger(obj);
            }
            else
            {
                TinkersSatchelPlugin._logger.LogError($"Pod {podObj} spawned for revived prefab {obj} has no seat!");
            }
            NetworkServer.Spawn(podObj);
            objBody.SetBodyStateToPreferredInitialState();

            slot.inventory.SetEquipment(new EquipmentState(EquipmentIndex.None, Run.FixedTimeStamp.now + cooldown, 0), (uint)slot.inventory.activeEquipmentSlot);
            return(true);
        }
Exemplo n.º 24
0
        public override void OnEnter()
        {
            base.OnEnter();
            Ray aimRay = base.GetAimRay();

            this.duration = this.baseDuration / this.attackSpeedStat;
            if (this.effectPrefab)
            {
                EffectManager.SimpleMuzzleFlash(this.effectPrefab, base.gameObject, muzzleLeft, false);
                EffectManager.SimpleMuzzleFlash(this.effectPrefab, base.gameObject, muzzleRight, false);
            }
            base.PlayAnimation("Gesture", "FireCannons", "FireCannons.playbackRate", this.duration);
            if (base.isAuthority && base.modelLocator && base.modelLocator.modelTransform)
            {
                if (base.modelLocator.modelTransform.GetComponent <ChildLocator>())
                {
                    ChildLocator childLocator = base.modelLocator.modelTransform.GetComponent <ChildLocator>();
                    //literally compiler names but who will look at this code anyways?
                    int       muzzleLeftShildIndex  = childLocator.FindChildIndex(muzzleLeft);
                    int       muzzleRightChildIndex = childLocator.FindChildIndex(muzzleRight);
                    Transform muzzleLeftTransform   = childLocator.FindChild(muzzleLeftShildIndex);
                    Transform muzzleRightTransform  = childLocator.FindChild(muzzleRightChildIndex);
                    if (muzzleLeftTransform)
                    {
                        CharacterMaster characterMaster;
                        characterMaster = new MasterSummon
                        {
                            masterPrefab          = MasterCatalog.FindMasterPrefab("WispMaster"),
                            position              = muzzleLeftTransform.position,
                            rotation              = muzzleLeftTransform.rotation,
                            summonerBodyObject    = null,
                            ignoreTeamMemberLimit = true,
                            teamIndexOverride     = TeamIndex.Monster
                        }.Perform();


                        AIOwnership component4 = characterMaster.gameObject.GetComponent <AIOwnership>();
                        BaseAI      component5 = characterMaster.gameObject.GetComponent <BaseAI>();

                        if (component4 && characterBody.master)
                        {
                            component4.ownerMaster = base.characterBody.master;
                        }
                        if (component5 && characterBody.master.gameObject)
                        {
                            component5.leader.gameObject = base.characterBody.master.gameObject;
                            component5.isHealer          = false;
                            component5.fullVision        = true;
                        }
                    }
                    if (muzzleRightTransform)
                    {
                        CharacterMaster characterMaster;
                        characterMaster = new MasterSummon
                        {
                            masterPrefab          = MasterCatalog.FindMasterPrefab("WispMaster"),
                            position              = muzzleRightTransform.position,
                            rotation              = muzzleRightTransform.rotation,
                            summonerBodyObject    = null,
                            ignoreTeamMemberLimit = true,
                            teamIndexOverride     = TeamIndex.Monster
                        }.Perform();


                        AIOwnership component4 = characterMaster.gameObject.GetComponent <AIOwnership>();
                        BaseAI      component5 = characterMaster.gameObject.GetComponent <BaseAI>();

                        if (component4 && characterBody.master)
                        {
                            component4.ownerMaster = base.characterBody.master;
                        }
                        if (component5 && characterBody.master.gameObject)
                        {
                            component5.leader.gameObject = base.characterBody.master.gameObject;
                            component5.isHealer          = false;
                            component5.fullVision        = true;
                        }
                    }
                }
            }
        }
Exemplo n.º 25
0
        public void Awake()
        {
            ReadConfig();
            On.RoR2.Run.Start += (orig, self) =>
            {
                orig(self);
                for (int i = 0; i < NextTitanSpawn.Length; i++)
                {
                    NextTitanSpawn[i] = -1f;
                    NextTitanKill[i]  = -1f;
                }
            };
            On.RoR2.Run.FixedUpdate += (orig, self) =>
            {
                orig(self);
                string scenename = SceneManager.GetActiveScene().name;
                if (scenename == "moon" || scenename == "moon2")
                {
                    for (int i = 0; i < NextTitanSpawn.Length; i++)
                    {
                        if (NextTitanSpawn[i] >= 0f)
                        {
                            if (NextTitanSpawn[i] <= Time.time)
                            {
                                if (i == 2)
                                {
                                    CreateTitanGoldCombatSquad((TeamIndex)i, BossSeedCount);
                                }
                                else
                                {
                                    CreateTitanGoldCombatSquad((TeamIndex)i, GetTeamSeedCount((TeamIndex)i));
                                }
                                NextTitanSpawn[i] = -1f;
                            }
                        }
                        if (NextTitanKill[i] >= 0f)
                        {
                            if (NextTitanKill[i] <= Time.time)
                            {
                                KillTitanSquad(TitanTeam[i]);
                                NextTitanKill[i] = -1f;
                            }
                        }
                    }
                }
            };

            On.EntityStates.Missions.BrotherEncounter.Phase1.OnEnter += (orig, self) =>
            {
                orig(self);
                if (Config_SpawnOnPhase.Value == 1)
                {
                    NextTitanSpawn[1] = Time.time + 5.0f;
                }
            };
            On.EntityStates.Missions.BrotherEncounter.Phase2.OnEnter += (orig, self) =>
            {
                orig(self);
                if (Config_SpawnOnPhase.Value == 2)
                {
                    NextTitanSpawn[1] = Time.time + 3.0f;
                }
            };
            On.EntityStates.Missions.BrotherEncounter.Phase3.OnEnter += (orig, self) =>
            {
                orig(self);
                if (Config_SpawnOnPhase.Value == 3)
                {
                    NextTitanSpawn[1] = Time.time + 5.0f;
                }
            };
            On.EntityStates.Missions.BrotherEncounter.Phase4.OnEnter += (orig, self) =>
            {
                orig(self);
                if (Config_KillOnSteal.Value)
                {
                    NextTitanKill[1] = Time.time + 7.5f;
                }
                if (Config_SpawnOnSteal.Value)
                {
                    BossSeedCount     = GetTeamSeedCount(TeamIndex.Player);
                    NextTitanSpawn[2] = Time.time + 12.0f;
                }
            };
            On.EntityStates.Missions.BrotherEncounter.EncounterFinished.OnEnter += (orig, self) =>
            {
                orig(self);
                for (int i = 0; i < NextTitanSpawn.Length; i++)
                {
                    NextTitanSpawn[i] = -1f;
                    NextTitanKill[i]  = Time.time + 2.5f;
                }
            };
            On.RoR2.GoldTitanManager.OnBossGroupStartServer += (orig, bossGroup) =>
            {
                bool        IsMithrix   = false;
                CombatSquad combatSquad = bossGroup.combatSquad;
                using (IEnumerator <CharacterMaster> enumerator = combatSquad.readOnlyMembersList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        if (enumerator.Current.masterIndex == MasterCatalog.FindMasterIndex("BrotherHurtMaster"))
                        {
                            IsMithrix = true;
                            break;
                        }
                    }
                }
                if (IsMithrix)
                {
                }
                else
                {
                    orig(bossGroup);
                }
            };
            int GetTeamSeedCount(TeamIndex team)
            {
                int SeedCount = 0;

                SeedCount = Util.GetItemCountForTeam(team, RoR2Content.Items.TitanGoldDuringTP.itemIndex, true, true);
                return(SeedCount);
            };
            void CreateTitanGoldCombatSquad(TeamIndex team, int SeedCount)
            {
                if (SeedCount > 0)
                {
                    CombatSquad combatSquad;
                    if (team == TeamIndex.Player)
                    {
                        combatSquad = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/NetworkedObjects/Encounters/MonstersOnShrineUseEncounter")).GetComponent <CombatSquad>();
                    }
                    else
                    {
                        combatSquad = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/NetworkedObjects/Encounters/ShadowCloneEncounter")).GetComponent <CombatSquad>();
                    }
                    int SpawnCount = 1;
                    //This is just here really.
                    //Like, swarms doesn't double aurelionite so this shouldn't be needed

                    /*if (RunArtifactManager.instance.IsArtifactEnabled(ArtifactCatalog.FindArtifactDef("Swarms")))
                     * {
                     *      if (Config_Debug.Value)
                     *      {
                     *              print("Doubled Aurelionite for Swarms");
                     *      }
                     * }*/
                    for (int i = 0; i < SpawnCount; i++)
                    {
                        Vector3         offsetpos = GetRandomSpawnPos();
                        CharacterMaster component = new MasterSummon
                        {
                            masterPrefab          = team == TeamIndex.Player ? TitanFriendly : TitanHostile,
                            position              = spawnposition + offsetpos,
                            summonerBodyObject    = null,
                            ignoreTeamMemberLimit = true,
                            teamIndexOverride     = team,
                        }.Perform();
                        AddTitanInventory(component, SeedCount);
                        combatSquad.AddMember(component);
                    }
                    if (combatSquad)
                    {
                        NetworkServer.Spawn(combatSquad.gameObject);
                        RegisterTitanSquad(combatSquad, team);
                    }
                }
            }

            Vector3 GetRandomSpawnPos()
            {
                Vector3 angle = new Vector3(1f, 1f, 1f);
                //Rotate the angle by a random degree
                float rotation = UnityEngine.Random.Range(0.0f, 360.0f);
                float x        = angle[0];
                float y        = angle[2];

                angle[1] = 0f;
                angle[0] = x * (float)Math.Cos(rotation) - y * (float)Math.Sin(rotation);
                angle[2] = x * (float)Math.Sin(rotation) + y * (float)Math.Cos(rotation);
                //Then normalize the angles
                angle  = Vector3.Normalize(angle);
                angle *= UnityEngine.Random.Range(20f, 40f);
                print(angle);
                return(angle);
            }

            void AddTitanInventory(CharacterMaster titan, int seeds)
            {
                float num  = 1f;
                float num2 = 1f;

                num  += Run.instance.difficultyCoefficient / 2f;
                num2 += Run.instance.difficultyCoefficient / 2f;
                num  *= Mathf.Pow((float)seeds, 1f);
                num2 *= Mathf.Pow((float)seeds, 0.5f);
                if (titan.teamIndex != TeamIndex.Player)
                {
                    num  = Mathf.Pow(num2, 0.5f);
                    num2 = Mathf.Pow(num2, 0.5f);
                }
                titan.inventory.GiveItem(RoR2Content.Items.BoostHp.itemIndex, Mathf.RoundToInt((num - 1f) * 10f));
                titan.inventory.GiveItem(RoR2Content.Items.BoostDamage.itemIndex, Mathf.RoundToInt((num2 - 1f) * 10f));
                if (Config_Debug.Value)
                {
                    print("Aurelionite spawned with " + (10 + Mathf.RoundToInt((num - 1f) * 10f)) * 10.0f + "% health.");
                    print("Aurelionite spawned with " + (10 + Mathf.RoundToInt((num2 - 1f) * 10f)) * 10.0f + "% damage.");
                }
            }

            void RegisterTitanSquad(CombatSquad combatSquad, TeamIndex team)
            {
                int slot = (int)team;

                if (slot >= 0 && slot <= TitanTeam.GetLength(0))
                {
                    KillTitanSquad(TitanTeam[slot]);
                    TitanTeam[slot] = combatSquad;
                }
            }

            void KillTitanSquad(CombatSquad combatSquad)
            {
                CharacterMaster[] HitList = new CharacterMaster[0];
                if (combatSquad)
                {
                    using (IEnumerator <CharacterMaster> enumerator = combatSquad.readOnlyMembersList.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            if (enumerator.Current)
                            {
                                if (enumerator.Current.GetBody())
                                {
                                    if (enumerator.Current.GetBody().healthComponent.alive)
                                    {
                                        Array.Resize <CharacterMaster>(ref HitList, HitList.Length + 1);
                                        HitList[HitList.Length - 1] = enumerator.Current;
                                    }
                                }
                            }
                        }
                    }
                }
                for (int i = 0; i < HitList.Length; i++)
                {
                    if (HitList[i])
                    {
                        HitList[i].TrueKill();
                    }
                }
            }
        }