## Spells

Fortunately D&D Beyond categorizes spells by applied conditions and lets you filter by it. Doing so lists eyebite, which applies unconscious as part of its Asleep mode, and symbol, which does so as part of its Sleep mode. In addition the spells sleep and catnap (not listed above) apply the condition, but not contingent on saving throws.

Whether the Slumber mode of imprisonment counts is unclear, the spell does not call out the unconscious condition, but asleep is often taken to mean unconscious. Ask your DM before making a sleeping beauty hydra.

## Monster abilities

In addition a number of monster traits cause the unconscious condition contingent on a saving throw, such as the chasme’s Drone:

Any other creature that starts its turn within 30 feet of the chasme must succeed on a DC 12 Constitution saving throw or fall unconscious for 10 minutes. (…)

There’s also the Ogre Chain Brute’s Chain Smash, the Kamadan’s Sleep Breath, the Beholder’s (and Gauth’s and Death Tyrant’s) Sleep ray, the Gentle Lullaby of a Satyr with pipes, and the Sleep Breath of Brass Dragons (and probably many others). Effects which cause the unconscious condition contingent on a poisoning (usually by failing the saving throw by 5 or more), such as the pseudodragon’s Sting presumably aren’t valid.

To my knowledge there are no player character options which include the effect (outside the above spells, or summoning an applicable monster, nor any magic items (where it isn’t part of a poison effect), but I welcome any additions I’ve missed.

## How do I avoid caching a redirect response from a form?

I have a Drupal 8 form used by authenticated users which sometimes needs to redirect based on the presence of absence of something in session. I don’t want the redirect to be cached.

My form is displayed directly with a route. i.e., the route has a _form default pointing to the form class.

My buildForm method starts like this:

public function buildForm(array $form, FormStateInterface$form_state)
{
$form('#cache') = ('max-age' => 0); if (some value not in session) {$response = new TrustedRedirectResponse($some_url);$response->setMaxAge(0);
throw new EnforcedResponseException(\$response);
}

// build the form.
}


I have not been able to avoid the redirect response being cached. It redirects as expected if the session variable does not exist but continues to redirect next time when the session variable does exist.

Users are authenticated so it is the dynamic page cache. drush cr or uninstalling the dynamic page cache “fixes” the problem.

## dnd 5e – Can Specters move into the ground to avoid Attacks of Opportunity?

In 5e, Specters have Incorporeal Movement which says

The specter can move through other creatures and objects as if they were difficult terrain. It takes 5(1d10) force damage if it ends its turn inside an object.

Therefore, I assume Specters can move through ground as if it were difficult terrain.

Could a specter attack a creature, move into its space and then move straight down into the ground to avoid an Attack of Opportunity? Regardless if it would be intelligent enough to do so, would the AoO happen before it is fully submerged below ground or would the ground protect the Specter?

My guess would be the ground would protect it because once it leaves the 5ft reach of its target, it would be mostly submerged.

## dnd 5e – 5e Can Specters move into the ground to avoid Attacks of Opportunity?

In 5e, Specters have Incorporeal Movement which says

The specter can move through other creatures and objects as if they were difficult terrain. It takes 5(1d10) force damage if it ends its turn inside an object.

Therefore, I assume Specters can move through ground as if it were difficult terrain.

Could a specter attack a creature, move into its space and then move straight down into the ground to avoid an Attack of Opportunity? Regardless if it would be intelligent enough to do so, would the AoO happen before it is fully submerged below ground or would the ground protect the Specter?

My guess would be the ground would protect it because once it leaves the 5ft reach of its target, it would be mostly submerged.

## smtp – How do email blast services avoid their mail servers being blacklisteddue to email spamming?

Email blast services like Postmark, Mailchimp, SendInBlue and etc allows their users to send thousands of email to reach out mass contacts. Multiply that by the thousands of users they have, thats a LOT of emails hammering various SMTP servers.

I’m just wondering how these services are not been blacklisted by public/private Email servers world wide?

I would imagine the entire domain would have been blacklisted by now.

EDIT: I recently noticed that my an ‘EngageBay.com’ email went into my spam folder.

## animation – Unity-How can I enlarge the sprite to avoid the movement of the character when the pivot change?

Thanks for contributing an answer to Game Development Stack Exchange!

But avoid

• Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

## machine precision – Avoid MachinePrecision numbers in Message

Can I change the output of Message to not show MachinePrecision numbers? E.g.

Bleh::test = "test 1";


This is tolerable:

Message(Bleh::test, 0.01)
(* Bleh::test -- test 0.01 *)


This is not:

xx = 0.01;
Do(xx += 0.04, {5})
Message(Bleh::test, xx)
(* Bleh::test -- test 0.21000000000000002 *)


Is there a way for Message to display this rounded off as:

xx
(* 0.21 *)


## How to avoid crash after running shellcode in browser exploit

I am learning information security. On the internet, majority of exploit code gets crashed after running shellcode.(for example, cve-2018-8174, https://www.exploit-db.com/exploits/44741)
How to avoid crash after running my own shellcode? Are there any methods to avoid crash? Any suggestions are welcomed. Thanks in advance.

## c# – How to avoid giant main function because of dependency injection

I try to use dependency injection as often as I can but every time I end up with the same problem : I always have a giant main function.

If I use it without any framework and send the classes in the constructors, I have to initialize every class in the main and it can take quite a lot of lines.

If I use a framework with a inversion of control / a service locator the result is nearly the same because I have to initialize the classes and send them to the IOC.

Is there any way to use dependency injection without having a big giant function initializing everything ?

## object oriented – how to avoid cascading cynamic casts?

You haven’t missed anything. Some things are just difficult to do.

Dynamic casts are not inherently evil, they are just fragile: if you add a DerivedC type, your casts will continue to work but just skip objects of this type with no compile-time error. This is very analogous to the issue that an Object::addTo(Inventory&) method would need to be kept in sync with the structure of the inventory.

The core question is along which dimensions you want to keep changes easy, and along which dimensions you can sacrifice ease of change.

• If you want to change the inventory system easily but not add new item types, dynamic casts or the visitor pattern appear sensible.
• If you want to keep the inventory system fixed but easily add new item types, then Object::addTo(Inventory&) seems better.

The visitor pattern can sometimes help by separating objects in a hierarchy from operations on that hierarchy, in a manner that meshes well with static typing. The downside is that the hierarchy of objects becomes fixed and cannot be extended later without breaking existing visitors.

Trying to extend both the hierarchy and the available operations is called the expression problem and is very tricky. I think there has been some success with using C++ templates, but integrating such solutions with your game’s data model is likely overkill.

For your scenario, all of these issues are tradeoffs but not dealbreakers: you’re not making any change impossible, some changes just become more difficult. You can always refactor later. Personally:

• I would use the visitor pattern based approach because I value static type checking very strongly.
• Your original downcasting-based solution is equally good if you have a QA strategy that would likely find any missing cases. I would add an else-branch that logs any missing cases and (if in testing/debug mode) coredumps the program.
• I would avoid the addTo() approach because this spreads knowledge about inventory management around the entire application (low cohesion, high coupling between different parts).

You should also consider whether it makes sense to model your DerivedA and DerivedB types as separate C++ classes. Especially for games, it can make more sense to sidestep the C++ type system and implement your own dynamically checked system. While that’s more error-prone, it also provides for far more flexibility that (a) makes it easier to script interactions, and (b) enables more complex mechanics, e.g. a type of ammo that can also be used as a grenade. Please read the chapter Type Object Pattern in the book Game Programming Patterns.