Ejemplo n.º 1
0
        private void BombOnHit(DamageReport damageReport)
        {
            if (!NetworkServer.active || !ArtifactEnabled)
            {
                return;
            }
            if (damageReport.victim.body.teamComponent.teamIndex == TeamIndex.Player)
            {
                return;
            }                                                                                     //Because pots and barrels making spite bombs is funny. also Birdsharks

#if DEBUG
            TurboEdition._logger.LogWarning(ArtifactName + " is enabled, and body hurt wasnt a player gonna check rolls.");
#endif

            if (Util.CheckRoll(spiteChance * 100) && damageReport.victim.body.healthComponent)
            {
#if DEBUG
                Chat.AddMessage(ArtifactName + " succeeded the roll.");
#endif
                Bomb2ArtifactManager manager = Run.instance.GetComponentInChildren <Bomb2ArtifactManager>();
                if (!manager)
                {
                    return;
                }
#if DEBUG
                TurboEdition._logger.LogWarning(ArtifactName + " manager does exist, spawning bombs.");
#endif
                if (spiteBombs > 0)
                {
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " spiteBombs config is set to " + spiteBombs + " overwritting the game's calculation methods.");
#endif
                    int sbc = (int)UnityEngine.Random.Range(1, (float)spiteBombs);
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " spawning " + sbc + " spiteBombs.");
#endif
                    manager.SpawnBombFromBody(damageReport.victimBody, sbc);
                    return;
                }
                manager.SpawnBombFromBody(damageReport.victimBody);
            }
        }
Ejemplo n.º 2
0
        private void ExtraDeath(DamageReport damageReport)
        {
            if (!NetworkServer.active || !ArtifactEnabled)
            {
                return;
            }
            if (RunArtifactManager.instance.IsArtifactEnabled(RoR2Content.Artifacts.bombArtifactDef) || !onlySpite)
            {
                if (damageReport.victim.body.teamComponent.teamIndex == TeamIndex.Monster)
                {
                    return;
                }                                                                                      //funny incoming
#if DEBUG
                Chat.AddMessage(ArtifactName + " something that is not a monster died, spawning spite bombs.");
#endif
                Bomb2ArtifactManager manager = Run.instance.GetComponentInChildren <Bomb2ArtifactManager>();
                if (!manager)
                {
                    return;
                }
#if DEBUG
                TurboEdition._logger.LogWarning(ArtifactName + " manager does exist, spawning MONSTER bombs.");
#endif
                if (playerBombs > 0)
                {
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " playerBombs config is set to " + playerBombs + " overwritting the game's calculation methods.");
#endif
                    int pbc = (int)UnityEngine.Random.Range(1, (float)playerBombs);
#if DEBUG
                    TurboEdition._logger.LogWarning(ArtifactName + " spawning " + pbc + " playerBombs.");
#endif
                    if (damageReport.victim.body.teamComponent.teamIndex == TeamIndex.Player && friendlyBombs)
                    {
                        manager.SpawnBombFromBody(damageReport.victimBody, pbc);
                        return;
                    }
                    manager.SpawnMonsterBombFromBody(damageReport.victimBody, pbc);
                    return;
                }
                manager.SpawnMonsterBombFromBody(damageReport.victimBody);
            }
        }