Пример #1
0
    private void OnReactionAttempt(EntityUid uid, BloodstreamComponent component, ReactionAttemptEvent args)
    {
        if (args.Solution.Name != BloodstreamComponent.DefaultBloodSolutionName &&
            args.Solution.Name != BloodstreamComponent.DefaultChemicalsSolutionName &&
            args.Solution.Name != BloodstreamComponent.DefaultBloodTemporarySolutionName)
        {
            return;
        }

        foreach (var effect in args.Reaction.Effects)
        {
            switch (effect)
            {
            case CreateEntityReactionEffect: // Prevent entities from spawning in the bloodstream
            case AreaReactionEffect:         // No spontaneous smoke or foam leaking out of blood vessels.
                args.Cancel();
                return;
            }
        }

        // The area-reaction effect canceling is part of avoiding smoke-fork-bombs (create two smoke bombs, that when
        // ingested by mobs create more smoke). This also used to act as a rapid chemical-purge, because all the
        // reagents would get carried away by the smoke/foam. This does still work for the stomach (I guess people vomit
        // up the smoke or spawned entities?).

        // TODO apply organ damage instead of just blocking the reaction?
        // Having cheese-clots form in your veins can't be good for you.
    }
Пример #2
0
        private void OnReactionAttempt(EntityUid uid, SolutionAreaEffectComponent component, ReactionAttemptEvent args)
        {
            if (args.Solution.Name != SolutionAreaEffectComponent.SolutionName)
            {
                return;
            }

            // Prevent smoke/foam fork bombs (smoke creating more smoke).
            foreach (var effect in args.Reaction.Effects)
            {
                if (effect is AreaReactionEffect)
                {
                    args.Cancel();
                    return;
                }
            }
        }