Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: Outcast on February 27, 2016, 02:45:58 AM

Title: Souper Ian's Overpower and Underpower for FFvsTR
Post by: Outcast on February 27, 2016, 02:45:58 AM
Well after doing some digging on my old collection of Freedom Force files, i found this code of Souper Ian's Overpower and Underpower for  :ffvstr:.

I'm not sure how to use it to really test if it works though.

Do i add the code in the init.py/localinit.py ? Just like as it was for the camera zooming code?

Hmmm.. on second thought the code looks a lot like Stumpy's code for Changing Melee Area Ranges in FFX. But it doesn't seem to have predefined values , or import instructions like Stumpy's code has.

It starts and looks like this:

##Adds underpowering and a weaker overpower
def extrapowerlevels(char, update=0):
    Object_SetAttr(char, 'underpowered', 0)
    Mission_CustomAction('CUSTOM_UNDERPOWER',char,char,'switchUnderPower',50,0)
    Object_SetAttr(char, 'overpowered', 0)
    Mission_CustomAction('CUSTOM_OVERPOWER',char,char,'switchOverPower',50,0)
    Object_SetGenericState(char,OBJSTATE_ATTACKBONUS,10000,0)
    RegTimer('removeFX',2,1,char)

def switchUnderPower(dummy, char):
    isUnder = Object_GetAttr(char, 'underpowered')
    if isUnder == 0:
        Object_SetAttr(char, 'underpowered', 1)
        Mission_StatusText('underpowering my attacks')
        Object_SetAttr(char, 'maxEnergyPoints', (Object_GetAttr(char, 'maxEnergyPoints')*2))
        Object_SetAttr(char, 'energyPoints', (Object_GetAttr(char, 'energyPoints')*2))
        Object_SetAttr(char, 'attackBonus', (Object_GetAttr(char, 'attackBonus')/2))
        handle=Object_PlayEffect(char, 'effect_ffx_teleport2', '', FX_LOOP|FX_TRACK_OBJECT_POS)
        Object_SetAttr(char, 'underpowerFX', handle)


So i think maybe it should be a stand alone .py file or something in the ffx3/mission/scripts folder. And it will probably still need a corresponding pyc file as well. :doh: