Skip to content

Commit

Permalink
playtesting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TerraPrograms committed Apr 29, 2024
1 parent 97fc183 commit 51f3cc6
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 22 deletions.
3 changes: 3 additions & 0 deletions calc/src/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class Field implements State.Field {
isMagicRoom: boolean;
isWonderRoom: boolean;
isGravity: boolean;
isInverse: boolean;
isAuraBreak?: boolean;
isFairyAura?: boolean;
isDarkAura?: boolean;
Expand All @@ -25,6 +26,7 @@ export class Field implements State.Field {
this.isMagicRoom = !!field.isMagicRoom;
this.isWonderRoom = !!field.isWonderRoom;
this.isGravity = !!field.isGravity;
this.isInverse = !!field.isInverse;
this.isAuraBreak = field.isAuraBreak || false;
this.isFairyAura = field.isFairyAura || false;
this.isDarkAura = field.isDarkAura || false;
Expand Down Expand Up @@ -58,6 +60,7 @@ export class Field implements State.Field {
isMagicRoom: this.isMagicRoom,
isWonderRoom: this.isWonderRoom,
isGravity: this.isGravity,
isInverse: this.isInverse,
attackerSide: this.attackerSide,
defenderSide: this.defenderSide,
isAuraBreak: this.isAuraBreak,
Expand Down
9 changes: 9 additions & 0 deletions calc/src/mechanics/gen789.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ export function calculateSMSSSV(
: 1;
let typeEffectiveness = type1Effectiveness * type2Effectiveness;

if (field.isInverse) {
if (typeEffectiveness === 0) {
typeEffectiveness = 2;
}
else {
typeEffectiveness = 1 / typeEffectiveness;
}
}

if (defender.teraType && defender.teraType !== 'Stellar') {
typeEffectiveness = getMoveEffectiveness(
gen,
Expand Down
1 change: 1 addition & 0 deletions calc/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export namespace State {
isMagicRoom?: boolean;
isWonderRoom?: boolean;
isGravity?: boolean;
isInverse?: boolean;
isAuraBreak?: boolean;
isFairyAura?: boolean;
isDarkAura?: boolean;
Expand Down
1 change: 1 addition & 0 deletions dist/calc/field.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export declare class Field implements State.Field {
isMagicRoom: boolean;
isWonderRoom: boolean;
isGravity: boolean;
isInverse: boolean;
isAuraBreak?: boolean;
isFairyAura?: boolean;
isDarkAura?: boolean;
Expand Down
2 changes: 2 additions & 0 deletions dist/calc/field.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/calc/field.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/calc/items.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export declare const SEED_BOOSTED_STAT: {
};
export declare function getItemBoostType(item: string | undefined): "Normal" | "Fighting" | "Flying" | "Poison" | "Ground" | "Rock" | "Bug" | "Ghost" | "Steel" | "Fire" | "Water" | "Grass" | "Electric" | "Psychic" | "Ice" | "Dragon" | "Dark" | "Fairy" | undefined;
export declare function getBerryResistType(berry: string | undefined): "Normal" | "Fighting" | "Flying" | "Poison" | "Ground" | "Rock" | "Bug" | "Ghost" | "Steel" | "Fire" | "Water" | "Grass" | "Electric" | "Psychic" | "Ice" | "Dragon" | "Dark" | "Fairy" | undefined;
export declare function getFlingPower(item?: string): 30 | 100 | 10 | 0 | 40 | 60 | 50 | 85 | 20 | 80 | 130 | 110 | 95 | 90 | 70;
export declare function getFlingPower(item?: string): 0 | 100 | 10 | 40 | 20 | 50 | 80 | 60 | 130 | 85 | 110 | 95 | 90 | 70 | 30;
export declare function getNaturalGift(gen: Generation, item: string): {
t: TypeName;
p: number;
Expand Down
8 changes: 8 additions & 0 deletions dist/calc/mechanics/gen789.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/calc/mechanics/gen789.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/calc/mechanics/util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export declare function getBaseDamage(level: number, basePower: number, attack:
export declare function getMostProficientStat(pokemon: Pokemon, gen?: Generation): StatID;
export declare function getFinalDamage(baseAmount: number, i: number, effectiveness: number, isBurned: boolean, stabMod: number, finalMod: number, protect?: boolean): number;
export declare function getShellSideArmCategory(source: Pokemon, target: Pokemon): MoveCategory;
export declare function getWeightFactor(pokemon: Pokemon): 2 | 1 | 0.5;
export declare function getWeightFactor(pokemon: Pokemon): 1 | 2 | 0.5;
export declare function countBoosts(gen: Generation, boosts: StatsTable): number;
export declare function getEVDescriptionText(gen: Generation, pokemon: Pokemon, stat: 'atk' | 'def' | 'spd' | 'spa', natureName: NatureName): string;
export declare function handleFixedDamageMoves(attacker: Pokemon, move: Move): number;
Expand Down
1 change: 1 addition & 0 deletions dist/calc/state.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export declare namespace State {
isMagicRoom?: boolean;
isWonderRoom?: boolean;
isGravity?: boolean;
isInverse?: boolean;
isAuraBreak?: boolean;
isFairyAura?: boolean;
isDarkAura?: boolean;
Expand Down
8 changes: 4 additions & 4 deletions dist/honkalculate.html
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@
<script type="text/javascript" src="./calc/util.js?8fa0c7ff"></script>
<script type="text/javascript" src="./calc/stats.js?9220179f"></script>
<script type="text/javascript" src="./calc/data/species.js?598102aa"></script>
<script type="text/javascript" src="./js/data/sets/gen9.js?25721f5c"></script>
<script type="text/javascript" src="./js/data/sets/gen9.js?7a1c8efe"></script>
<script type="text/javascript" src="./js/data/sets/gen8.js?ecf43658"></script>
<script type="text/javascript" src="./js/data/sets/gen7.js?78168bde"></script>
<script type="text/javascript" src="./js/data/sets/gen6.js?2219279f"></script>
Expand All @@ -900,10 +900,10 @@
<script type="text/javascript" src="./calc/data/index.js?083d2bc9"></script>
<script type="text/javascript" src="./calc/move.js?48331ad1"></script>
<script type="text/javascript" src="./calc/pokemon.js?ea90f3ad"></script>
<script type="text/javascript" src="./calc/field.js?2c7f95da"></script>
<script type="text/javascript" src="./calc/field.js?b0fd6c59"></script>
<script type="text/javascript" src="./calc/items.js?3cbea98f"></script>
<script type="text/javascript" src="./calc/mechanics/util.js?7d958cae"></script>
<script type="text/javascript" src="./calc/mechanics/gen789.js?4a1baa7c"></script>
<script type="text/javascript" src="./calc/mechanics/gen789.js?9d921166"></script>
<script type="text/javascript" src="./calc/mechanics/gen56.js?326e578d"></script>
<script type="text/javascript" src="./calc/mechanics/gen4.js?7d2b7674"></script>
<script type="text/javascript" src="./calc/mechanics/gen3.js?2fa3d6a1"></script>
Expand All @@ -913,7 +913,7 @@
<script type="text/javascript" src="./calc/result.js?d5c7552b"></script>
<script type="text/javascript" src="./calc/adaptable.js?afeb3759"></script>
<script type="text/javascript" src="./calc/index.js?2377cbc8"></script>
<script type="text/javascript" src="./js/shared_controls.js?08b2aa60"></script>
<script type="text/javascript" src="./js/shared_controls.js?11db85bb"></script>
<script type="text/javascript" src="./js/honkalculate_controls.js?23c996e5"></script>

<div style="clear:both;padding:20px;text-align:left">Created by Honko, maintained by Austin and Kris
Expand Down
15 changes: 10 additions & 5 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ <h5>OHKO Colors</h5>
<input class="visually-hidden calc-trigger" type="radio" name="weather" value="Snow" id="snow" />
<label class="btn btn-small btn-right" for="snow">Snow</label>
<input class="visually-hidden calc-trigger" type="radio" name="weather" value="Hail" id="hail" />
<label class="btn btn-small btn-right" for="hail">Hail</label>
<label class="btn btn-small btn-mid" for="hail">Hail</label>
</div>
<div class="gen-specific g6 g7 g8 g9" title="Select the current weather condition.">
<input class="visually-hidden calc-trigger" type="radio" name="weather" value="Harsh Sunshine" id="harsh-sunshine" />
Expand Down Expand Up @@ -822,6 +822,11 @@ <h5>OHKO Colors</h5>
<input aria-describedby="gravityInstruction" class="visually-hidden calc-trigger" type="checkbox" id="gravity" />
<label class="btn" for="gravity">Gravity</label>
</div>
<div class="gen-specific g4 g5 g6 g7 g8 g9" style="width: 22.2em; margin: 5px auto; display: inline-block;" title="Is inverse battle in effect?">
<span hidden id="inverseInstruction">Is inverse battle in effect?</span>
<input aria-describedby="inverseInstruction" class="visually-hidden calc-trigger" type="checkbox" id="inverse" />
<label class="btn btn-xxxwide btn-mid" for="inverse">Inverse Battle</label>
</div>
<hr class="gen-specific g2 g3 g4 g5 g6 g7 g8 g9" />
<table class="field">
<thead>
Expand Down Expand Up @@ -1669,7 +1674,7 @@ <h5>OHKO Colors</h5>
<script type="text/javascript" src="./calc/util.js?8fa0c7ff"></script>
<script type="text/javascript" src="./calc/stats.js?9220179f"></script>
<script type="text/javascript" src="./calc/data/species.js?598102aa"></script>
<script type="text/javascript" src="./js/data/sets/gen9.js?25721f5c"></script>
<script type="text/javascript" src="./js/data/sets/gen9.js?7a1c8efe"></script>
<script type="text/javascript" src="./js/data/sets/gen8.js?ecf43658"></script>
<script type="text/javascript" src="./js/data/sets/gen7.js?78168bde"></script>
<script type="text/javascript" src="./js/data/sets/gen6.js?2219279f"></script>
Expand All @@ -1686,10 +1691,10 @@ <h5>OHKO Colors</h5>
<script type="text/javascript" src="./calc/data/index.js?083d2bc9"></script>
<script type="text/javascript" src="./calc/move.js?48331ad1"></script>
<script type="text/javascript" src="./calc/pokemon.js?ea90f3ad"></script>
<script type="text/javascript" src="./calc/field.js?2c7f95da"></script>
<script type="text/javascript" src="./calc/field.js?b0fd6c59"></script>
<script type="text/javascript" src="./calc/items.js?3cbea98f"></script>
<script type="text/javascript" src="./calc/mechanics/util.js?7d958cae"></script>
<script type="text/javascript" src="./calc/mechanics/gen789.js?4a1baa7c"></script>
<script type="text/javascript" src="./calc/mechanics/gen789.js?9d921166"></script>
<script type="text/javascript" src="./calc/mechanics/gen56.js?326e578d"></script>
<script type="text/javascript" src="./calc/mechanics/gen4.js?7d2b7674"></script>
<script type="text/javascript" src="./calc/mechanics/gen3.js?2fa3d6a1"></script>
Expand All @@ -1699,7 +1704,7 @@ <h5>OHKO Colors</h5>
<script type="text/javascript" src="./calc/result.js?d5c7552b"></script>
<script type="text/javascript" src="./calc/adaptable.js?afeb3759"></script>
<script type="text/javascript" src="./calc/index.js?2377cbc8"></script>
<script type="text/javascript" src="./js/shared_controls.js?08b2aa60"></script>
<script type="text/javascript" src="./js/shared_controls.js?11db85bb"></script>
<script type="text/javascript" src="./js/index_randoms_controls.js?34234c00"></script>
<script type="text/javascript" src="./js/moveset_import.js?7a7954dd"></script>
</div>
Expand Down
Loading

0 comments on commit 51f3cc6

Please sign in to comment.