chronicleroflegends
Member
Hey everybody, I know a big issue a lot of us have faced is that our monsters reset to action 0 when they get hurt.
This has been pretty annoying and makes bosses way too easy to beat.
I have a little update that can help with this issue. You will have to edit a system script, so be sure to make a backup.
Thanks to Mugi and Dale_Coop for pointing me in the right direction for this!
OK, you will need to edit your routines\module\system\HandleObjectUpdates.asm script.
Look for the label that says HandleObjectTimers:
You are going to want to change the code that follows it to this (or similar):
There are a few Constants in there you will need to create to make it work,
but this script does a few things:
1) You can place custom invulnerability timers on the player, bosses, or other objects
2) It halts the movement of normal enemies on hurt, but not bosses
3) For normal enemies, it resets the CURRENT action they are on, but not set them back to 0.
4) For a boss (or any other enemy you may add an ID for) it will give them invulnerability time after getting hit, but WILL NOT reset their actions.
This way you can have a boss that can actually fight back!
Now I am sure this script isn't perfect, it depends how you have your enemies and bosses setup. But it shouldn't be too difficult to customize to your needs.
One suggestion I have had already (Thanks Cargo) is to replace one of your objects action flags with a 'not stunnable flag' and check that instead of object ID.
That way you could have bosses that have specific animations that they are vulnerable to being 'stunned'
Anyways, I hope this helps somebody out with their bosses and other enemies!
This has been pretty annoying and makes bosses way too easy to beat.
I have a little update that can help with this issue. You will have to edit a system script, so be sure to make a backup.
Thanks to Mugi and Dale_Coop for pointing me in the right direction for this!
OK, you will need to edit your routines\module\system\HandleObjectUpdates.asm script.
Look for the label that says HandleObjectTimers:
You are going to want to change the code that follows it to this (or similar):
Code:
HandleObjectTimers:
;; Updated version by Chronicler Of Legends 3_3_19
;;; handle object timers, tool
LDA Object_timer_0,x
BEQ ObjectTimer0Finished
DEC Object_timer_0,x
LDA Object_timer_0,x
BNE ObjectTimer0Finished ;; timer is still going.
;;;;; object timer 0 has cycled and is finished.
;;;;; right now, we'll use this to flip hurt/invincible to just invincible, to normal.
LDA Object_status,x
AND #%00000001 ;; is it hurt and invincible?
BEQ notHurtAndInvincible
;; hurt and invincible
LDA Object_status,x
AND #%11111110
ORA #%00000010
STA Object_status,x
;; Is this a player, boss, or other object?
LDA Object_type,x
CMP player1_object
BNE +
;; Changed this to custom invincibility timer.
LDA #PLR_INVINC_TIM ;; my custom invincibility timer constant
STA Object_timer_0,x
JMP handleObjectTimer_afterSetInvincibility
+: ;; Not player object
;; Is it a boss?
LDA Object_type,x
CMP #ENEMY_BOSS1_ID ;; CUSTOM ID SET IN USER CONSTANTS, you can change this to however you want to flag an enemy as a 'boss'
BNE +
LDA #INVINCIBILITY_TIMER ;; Same as a normal enemy
STA Object_timer_0,x
JMP handleObjectTimer_afterSetInvincibility
;+: ;; Add other things that you want to have custom invulnerablity timers here.
; LDA Object_type,x ; this can be any type of comparison that flags the object
; CMP #SOME_ID_HERE
; BNE +
; LDA #CUSTOM_TIMER
; STA Object_timer_0,x
; JMP handleObjectTimer_afterSetInvincibility
+:
;; Normal object
LDA #INVINCIBILITY_TIMER
STA Object_timer_0,x
handleObjectTimer_afterSetInvincibility:
;; Is it a boss?
LDA Object_type,x
CMP #ENEMY_BOSS1_ID
BNE +
JMP ObjectTimer0Finished ;; Skip resetting the movement
+:
LDA Object_movement,x
AND #%00001111
STA Object_movement,x
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
JMP ObjectTimer0Finished
notHurtAndInvincible:
LDA Object_status,x
AND #%00000010
BEQ ObjectTimer0Finished ;; no longer invincible...not sure what this timer would be doing at this point.
;;; it IS still invincible, need to change it back to normal.
LDA Object_status,x
AND #%11111100
STA Object_status,x
;;; activate state 0
;ChangeObjectState #$00,#$02
;; Is it a boss?
LDA Object_type,x
CMP #ENEMY_BOSS1_ID
BNE +
JMP ObjectTimer0Finished ;; Don't reset the action for bosses.
+:
JSR DoNewAction
ObjectTimer0Finished:
RTS
There are a few Constants in there you will need to create to make it work,
but this script does a few things:
1) You can place custom invulnerability timers on the player, bosses, or other objects
2) It halts the movement of normal enemies on hurt, but not bosses
3) For normal enemies, it resets the CURRENT action they are on, but not set them back to 0.
4) For a boss (or any other enemy you may add an ID for) it will give them invulnerability time after getting hit, but WILL NOT reset their actions.
This way you can have a boss that can actually fight back!
Now I am sure this script isn't perfect, it depends how you have your enemies and bosses setup. But it shouldn't be too difficult to customize to your needs.
One suggestion I have had already (Thanks Cargo) is to replace one of your objects action flags with a 'not stunnable flag' and check that instead of object ID.
That way you could have bosses that have specific animations that they are vulnerable to being 'stunned'
Anyways, I hope this helps somebody out with their bosses and other enemies!