• Welcome to Freedom Reborn Archive.
 

Idea for script help

Started by Failed_Hero, April 01, 2008, 08:27:23 PM

Previous topic - Next topic

Failed_Hero

I was looking at the defense mechanism attribute, and I wondering how difficult it would be to add temp invulnerability or fast healing as a reaction to pain? 

TaskMasterX

In FFX 3.2 there were two new Functions added to Defence Mechanism: resistanceThroughPain which adds Invulnerable points to the character when damaged, and strengthandResistanceThroughPain which adds Strength and Invulnerable Points.

In FFX 3.2.1, I added adrenalineSurge which increases resistance to panic and stun, provides healing at a rate proportional to the amount of damage received, and increases Strength +1 each time the character is damaged to a max. +2. All effects are canceled if the character is mental blanked or no more enemies are in visual range.

Epimethee

Both would be fairly easy to do. Temporary Invulnerability would then probably require a couple lines of code, as we could call the existing code. Fast Healing would be a little bit trickier; for example, we could make it a removable attribute, but we'd need to make the amount the HP healed (max 100) persistent. The only real issue is that Fast Healing is intrinsically a Defence Mechanism in itself, so buying the attribute normally would do the same job, wouldn't it?

Some non-tested code (and I'm rusty!) for Temporary Invulnerability:
Open ffx.py in Notepad (back up first), between the code under the "def OnEvasiveTeleport(event):" and the start of the Coordinator section, add the following:

#get a chance to gain Temporary Invulnerability (cf. attribute) 
def tempInvulnerabilityChance(char,param,intensity):
    if not FFX_ObjectHasAttr(char, 'ffqtempinvuln-on'):
        FFX_ObjectSetAttr(char, 'ffqtempinvuln-on', 0)
        Object_SetAttr(char, 'ffqtempinvuln-irradiated', 0)
        Object_SetAttr(char, 'ffqtempinvuln-acidburnt', 0)
        Object_SetAttr(char, 'ffqtempinvuln-nullified', 0)
    if randint(1,15) > intensity: #15 probably needs to be tweaked.
OnFFqTempInvulnOn(char,char)


In ffxdefault.py, under the FFX_DEATHRESPONSES section, just before the last line (the lone "]") insert the line
["tempInvulnerabilityChance"],


The random chance based on the amount of damage compensates for the fact that Temporary Invulnerability is quite powerful for a Defence Mechanism. For those wanting 100% chance, Taskmaster's new resistanceThroughPain fits the bill perfectly.

Failed_Hero

For "rusty" skills you did a great job.  It works.  The only issue is Minute Man's shield activates as the shield FX and I would like to have a no effect. Any idea how to do that thanks man. Epimethee

Epimethee

Woohoohoo! The stars aligned right it seems. As for the FX, maybe you could open ffxcusto.py and, under FFQ_TEMPINVULNERABILITY_CUSTOM, add your Defence Mechanism character with an empty effect, e.g.:

FFQ_TEMPINVULNERABILITY_CUSTOM=[
["default","area","effect_ffq_tempinvuln","power... waning... need to rest..."],
["types","AAnimation","EFX","ASpeech"],
["mentor","hover_area","effect_ffq_tempinvuln_ment","moons of... must concentrate... c-can't..."],
["failed_hero_character","area","","only a f-flesh... wound..."],
]