øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1592.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index4b2f.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.220e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index4b2f.html.zxÁ&h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ`¦D»ZOKtext/htmlISO-8859-1gzip8:Ö»ZÿÿÿÿÿÿÿÿWed, 11 Mar 2020 00:02:34 GMT0ó°° ®0®P®€§²ð®Á&h^»Z How to check target for death protection

Author Topic: How to check target for death protection  (Read 1464 times)

Mikey

  • Karlabos
  • *
  • Posts: 30
    • View Profile
How to check target for death protection
« on: April 14, 2011, 06:45:23 PM »
I want my spell ability to check the target for death protection, then toggle "factor 1/16" if found, using ASM.

I'm trying to make a spell that divides a target's HP, but if it's protected from death I want it to do damage like a normal spell.

Example where 8 is the spell power:

Monster not protected from death, divide HP by half (8/16)

Monster protected from death, do normal damage using spell power of 8.

Ronnen

  • Karlabos
  • *
  • Posts: 33
    • View Profile
Re: How to check target for death protection
« Reply #1 on: June 21, 2011, 12:12:15 PM »
Did you ever figure this out Mikey?

Not sure if any of this is helpful or not, but the code that calculates if a spell / ability hits or not does the following:

Code: [Select]
C2/224B: AD A2 11     LDA $11A2
C2/224E: 89 02        BIT #$02    (Check for spell miss if death prot.)
C2/2250: F0 07        BEQ $2259   (Branch if not ^)
C2/2252: B9 A1 3A     LDA $3AA1,Y
C2/2255: 89 04        BIT #$04
C2/2257: D0 5C        BNE $22B5   (Always miss if Prot. from death)
C2/2259: AD A2 11     LDA $11A2

I'm planning to work on something that makes all instant death effects do damage instead if the target (Player or Enemy) is protected from death.

I did a proof of concept of that making ChainSaw do damage even if it goes for instant death attack (and making it always go for instant death for ease of testing)...

Code: [Select]
hirom   ; don't change this
header  ; comment out if your rom has no header

org $C22257  ; modify the hit/miss calc block

DW #$6ED0   ; This is really BNE $22C7
             ; if Miss-if-death-prot and target is death-prot...
; make this a regular hit that does damage but doesn't kill
; by making the attack hit but do no status effects

org $C22B30  ; modify the Chainsaw block

NOP                   ;EDIT make it always go for instant kill
NOP
NOP   ; JSR $4B5A   ;(0 to 255)
NOP
NOP            ;AND #$03     
NOP
NOP ; BNE DoHit   ;(75% chance)
LDA #$08
STA $B6     ;(Animation)
NOP                  ; EDIT don't make it clear battle power
NOP
NOP ;STZ $11A6   ;(Battle power)