-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TODO List, task No.5 #200
TODO List, task No.5 #200
Conversation
js/damage.js
Outdated
@@ -298,7 +302,6 @@ function getDamageResult(attacker, defender, move, field) { | |||
break; | |||
case "Nature Power": | |||
basePower = (field.terrain === "Electric" || field.terrain === "Grassy" || field.terrain === "Psychic") ? 90 : (field.terrain === "Misty") ? 95 : 80; | |||
//console.log("A " + field.terrain + " terrain " + move.type + move.name + " with " + move.bp + " base power " + " agaisnt a(n) " + defender.name + " that has " + defender.type1 + " " + defender.type2 + " typing"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might actually still want this, I was using to be sure terrain and nature power were working correctly
js/damage.js
Outdated
for (var times = 0; times < move.usedTimes; times++){ | ||
var oldAttack = attack; | ||
var newAttack = getModifiedStat(attacker.rawStats[attackStat], attacker.boosts[attackStat]); | ||
damage = damage.map(function(affectedAmount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing parentheses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uuuuuuh where are they missing ? Neither Sublime Text nor GitHub gave me anything that pointed at a mistake here, even though I could be wrong..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was actually just commenting never mind as you typed that lol. It looked wrong on mobile at first mb
return 'Water'; | ||
default: | ||
return ''; | ||
if (item.indexOf("Memory") !== -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plates works the same way, do they not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Plates' names are like "Meadow Plate", "Flame Plate", while Memories directly point at type such as "Fire Memory", "Grass Memory", etc. so instead of looping through every case we just cut "Fire" from "Fire Memory" and we return it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I forgot the plate naming was different :p
return 'possible ' + i + 'HKO' + afterText; | ||
} else { | ||
qualifier = 'nearly '; | ||
// until someone comes up with a better damage recalculation formula, we'll tell the user it's an estimate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t know if this is necessary..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, the multi-turn moves formula is a bit brutal, but couldn't find a more accurate way to deal with the new attack value.
Besides that, looks good! |
js/damage.js
Outdated
@@ -545,8 +548,7 @@ function getDamageResult(attacker, defender, move, field) { | |||
description.defenderAbility = defAbility; | |||
} | |||
|
|||
if ((gen < 7 && defender.item === "Soul Dew" && (defender.name === "Latios" || defender.name === "Latias") && !hitsPhysical) || | |||
(defender.item === "Assault Vest" && !hitsPhysical) || defender.item === "Eviolite") { | |||
if (gen < 7 && (!hitsPhysical && ["Latios","Latias"].indexOf(defender.name) !== -1) || defender.item === "Eviolite" || (!hitsPhysical && defender.item === "Assault Vest")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing check for Soul Dew
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad ^^".
Great work! |
I don't know if I should comment here or on the following fixes but there are problems with this modification:
|
@Ntonio36 please fix or I’m reverting this, this has caused a lot of issues 0: |
MK360 hits again
Basically shows KO chances when using a stat-dropping move several turns in a row, with some (big) cleanups.
Commits :
index.template.html
: add dropdown for showing how many times this select move is used in a row.damage.js
: refactor + calculate stat-drop induced damage. Also handles Contrary and White Herb.damage_rby.js
: adding description in case a Pokémon used such a move.item_data.js
: refactor Multi-Attack item type detection. Somehow, no one noticed the type of the Memory held is fully mentioned in its name.move_data.js
: added a property for moves that drop stats, whose value is equal with by how much does a stat drop.shared_controls.js
: added the ability to handle - guess what - moves that drop stats by showing their select dropdown, and also binding a property that is used in several places.ko_chance.js
: little refactor + built a workaround to deal with multi-turn moves.