News:

Rings of Reznor!

Main Menu

Attribute: Recurring damage on hit

Started by RingsOfReznor, August 22, 2021, 03:43:16 AM

Previous topic - Next topic

RingsOfReznor

Hi all, I've been playing  :ff: and  :ffvstr: for a while but just started playing with scripts.

I've come to ask if anyone has successfully implemented an attribute that triggers damage over time?

I made a start on this concept with El Diablo using the bulk of the code from Fire Cage, but as you can see I don't really know what I'm doing :P I erased my "progress" when I reinstalled ffx3



VRANG VRANG VRANG VRANG

RingsOfReznor

Came back for another attempt without success... next step will be to smooth out the trigger condition with 'makeFireCage' as a test.
Feedback/suggestions welcome!

Code:
VRANG VRANG VRANG VRANG

seraglio

I created a Damage over Time power swap decades ago for FF1. I'm not sure what exactly you are trying to do with your code, but swaps are a pretty standard way of adding a feature to an attack via stun swap. Maybe that would work for you?

#################### Enflamed fireDOT #############################

def stuntofireDOT(event):
    fireDOTP(event,PCSTATE_STUNNED,2)
def hypnosistofireDOT(event):
    fireDOTP(event,PCSTATE_HYPNOTISED,5)
def ragetofireDOT(event):
    fireDOTP(event,PCSTATE_ENRAGED,4)
def exiletofireDOT(event):
    fireDOTP(event,PCSTATE_EXILE,3)
def blanktofireDOT(event):
    fireDOTP(event,PCSTATE_BLANK,3)
def panictofireDOT(event):
    fireDOTP(event,PCSTATE_PANICKED,3)

def hextofireDOT(event):
    fireDOTS(event,SCSTATE_HEXED,4)
def blindtofireDOT(event):
    fireDOTS(event,SCSTATE_BLIND,6)
def powernulltofireDOT(event):
    fireDOTS(event,SCSTATE_POWER_NULLIFICATION,3)
def irradiatetofireDOT(event):
    fireDOTS(event,SCSTATE_IRRADIATED,6)


def densitytofireDOT(event):
    char=event.object
    source=event.string
    if densityaltered(char):
        Object_SetGenericState(char,OBJSTATE_DENSITY_CHANGE,0,REMOVE_STATE)
        FFX_UpdateStates(char)
        makefireDOT(char,source,6)

def fireDOTP(event,state,intensity):
    char=event.object
    source=event.string
    if Object_GetPrimaryState(char)==state:
        Object_SetPrimaryState(char,state,0,REMOVE_STATE)
        FFX_UpdateStates(char)
        makefireDOT(char,source,intensity)

def fireDOTS(event,state,intensity):
    char=event.object
    source=event.string
    if Object_GetSecondaryStates(char)&state:
        Object_SetSecondaryState(char,state,0,REMOVE_STATE)
        FFX_UpdateStates(char)
        makefireDOT(char,source,intensity)

def makefireDOT(char,source,intensity):
    pulse=FFX_Rand(1,4)+intensity*2
    FFX_ObjectSetAttr(char,'pulse',pulse)
    RegTimer('fireDOTUpdate',0.2,0,char,source)


   
def fireDOTUpdate(event):
    char=event.object
    pulse=FFX_ObjectGetAttr(char,'pulse',)-1
    FFX_ObjectSetAttr(char,'pulse',pulse)
    if Object_IsAlive(char)==0:
        pulse=0
        Mission_StatusText("Dude's dead already!")
    if Object_GetAttr(char,'material')==4:
        return
    if pulse<=0:
        return
        Mission_StatusText("Extinguished!")
    else:
        Trigger_Power(char,char,'fireDOT1','',1)
        Mission_StatusText('pulsecount is %s'%(pulse))
        if pulse>0:
            RegTimer('fireDOTUpdate',2,0,char)







Hoepfully you played enough with swaps in FFX that that makes sense. I have a newer version that allows for the damage type to be customized...but its more in depth...I pulled this from a 2011 backup.

The important bit is Trigger_Power(char,char,'fireDOT1','',1). Basically it triggers a direct power called fireDOT1 from powers .dat. I set it as a low damage, direct attack, no energy, no stun and animation is PAIN. The target attacks HIMSELF with this direct power every 2 seconds for the PULSE duration, based on intensity. thats it...that way you can get actual fire damage not untyped damage. There are numerous caveats to this of course...target cant be in a primary state, targets AI is interupted, etc. I see those as features. Otherwise its pretty close to acid burn, irradiate etc. Let me know if this is useful...my programming days are decades behind me, but maybe I can help.

RingsOfReznor

Hi seraglio, thanks for the cool share!

I really like the concept although I feel it's in a different direction to where I was going.

I'm familiar with state swaps, but I was seeking to trigger extra damage contingent on hitting an enemy with a flame attack while having the attribute, like a damage-over-time version of Claws or Charged.
VRANG VRANG VRANG VRANG