Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Basically:
- - Move to random adjacent panel.
- - Target panel 3 panels in front of MegaMan.
- - Move towards target until MegaMan is in range or cannot move further (directly) towards target.
- - Attack.
- - Repeat.
- Notes:
- - Before the first move to the random adjacent panel, the current position is saved (let's call it L).
- Next time it does the first move to a random adjacent panel it will prefer not to move back to L.
- - If confused or blinded, the attack cooldown delay is always the same as the V1's (120 frames).
- - If confused, the attack range is only 1 square ahead. However, the range check is still 3 squares ahead.
- - When moving towards target panel, vertical movement has priority over horizontal movement.
- - When moving towards target panel, will never move away from target panel (so it can't always go around holes).
- - The confused/blinded behavior depends on WHEN the virus is confused/blinded:
- - If confused/blinded while attacking, will continuously attack immediately after moving to random adjacent panel.
- - If confused/blinded while moving, will keep moving to random adjacent panel until MegaMan is in range. After attack it falls into the pattern above.
- Simplified version with confused and blinded:
- RandomMovement (start):
- - Select a random adjacent panel A to move to, excluding L, unless L is the only panel it can move to.
- - If no such panel could be found, go to Attack.
- - Save current position L.
- - Move to selected panel A.
- - If blinded, go to Attack.
- - Otherwise, go to TargetEnemy.
- TargetEnemy:
- - If MegaMan is in range of 3 panels ahead, go to Attack.
- - Set the target position T to the 3rd panel in front of MegaMan.
- - Go to HomingMovement.
- HomingMovement:
- - If MegaMan is in range of 3 panels ahead, go to Attack.
- - If confused or blinded:
- - Move to random adjacent panel.
- - If not possible, go to Attack.
- - Otherwise, go back to HomingMovement.
- - If OldStove is on target position T, go to Attack.
- - If OldStove can move vertically towards T:
- - Do so.
- - Go back to HomingMovement.
- - If OldStove can move horizontally towards T:
- - Do so.
- - Go back to HomingMovement.
- Attack:
- - If confused or blinded, set attack cooldown to 120 frames.
- - Otherwise, set attack cooldown to the default based on virus level.
- - If confused, set attack range to 1 panel ahead.
- - Otherwise, set attack range to 3 panels ahead.
- Expanded version:
- RandomMovement (start):
- - Find all adjacent panels that OldStove can move to.
- [_][_][_]/[_][A][_] O = OldStove
- [_][_][_]/[A][O][A] M = MegaMan
- [M][_][_]/[_][A][_] A = adjacent panel
- If no such panel exists (i.e. OldStove cannot move):
- - Go to Attack.
- If one such panel exists:
- - Move to it.
- If multiple such panels exist:
- - Exclude L.
- - Move to a random adjacent panel (equal chance for each).
- - Save the last position (before moving) as position L. (So OldStove will prefer not to do its first random movement to L next time.)
- [_][_][_]/[_][O][_]
- [_][_][_]/[_][L][_]
- [M][_][_]/[_][_][_]
- - Check if blinded.
- If yes:
- - Go to Attack.
- - Go to TargetEnemy.
- TargetEnemy:
- - Check if enemy (MegaMan) in following range:
- [_][R][R]/[R][O][_] R = range
- [_][_][_]/[_][_][_]
- [M][_][_]/[_][_][_]
- If yes:
- - Go to Attack.
- - Set target position T to 3rd square in front of target (regardless of panel color).
- [_][_][_]/[_][O][_]
- [_][_][_]/[_][_][_]
- [M][_][_]/[T][_][_]
- - Go to HomingMovement.
- HomingMovement:
- - Check if enemy in following range:
- [_][R][R]/[R][O][_] R = range
- [_][_][_]/[_][_][_]
- [M][_][_]/[T][_][_]
- If yes:
- - Go to Attack.
- - Check if confused or blinded.
- If yes:
- - Move OldStove to random adjacent panel. Equal chance for each panel that qualifies. L is not affected.
- [_][_][_]/[A][O][A]
- [_][_][_]/[_][A][_]
- [M][_][_]/[T][_][_]
- If no such panel exists (i.e. OldStove cannot move):
- - Go to Attack.
- - Go to HomingMovement.
- - Check if OldStove current position is T.
- If yes:
- - Go to Attack.
- - Check if OldStove can move vertically towards T.
- If yes:
- - Move OldStove vertically towards T. L is not affected.
- [_][_][_]/[_][O][_] N = new position
- [_][_][_]/[_][N][_]
- [M][_][_]/[_][_][_]
- - Go to HomingMovement.
- - Check if OldStove can move horizontally towards T. L is not affected.
- If yes:
- - Move OldStove horizontally towards T.
- [_][_][_]/[N][O][_] H = hole
- [_][_][_]/[_][H][_] N = new position
- [M][_][_]/[_][_][_]
- - Go to HomingMovement.
- - Go to Attack.
- Attack:
- - Check if confused or blinded.
- If confused:
- - Set attack cooldown to 120 frames (2 seconds).
- - Set attack range to 1 panel ahead.
- [_][_][_]/[_][_][_]
- [_][_][_]/[R][O][_]
- [_][_][_]/[_][_][_]
- If blinded:
- - Set attack cooldown to 120 frames (2 seconds).
- - Set attack range to 3 panels ahead.
- [_][_][_]/[_][_][_]
- [_][R][R]/[R][O][_]
- [_][_][_]/[_][_][_]
- If no:
- - Set attack cooldown to the following:
- V1 120 frames (2 seconds)
- V2 100 frames (1⅔ seconds)
- V3 80 frames (1⅓ seconds)
- SP 60 frames (1 second)
- Rare 80 frames (1⅓ seconds)
- Rare2 40 frames (⅔ seconds)
- - Set attack range to default (3 panels ahead).
- [_][_][_]/[_][_][_]
- [_][R][R]/[R][O][_]
- [_][_][_]/[_][_][_]
- - Perform attack.
- - Go to RandomMovement.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement