Skip to content
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

Sharing is Caring: Fix Air Balloon #10074

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions data/mods/sharingiscaring/items.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const Items: {[k: string]: ModdedItemData} = {
airballoon: {
inherit: true,
// airborneness implemented in sim/pokemon.js:Pokemon#isGrounded
onDamagingHit(damage, target, source, move) {
this.add('-enditem', target, 'Air Balloon');
if (target.item === 'airballoon') {
target.item = '';
target.itemState = {id: '', target};
} else {
delete target.volatiles['item:airballoon'];
target.m.sharedItemsUsed.push('airballoon');
}
this.runEvent('AfterUseItem', target, null, null, this.dex.items.get('airballoon'));
},
},
};
4 changes: 2 additions & 2 deletions data/mods/sharingiscaring/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export const Scripts: ModdedBattleScriptsData = {
if ('ingrain' in this.volatiles && this.battle.gen >= 4) return true;
if ('smackdown' in this.volatiles) return true;
const item = (this.ignoringItem() ? '' : this.item);
if (item === 'ironball' || this.volatiles['item:ironball']) return true;
if (item === 'ironball' || (this.volatiles['item:ironball'] && !this.ignoringItem())) return true;
// If a Fire/Flying type uses Burn Up and Roost, it becomes ???/Flying-type, but it's still grounded.
if (!negateImmunity && this.hasType('Flying') && !(this.hasType('???') && 'roost' in this.volatiles)) return false;
if (this.hasAbility('levitate') && !this.battle.suppressingAbility(this)) return null;
if ('magnetrise' in this.volatiles) return false;
if ('telekinesis' in this.volatiles) return false;
if (item === 'airballoon' || this.volatiles['item:airballoon']) return false;
if (item === 'airballoon' || (this.volatiles['item:airballoon'] && !this.ignoringItem())) return false;
return true;
},
hasItem(item) {
Expand Down