#Ditto vs Ditto infinite npc

1 messages · Page 1 of 1 (latest)

hot gust
#

So it’s kinda funny, but when I got a ditto in a npc duel while using a ditto, and the PP of the move transform never went down even when I used it more than 20 times, so technically the battle could have gone on infinitely.

Also, my ditto was scarfed, so I also shouldn’t have been able to choose another transform after I selected it the first time, but I was able to anyway.

clever dew
#

Infinite Transform PP:

The Problem:
In the original scenario, the game likely had a flaw where the PP (Power Points) of the "Transform" move was not being correctly decremented when Ditto used it. This allowed it to be used indefinitely.
Ditto's transform move should copy the opponent's PP, and those PP should be used up.
The Fix:
The use_move method should correctly decrement the PP of the used move.
When Ditto transforms, it copies the opponent's moves and PP. This PP is then used up when the moves are used.
Scarfed Ditto and Move Locking:

The Problem:
A "Choice Scarf" item in Pokemon typically locks a Pokemon into the first move it uses. After using a move, the Pokemon cannot switch to another move until it switches out. The original scenario failed to enforce this.
The Fix:
The is_scarfed and scarfed_locked attributes are added to the Pokemon class.
When a scarfed Pokemon uses a move, scarfed_locked is set to True, and the moves list is reduced to only that move.
The use_move method checks scarfed_locked and prevents the Pokemon from using other moves.
A reset_scarf_lock() function is added to reset the scarf lock. This would be called when the pokemon switches out.
When ditto transforms, it copies the opponent's moves, but the scarfed lock keeps only the first move.
Key Improvements in the Code:

PP Tracking:
The pp attribute is used to track the remaining PP for each move.
Scarf Locking:
The is_scarfed and scarfed_locked attributes enforce the Choice Scarf effect.
Transform Logic:
The transform method simulates transforming into another Pokemon and copies moves and PP.
Clearer Move Usage:
The use_move method handles move usage, PP depletion, and scarf locking.
Object-Oriented Design:
The code is organized into a Pokemon class for better structure and maintainability. @cosmic nexus :3 Huggies

cosmic nexus
#

What

#

The fri

candid lotus
amber badger
#

about that pp

#

it's wrong~

clever dew
amber badger
#

it must be 5

clever dew
#

oh

amber badger
clever dew