Overpower and underpower in FFVTTR, only a few years late!

Started by SouperIan, April 06, 2010, 03:09:25 PM

Previous topic - Next topic

SouperIan

Yeah, yeah, I know. I think I did post this, back before the crash, but for the past two years or so I've been away from my computer with FFVTTR and all the scripting stuff. Still haven't reinstalled FFVTTR yet - lost the disc. How embarrassing.

But anyway. Here's some rough code - can't remember how much I tested it, and can't right now, but from what I remember it works. Might be best if someone takes a look at it first before you all get overexcited. From what I remember you add a extrapowerlevels(char) call in to the section which initialises extra attributes. This then gives the character two custom commands - one to go into overpowered mode, one to go into under. (and to get out of them once you've entered them) Yes, you can enter them both at once. That's a bit silly, but right now I can't edit the code to stop you doing it.

##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)

    else:
        Object_SetAttr(char, 'underpowered', 0)
        Mission_StatusText('returning my attacks to normal strength')
        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))
        if Object_GetAttr(char, 'underpowerFX')!=-1:
            Object_StopEffect(char,int(Object_GetAttr(char,'underpowerFX')))
            Object_SetAttr(char,'underpowerFX',-1)

def switchOverPower(dummy, char):
   isOver = Object_GetAttr(char, 'overpowered')
   if isOver == 0:
       Object_SetAttr(char, 'overpowered', 1)
       Mission_StatusText('overpowering my attacks')
       Object_SetAttr(char, 'maxEnergyPoints', (Object_GetAttr(char, 'maxEnergyPoints')/1.5))
       Object_SetAttr(char, 'energyPoints', (Object_GetAttr(char, 'energyPoints')/1.5))
       Object_SetAttr(char, 'attackBonus', (Object_GetAttr(char, 'attackBonus')*1.5))
       handle=Object_PlayEffect(char, 'effect_ffx_teleport1', '', FX_LOOP|FX_TRACK_OBJECT_POS)
       Object_SetAttr(char, 'overpowerFX', handle)
   else:
       Object_SetAttr(char, 'overpowered', 0)
       Mission_StatusText('returning my attacks to normal strength')
       Object_SetAttr(char, 'maxEnergyPoints', (Object_GetAttr(char, 'maxEnergyPoints')*1.5))
       Object_SetAttr(char, 'energyPoints', (Object_GetAttr(char, 'energyPoints')*1.5))
       Object_SetAttr(char, 'attackBonus', (Object_GetAttr(char, 'attackBonus')/1.5))
       if Object_GetAttr(char, 'overpowerFX')!=-1:
           Object_StopEffect(char,int(Object_GetAttr(char,'overpowerFX')))
           Object_SetAttr(char,'overpowerFX',-1)


Enjoy getting it to work! I'm now staring at my old code and seeing if there's anything useful to salvage. I always did like the zombie apocalypse attribute.

Possibly still here.

Epimethee

Hey, welcome back, SouperIan! Thanks for the code.

(BTW, FFvsTTR is available on Steam for a few bucks.)
FFX add-on for FFvsTTR at ffx.freedomforce4ever.com

SouperIan

Maybe once exams are done (university, bah). And I've got a slightly more reliable laptop - the computer I used to use for FFVTTR I only get access to for a few weeks every four months or so, and on my laptop the USB ports have just failed, joining the sound card and monitor in uselessness. Also, it has enough problems running Solitaire, FFVTTR'd probably kill it.

Been poking through the old code, there's some stuff that's fun but ridiculously unbalanced, and what looks like the start of an alternate weakness/resistance script system that I don't think I ever got working. There's some nice environmental code for danger room battles I might clean up a bit and post - does stuff like spawns random civilians, sets a day and night cycle, and weather effects.
Possibly still here.

EGD Eric

But does't FFvttR already have overpower? If you hold ctrl before using the power, the attack menu turns red, and then you choose which attack you want to overpower.

Previsionary

Yes, but, iirc, this code was made to represent the original FF's underpower and double overpower states.
Disappear when you least expe--