-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Ability] Implement ability illusion #2217
Closed
Closed
Changes from 32 commits
Commits
Show all changes
202 commits
Select commit
Hold shift + click to select a range
77d5baa
get name for illusion
PyGaVS dc2bf95
Illusion working but without AI
PyGaVS 068c935
illusion working entirely
PyGaVS 7ed5395
merge up-to-date
PyGaVS 56de1e2
add illusion
PyGaVS 8927758
add comments in AbAttr classes
PyGaVS f79174e
add comments for the property pokemon.illusion
PyGaVS 88ecabe
update generateIllusion method
PyGaVS ee5d689
feat: Add Google and Discord login functionality
f-fsantos dbb1fc1
refactor: Add missing properties to initLoggedInUser function
f-fsantos ef5847d
Update src/locales/de/menu-ui-handler.ts
f-fsantos 0dff7b4
shiny illusion working
PyGaVS 045b754
Zoroark uses the actual form of the target as illusion
PyGaVS 782718c
make i18n debugging an optional env setting
flx-sta e929538
set development default also to "0"
flx-sta 1094d55
illusion update
PyGaVS 7947d27
merge up to date
PyGaVS 973098f
Illusion not available under neutralizing gas
PyGaVS b21922b
Merge branch 'main' into updates
PyGaVS e6d078b
resolve party ui handler conflict
PyGaVS d197186
resolve party ui conflicts
PyGaVS 34e5ba4
remove overrides changes
PyGaVS c936261
resolve conflicts on pokemon.ts getAttackTypeEffectiveness()
PyGaVS 4190246
optimization
PyGaVS ef64037
overrides reset
PyGaVS 3323b64
remove comments
PyGaVS 0e114e8
add french localization
PyGaVS 7f4c373
resolve merge conflicts
PyGaVS 3136734
missed one localization
PyGaVS db200b8
Update src/locales/de/ability-trigger.ts
PyGaVS 759870e
Update src/locales/pt_BR/ability-trigger.ts
PyGaVS 6ea4faa
Update src/locales/zh_CN/ability-trigger.ts
PyGaVS 15c843f
Update src/locales/zh_TW/ability-trigger.ts
PyGaVS d4eea94
Update src/locales/fr/ability-trigger.ts
PyGaVS 6f19e50
Update src/locales/ko/ability-trigger.ts
PyGaVS a74f450
locale key changed
PyGaVS 2e127ec
change locale key
PyGaVS d5ebdce
Update ability-trigger.ts (Illusion IT)
NicusPulcis ef2cfd4
Merge pull request #1 from NicusPulcis/patch-53
PyGaVS ac450a7
Update src/locales/es/ability-trigger.ts
PyGaVS fc1a1ed
[Bug] add move effectiveness text color check to ignore ability (#2042)
torranx a996fba
[Bug] Fix inputs being annoying in the corner of the screen again (#2…
SquillWall ff1fa15
fix inaccurate docs for TypeImmunityAbAttr (#2957)
torranx c44b38c
chore: Add beta branch to GitHub Actions tests workflow
f-fsantos 4dbed9c
chore: Add beta branch to GitHub Actions linter and gh-pages workflow
f-fsantos f506a70
Merge branch 'beta' into discord-oauth
f-fsantos ea4e56b
Update src/locales/ko/menu-ui-handler.ts
f-fsantos cf1e457
Update src/locales/ko/menu.ts
f-fsantos 84e03be
Localization(pt): translated bgm-name.ts (#2955)
josericardo-fo db38963
Merge remote-tracking branch 'upstream/beta' into feature/i18n-debugging
flx-sta fab5992
update VITE_I18N_DEBUG in .env files
flx-sta cbf9bdb
chore: Update environment variables for beta and production environments
f-fsantos 3674325
Merge pull request #1693 from f-fsantos/discord-oauth
f-fsantos 3c09eef
Merge remote-tracking branch 'upstream/beta' into feature/i18n-debugging
flx-sta 616b448
chore: Add beta branch to GitHub Actions deploy workflow
f-fsantos 85a89b9
Merge branch 'beta' of github.com:pagefaultgames/pokerogue into beta
f-fsantos 4797878
Hardcoded Pokemon should have proper names (#2941)
Tempo-anon fc4b97d
Merge pull request #2692 from flx-sta/feature/i18n-debugging
Tempo-anon fc2e75f
delete party as useless parameter in applyPresummonAbAttr() + optimiz…
PyGaVS 5742f08
Refactor challenges and add fresh start (#2963)
Xavion3 01f6ec2
[Balance] Update many TM learnsets (#2879)
Fontbane 991051f
Refactor challenges and add fresh start (#2964)
Xavion3 6bc191c
[Bug] Fix off-by-one error in damage calc (#2970)
DayKev 55f2a32
[Bug] Grounded on Terrain fixes (#2969)
chaosgrimmon d69bedd
Update game-stats-ui-handler.ts (italian) (#2965)
NicusPulcis e9b13be
[Bugfix] Fix a bug during bgm-bar initialization (#2822)
Dakurei caf541b
[Mirror][Localization] Translate game victory sentences #2254 (#2906)
EnochG1 74941bd
[Mirror][Localization] Translate summary #2336 (#2907)
EnochG1 2f550ea
[Localization] Localization arena flyout (Active Battle Effects) (#2932)
EnochG1 516a100
This should prevent gym leaders appear as doubles (marnie & piers) wh…
CodeTappert dd361c5
The stat messages can now be plural (#2600)
CodeTappert e879b3c
[Enhancement][QoL] Add option to adjust shop overlay opacity (#2622)
torranx 50d7ed3
[Bug] Fix battler tags lapsing at incorrect times (#2944)
innerthunder 4b3984c
Update French pokemon-summary.ts (#2976)
Adri1 2f81bd5
[Test] Prevent tests from running if overrides are different from the…
OrangeRed aa90a9f
[QoL] Highlight targets of multitarget moves instead of immediate exe…
torranx b6360a2
refactor illusion parameter on Pokemon methods + corrections
PyGaVS 41e9073
deleted Promise type on a return func that don't use Promise
PyGaVS e2290e4
[Refactor] rewrite applyAbAttrsInternal to use an iterator. (#1832)
OrangeRed ee5a523
Merge branch 'beta' into updates
PyGaVS d576e7b
[Move] Implement Core Enforcer (#2024)
zacharied c3438de
merge changes on beta branch
PyGaVS b5de9de
merge changes on beta branch
PyGaVS 0c23d8f
delete Promise in ApplyPreSummonAbAttr()
PyGaVS 045fd57
Update typescript and typedoc (#2988)
OrangeRed c5577d6
update workflow (#2989)
OrangeRed 5aee958
[Qol/Balance] Dynamax cannon tweak (#2540)
AsdarDevelops d57a7c9
[Test] Fix/Extend Unit Test for Hard Press (#2992)
xsn34kzx 1965f2b
[Test] Update tests to enable no-crits override (#2971)
DayKev 39bdfea
[Localization]Localized move-trigger text (#2913)
mercurius-00 3a1d41a
[Bug] Fix description of rare candy to have proper amount of level (#…
hayuna 21d36bf
move status effect enum into separate file (#2998)
OrangeRed 683c337
add .env.test (#2997)
flx-sta 2314d34
[QoL] Create default overrides class and export that with custom over…
OrangeRed 4dc1af9
[Feature][FUN] add breedersInSpace splash message (#2631)
flx-sta 9df3bdd
[Enhancement] Pokemon generation number tooltip (#2642)
EmberCM 8e44ddf
[Beta] Updating the manage data->unlock all option to work with all a…
Opaque02 5898012
[Bug] vite port (for development) (#3003)
flx-sta a3177c6
feat: Update isBeta check in utils.ts to use import.meta.env.MODE
f-fsantos b2ced62
Merge branch 'beta' of github.com:pagefaultgames/pokerogue into beta
f-fsantos 7709ff5
refactor: Update trainerId and secretId in game data
f-fsantos a1a906e
Adds bg glow behind starters with unlocked passives (#2497)
Fontbane 985c24e
[Localization] Localize missed things in battlers-tag.ts (#3004)
EnochG1 0aa5e0d
[Feature] Fully implement Octolock (#2985)
mcmontag f7b53fa
[Bug] Fix import of overrides in a test (#3009)
mcmontag cbc6005
[BUG] Fixes Sketch copying the first move used by the opponent instea…
schmidtc1 0c0de41
[Bug] Making FormChangeItems Untransferrable (#2695)
Arxalc 4a39946
[Bug] Fix Clear terrains upon Trainer Battle (#2027)
Arxalc 2eb317c
Fix item reward overrides going out of bounds (#3012)
OrangeRed 5852cae
[Localization] Localize Berry Heal message (#2996)
EnochG1 35bbbcb
Adds a check to the bgm-bar display to prevent it from being displaye…
Dakurei 3e8c9d5
[Sprite] Improves Corviknight Palette usage (#3020)
chaosgrimmon a4f3829
[Beta][Localization] Update French battler-tags.ts and battle.ts (#3015)
Adri1 1be11d2
[Bug] Fix Lock-On and Mind Reader not working on the first turn (#3001)
schmidtc1 eedabbf
[Bug] Struggle Recoil should ignore Magic Guard (#3017)
frutescens 8d5bfa5
[Enhancement] Decouple move power calculation from Pokemon.apply(), F…
torranx 416079d
[QoL] Offset the status indicator to keep pokeball in view (#2966)
EmberCM 984b188
[Bug] Fix to epic shiny Yungoos icon (#2991) (#3016)
ArielStevens 2efde67
[Localization(ko)] Change line-break position of ghost type curse add…
EnochG1 76b42c4
Revert "[Localization]Localized move-trigger text (#2913)" (#3026)
CodeTappert a9a071b
[Localization(ko)] Fixed typo in Bertha's dialogue (#3025)
sodaMelon b1e7ae4
[Bug] Prevent fixed-damage and OHKO moves from being modified by dama…
Corrade 4bf5031
[Localization] Brought german localization up to date (#3010)
CodeTappert 21f2e69
[Bug] Remove redundant damage number popups (#3024)
DayKev d396207
create simple unit tests
PyGaVS 62fb047
merge beta up to date
PyGaVS ce98794
AI test and bug fix
PyGaVS b215de1
[Move] Implements Conversion 2 (#2943)
schmidtc1 4261ab3
[BUG] Fixes bug with Metronome freezing the game (#2819)
schmidtc1 66481c0
Add missing passive background graphic for legacy UI
Madmadness65 7d0437d
[Localization] Localize ability messages in ability.ts (trigger, appl…
EnochG1 e6639ec
Update egg.ts (italian) (#3038)
NicusPulcis d96b553
[Sprite] Revert Larvesta, fixing stray pixels (#3042)
chaosgrimmon 514c6a1
[Bug] Fix level 100 moves being skipped if leveled past 100 (#3040)
mcmontag fcbe5e9
[Bug][Fix][Surf][Muddy Water][Sludge Wave][Animation] Added image to …
pom-eranian 4353ccc
[Sprite] Fix Cofagrigus sprite (#3045)
Fontbane 672c9aa
merge beta up-to-date
PyGaVS bde9b84
Fix FR typo (#3051)
Dakurei f372c3f
merge beta up-to-date
PyGaVS 93290c6
add unit tests
PyGaVS 7e8f7c1
add corrections + unit tests
PyGaVS c4e146b
[Beta][Localization] Update Portuguese battler-tags.ts and battle.ts …
josericardo-fo 27b03af
[Music/BGM] Fix bgm file & loop for battle_rival (#3053)
Dakurei dd693ae
stop loading pride-update banner (#3057)
flx-sta 99f4a9d
[Item] Add Scope Lens and Leek (#2666)
xsn34kzx 719764e
[Music/BGM] New music added for the "Slum" biome, composed by Andr06 …
Dakurei eb4604d
[Bug] implemented multi target damage penalty (#2329)
bucket1582 37526c8
[BUG] Uturn faint switch bug fix (#2980)
DustinLin 36cf0ea
[Sprite] Remove extra Oinkologne sprites (#3067)
chaosgrimmon 6735dd7
[Sprite] Mega Mewtwo sprite fixes (#3065)
chaosgrimmon be1f938
[Music/BGM] New music added for the "Sea" biome, composed by Andr06 (…
Dakurei 6cb2967
merge beta up-to-date
PyGaVS 94b032a
[Balance] Add 12 new TMs and remove 3 (#2733)
Fontbane a2edc21
[Refactor/Test] Update Dynamax Cannon Unit Tests (#3074)
xsn34kzx 8d1a066
fix: update SameSite attribute in setCookie function to None
f-fsantos 22cd54c
fix: update SameSite attribute in setCookie function to Strict
f-fsantos 4c65569
feat: Add prompt=none to Discord OAuth authorization URL
f-fsantos 93bcf8a
fix: Remove unnecessary cookie setting in LoginPhase and MenuUiHandler
f-fsantos cf95031
feat: Improve cookie handling in getCookie function
f-fsantos 5abf9ec
feat: Delete duplicate cookies with the same name in getCookie function
f-fsantos cda7448
[Localization] Add minor Korean translations to ability-trigger file …
smee6 50cf1c0
Fix broken `multi_target` tests and remove RNG-based failures (#3095)
DayKev cc6b424
Prevent RNG from breaking the Quick Draw tests (#3096)
DayKev ecbf757
Make EXP boosting items stack additively and not multiplicatively (#3…
DayKev 21f5595
[Bug] Fixes Encore bug with multi-target moves missing (#3060)
schmidtc1 4ad5302
Add remaining relearn moves (#2894)
Fontbane f298ec3
[Enhancement] Decouple move accuracy and accuracy multiplier calculat…
torranx 1041372
[Sprite] Fix a number of sprite issues including the Zubat line, Gold…
Fontbane b6266c6
[Move] Finish implementation of Glaive Rush (#2720)
DayKev 21940e6
[Bug] fix not changing moveset after add to starter #1932 (#2396)
gjeodnd12165 fc722be
[Bug] Enemies can properly use stuff cheeks (#3090)
schmidtc1 01de9b9
[Feature] Added pokemon nicknames/renaming (#2570)
sirzento de0aacf
[Sprite] Show Partner Eevee variants (#3097)
chaosgrimmon d0cbe19
Allow Necrozma forms to play their special music (#3054)
Madmadness65 ccb38ca
[BUG] fixing multi-hit and move messages on faint (#2981)
DustinLin 5006d04
[Bug] Sheer Force/Serene Grace Flyout Bugfix (#2496)
okimin 3d2c2a1
[Visual] Achievement icons (#2617)
frutescens aba7132
Re-add changes accidentally deleted by #2617
Madmadness65 04819b8
Fix some broken images in item atlas & achievement
Madmadness65 348a449
merge up-to-date + implement illusion on nickname
PyGaVS 200fa5b
update illusion test
PyGaVS b42fa55
fix: Remove unnecessary cookie setting in removeCookie function
f-fsantos e2829f5
fix: Update removeCookie function to use Max-Age=-1 instead of Expire…
f-fsantos 32d1b6b
[QoL] Starter UI selection update to allow removing specific pokemon …
Opaque02 86ebd0c
[Bug] Ability changing on evolution fix (#2995)
DayKev d3c9392
Localization(pt): Updated move.ts (#3078)
josericardo-fo e846498
[Bug] Enemy pokemon's Harvest creates berry icons on the player's sid…
schmidtc1 799458c
[Bug] Fix hustle not applying attack boost (#3101)
torranx 630deb9
[Sprite] Mega Latis using opposite's eye colour (#3102)
chaosgrimmon 1d39f8d
[Bug] Fix Thousand Arrows not hitting targets under the effects of Ma…
innerthunder 11c5c0a
[Move] Aeroblast is a wind move (#3109)
Tempo-anon a0502fb
[Refactor] Replaces the single and double battles overrides with a si…
DayKev 5cb1125
fix `Overrides` capitalization (#3111)
flx-sta 4a04ef5
[Balance] More TM fixes (#3081)
Fontbane adf5d63
merge up-to-date
PyGaVS 5764211
merge up-to-date
PyGaVS 280f4e0
resolve unexpected merge conflicts
PyGaVS 8d54ab4
remove unexpected changes
PyGaVS 955ceb8
remove unexpected changes
PyGaVS 4acf2b8
remove unexpected changes
PyGaVS 8b46fc4
Merge branch 'beta' into updates
PyGaVS c78d9f0
update unexpected changes
PyGaVS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1833,6 +1833,12 @@ export class PostSummonRemoveArenaTagAbAttr extends PostSummonAbAttr { | |
} | ||
} | ||
|
||
export class PreSummonAbAttr extends AbAttr { | ||
applyPreSummon(pokemon: Pokemon, passive: boolean, party: Pokemon[], args: any[]): boolean { | ||
return false; | ||
} | ||
} | ||
|
||
export class PostSummonMessageAbAttr extends PostSummonAbAttr { | ||
private messageFunc: (pokemon: Pokemon) => string; | ||
|
||
|
@@ -1845,6 +1851,11 @@ export class PostSummonMessageAbAttr extends PostSummonAbAttr { | |
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { | ||
pokemon.scene.queueMessage(this.messageFunc(pokemon)); | ||
|
||
pokemon.scene.getField(true).map(pokemon => { | ||
if (pokemon.breakIllusion()) { | ||
pokemon.scene.queueMessage(i18next.t("abilityTriggers:illusionBreak", { pokemonName: getPokemonNameWithAffix(pokemon) })); | ||
} | ||
}); | ||
return true; | ||
} | ||
} | ||
|
@@ -2166,6 +2177,10 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr { | |
target = targets[0]; | ||
} | ||
|
||
if (target.illusion.active) { | ||
return false; | ||
} | ||
|
||
pokemon.summonData.speciesForm = target.getSpeciesForm(); | ||
pokemon.summonData.fusionSpeciesForm = target.getFusionSpeciesForm(); | ||
pokemon.summonData.ability = target.getAbility().id; | ||
|
@@ -3387,11 +3402,11 @@ export class MaxMultiHitAbAttr extends AbAttr { | |
} | ||
|
||
export class PostBattleAbAttr extends AbAttr { | ||
constructor() { | ||
super(true); | ||
constructor(showAbility: boolean = true) { | ||
super(showAbility); | ||
} | ||
|
||
applyPostBattle(pokemon: Pokemon, passive: boolean, args: any[]): boolean { | ||
applyPostBattle(pokemon: Pokemon, passive: boolean, party: Pokemon[], args: any[]): boolean { | ||
return false; | ||
} | ||
} | ||
|
@@ -3874,6 +3889,93 @@ export class IceFaceBlockPhysicalAbAttr extends ReceivedMoveDamageMultiplierAbAt | |
} | ||
} | ||
|
||
export class IllusionPreSummonAbAttr extends PreSummonAbAttr { | ||
/** | ||
* Apply a new illusion when summoning Zoroark if the illusion is available | ||
* | ||
* @param {Pokemon} pokemon - The Pokémon with the Illusion ability. | ||
* @param {boolean} passive - N/A | ||
* @param {Pokemon[]} party - The party of the trainer's pokemon. | ||
* @param {...any} args - N/A | ||
* @returns {boolean} - Whether the illusion was applied. | ||
*/ | ||
applyPreSummon(pokemon: Pokemon, passive: boolean, party: Pokemon[], args: any[]): boolean { | ||
|
||
let suppressed = false; | ||
pokemon.scene.getField(true).filter(p => p !== pokemon).map(p => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does |
||
if (p.getAbility().hasAttr(SuppressFieldAbilitiesAbAttr) && p.canApplyAbility()) { | ||
suppressed = true; | ||
} | ||
if (p.getPassiveAbility().hasAttr(SuppressFieldAbilitiesAbAttr) && p.canApplyAbility(true)) { | ||
suppressed = true; | ||
} | ||
}); | ||
|
||
if (pokemon.illusion.available && !suppressed) { | ||
return pokemon.generateIllusion(party); | ||
} else { | ||
return false; | ||
} | ||
} | ||
} | ||
|
||
export class IllusionBreakAbAttr extends PostDefendAbAttr { | ||
/** | ||
* Destroy illusion if attack move deals damage to zoroark | ||
* | ||
* @param {Pokemon} pokemon - The Pokémon with the Illusion ability. | ||
* @param {boolean} passive - N/A | ||
* @param {Pokemon} attacker - The attacking Pokémon. | ||
* @param {PokemonMove} move - The move being used. | ||
* @param {PokemonMove} hitResult - The type of hitResult the pokemon got | ||
* @param {...any} args - N/A | ||
* @returns {boolean} - Whether the illusion was destroyed. | ||
*/ | ||
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean | Promise<boolean> { | ||
|
||
//[HitResult.EFFECTIVE, HitResult.SUPER_EFFECTIVE, HitResult.NOT_VERY_EFFECTIVE, HitResult.ONE_HIT_KO] | ||
if (hitResult > 4) { | ||
PyGaVS marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You ignored @Tempo-anon s improvement request here |
||
return false; | ||
} | ||
pokemon.breakIllusion(); | ||
pokemon.scene.queueMessage(i18next.t("abilityTriggers:illusionBreak", { pokemonName: getPokemonNameWithAffix(pokemon) })); | ||
return true; | ||
} | ||
} | ||
|
||
export class IllusionAfterBattle extends PostBattleAbAttr { | ||
PyGaVS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* Illusion will be available again after a battle and apply the illusion of the pokemon is already on field | ||
* | ||
* @param {Pokemon} pokemon - The Pokémon with the Illusion ability. | ||
* @param {boolean} passive - N/A | ||
* @param {Pokemon[]} party - The party of the trainer's pokemon. | ||
* @param {...any} args - N/A | ||
* @returns {boolean} - Whether the illusion was applied. | ||
*/ | ||
applyPostBattle(pokemon: Pokemon, passive: boolean, party: Pokemon[], args: any[]): boolean { | ||
pokemon.breakIllusion(); | ||
pokemon.illusion.available = true; | ||
return true; | ||
} | ||
} | ||
|
||
export class IllusionDisableAbAttr extends PostSummonAbAttr { | ||
/** | ||
* Illusion will be disabled if the pokemon is summoned with an illusion. | ||
* So the pokemon can use 1 illusion per battle. | ||
PyGaVS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @param {Pokemon} pokemon - The Pokémon with the Illusion ability. | ||
* @param {boolean} passive - N/A | ||
* @param {...any} args - N/A | ||
* @returns {boolean} | ||
*/ | ||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> { | ||
pokemon.illusion.available = false; | ||
return true; | ||
} | ||
PyGaVS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
/** | ||
* If a Pokémon with this Ability selects a damaging move, it has a 30% chance of going first in its priority bracket. If the Ability activates, this is announced at the start of the turn (after move selection). | ||
* | ||
|
@@ -4070,6 +4172,11 @@ export function applyPostSummonAbAttrs(attrType: Constructor<PostSummonAbAttr>, | |
return applyAbAttrsInternal<PostSummonAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostSummon(pokemon, passive, args), args); | ||
} | ||
|
||
export function applyPreSummonAbAttrs(attrType: Constructor<PreSummonAbAttr>, | ||
pokemon: Pokemon, party: Pokemon[], ...args: any[]): Promise<void> { | ||
return applyAbAttrsInternal<PreSummonAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPreSummon(pokemon, passive, party, args), args); | ||
} | ||
|
||
PyGaVS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export function applyPreSwitchOutAbAttrs(attrType: Constructor<PreSwitchOutAbAttr>, | ||
pokemon: Pokemon, ...args: any[]): Promise<void> { | ||
return applyAbAttrsInternal<PreSwitchOutAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPreSwitchOut(pokemon, passive, args), args, false, true); | ||
|
@@ -4126,9 +4233,9 @@ export function applyCheckTrappedAbAttrs(attrType: Constructor<CheckTrappedAbAtt | |
return applyAbAttrsInternal<CheckTrappedAbAttr>(attrType, pokemon, (attr, passive) => attr.applyCheckTrapped(pokemon, passive, trapped, otherPokemon, args), args, true); | ||
} | ||
|
||
export function applyPostBattleAbAttrs(attrType: Constructor<PostBattleAbAttr>, | ||
pokemon: Pokemon, ...args: any[]): Promise<void> { | ||
return applyAbAttrsInternal<PostBattleAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostBattle(pokemon, passive, args), args); | ||
export function applyPostBattleAbAttrs(attrType: { new(...args: any[]): PostBattleAbAttr }, | ||
pokemon: Pokemon, party: Pokemon[], ...args: any[]): Promise<void> { | ||
return applyAbAttrsInternal<PostBattleAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostBattle(pokemon, passive, party, args), args); | ||
} | ||
|
||
export function applyPostFaintAbAttrs(attrType: Constructor<PostFaintAbAttr>, | ||
|
@@ -4617,7 +4724,15 @@ export function initAbilities() { | |
new Ability(Abilities.ILLUSION, 5) | ||
.attr(UncopiableAbilityAbAttr) | ||
.attr(UnswappableAbilityAbAttr) | ||
.unimplemented(), | ||
//The pokemon genrate an illusion if it's available | ||
.conditionalAttr((pokemon) => pokemon.illusion.available, IllusionPreSummonAbAttr, false) | ||
//Illusion is not available after summon | ||
.attr(IllusionDisableAbAttr, false) | ||
//The pokemon loses his illusion when he is damaged by a move | ||
.conditionalAttr((pokemon) => pokemon.illusion.active, IllusionBreakAbAttr, true) | ||
//Illusion is available again after a battle | ||
.conditionalAttr((pokemon) => pokemon.isAllowedInBattle(), IllusionAfterBattle, false) | ||
.bypassFaint(), | ||
PyGaVS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
new Ability(Abilities.IMPOSTER, 5) | ||
.attr(PostSummonTransformAbAttr) | ||
.attr(UncopiableAbilityAbAttr), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
NIT: why remove this new line?
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.
not intentional