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

Counter and Mirror Coat have incorrect type category checks #2065

Closed
surtr-games opened this issue Nov 13, 2024 · 2 comments · Fixed by #2066
Closed

Counter and Mirror Coat have incorrect type category checks #2065

surtr-games opened this issue Nov 13, 2024 · 2 comments · Fixed by #2066

Comments

@surtr-games
Copy link
Contributor

In battle_ai_scripts.s:

AI_CV_Counter6:
	get_target_type1
	if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter_End
	get_target_type2
	if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter_End
	if_random_less_than 50, AI_CV_Counter_End
AI_CV_Counter7:
	if_random_less_than 100, AI_CV_Counter8
	score +4
AI_CV_Counter8:
	end

Counter deals double the damage received if hit by a physical attack.
So, in my opinion, it doesn't make sense to score +4 if none of the mon's types is physical.
Mirror Coat has the same issue.

Do you agree that this should be considered a bug?
If so, should we fix it in Pret (conditionally, with the BUGFIX define)?
If so, any suggestions on how to fix it?

@ketsuban
Copy link
Contributor

I think maybe you've misunderstood what get_target_type{1,2} do - it's checking the opponent, not the user, on the basis that (since this is Gen 3 and we don't have a physical/special split) they're likely to use moves of the same persuasion as their STAB types. Theoretically it could make better use of Counter/Mirror Coat (e.g. by "cheating" and looking at what move the player has used) but that's well out of the scope of the BUGFIX macro and more in the realm of "rewrite the AI entirely".

@GriffinRichards
Copy link
Member

@ketsuban Follow that logic through the script and you'll see the bug. If the opponent is a physical type (and so as you noted more likely to use a physical move Counter would be good for) it ends the script with no further action. On the other hand if it's not a physical type it has a chance to reach score +4, increasing the likelihood that Counter is the chosen move.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants