Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Draconius GO
Reply
 
Thread Tools
  #351    
Old August 2nd, 2017 (12:48 AM). Edited August 3rd, 2017 by ShyGuy25.
ShyGuy25 ShyGuy25 is offline
     
    Join Date: Jun 2012
    Gender: Male
    Posts: 20
    I'm trying to add Galvanize as a branch off of DollSteak's -Ate abilities, I figured I could do it by changing the type from Ice/Fairy/Flying to Electric (0xD).

    However it doesn't work, can anyone have a look and see what's wrong?

    Fire Red
    Spoiler:
    [CODE].text
    .align 2
    .thumb
    .thumb_func
    .global typechangeabilities

    BufferAbility:
    mov r0, r6
    add r0, #0x20
    ldrb r1, [r0]
    NormalCheck:
    mov r0, r9
    cmp r0, #0x0
    bne NormalizeCheck
    RefrigerateCheck:
    cmp r1, #0x87
    bne PixilateCheck
    Refrigerate:
    mov r0, #0xF
    b StoreType
    PixilateCheck:
    cmp r1, #0x88
    bne AerilateCheck
    Pixilate:
    mov r0, #0x17
    b StoreType
    GalvanizeCheck:
    cmp r1, #0x8D
    bne PixilateCheck
    Galvanize:
    mov r0, #0xD
    b StoreType
    AerilateCheck:
    cmp r1, #0x89
    bne Return
    Aerilate:
    mov r0, #0x2

    StoreType:
    mov r9, r0
    ldr r0, .ChangeTypeLoc
    ldr r1, [r0]
    add r1, #0x13
    ldrb r1, [r1]
    mov r2, #0x3F
    and r2, r1
    cmp r2, #0x0
    bne Return
    mov r2, r9
    strb r2, [r1]
    Boost:
    mov r0, r8
    mov r1, #0xA7
    mul r0, r1
    lsr r0, #0x7
    mov r8, r0
    mul r7, r1
    lsr r7, #0x7
    b Return
    NormalizeCheck:
    cmp r1, #0x8A
    bne Return
    Normalize:
    mov r0, #0x0
    mov r9, r0
    Return:
    ldr r0, [sp, #0x4]
    ldrh r0, [r0, #0xA]
    str r0, [sp, #0x18]
    ldrh r0, [r6, #0x2E]
    cmp r0, #0x87
    bne NoEnigmaBerry
    ldr r1, .Return
    bx r1
    NoEnigmaBerry:
    ldr r0, .Return2
    bx r0

    .align 2
    .ChangeTypeLoc: .word 0x02023FE8
    .Return: .word 0x0803ED87
    .Return2: .word 0x0803EDA1


    edit: if this helps with anything im using the MrDS rombase which might affect things like pointers.
    Reply With Quote

    Relevant Advertising!

      #352    
    Old September 29th, 2017 (7:09 AM).
    pikachux2's Avatar
    pikachux2 pikachux2 is offline
    Never Evolve
       
      Join Date: Mar 2010
      Location: USA
      Gender: Male
      Nature: Jolly
      Posts: 83
      Hey, can anyone explain to me if I need to, or why I don't need to, point Abilities in PGE to some specific offset? Does the game just check the string representation of the ability to see if the Pokémon has it? Or am I missing the part where I somehow point it to the index of the ability in PGE?
      Reply With Quote
        #353    
      Old September 29th, 2017 (8:24 AM).
      Skeli Unbound's Avatar
      Skeli Unbound Skeli Unbound is offline
      Lord of the Rings
         
        Join Date: Apr 2014
        Location: Canada
        Age: 19
        Gender: Male
        Nature: Adamant
        Posts: 123
        Quote:
        Originally Posted by pikachux2 View Post
        Hey, can anyone explain to me if I need to, or why I don't need to, point Abilities in PGE to some specific offset? Does the game just check the string representation of the ability to see if the Pokémon has it? Or am I missing the part where I somehow point it to the index of the ability in PGE?
        The ability names and descriptions and still stored in tables.
        __________________
        Pokemon Unbound

        Reply With Quote
          #354    
        Old September 30th, 2017 (3:07 AM).
        pikachux2's Avatar
        pikachux2 pikachux2 is offline
        Never Evolve
           
          Join Date: Mar 2010
          Location: USA
          Gender: Male
          Nature: Jolly
          Posts: 83
          Quote:
          Originally Posted by Skeli Unbound View Post
          The ability names and descriptions and still stored in tables.
          Thanks, I understand that, but how is the actual effect of the ability called in battle? I can't find anyway to point the name of the ability to its corresponding effect. So the question is, do I have to?
          Reply With Quote
            #355    
          Old September 30th, 2017 (8:41 AM).
          BluRose BluRose is offline
          blu rass
             
            Join Date: Apr 2014
            Location: hyakkoku city
            Age: 16
            Gender: Male
            Nature: Timid
            Posts: 721
            Quote:
            Originally Posted by pikachux2 View Post
            Thanks, I understand that, but how is the actual effect of the ability called in battle? I can't find anyway to point the name of the ability to its corresponding effect. So the question is, do I have to?
            individual abilities are each checked for in the battle engine as indexes.

            this next scene is a plausible way of it working

            so like take levitate
            let's say we have our latios with levitate
            earthquake is used by opponent
            game checks type of move used - returns ground
            game checks latios for ability - returns levitate
            compares it with levitate's index number
            branches off to levitate's battle message printing and zero damage done
            attack over
            __________________
            am i cool yet
            Reply With Quote
              #356    
            Old October 1st, 2017 (12:05 AM).
            pikachux2's Avatar
            pikachux2 pikachux2 is offline
            Never Evolve
               
              Join Date: Mar 2010
              Location: USA
              Gender: Male
              Nature: Jolly
              Posts: 83
              Quote:
              Originally Posted by BluRose View Post
              individual abilities are each checked for in the battle engine as indexes.

              this next scene is a plausible way of it working

              so like take levitate
              let's say we have our latios with levitate
              earthquake is used by opponent
              game checks type of move used - returns ground
              game checks latios for ability - returns levitate
              compares it with levitate's index number
              branches off to levitate's battle message printing and zero damage done
              attack over
              thanks perfect
              Reply With Quote
                #357    
              Old October 1st, 2017 (5:29 PM).
              pikachux2's Avatar
              pikachux2 pikachux2 is offline
              Never Evolve
                 
                Join Date: Mar 2010
                Location: USA
                Gender: Male
                Nature: Jolly
                Posts: 83
                One more thing, this line of code I've found at the end of each ability script,
                Spoiler:
                #insert 01 49 08 47 00 00 xx xx xx 08 at 026192

                I assume I'm supposed to change those x's to something meaningful like a pointer, is that the case?
                Reply With Quote
                  #358    
                Old October 1st, 2017 (7:13 PM). Edited October 1st, 2017 by Skeli Unbound.
                Skeli Unbound's Avatar
                Skeli Unbound Skeli Unbound is offline
                Lord of the Rings
                   
                  Join Date: Apr 2014
                  Location: Canada
                  Age: 19
                  Gender: Male
                  Nature: Adamant
                  Posts: 123
                  Quote:
                  Originally Posted by pikachux2 View Post
                  One more thing, this line of code I've found at the end of each ability script,
                  Spoiler:
                  #insert 01 49 08 47 00 00 xx xx xx 08 at 026192

                  I assume I'm supposed to change those x's to something meaningful like a pointer, is that the case?
                  Pointer to your asm routine +1.
                  __________________
                  Pokemon Unbound

                  Reply With Quote
                    #359    
                  Old October 2nd, 2017 (11:47 AM).
                  pikachux2's Avatar
                  pikachux2 pikachux2 is offline
                  Never Evolve
                     
                    Join Date: Mar 2010
                    Location: USA
                    Gender: Male
                    Nature: Jolly
                    Posts: 83
                    Quote:
                    Originally Posted by Skeli Unbound View Post
                    Pointer to your asm routine +1.
                    Thanks again
                    Reply With Quote
                    Reply

                    Quick Reply

                    Join the conversation!

                    Create an account to post a reply in this thread, participate in other discussions, and more!

                    Create a PokéCommunity Account

                    Sponsored Links
                    Thread Tools

                    Posting Rules
                    You may not post new threads
                    You may not post replies
                    You may not post attachments
                    You may not edit your posts

                    BB code is On
                    Smilies are On
                    [IMG] code is On
                    HTML code is Off

                    Forum Jump


                    All times are GMT -8. The time now is 6:14 PM.