Merge branch 'mystery-battle-events' of https://github.com/InnocentGameDev/PokeRogue-Events into clowning-around
merging changes from main
This commit is contained in:
commit
6d2129a3f0
23
index.css
23
index.css
|
@ -19,9 +19,21 @@ html {
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
display:flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
background: #484050;
|
background: #484050;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#links {
|
||||||
|
width: 90%;
|
||||||
|
text-align: center;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -195,6 +207,17 @@ input:-internal-autofill-selected {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tnc-links {
|
||||||
|
font-size: xx-small;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #328cea;
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Firefox old*/
|
/* Firefox old*/
|
||||||
@-moz-keyframes blink {
|
@-moz-keyframes blink {
|
||||||
0% {
|
0% {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
</style>
|
</style>
|
||||||
<link rel="stylesheet" type="text/css" href="./index.css" />
|
<link rel="stylesheet" type="text/css" href="./index.css" />
|
||||||
<link rel="manifest" href="./manifest.webmanifest">
|
<link rel="manifest" href="./manifest.webmanifest">
|
||||||
|
<script type="text/javascript" src="https://app.termly.io/resource-blocker/c5dbfa2f-9723-4c0f-a84b-2895124e851f?autoBlock=on"></script>
|
||||||
<script>
|
<script>
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
window.addEventListener("load", function () {
|
window.addEventListener("load", function () {
|
||||||
|
@ -113,9 +114,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="tnc-links">
|
||||||
|
<a href="#" class="termly-display-preferences" style="display: none;" target="_blank" rel="noreferrer noopener">Consent Preferences</a>
|
||||||
|
<a href="https://app.termly.io/policy-viewer/policy.html?policyUUID=bc96778b-3f04-4d25-bafc-0deba53e8bec" target="_blank" rel="noreferrer noopener">Privacy Policy</a>
|
||||||
|
<a href="https://app.termly.io/policy-viewer/policy.html?policyUUID=8b523c05-7ec2-4646-9534-5bd61b386e2a" target="_blank" rel="noreferrer noopener">Cookie Disclaimer</a>
|
||||||
|
<a href="https://app.termly.io/policy-viewer/policy.html?policyUUID=b01e092a-9721-477f-8356-45576702ff9e" target="_blank" rel="noreferrer noopener">Terms & Conditions</a>
|
||||||
|
<a href="https://app.termly.io/policy-viewer/policy.html?policyUUID=3b5d1928-3f5b-4ee1-b8df-2d6c276b0bcc" target="_blank" rel="noreferrer noopener">Acceptable Use Policy</a>
|
||||||
|
</div>
|
||||||
<script type="module" src="./src/main.ts"></script>
|
<script type="module" src="./src/main.ts"></script>
|
||||||
<script src="./src/touch-controls.ts" type="module"></script>
|
<script src="./src/touch-controls.ts" type="module"></script>
|
||||||
<script src="./src/debug.js" type="module"></script>
|
<script src="./src/debug.js" type="module"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -219,7 +219,7 @@ export class Egg {
|
||||||
let abilityIndex = undefined;
|
let abilityIndex = undefined;
|
||||||
if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility
|
if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility
|
||||||
|| (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE)))) {
|
|| (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE)))) {
|
||||||
abilityIndex = pokemonSpecies.ability2 ? 2 : 1;
|
abilityIndex = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function has way to many optional parameters
|
// This function has way to many optional parameters
|
||||||
|
|
|
@ -717,9 +717,13 @@ export default class Move implements Localizable {
|
||||||
* @returns The calculated power of the move.
|
* @returns The calculated power of the move.
|
||||||
*/
|
*/
|
||||||
calculateBattlePower(source: Pokemon, target: Pokemon): number {
|
calculateBattlePower(source: Pokemon, target: Pokemon): number {
|
||||||
const power = new Utils.NumberHolder(this.power);
|
if (this.category === MoveCategory.STATUS) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const power = new Utils.NumberHolder(this.power);
|
||||||
const typeChangeMovePowerMultiplier = new Utils.NumberHolder(1);
|
const typeChangeMovePowerMultiplier = new Utils.NumberHolder(1);
|
||||||
|
|
||||||
applyPreAttackAbAttrs(MoveTypeChangeAttr, source, target, this, typeChangeMovePowerMultiplier);
|
applyPreAttackAbAttrs(MoveTypeChangeAttr, source, target, this, typeChangeMovePowerMultiplier);
|
||||||
|
|
||||||
const sourceTeraType = source.getTeraType();
|
const sourceTeraType = source.getTeraType();
|
||||||
|
|
|
@ -140,10 +140,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
// If abilityIndex is not provided, determine it based on species and hidden ability
|
// If abilityIndex is not provided, determine it based on species and hidden ability
|
||||||
if (species.abilityHidden && hasHiddenAbility) {
|
if (species.abilityHidden && hasHiddenAbility) {
|
||||||
// If the species has a hidden ability and the hidden ability is present
|
// If the species has a hidden ability and the hidden ability is present
|
||||||
this.abilityIndex = species.ability2 ? 2 : 1; // Use ability index 2 if species has a second ability, otherwise use 1
|
this.abilityIndex = 2;
|
||||||
} else {
|
} else {
|
||||||
// If there is no hidden ability or species does not have a hidden ability
|
// If there is no hidden ability or species does not have a hidden ability
|
||||||
this.abilityIndex = species.ability2 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0
|
this.abilityIndex = species.ability2 !== species.ability1 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (formIndex !== undefined) {
|
if (formIndex !== undefined) {
|
||||||
|
@ -1862,7 +1862,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
const types = this.getTypes(true, true);
|
const types = this.getTypes(true, true);
|
||||||
|
|
||||||
const cancelled = new Utils.BooleanHolder(false);
|
const cancelled = new Utils.BooleanHolder(false);
|
||||||
|
const power = move.calculateBattlePower(source, this);
|
||||||
const typeless = move.hasAttr(TypelessAttr);
|
const typeless = move.hasAttr(TypelessAttr);
|
||||||
|
|
||||||
const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => types.includes(attr.immuneType)))
|
const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => types.includes(attr.immuneType)))
|
||||||
? this.getAttackTypeEffectiveness(move, source, false, false)
|
? this.getAttackTypeEffectiveness(move, source, false, false)
|
||||||
: 1);
|
: 1);
|
||||||
|
@ -1887,7 +1889,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
case MoveCategory.PHYSICAL:
|
case MoveCategory.PHYSICAL:
|
||||||
case MoveCategory.SPECIAL:
|
case MoveCategory.SPECIAL:
|
||||||
const isPhysical = moveCategory === MoveCategory.PHYSICAL;
|
const isPhysical = moveCategory === MoveCategory.PHYSICAL;
|
||||||
const power = move.calculateBattlePower(source, this);
|
|
||||||
const sourceTeraType = source.getTeraType();
|
const sourceTeraType = source.getTeraType();
|
||||||
|
|
||||||
if (!typeless) {
|
if (!typeless) {
|
||||||
|
|
|
@ -193,17 +193,31 @@ export default class MenuUiHandler extends MessageUiHandler {
|
||||||
handler: () => {
|
handler: () => {
|
||||||
this.scene.gameData.tryExportData(GameDataType.SYSTEM);
|
this.scene.gameData.tryExportData(GameDataType.SYSTEM);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Consent Preferences",
|
||||||
|
handler: () => {
|
||||||
|
const consentLink = document.querySelector(".termly-display-preferences") as HTMLInputElement;
|
||||||
|
const clickEvent = new MouseEvent("click", {
|
||||||
|
view: window,
|
||||||
|
bubbles: true,
|
||||||
|
cancelable: true
|
||||||
|
});
|
||||||
|
consentLink.dispatchEvent(clickEvent);
|
||||||
|
consentLink.focus();
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
keepOpen: true
|
keepOpen: true
|
||||||
});
|
},
|
||||||
manageDataOptions.push({
|
{
|
||||||
label: i18next.t("menuUiHandler:cancel"),
|
label: i18next.t("menuUiHandler:cancel"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
this.scene.ui.revertMode();
|
this.scene.ui.revertMode();
|
||||||
return true;
|
return true;
|
||||||
}
|
},
|
||||||
}
|
keepOpen: true
|
||||||
);
|
});
|
||||||
|
|
||||||
this.manageDataConfig = {
|
this.manageDataConfig = {
|
||||||
xOffset: 98,
|
xOffset: 98,
|
||||||
|
|
Loading…
Reference in New Issue