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

Cheek pouch fixes #2375

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
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
8 changes: 3 additions & 5 deletions battle-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,11 +1052,9 @@ BattlePokemon = (function () {
if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect;
if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target;
item = this.getItem();
if (this.battle.runEvent('UseItem', this, null, null, item) && this.battle.runEvent('EatItem', this, null, null, item)) {
this.battle.add('-enditem', this, item, '[eat]');

this.battle.singleEvent('Eat', item, this.itemData, this, source, sourceEffect);

this.battle.add('-enditem', this, item, '[eat]');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this line, berries will bypass Unnerve.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, based on where you moved it, it means berries will bypass Unnerve, then they might possibly keep their item!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might keep their item as in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EatItem is actually a very important for making sure berries don't get consumed out of order, and is used in quite a few cases:

  • Unnerve blocking all berries
  • Heal Block blocking healing berries

The way the order is now, an eating message will appear, the effect will trigger, and then Unnerve will block the item from being "consumed" and the item will stay as held. Berry Pouch probably needs to activate in an event that occurs after EatItem, perhaps in AfterUseItem? We'll still have to do some extra checks for Bug Bite and whatnot (because those are not fixed yet)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I continue working on this, or will Marty do it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continue working on this. The person assigned to a pull request is the one who reviews it before merging (usually), and Marty knows the most about game mechanics.

this.battle.singleEvent('Eat', item, this.itemData, this, source, sourceEffect);
if (this.battle.runEvent('EatItem', this, null, null, item) && this.battle.runEvent('UseItem', this, null, null, item)) {
this.lastItem = this.item;
this.item = '';
this.itemData = {id: '', target: this};
Expand Down