Last active
February 23, 2022 03:16
-
-
Save bigfarts/da0263ea8d2f973e8e79e4b36fcfa0ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# THIS IS PSEUDOCODE | |
# THIS IS PSEUDOCODE | |
# THIS IS PSEUDOCODE | |
# This is the logic exactly as written in BN6. It's kind of weird! | |
def processflashing(obj): | |
if obj.flashingtimeleft == 0 and obj.hit.flash: | |
obj.flashingtimeleft = 120 | |
obj.hit.flash = False | |
if obj.flashingtimeleft != 0: | |
obj.flashingtimeleft -= 1 | |
if obj.flashingtimeleft > 0: | |
obj.flashing = True | |
return | |
obj.flashing = False | |
def processstatus(obj): | |
# Check paralysis. | |
obj.paralyzedtimeleft -= 1 | |
if obj.paralyzedtimeleft <= 0: | |
obj.paralyzed = False | |
obj.hit.paralyze = False | |
obj.paralzyedtimeleft = 0 | |
else: | |
if obj.hit.paralyze: | |
obj.hit.paralyze = False | |
obj.hit.confuse = False | |
obj.confusedtimeleft = 0 | |
obj.frozentimeleft = 0 | |
obj.bubbledtimeleft = 0 | |
obj.bubbled = False | |
obj.frozen = False | |
obj.confused = False | |
if not obj.paralyzed: | |
obj.paralyzed = True | |
# Check frozen. | |
obj.frozentimeleft -= 1 | |
if obj.frozentimeleft <= 0: | |
obj.frozen = False | |
obj.frozentimeleft = 0 | |
else: | |
if obj.hit.freeze: | |
obj.hit.freeze = False | |
obj.hit.bubble = False | |
obj.hit.confuse = False | |
obj.confusedtimeleft = 0 | |
obj.paralyzedtimeleft = 0 | |
obj.bubbledtimeleft = 0 | |
obj.bubbled = False | |
obj.confused = False | |
if not obj.frozen: | |
obj.frozen = True | |
# Check bubbled. | |
obj.bubbledtimeleft -= 1 | |
if obj.bubbledtimeleft <= 0: | |
obj.bubbled = False | |
obj.bubbledtimeleft = 0 | |
else: | |
if obj.hit.bubble: | |
obj.hit.bubble = False | |
obj.hit.confuse = False | |
obj.confusedtimeleft = 0 | |
obj.paralyzedtimeleft = 0 | |
obj.frozentimeleft = 0 | |
obj.confused = False | |
if not obj.bubbled: | |
obj.bubbled = True | |
# Check confused. | |
obj.confusedtimeleft -= 1 | |
if obj.confusedtimeleft <= 0: | |
obj.confused = False | |
obj.confusedtimeleft = 0 | |
else: | |
if obj.hit.confuse: | |
obj.hit.freeze = False | |
obj.hit.bubble = False | |
obj.hit.confuse = False | |
obj.hit.paralyze = False | |
obj.paralyzedtimeleft = 0 | |
obj.frozentimeleft = 0 | |
obj.bubbledtimeleft = 0 | |
obj.confused = True | |
obj.bubbled = False | |
obj.frozen = False | |
obj.paralyzed = False | |
# Check immobilized. | |
obj.immobilizedtimeleft -= 1 | |
if obj.immobilizedtimeleft <= 0: | |
obj.immobilized = False | |
obj.immobilizedtimeleft = 0 | |
else: | |
if obj.hit.immobilize: | |
obj.hit.immobilize = False | |
obj.immobilized = True | |
# Check blinded. | |
obj.blindedtimeleft -= 1 | |
if obj.blindedtimeleft <= 0: | |
obj.blinded = False | |
obj.blindedtimeleft = 0 | |
else: | |
if obj.hit.blind: | |
obj.hit.blind = False | |
obj.blinded = True | |
# Check invincible. | |
obj.invincibletimeleft -= 1 | |
if obj.invincibletimeleft <= 0: | |
obj.invincible = False | |
obj.invincibletimeleft = 0 | |
else: | |
obj.invincible = True | |
if not obj.hit.drag: | |
if not obj.dragged: | |
obj.dragstate = 0x00 | |
if not obj.hit.slide: | |
if not obj.sliding: | |
obj.slidestate = none | |
else: | |
# TODO: no idea if this is correct | |
processslide(obj) | |
else: | |
obj.hit.slide = False | |
processslide(obj) | |
processflashing(obj) | |
processstatus(obj) | |
else: | |
obj.currentattack = 0x05 # Player is interrupted. | |
else: | |
obj.hit.drag = False | |
obj.frozen = False | |
obj.hit.freeze = False | |
obj.frozentimeleft = 0 | |
obj.bubbled = False | |
obj.hit.bubble = False | |
obj.bubbledtimeleft = 0 | |
if not obj.hit.unk15 and (not obj.hit.unk02 or obj.currentattack == 0x04): # ?? what are these flags??? | |
obj.paralyzed = False | |
obj.hit.paralyze = False | |
obj.paralyzedtimeleft = 0 | |
obj.hit.paralyze = False | |
obj.currentattack = 0x05 # Player is interrupted. | |
# Unclear how dragstate gets processed... more research needed. | |
obj.dragstate = 0x00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment