Grammarsalad / Spells_and_Magic

1 stars 0 forks source link

Potion Brewing Code #2

Open Grammarsalad opened 2 years ago

Grammarsalad commented 2 years ago

//first, let's get all potions on various lists //NOTE TO SELF: Expand Return effect to return die values

COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~ //copies all itm files
    PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
    READ_BYTE 0x001C type //Item type
        PATCH_IF (type = 0x0009) BEGIN  //if potion type
        READ_LONG 0x34 gold //broken up by tier
        LPF RETURN_EFFECT
         INT_VAR
                match_opcode = 12
         RET
                the_opcode
                eff_resource
                eff_par1
                eff_par2
                ref
         END  //return effect  
         PATCH_IF ((the_opcode = 12) AND (((eff_par2 = 65536) OR (eff_par2 = 65537)) OR ((eff_par2 = 65538) OR (eff_par2 = 65539))) BEGIN //acid
               PATCH_PRINT "Par1 is %eff_par1%; Par2 is %eff_par2%. opcode is %the_opcode%."   
         END //acid
         PATCH_IF (eff_par2 = 131072) OR (eff_par2 = 131073) OR (eff_par2 = 131074) OR (eff_par2 = 131075) BEGIN //cold, brr!
               PATCH_PRINT "Par1 is %eff_par1%; Par2 is %eff_par2%. opcode is %the_opcode%."                     
         END //cold
         PATCH_IF (eff_par2 = 524288) OR (eff_par2 = 524289) OR (eff_par2 = 524290) OR (eff_par2 = 524291) BEGIN // fire, fire!
               PATCH_PRINT "Par1 is %eff_par1%; Par2 is %eff_par2%. opcode is %the_opcode%."                     
         END //fire

        END//potion item type
    END //source size
BUT_ONLY