Hi there, name's MidiGuy. I've recently come to like this boss. (Already used it for 1 of my custom bosses.) And I was just wondering if I could help just a little help with creating a new routine for it. What I'd like to do is make a routine where the boss will automaticly lose a hit point after a certain amount of time, allowing us to make a session where the boss could go crazy after taking a hit, then calm down after that set amount of time. Like it would be like this: STATE8: JSR Move JSR JumpHurt RTS STATE7: JSR Move JSR GoCrazyfor5secondsthenlose1hpautomaticly (Yeah, long feature I know :p) RTS STATE6: JSR Move JSR JumpHurt RTS So Im guessing it would probably look something like this: Code AutoHPLoseTimer: "Timer Code (This is what I'd need.)" DEC $1528,x (I believe this is the code the subtracts the health right?) Then like the rest of the feautures it could be used with a "JSR AutoHPLoseTimer" at a certain STATE. I still don't know much about asm, but from what I gather it would probably look somewhat like this. Anyway, if anyone could help out with this, that would be great. | |
My Youtube Channel Showcases alot of my vids. ^^ Thanks to Pester for the Layout | Hack Progress: -About- Havn't done much hack work/level making so... .. (Just a little SMBX stuff really) |
If you want to make a timer you can just use one of the free sprite tables that smw auto decrements (if you don't want to do it yourself). If description on $1558,x is correct you can use that one.
the idea is to set $1558,x or whatever to some intial count. Then you wait until $1558,x equals zero, that is when the timer has expired. If I stored dec 60 there, because the game runs at 60hz for NTSC roms then it would expire after one second once it equals zero.
In code, before entering the angry state, you set the timer to some value depending on how long you want it to last. Then in your angry code you keep testing if the timer has expired, if the timer value is not zero then it hasn't expired yet. Once it has reached zero the time has passed and you can change state or whatever you are going for.
In your example code you would DEC $1528,x (if that's your hp counter) after timer has expired ofcourse.