subtledoctor Posted January 10, 2018 Posted January 10, 2018 Stats.ids has MAXHITPOINTS so I can add that to SPLPROT.2da, but is there any way for a spell to have different effects based on the current hp of the caster? Quote
Jarno Mikkola Posted January 10, 2018 Posted January 10, 2018 Summon a contingency ... and kill with kindness. Quote
subtledoctor Posted January 10, 2018 Author Posted January 10, 2018 Ugh... would definitely prefer not to deal with opcode 232 Quote
Ardanis Posted January 10, 2018 Posted January 10, 2018 I seem to recall Chimeric was looking for the same thing not that long ago, and came up dry as well? Unfortunately, no, I don't think it exists. Quote
subtledoctor Posted January 10, 2018 Author Posted January 10, 2018 God that's annoying. Hmm... maybe I can set a brief min1hp effect to prevent zombification. Quote
argent77 Posted January 10, 2018 Posted January 10, 2018 I haven't test this, but can't you use opcode 82 (Set AI script) to set a temporary script to the target's AREA script slot? The script can be used to execute code based on current HP. Using the AREA slot should minimize interference with existing scripts. There is most likely a slight delay between spell hitting target and target executing script though.Example: IF HPPercentLT(Myself,25) THEN RESPONSE #100 ChangeAIScript("",AREA) ApplySpellRES("MYSPELL1",Myself) END IF HPPercentLT(Myself,50) THEN RESPONSE #100 ChangeAIScript("",AREA) ApplySpellRES("MYSPELL2",Myself) END IF True() THEN RESPONSE #100 ChangeAIScript("",AREA) ApplySpellRES("MYSPELL3",Myself) END Quote
subtledoctor Posted January 10, 2018 Author Posted January 10, 2018 Using scripts in spells... Yeah. This particular issue involves my particular implementation of psionics: I use the psion's max hp to power his/her abilities. So you use Id Insinuation on somebody and your max hp drops by 4, before slowly being restored over the next 8 rounds. Idea being psionics is not magical, you are literally using your life energy as fuel to power your abilities. Problem is, if you are injured, say with 5/10 hp, and you use a psionics power that costs 6 max hp, then you drop to -1/4 hp. At this point your portrait goes gray, you can still run around but you die the next time you take damage, and all processes stop running on you - the max hp regeneration doesn't happen, you never get back to normal. (I think even ctrl-R doesn't fix it.) I've gotten around it by having dual effects: first, you take 6 stunning (nonlethal) damage, then 1 second later your max hp drop by 6 with param2 set to 3 so it doesn't effect your current hp. Then both current hp and max hp regenerate in tandem (simultaneous opcode 18, and opcode 17 with param2 = 3). Finally, I put a 324 effect at the beginning to prevent the max hp loss of your max hp are below the cost of the ability. So if you use too many powers and burn through all your life energy too quickly, the last one you use just does the stunning damage, which will knock you unconscious. Which I think is an appropriate penalty. I've got the dual effects working well for regular powers now, but the next step is to apply them to maintainable powers. That will be more complicated since they separate the initial hp loss from the regeneration; the latter goes into an innate ability called 'Cancel [Power].' Idea being, if your 10/10 hp psion uses a 6 hp power, like inertial Barrier, then you end up with 4/4 hp until you use the 'cancel' ability. Issue is, on this case what to do if a 4/10 hp psion tries to initiate Inertial Barrier? You'll fall unconscious but does the power work? If so, you could wake up and have the barrier without any max hp loss, only a current hp loss (which could be cured with a potion). I could make the ability fizzle completely... that would be a real penalty for using to many powers! And in this case I'd probably want to treat the one-shot powers the same way. (Should be possible... though non-self-targeted powers might be tricky.) Alternatively I'll scrap maintainable powers and just make every power have a set duration, like 1 turn or something. Powers targeting enemies already work like that - trying to create a maintainable Hold or Domination that triggers a max hp regeneration when the enemy dies or throws off the effect was just too difficult. Eh, anyway, one way or another I think I have a solution in sight. Quote
Ardanis Posted January 10, 2018 Posted January 10, 2018 (edited) ...I think I was right then to build the neothelid encounter around its burrowing ability (not like I had much choice anyway) instead of detailed psionics implementation Edited January 10, 2018 by Ardanis Quote
Avenger Posted January 11, 2018 Posted January 11, 2018 Maybe you can use current hp targeting with projectiles. Otherwise, yeah, accessing the current hp from splprot would be a nice feature. Unhardcoding power words would be easy then Quote
Grammarsalad Posted January 11, 2018 Posted January 11, 2018 Maybe you can use current hp targeting with projectiles. Otherwise, yeah, accessing the current hp from splprot would be a nice feature. Unhardcoding power words would be easy then That would totally rock the casbah Quote
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.