How To Maximise Your Defenses HTML Edit

X-Act

np: Biffy Clyro - Shock Shock
is a Site Content Manager Alumnusis a Programmer Alumnusis a Smogon Discord Contributor Alumnusis a Top Researcher Alumnusis a Top CAP Contributor Alumnusis a Top Tiering Contributor Alumnusis a Top Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
Here's one of my articles in HTML format for correction.

HTML:
<h2>How to Maximize Your Defenses</h2>
 
<h3>Introduction</h3>
 
<p>You are on Netbattle, trying to give your Dusclops good defensive effort values (EVs). You decide to use all of your EVs to boost its defenses, so you have 510 effort values to work with. You notice that Dusclops has 130 base Defense and 130 base Special Defense, so you put 252 EVs in Defense, 252 EVs in Special Defense and the remaining 6 EVs in HP. You then realize that you can give Dusclops a nature that boosts either its Defense or Special Defense. So now its defenses aren’t equal, and... you start to wonder if your previous EV distribution was such a good idea after all...</p>
 
<p>Or suppose you want to make your Salamence be able to take hits a little better. You can reserve 80 EVs, say, for this purpose, and you’re trying to distribute them to Salamence’s defenses in the best way possible. So, you look at Salamence’s stats. It has 95 base HP, 80 base Defense and 80 base Special Defense. You notice Salamence’s Intimidate trait, so you decide that Salamence can already take physical hits moderately well, and hence you put the 80 EVs in Special Defense. However, you start to wonder if this decision is justified. Maybe putting them in HP would have been better...</p>
 
<p>If the above conforms to what you usually think about when trying to find good defensive EVs for your Pokemon, and want to start building the best defensive Pokemon given the EVs you have left, continue reading.</p>
 
<h3>Overall Harm</h3>
 
<p>To understand how to distribute your defensive EVs, it is important to understand what the Overall Harm that a Pokemon can sustain is.</p>
 
<p>The Overall Harm is a number representing the fraction of HP a Pokemon would lose if it was to be dealt a physical move and a special move of the same power in succession. It is defined using the following formula:</p>
 
<p>Overall Harm = (<em>k</em>(<em>D</em> + <em>IS</em>) + 4<em>DS</em>) / <em>HDS</em></p>
 
<p>where:</p>
 
<ul>
<li><em>k</em> is a constant representing the damage being dealt by the foe</li>
<li><em>D</em> is your Defense stat</li>
<li><em>S</em> is your Special Defense stat</li>
<li><em>H</em> is your HP stat</li>
<li><em>I</em> is 2/3 if your Pokemon has the Intimidate trait, 1 otherwise</li>
</ul>
 
<p>Thus, to distribute your EVs for maximum defenses, you need to choose <em>H</em>, <em>D</em> and <em>S</em> in the above formula such that the Overall Harm is the lowest possible.</p>
 
<h3>The DefenseEffortValues Applet</h3>
 
<p>The DefenseEffortValues applet below uses the formula for the Overall Harm displayed above, and cycles through all possible EV distributions to give you the one that provides you with the lowest possible Overall Harm. (The value for <em>k</em> used in the applet is 20000. You can read later for an explanation of the choice of this value.)</p>
 
<applet code="DefenseEffortValues.class" width=600 height=410></applet>
 
<p>Make sure you have the Java console version 1.5 or better installed on your computer, otherwise the applet above won’t work.</p>
 
<p>On the left hand side of the applet, input your Pokemon's <strong>base HP</strong>, <strong>base Defense</strong>, <strong>base Special Defense</strong>, and the <strong>amount of EVs you have left</strong>. You can also enter its <strong>HP IV</strong>, <strong>Defense IV</strong> and <strong>Special Defense IV</strong>, as well as the Pokemon's <strong>Level</strong>. If the Pokemon has the <strong>Intimidate</strong> trait or the <strong>Marvel Scale</strong>, click on the respective checkbox. If the Pokemon holds <strong>Soul Dew</strong> or <strong>Metal Powder</strong>, click on its checkbox. (For <strong>Deepseascale</strong>, you can click on the Soul Dew checkbox to achieve the same effect.) If the Pokemon already has a nature assigned to it, choose it from the drop down list, otherwise you can let the applet find the best Pokemon nature that maximises its defenses by choosing <strong>Find Best</strong>. You can adjust your <strong>EV bias</strong> from the slider; moving it more towards Defense makes the applet take care of Defense more than Special Defense, and vice versa. You can also input any number of Defense or Special Defense stat modifiers from the respective choice boxes. Click on <strong>Find EVs</strong> to find the best defensive EVs using the data you're entered. The best EVs and the corresponding stats will be displayed on the grey part of the applet on the right hand side, together with the best nature if you had chosen to find the best nature possible. The <strong>Reset</strong> button, of course, clears all the values that have been entered.</p>
 
<p>For the Dusclops example written in the introduction, the applet tells us to put 252 EVs in HP, 160 EVs in Defense and 88 EVs in Special Defense, with a nature that boosts Special Defense. The stats would then be 284 HP, 336 Defense and 352 Special Defense.</p>
 
<p>For the Salamence example, assuming it has an Adamant Nature, the applet tells us to put 60 EVs in HP and 20 EVs in Special Defense for the best overall defense. This gives us a 346 HP stat, 196 Defense stat and 201 Special Defense stat.</p>
 
<p>You may skip all the following sections if you’re not interested in how the formula for the overall harm was obtained.</p>
 
<h3>How the Overall Harm Formula was obtained</h3>
 
<p>To be able to understand how the Overall Harm formula was found, we first need to know how the game actually calculates the damage that your Pokemon is dealt. This is done by the so-called Damage Formula, which can be written in the following manner:</p>
 
<p>Damage = ((Harm Dealt) ÷ (Your Defense)) + 2) × TypeModifiers × RandomNumber</p>
 
<p>(Harm Dealt is equal to 42 × Foe’s Attack × Move Base Power ÷ 50 if the foe is a Level 100 Pokemon.) We need to find out what happens to the damage dealt if the same Pokemon uses the same move over and over, and you increase or decrease your Defense (or Special Defense) stat. Because of this, the foe’s attack stat and move base power is kept constant throughout, and so are the Type Modifiers. We assume that the random number generated is always the maximum, too, so the damage formula becomes:</p>
 
<p>Damage = (<em>k</em> ÷ <em>D</em>) + 2</p>
 
<p>where <em>k</em> is the constant damage that the foe is dealing, and <em>D</em> is your defense stat.</p>
 
<p>We now need to factor your HP in the calculation. If 60 damage is dealt to a Pokemon with 300HP, it will lose 1/5 of its total HP, whereas 60 damage dealt to a Pokemon with 480HP will only make it lose 1/8 of its total HP. Here, we see why the HP stat is also important. Hence, we can conclude that</p>
 
<p>Physical Damage as a Fraction of HP = ((<em>k</em> ÷ <em>D</em>) + 2) ÷ <em>H</em></p>
 
<p>where <em>H</em> is your HP stat. Rearranging, we get</p>
 
<p>Physical Damage as a Fraction of HP = (<em>k</em> + 2<em>D</em>) ÷ <em>HD</em></p>
 
<p>Similarly,</p>
 
<p>Special Damage as a Fraction of HP = (<em>k</em> + 2<em>S</em>) ÷ <em>HS</em></p>
 
<p>where <em>S</em> is your Special Defense stat. Adding the above two formulae together and rearranging the formula, we get the Overall Harm that the Pokemon will take as a fraction of its HP:</p>
 
<p>Overall Harm = ((<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>) + ((<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>)</p>
<p>= (<em>S</em>(<em>k</em> + 2<em>D</em>) + <em>D</em>(<em>k</em> + 2<em>S</em>)) ÷ <em>HDS</em></p>
<p>= (<em>kS</em> + 2<em>DS</em> + <em>kD</em> + 2<em>DS</em>) ÷ <em>HDS</em></p>
<p>= (<em>k</em>(<em>D</em> + <em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em></p>
 
<p><strong>Overall Harm = (<em>k</em>(<em>D</em> + <em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em></strong></p>
 
<p>All that remains is to choose a suitable value of <em>k</em>. This can be basically any number that you can dream of. However, higher values of <em>k</em> produce better values (otherwise the value for the Overall Harm would be too small). 20000 seems to be a good all-round value. (Incidentally, it’s very near the value generated when a Level 100 Pokemon with 317 Attack stat uses a 75 Base Power move).</p>
 
<h3>Biased Overall Harm</h3>
 
<p>Sometimes, you don’t need your Pokemon to take hits equally well from both attacks and special attacks. Maybe you prefer your Pokemon to take hits better from the physical side, or from the special side. This is where the Biased Overall Harm comes in.</p>
 
<p>First, we introduce a bias factor <em>B</em>. <em>B</em> is a number between 0 and 1 inclusive, which provides the degree of bias you want from the <em>physical</em> side. <em>B</em>=0 would make the Overall Harm formula take care of the special side exclusively; <em>B</em>=1 would make the formula take care of only the physical side; <em>B</em>=0.5 would make the Overall Harm formula take care of both equally (as it is right now). Of course, <em>B</em> can take any value you like between 0 and 1, which gives you varying degrees of bias.</p>
 
<p>Let’s see how we are going to incorporate this number in the Overall Harm formula now.</p>
 
<p>First of all, we rewrite the Overall Harm formula as follows:</p>
 
<p>Overall Harm = [(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + [(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
 
<p>Recall that the first pair of square brackets is the damage you take from a physical hit, and the second pair of square brackets is the damage you take from a special hit of the same power. We now need to vary this damage according to the value of <em>B</em>. Here is how it’s done:</p>
 
<p>Biased Overall Harm = (2<em>B</em>)[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + (2 – 2<em>B</em>)[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
 
<p>Let’s see what happens when <em>B</em> = 1:</p>
 
<p>Biased Overall Harm = (2(1))[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + (2 – 2(1))[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
<p>= 2[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + 0[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
<p>= 2[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>]</p>
 
<p>So, when <em>B</em> = 1, the Overall Harm formula returns the damage from two physical hits, and so the applet will exclusively raise the defense stat to try to lower the overall damage harm as much as possible.</p>
 
<p>When <em>B</em> = 0:</p>
 
<p>Biased Overall Harm = (2(0))[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + (2 – 2(0))[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
<p>= 0[(<em>k</em> + 2<em>D</em>) / <em>HD</em>] + 2[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
<p>= 2[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
 
<p>This returned the damage from two special hits, and so the applet would try to increase the special defense stat as much as possible in this case.</p>
 
<p>And when <em>B</em> = 0.5:</p>
 
<p>Biased Overall Harm = (2(0.5))[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + (2 – 2(0.5))[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
<p>= 1[(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + 1[(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
<p>= [(<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>] + [(<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>]</p>
 
<p>This returned the usual, unbiased, Overall Harm formula we wrote before, as it should have done.</p>
 
<h3>Raising Your Defenses</h3>
 
<p>Sometimes, you raise your defenses during the match, either via moves, via items or via traits.</p>
 
<p>The item <em>Soul Dew</em> makes the Special Defense stat of Latios and Latias 1.5 times what it was before. The item <em>Metal Powder</em> makes both the Defense and Special Defense of Ditto 1.5 times what they were before.</p>
 
<p>The trait <em>Marvel Scale</em> makes the Defense of Milotic 1.5 times what it was before if it is afflicted by a Special condition.</p>
 
<p>You can also raise your Defense and Special Defense stats using moves such as <em>Curse</em>, <em>Calm Mind</em>, <em>Amnesia</em>, <em>Iron Defense</em>, etc.</p>
 
<p>The effect of these things in the Overall Harm formula is very minor: you just replace <em>D</em> and <em>S</em>, if necessary, by the modified defense and/or special defense stats.</p>
 
<h3>Pokemon with Intimidate</h3>
 
<p>When a Pokemon with the Intimidate trait switches into the foe, it makes the opponent’s physical attack stat 2/3 of what it was before. This means that, in the above formula, the physical damage as a fraction of HP would be</p>
 
<p>Physical Damage as a Fraction of HP = ((2/3)<em>k</em> + 2<em>D</em>) ÷ <em>HD</em></p>
 
<p>The special damage as a fraction of HP would still be the same. Hence, overall,</p>
 
<p>Overall Harm = (((2/3)<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>) + ((<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>)</p>
<p>= (<em>S</em>((2/3)<em>k</em> + 2<em>D</em>) + <em>D</em>(<em>k</em> + 2<em>S</em>)) ÷ <em>HDS</em></p>
<p>= ((2/3)<em>kS</em> + 2<em>DS</em> + <em>kD</em> + 2<em>DS</em>) ÷ <em>HDS</em></p>
<p>= (<em>k</em>(<em>D</em> + (2/3)<em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em></p>
 
<p><strong>Overall Harm for Pokemon with Intimidate = (<em>k</em>(<em>D</em> + (2/3)<em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em></strong></p>
 
<p>Of course, this will hold for as long as the foe stays Intimidated.</p>
 
<h3>Pokemon with Leftovers</h3>
 
<p>A Pokemon with Leftovers recovers 1/16 of its HP at the end of each turn. Thus, at the end of the turn, the physical and special damage as a fraction of HP will both be 1/16 less, and hence</p>
 
<p>Overall Harm = ((<em>k</em> + 2<em>D</em>) ÷ <em>HD</em> – 1/16) + ((<em>k</em> + 2<em>S</em>) ÷ <em>HS</em> – 1/16)</p>
<p>= ((<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>) + ((<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>) – (1/16 + 1/16)</p>
<p>= ((<em>k</em>(<em>D</em> + <em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em>) – 1/8</p>
 
<p><strong>Overall Harm for Pokemon with Leftovers = Overall Harm – 0.125</strong>
 
<p>This means that attaching Leftovers to a Pokemon will not affect the way you distribute your defensive EVs to guarantee the maximum defenses possible. This is why the Leftovers item is not mentioned anywhere in the applet.</p>
 

chaos

is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Smogon Discord Contributoris a Contributor to Smogonis an Administratoris a Tournament Director Alumnusis a Researcher Alumnus
Owner
<h2>How to Maximize Your Defenses</h2>
This is auto-added by the SCMS as an <h1>. All of the <h3>s should be promoted to <h2> and that line should be removed.

Overall Harm = (<em>k</em>(<em>D</em> + <em>IS</em>) + 4<em>DS</em>) / <em>HDS</em>
Variables are more appropriately marked up with <var>.

<applet code="DefenseEffortValues.class" width=600 height=410></applet>
Note that <applet> is not an XHTML strict tag, and all uses of it in modern code should be replaced by <object>. I'd rather not have a Java applet directly linked to in the article because it will bump up the loading time and make some browsers lag. If you want to LINK to an applet, thats okay, but don't embed it in an article.

I would take all of the explanation of the applet and move it to a different page.

<p>Overall Harm = ((<em>k</em> + 2<em>D</em>) ÷ <em>HD</em>) + ((<em>k</em> + 2<em>S</em>) ÷ <em>HS</em>)</p>
<p>= (<em>S</em>(<em>k</em> + 2<em>D</em>) + <em>D</em>(<em>k</em> + 2<em>S</em>)) ÷ <em>HDS</em></p>
<p>= (<em>kS</em> + 2<em>DS</em> + <em>kD</em> + 2<em>DS</em>) ÷ <em>HDS</em></p>
<p>= (<em>k</em>(<em>D</em> + <em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em></p>

<p><strong>Overall Harm = (<em>k</em>(<em>D</em> + <em>S</em>) + 4<em>DS</em>) ÷ <em>HDS</em></strong></p>

... and stuff like it
These aren't really "paragraphs". You're trying to fit special formatting into semantic tags like <p>, and not only will it look bad, it won't be semantically correct. If you want special formatting, mark the whole thing up with <pre> and format it how you like. Alternatively, <code> is also permissible. I'm not sure which I prefer at the moment.

<p>The item <em>Soul Dew</em> makes the Special Defense stat of Latios and Latias 1.5 times what it was before. The item <em>Metal Powder</em> makes both the Defense and Special Defense of Ditto 1.5 times what they were before.</p>
Instead of emphasis, how about just linking to the item?

When you finish making corrections, repost it and I will look over it again. Thanks! :)
 

X-Act

np: Biffy Clyro - Shock Shock
is a Site Content Manager Alumnusis a Programmer Alumnusis a Smogon Discord Contributor Alumnusis a Top Researcher Alumnusis a Top CAP Contributor Alumnusis a Top Tiering Contributor Alumnusis a Top Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
Hope this is a better effort:

HTML:
<h2>Introduction</h2>
 
<p>You are on Netbattle, trying to give your Dusclops good defensive effort values (EVs). You decide to use all of your EVs to boost its defenses, so you have 510 effort values to work with. You notice that Dusclops has 130 base Defense and 130 base Special Defense, so you put 252 EVs in Defense, 252 EVs in Special Defense and the remaining 6 EVs in HP. You then realize that you can give Dusclops a nature that boosts either its Defense or Special Defense. So now its defenses aren’t equal, and… you start to wonder if your previous EV distribution was such a good idea after all...</p>
 
<p>Or suppose you want to make your Salamence be able to take hits a little better. You can reserve 80 EVs, say, for this purpose, and you’re trying to distribute them to Salamence’s defenses in the best way possible. So, you look at Salamence’s stats. It has 95 base HP, 80 base Defense and 80 base Special Defense. You notice Salamence’s Intimidate trait, so you decide that Salamence can already take physical hits moderately well, and hence you put the 80 EVs in Special Defense. However, you start to wonder if this decision is justified. Maybe putting them in HP would have been better...</p>
 
<p>If the above conforms to what you usually think about when trying to find good defensive EVs for your Pokemon, and want to start building the best defensive Pokemon given the EVs you have left, continue reading.</p>
 
<h2>Overall Harm</h2>
 
<p>To understand how to distribute your defensive EVs, it is important to understand what the Overall Harm that a Pokemon can sustain is.</p>
 
<p>The Overall Harm is a number representing the fraction of HP a Pokemon would lose if it was to be dealt a physical move and a special move of the same power in succession. It is defined using the following formula:</p>
 
<pre>Overall Harm = (<var>k</var>(<var>D</var> + <var>IS</var>) + 4<var>DS</var>) ÷ <var>HDS</var></pre>
 
<p>where:</p>
 
<ul>
<li><var>k</var> is a constant representing the damage being dealt by the foe</li>
<li><var>D</var> is your Defense stat</li>
<li><var>S</var> is your Special Defense stat</li>
<li><var>H</var> is your HP stat</li>
<li><var>I</var> is 2/3 if your Pokemon has the Intimidate trait, 1 otherwise</li>
</ul>
 
<p>Thus, to distribute your EVs for maximum defenses, you need to choose <var>H</var>, <var>D</var> and <var>S</var> in the above formula such that the Overall Harm is the lowest possible.</p>
 
<h2>The DefenseEffortValues Applet</h2>
 
<p>The DefenseEffortValues applet uses the formula for the Overall Harm displayed above, and cycles through all possible EV distributions to give you the one that provides you with the lowest possible Overall Harm. (The value for <var>k</var> used in the applet is 20000. You can read later for an explanation of the choice of this value.) It can be accessed <a href="defenseapplet.htm">here</a>.</p>
 
<p>For the Dusclops example written in the introduction, the applet tells us to put 252 EVs in HP, 160 EVs in Defense and 88 EVs in Special Defense, with a nature that boosts Special Defense. The stats would then be 284 HP, 336 Defense and 352 Special Defense.</p>
 
<p>For the Salamence example, assuming it has an Adamant Nature, the applet tells us to put 60 EVs in HP and 20 EVs in Special Defense for the best overall defense. This gives us a 346 HP stat, 196 Defense stat and 201 Special Defense stat.</p>
 
<p>You may skip all the following sections if you’re not interested in how the formula for the overall harm was obtained.</p>
 
<h2>How the Overall Harm Formula was Obtained</h2>
 
<p>To be able to understand how the Overall Harm formula was found, we first need to know how the game actually calculates the damage that your Pokemon is dealt. This is done by the so-called Damage Formula, which can be written in the following manner:</p>
 
<pre>Damage = ((Harm Dealt) ÷ (Your Defense)) + 2) × TypeModifiers × RandomNumber</pre>
 
<p>(Harm Dealt is equal to 42 × Foe’s Attack × Move Base Power ÷ 50 if the foe is a Level 100 Pokemon.) We need to find out what happens to the damage dealt if the same Pokemon uses the same move over and over, and you increase or decrease your Defense (or Special Defense) stat. Because of this, the foe’s attack stat and move base power is kept constant throughout, and so are the Type Modifiers. We assume that the random number generated is always the maximum, too, so the damage formula becomes:</p>
 
<pre>Damage = (<var>k</var> ÷ <var>D</var>) + 2</pre>
 
<p>where <var>k</var> is the constant damage that the foe is dealing, and <var>D</var> is your defense stat.</p>
 
<p>We now need to factor your HP in the calculation. If 60 damage is dealt to a Pokemon with 300HP, it will lose 1/5 of its total HP, whereas 60 damage dealt to a Pokemon with 480HP will only make it lose 1/8 of its total HP. Here, we see why the HP stat is also important. Hence, we can conclude that</p>
 
<pre>Physical Damage as a Fraction of HP = ((<var>k</var> ÷ <var>D</var>) + 2) ÷ <var>H</var></pre>
 
<p>where <var>H</var> is your HP stat. Rearranging, we get</p>
 
<pre>Physical Damage as a Fraction of HP = (<var>k</var> + 2<var>D</var>) ÷ <var>HD</var></pre>
 
<p>Similarly,</p>
 
<pre>Special Damage as a Fraction of HP = (<var>k</var> + 2<var>S</var>) ÷ <var>HS</var></pre>
 
<p>where <var>S</var> is your Special Defense stat. Adding the above two formulae together and rearranging the formula, we get the Overall Harm that the Pokemon will take as a fraction of its HP:</p>
 
<pre>
Overall Harm = ((<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>) + ((<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>)
             = (<var>S</var>(<var>k</var> + 2<var>D</var>) + <var>D</var>(<var>k</var> + 2<var>S</var>)) ÷ <var>HDS</var>
             = (<var>kS</var> + 2<var>DS</var> + <var>kD</var> + 2<var>DS</var>) ÷ <var>HDS</var>
             = (<var>k</var>(<var>D</var> + <var>S</var>) + 4<var>DS</var>) ÷ <var>HDS</var>
 
<strong>Overall Harm = (<var>k</var>(<var>D</var> + <var>S</var>) + 4<var>DS</var>) ÷ <var>HDS</var></strong>
</pre>
 
<p>All that remains is to choose a suitable value of <var>k</var>. This can be basically any number that you can dream of. However, higher values of <var>k</var> produce better values (otherwise the value for the Overall Harm would be too small). 20000 seems to be a good all-round value. (Incidentally, it’s very near the value generated when a Level 100 Pokemon with 317 Attack stat uses a 75 Base Power move).</p>
 
<h2>Biased Overall Harm</h2>
 
<p>Sometimes, you don’t need your Pokemon to take hits equally well from both attacks and special attacks. Maybe you prefer your Pokemon to take hits better from the physical side, or from the special side. This is where the Biased Overall Harm comes in.</p>
 
<p>First, we introduce a bias factor <var>B</var>. <var>B</var> is a number between 0 and 1 inclusive, which provides the degree of bias you want from the <em>physical</em> side. <var>B</var>=0 would make the Overall Harm formula take care of the special side exclusively; <var>B</var>=1 would make the formula take care of only the physical side; <var>B</var>=0.5 would make the Overall Harm formula take care of both equally (as it is right now). Of course, <var>B</var> can take any value you like between 0 and 1, which gives you varying degrees of bias.</p>
 
<p>Let’s see how we are going to incorporate this number in the Overall Harm formula now.</p>
 
<p>First of all, we rewrite the Overall Harm formula as follows:</p>
 
<pre>Overall Harm = [(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + [(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]</pre>
 
<p>Recall that the first pair of square brackets is the damage you take from a physical hit, and the second pair of square brackets is the damage you take from a special hit of the same power. We now need to vary this damage according to the value of <var>B</var>. Here is how it’s done:</p>
 
<pre>Biased Overall Harm = (2<var>B</var>)[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + (2 – 2<var>B</var>)[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]</pre>
 
<p>Let’s see what happens when <var>B</var> = 1:</p>
 
<pre>
Biased Overall Harm = (2(1))[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + (2 – 2(1))[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
                    = 2[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + 0[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
                    = 2[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>]
</pre>
 
<p>So, when <var>B</var> = 1, the Overall Harm formula returns the damage from two physical hits, and so the applet will exclusively raise the Defense stat to try to lower the overall damage harm as much as possible.</p>
 
<p>When <var>B</var> = 0:</p>
 
<pre>
Biased Overall Harm = (2(0))[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + (2 – 2(0))[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
                    = 0[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + 2[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
                    = 2[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
</pre>
 
<p>This returned the damage from two special hits, and so the applet would try to increase the Special Defense stat as much as possible in this case.</p>
 
<p>And when <var>B</var> = 0.5:</p>
 
<pre>
Biased Overall Harm = (2(0.5))[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + (2 – 2(0.5))[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
                    = 1[(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + 1[(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
                    = [(<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>] + [(<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>]
</pre>
 
<p>This returned the usual, unbiased, Overall Harm formula we wrote before, as it should have done.</p>
 
<h2>Raising Your Defenses</h2>
 
<p>Sometimes, you raise your defenses during the match, either via moves, via items or via traits.</p>
 
<p>The item <a href="/dp/items/soul_dew">Soul Dew</a> makes the Special Defense stat of Latios and Latias 1.5 times of what it was before. The item <a href="/dp/items/metal_powder">Metal Powder</a> makes both the Defense and Special Defense of Ditto 1.5 times of what they were before.</p>
 
<p>The trait <a href="/dp/abilities/marvel_scale">Marvel Scale</a> makes the Defense of Milotic 1.5 times of what it was before if it is afflicted by a Special condition.</p>
 
<p>You can also raise your Defense and Special Defense stats using moves such as <a href="/dp/moves/curse">Curse</a>, <a href="/dp/moves/calm_mind">Calm Mind</a>, <a href="/dp/moves/amnesia">Amnesia</a>, <a href="/dp/moves/iron_defense">Iron Defense</a>, etc.</p>
 
<p>The effect of these things in the Overall Harm formula is very minor: you just replace <var>D</var> and <var>S</var>, if necessary, by the modified Defense and/or Special Defense stats.</p>
 
<h2>Pokemon with Intimidate</h2>
 
<p>When a Pokemon with the
<a href="/dp/abilities/intimidate">Intimidate</a> trait switches into the foe, it makes the opponent’s physical attack stat 2/3 of what it was before. This means that, in the above formula, the physical damage as a fraction of HP would be</p>
 
<pre>Physical Damage as a Fraction of HP = ((2/3)<var>k</var> + 2<var>D</var>) ÷ <var>HD</var></pre>
 
<p>The special damage as a fraction of HP would still be the same. Hence, overall,</p>
 
<pre>
Overall Harm = (((2/3)<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>) + ((<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>)
             = (<var>S</var>((2/3)<var>k</var> + 2<var>D</var>) + <var>D</var>(<var>k</var> + 2<var>S</var>)) ÷ <var>HDS</var>
             = ((2/3)<var>kS</var> + 2<var>DS</var> + <var>kD</var> + 2<var>DS</var>) ÷ <var>HDS</var>
             = (<var>k</var>(<var>D</var> + (2/3)<var>S</var>) + 4<var>DS</var>) ÷ <var>HDS</var>
 
<strong>Overall Harm for Pokemon with Intimidate = (<var>k</var>(<var>D</var> + (2/3)<var>S</var>) + 4<var>DS</var>) ÷ <var>HDS</var></strong>
</pre>
 
<p>Of course, this will hold for as long as the foe stays Intimidated.</p>
 
<h2>Pokemon with Leftovers</h2>
 
<p>A Pokemon with Leftovers recovers 1/16 of its HP at the end of each turn. Thus, at the end of the turn, the physical and special damage as a fraction of HP will both be 1/16 less, and hence</p>
 
<pre>
Overall Harm = ((<var>k</var> + 2<var>D</var>) ÷ <var>HD</var> – 1/16) + ((<var>k</var> + 2<var>S</var>) ÷ <var>HS</var> – 1/16)
             = ((<var>k</var> + 2<var>D</var>) ÷ <var>HD</var>) + ((<var>k</var> + 2<var>S</var>) ÷ <var>HS</var>) – (1/16 + 1/16)
             = ((<var>k</var>(<var>D</var> + <var>S</var>) + 4<var>DS</var>) ÷ <var>HDS</var>) – 1/8
 
<strong>Overall Harm for Pokemon with Leftovers = Overall Harm – 0.125</strong>
</pre>
 
<p>This means that attaching Leftovers to a Pokemon will not affect the way you distribute your defensive EVs to guarantee the maximum defenses possible. This is why the Leftovers item is not mentioned anywhere in the applet.</p>
defenseapplet.htm:

HTML:
<p align="center">
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="600" height="410">
<PARAM name="code" value="DefenseEffortValues.class">
</object>
</p>
 
<p>Make sure you have the Java console version 1.5 or better installed on your computer, otherwise the applet above won’t work.</p>
 
<p>On the left hand side of the applet, input your Pokemon's <strong>base HP</strong>, <strong>base Defense</strong>, <strong>base Special Defense</strong>, and the <strong>amount of EVs you have left</strong>. You can also enter its <strong>HP IV</strong>, <strong>Defense IV</strong> and <strong>Special Defense IV</strong>, as well as the Pokemon's <strong>Level</strong>. If the Pokemon has the <strong>Intimidate</strong> trait or the <strong>Marvel Scale</strong>, click on the respective checkbox. If the Pokemon holds <strong>Soul Dew</strong> or <strong>Metal Powder</strong>, click on its checkbox. (For <strong>Deepseascale</strong>, you can click on the Soul Dew checkbox to achieve the same effect.) If the Pokemon already has a nature assigned to it, choose it from the drop down list, otherwise you can let the applet find the best Pokemon nature that maximises its defenses by choosing <strong>Find Best</strong> (it will always choose a nature that boosts its Defense or its Special Defense). You can adjust your <strong>EV bias</strong> from the slider; moving it more towards Defense makes the applet take care of defense more than Special Defense, and vice versa. You can also input any number of Defense or Special Defense stat modifiers from the respective choice boxes. Click on <strong>Find EVs</strong> to find the best defensive EVs using the data you're entered. The best EVs and the corresponding stats will be displayed on the grey part of the applet on the right hand side, together with the best nature if you had chosen to find the best nature possible. The <strong>Reset</strong> button, of course, clears all the values that have been entered.</p>
 

chaos

is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Smogon Discord Contributoris a Contributor to Smogonis an Administratoris a Tournament Director Alumnusis a Researcher Alumnus
Owner
Looks much better.

Links should be relative whenever possible: href="/dp/items/soul_dew" instead of the whole URL.

That <object> will only work on Windows because of the classid. There are some cross-platform ways to do it, but it's weird. For now, I think we should just leave the applet out completely until I decide how the problem should be handled. Ideally, I'd like to just translate any Java applets to be apart of the official Smogon site into JavaScript because it will run without plugins/cross platform hacks/other problems associated with Java/embedded objects.

Besides that, looks fine. I don't have much else to add at the moment, lets see how it looks on the site itself. If you want to create a file in /dp/articles/ on the SCMS, that'd be cool.
 

X-Act

np: Biffy Clyro - Shock Shock
is a Site Content Manager Alumnusis a Programmer Alumnusis a Smogon Discord Contributor Alumnusis a Top Researcher Alumnusis a Top CAP Contributor Alumnusis a Top Tiering Contributor Alumnusis a Top Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
Okay. Unfortunately, I don't know any Javascript, so I can't translate the applet into Javascript. I fixed the links.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top