Skip to content

Commit

Permalink
Rename hasSTAB to forceSTAB
Browse files Browse the repository at this point in the history
This better describes what it actually means.
  • Loading branch information
Zarel committed Oct 28, 2018
1 parent d5f2516 commit 68e81c8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions data/moves.js
Original file line number Diff line number Diff line change
Expand Up @@ -5048,11 +5048,11 @@ let BattleMovedex = {
onModifyMove: function (move) {
if (move.sourceEffect === 'waterpledge') {
move.type = 'Water';
move.hasSTAB = true;
move.forceSTAB = true;
}
if (move.sourceEffect === 'grasspledge') {
move.type = 'Fire';
move.hasSTAB = true;
move.forceSTAB = true;
}
},
onHit: function (target, source, move) {
Expand Down Expand Up @@ -6466,11 +6466,11 @@ let BattleMovedex = {
onModifyMove: function (move) {
if (move.sourceEffect === 'waterpledge') {
move.type = 'Grass';
move.hasSTAB = true;
move.forceSTAB = true;
}
if (move.sourceEffect === 'firepledge') {
move.type = 'Fire';
move.hasSTAB = true;
move.forceSTAB = true;
}
},
onHit: function (target, source, move) {
Expand Down Expand Up @@ -18416,11 +18416,11 @@ let BattleMovedex = {
onModifyMove: function (move) {
if (move.sourceEffect === 'grasspledge') {
move.type = 'Grass';
move.hasSTAB = true;
move.forceSTAB = true;
}
if (move.sourceEffect === 'firepledge') {
move.type = 'Water';
move.hasSTAB = true;
move.forceSTAB = true;
}
},
onHit: function (target, source, move) {
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ interface MoveData extends EffectData {
volatileStatus?: string
weather?: string
willCrit?: boolean
forceSTAB?: boolean
zMovePower?: number
zMoveEffect?: string
zMoveBoost?: SparseBoostsTable
Expand Down Expand Up @@ -537,7 +538,6 @@ interface ActiveMove extends Effect, MoveData {
hasAuraBreak?: boolean
hasBounced?: boolean
hasSheerForce?: boolean
hasSTAB?: boolean
isExternal?: boolean
lastHit?: boolean
magnitude?: number
Expand Down
2 changes: 1 addition & 1 deletion mods/gen4/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let BattleScripts = {
baseDamage = this.randomizer(baseDamage);

// STAB
if (move.hasSTAB || type !== '???' && pokemon.hasType(type)) {
if (move.forceSTAB || type !== '???' && pokemon.hasType(type)) {
// The "???" type never gets STAB
// Not even if you Roost in Gen 4 and somehow manage to use
// Struggle in the same turn.
Expand Down
2 changes: 1 addition & 1 deletion sim/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ class Battle extends Dex.ModdedDex {
baseDamage = this.randomizer(baseDamage);

// STAB
if (move.hasSTAB || (type !== '???' && pokemon.hasType(type))) {
if (move.forceSTAB || (type !== '???' && pokemon.hasType(type))) {
// The "???" type never gets STAB
// Not even if you Roost in Gen 4 and somehow manage to use
// Struggle in the same turn.
Expand Down
2 changes: 1 addition & 1 deletion sim/dex-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ class Move extends Effect {
* Forces the move to get STAB even if the type doesn't match
* @type {boolean}
*/
this.hasSTAB = !!this.hasSTAB;
this.forceSTAB = !!this.forceSTAB;

/**
* True if it can't be copied with Sketch
Expand Down

0 comments on commit 68e81c8

Please sign in to comment.