If a bonus action attack for Two-Weapon Fighting involves multiple ability modifiers, which ones are added to the damage roll?

This question is entirely inspired by the following:

  • Bonus action attack ability score modifier (5E Question)

That question, however, happens to ask about a homebrew method of adding multiple ability modifiers to the bonus action attack of Two-Weapon Fighting and so, ultimately, has a homebrew solution. This question concerns non-homebrew methods of creating this scenario.


Two-Weapon Fighting states:

[…] You don’t add your ability modifier to the damage of the bonus attack, unless that modifier is negative. […]

But what happens when you would add more than one ability modifier to the damage roll? There are a few ways of doing this, and I’ll list the ones I know of below:

The Way of Mercy Monk’s Hand of Harm feature:

[…] When you hit a creature with an unarmed strike, you can spend 1 ki point to deal extra necrotic damage equal to one roll of your Martial Arts die + your Wisdom modifier. […]

The Devotion Paladin’s Channel Divinity: Sacred Weapon feature:

[…] For 1 minute, you add your Charisma modifier to attack rolls made with that weapon […]

The Oathbreaker Paladin’s Aura of Hate feature:

[…] Starting at 7th level, the paladin, as well any fiends and undead within 10 feet of the paladin, gains a bonus to melee weapon damage rolls equal to the paladin’s Charisma modifier […]

The Ranger’s Foe Slayer feature:

[…] Once on each of your turns, you can add your Wisdom modifier to the attack roll or the damage roll of an attack you make against one of your favored enemies. […]

The Warlock’s Lifedrinker Eldritch Invocation:

[…] When you hit a creature with your pact weapon, the creature takes extra necrotic damage equal to your Charisma modifier […]

Note, that perhaps some of these aren’t quite the same as the others, but what I’m asking remains the same: When a feature actually does cause you to add multiple different ability modifiers to an attack made as part of Two-Weapon Fighting which ones are not added to the damage roll?

For a basic unarmed strike, is only the proficiency bonus included in the attack roll, or is the Strength modifier also added?

The Player’s Handbook, Chapter 9, states about attack rolls:

The ability modifier used for a melee weapon attack is Strength

A bit later on it also states about melee attacks:

Instead of using a weapon to make a melee weapon attack, you can use an unarmed strike: a punch, kick, head-butt, or similar forceful blow (none of which count as weapons). On a hit, an unarmed strike deals bludgeoning damage equal to 1 + your Strength modifier. You are proficient with your unarmed strikes.

I’m not sure whether an unarmed strike is considered a “melee weapon attack.”

For a basic unarmed strike (i.e. no Monk, Tavern Brawler or anything else that enhances unarmed strikes), is only the proficiency bonus added to the attack roll, or is the Strength modifier also added?

Clearly the Strength modifier is added to the damage, but I’m asking about the attack roll.

Does Witch Bolt deal the added 1d12 damage on the turn that it’s cast?

Assuming that Witch bolt is cast at 1st level and hits the target would the target take 2d12 damage in that turn because its the beginning of the spell’s duration and

"on each of your turns for the duration, you can use your action to deal 1d12 lightning damage to the target automatically."

or does it take effect the turn after you cast it?

Can a webpage differ in content if ‘http’ is changed to ‘https’ or if ‘www.’ is added after ‘http://’ (or ‘https://’)?

When I use the Python package newspaper3k package and run the code

import newspaper paper = newspaper.build('http://abcnews.com', memoize_articles=False) for url in paper.article_urls():     print(url) 

I get a list of URLs for articles that I can download, in which both these URLs exist

  • http://abcnews.go.com/Health/coronavirus-transferred-animals-humans-scientists-answer/story?id=73055380
  • https://abcnews.go.com/Health/coronavirus-transferred-animals-humans-scientists-answer/story?id=73055380

As can be seen, the only difference between the two URLs is the s in https.

The question is, can the webpage content differ simply because an s is added to http? If I scrape a news source (in this case http://abcnews.com), do I need to download both articles to be sure I don’t miss any article, or are they guaranteed to have the same content so that I can download only one of them?

I have also noticed that some URLs also are duplicated by adding www. after the http:// (or https://). I have the same question here: Can this small change cause the webpage content to differ, and is this something I should take into account or can I simply ignore one of these two URLs?

Libgdx – TextButtons added to Table – clicklistener not working [closed]

I am having issues trying to implement a menu in a previously created game. I am pretty new to Libgdx and not sure how everything works just yet. I am adding a menu to an already created game scene using a table and text buttons.

My goal:

  1. Click button which shows table full of buttons
  2. Click specific table button and do something with them
  3. Click away from the table area then table/buttons will disappear

I’ve got it all working except connecting the buttons to clicklisteners. I can only think of the buttons not actually being on the top surface where you can click them.

Section of code: Shortened for brevity; class implements InputProcessor

    protected MenuComponent(GameContext context, SeaBattleScene owner) {         super(context, owner);         this.context = context;     }      @Override     public void create() {         batch = new SpriteBatch();         this.stage = new Stage();         Gdx.input.setInputProcessor(stage);         menuUp = new Texture("assets/ui/disengage.png");         menuDown = new Texture("assets/ui/disengagePressed.png");         menuWindow = createMenuWindow();         menuWindow.setVisible(false);         stage.addActor(menuWindow);         stage.getRoot().setPosition(65,150);     }      @Override     public void update() {     }      @Override     public void render() {         batch.begin();         batch.draw((menuButtonIsDown)?menuDown:menuUp, MENU_buttonX, MENU_buttonY);         batch.end();         stage.act();         stage.draw();     }     private Table createMenuWindow() {         //Table View         Table table = new Table();         table.setPosition(675,160);         //Button View         SpriteDrawable upFormat=new SpriteDrawable(new Sprite(createRoundPixMap(Color.BLACK,100, 30,10)));         SpriteDrawable downFormat=new SpriteDrawable(new Sprite(createRoundPixMap(Color.BLACK,100, 30,10)));         SpriteDrawable checkedFormat=new SpriteDrawable(new Sprite(createRoundPixMap(Color.BLACK,100, 30,10)));         TextButtonStyle buttonStyle=new TextButtonStyle(upFormat, downFormat, checkedFormat, new BitmapFont());         //Individual Buttons         TextButton lobbyButton = new TextButton("Back to Lobby",buttonStyle);         lobbyButton.addListener( new ClickListener() {                           public void clicked(InputEvent event, float x, float y) {                 System.out.println("Clicked");             };         });         TextButton mapButton = new TextButton("Show Maps",buttonStyle);         table.add(lobbyButton).pad(3,0,3,0).row();         table.add(mapButton).pad(3,0,3,0).row();         return table;     }           public static Texture createRoundPixMap(Color color, int width,             int height, int cornerRadius) {         Pixmap pixmap = new Pixmap(width, height, Pixmap.Format.Alpha);         pixmap.setBlending(Pixmap.Blending.None);         pixmap.setColor(color.r,color.g,color.b,0.4f);         pixmap.fillCircle(cornerRadius, cornerRadius, cornerRadius);         pixmap.fillCircle(width - cornerRadius, cornerRadius, cornerRadius);         pixmap.fillCircle(width - cornerRadius, height - cornerRadius, cornerRadius);         pixmap.fillCircle(cornerRadius, height - cornerRadius, cornerRadius);         pixmap.fillRectangle(0, cornerRadius, width, height - (cornerRadius * 2));         pixmap.fillRectangle(cornerRadius, 0, width - (cornerRadius * 2), height);         Texture texture = new Texture(pixmap);         pixmap.dispose();         return texture;     } 

Can someone expain or show me what I am doing wrong, so I can fix it to where I can use the buttons?

This is basically what it looks like: Menu

Woocommerce redirection to checkout for certain after product added to cart

I have implement this code in function.php to redirect the page to checkout if product with id(26285) added to the cart .This is the code

add_action( 'woocommerce_add_to_cart', 'custom_add_to_cart', 1, 2 ); function custom_add_to_cart( $  cart_item_key, $  product_id ) {  $  site_url = get_site_url(); if($  product_id == 26285) {  // Redirecting to some url wp_redirect($  site_url.'/my-account/'); exit; }} 

the condition i need to satisfy here is , if the product with ID:26285 added to the cart i need to redirect to checkout.The problem i am facing now is the page is redirecting but the product was not adding to cart . How to achive that?

Your help will very much appreciated. Have a nice day!

I am unable to understand the logic behind the code (I’ve added exact queries as comments in the code)

Our local ninja Naruto is learning to make shadow-clones of himself and is facing a dilemma. He only has a limited amount of energy (e) to spare that he must entirely distribute among all of his clones. Moreover, each clone requires at least a certain amount of energy to function (m) . Your job is to count the number of different ways he can create shadow clones. Example:

e=7;m=2

ans = 4

The following possibilities occur: Make 1 clone with 7 energy

Make 2 clones with 2, 5 energy

Make 2 clones with 3, 4 energy

Make 3 clones with 2, 2, 3 energy.

Note: <2, 5> is the same as <5, 2>. Make sure the ways are not counted multiple times because of different ordering.

Answer

int count(int n, int k){     if((n<k)||(k<1)) return 0;     else if ((n==k)||(k==1)) return 1;     else return count(n-1,k-1)+ count(n-k,k);   // logic behind this? }  int main() {     int e,m;            // e is total energy and m is min energy per clone     scanf("%d %d", &e, &m);     int max_clones= e/m;     int i,ans=0;     for(i=1;i<=max_clones;i++){         int available = e - ((m-1)*i);   // why is it (m-1)*i instead of m*i         ans += count(available, i);     }     return 0; }