Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Add Pinecone Bomb blue magic spell. #346

Merged
merged 12 commits into from
Apr 9, 2020
Merged

Add Pinecone Bomb blue magic spell. #346

merged 12 commits into from
Apr 9, 2020

Conversation

mrhappyasthma
Copy link
Contributor

Now that the order of operations has been cleaned up for spells,
Pinecone Bomb can be properly implemented. It does damage to the mob
(which may wake it up from a previous slept state), but then can reapply
sleep as described here: https://ffxiclopedia.fandom.com/wiki/Pinecone_Bomb

mrhappyasthma and others added 2 commits February 16, 2020 00:48
Now that the order of operations has been cleaned up for spells,
Pinecone Bomb can be properly implemented. It does damage to the mob
(which may wake it up from a previous slept state), but then can reapply
sleep as described here: https://ffxiclopedia.fandom.com/wiki/Pinecone_Bomb
@ibm2431
Copy link
Contributor

ibm2431 commented Feb 16, 2020

Hello, @mrhappyasthma! Thank you for contributing to Project Topaz!

So that we don't use our parent project's brand, we've changed some function and table names to reflect adopting a new brand. I remember seeing that this PR was started prior to Topaz and originally submitted to our parent project - I took the liberty of updating these references for you; you don't need to sweat over them!

Although, I realize after I submitted the push that I should have asked first to make sure I didn't step on your toes. I'm sorry if I did! My intent was to make your contribution experience as painless as possible! 😅

That said, I haven't had the chance to take a look at the code yet. We try to be relatively swift with reviews though, so I look forward to working with you soon!

@mrhappyasthma
Copy link
Contributor Author

No worries. I look forward to your review.

Copy link
Contributor

@ibm2431 ibm2431 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this out and it does seem to work!

There a few questions over fTP values, and how the sleep duration is supposed to work. Tagging @Wiggo32 in case he's played with the spell beyond the one capture I could find.

if (resist > 0.5) then -- Apply the sleep
local power = 2
local tick = 0
local duration = 90 * resist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the description for the spell, it claims that duration is supposed to vary depending on TP. At the moment, this is basing the duration off of attacker INT versus target resistance.

  1. Is it supposed to always be affected by TP?
  2. Is TP -> duration effect only applicable when under Chain Affinity?
  3. What's the base duration of this type of sleep? With or without Chain Affinity?
  4. What's the sleep duration at certain TP values? Minimum, maximum?

@Wiggo32 I looked at your capture of you learning Pinecone Bomb and testing it out, but there was no explicit duration testing (the sapling was auto-attacked awake, and the draugar was unaffected)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my first time adding a BLU spell, so I'm open to any improvements.

I just copied how sleep was applied in other spells, so it may not be 100% accurate. If you have a reference for how this should be applied, please point me in the right direciton!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we'll probably have to do is find some information - or get a capture - on the basic duration of the effect. Even if we can't fully pick apart how TP affects the duration for this (or other) Blue spells, we can at least apply the bare minimum duration for now and add a note in the script (and create a new Issue) that it's still missing duration bonuses from TP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

Should I wait on someone to do a "capture"? Or should I go forward with a TODO note and reference a github issue to update the TP modification of the sleep duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have some captures. I'll check them out and see what I can determine. Then hopefully someone more experienced can double check me.

scripts/globals/spells/bluemagic/pinecone_bomb.lua Outdated Show resolved Hide resolved
function onSpellCast(caster,target,spell)
local params = {}
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.tpmod = TPMOD_CRITICAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say that the TP mod for this spell doesn't seem to be critical hit chance, but then I looked at the blue magic global and it doesn't look like tpmod params are used at all.

I did some searches and found a definition for params.tpmod = TPMOD_DURATION for Battle Dance, which seems like what we should be using here (again, this param is never checked), but that specific global value doesn't seem to be defined anyway.

I'm not going to expect you to fix that fact that these mods don't seem to do anything, but could you change this to at least claim it's supposed to effect duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these BLU enums seems to be in bad shape. I'm happy to clean them up as needed, but need some guidance.

Would you prefer which/any of the following:

  • Remove the TPMOD param since it's unused
  • Add TPMOD_DURATION value since it's missing, and then reference it here
  • Add usage of params.tpmod in the global bluemagic.lua (if so, where)

I think the bottom two are probably the right approach, assuming this value is supposed to be used somewhere. But if we felt this value is obsolete or unnecessary, perhaps removing it until it's implemented would be less ambiguous?

Also we should probably file an issue for this problem to track these changes, which can be applied ahead of this PR as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #354 to track.

Let me know what your preferences are. I'm happy to do an audit or cleanup based on what is preferred. (Although if we want to use the parameters, I could use some pointers since I'm not that familiar with the code and have no retail FFXI)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the bottom two are the more time consuming, but overall the best choice. It will require a bit of rework for the Blue Magic global, which desperately needs it.

For the purpose of this PR though, go ahead and add TPMOD_DURATION to both the global and this script (matching the one for Battle Dance), and then after a separate PR hooking up the params to be used, we can work on having spells being able to make use of the mods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a plan. Will update this in a commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit added. Please take a look.

@ibm2431
Copy link
Contributor

ibm2431 commented Feb 18, 2020

Tagging #269

@mrhappyasthma
Copy link
Contributor Author

Question: Do you want me squashing these commits? Or do the mergers handle that for this repo?

@ibm2431
Copy link
Contributor

ibm2431 commented Feb 20, 2020

We can go ahead and squash for you~!

@mrhappyasthma
Copy link
Contributor Author

Awesome. Just wanted to verify! :)

@KnowOne134 KnowOne134 assigned KnowOne134 and unassigned KnowOne134 Feb 22, 2020
@KnowOne134 KnowOne134 added the hold Requests have been made to merge label Feb 22, 2020
@ibm2431 ibm2431 changed the base branch from master to blue-mage February 23, 2020 14:12
mrhappyasthma and others added 5 commits February 23, 2020 11:42
Now that the order of operations has been cleaned up for spells,
Pinecone Bomb can be properly implemented. It does damage to the mob
(which may wake it up from a previous slept state), but then can reapply
sleep as described here: https://ffxiclopedia.fandom.com/wiki/Pinecone_Bomb
@mrhappyasthma
Copy link
Contributor Author

Rebased and closed out some of the outstanding comments.

This PR is still waiting on a more accurate TP-based sleep duration.

@ibm2431 ibm2431 self-assigned this Feb 25, 2020
@ibm2431 ibm2431 added the research needed Mechanics need further research label Feb 25, 2020
@mrhappyasthma
Copy link
Contributor Author

Corrected the attackType to be RANGED.

Still need to do a bit of research for the TP-based sleep. Been crazy with work and will be having more travel over the coming weeks. Whenever I can find some downtime I can plot some of the values from the captures and find a reasonable equation.

@ibm2431 ibm2431 added focus Related to a current project focus reviewed Has been reviewed by at least one Staff Member labels Mar 14, 2020
@ibm2431
Copy link
Contributor

ibm2431 commented Mar 21, 2020

Compiled a spreadsheet from the two captures in which Chain Affinity was used:
Pinecone-Bomb.zip

@mrhappyasthma
Copy link
Contributor Author

BTW I still haven't forgotten about this. Just a crazy time we live in these days... Whenever I get some time I'll dig into those spreadsheets and compile any other data that is needed.

Copy link
Contributor

@ibm2431 ibm2431 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a commit based on added findings from Wiggo's most recent "base" capture:
https://docs.google.com/spreadsheets/d/1lJafURoeyiZ6NAz6A8NpdSk9VMjD0JLqjtxIa190RWs/

As strange as it seems, it's looking like it's close to a simple inverse bell curve between 15 and 60 seconds. This is based on the Qufim and Yuhtunga testing, where Wiggo is way over the cap of the mobs, so resists aren't coming into play. And when the spell fails, it fails outright - no damage at all. I'm relying on the damage check here.

It may seem weird, but an inverse bell fits the duration data well - and I'm fairly confident in the accuracy of this determination - so that's what I'm going with absent evidence to the contrary. I broke it out into it's own function in case we come across similar data later and end up needing to copy-paste the function into the blue global.

How TP affects duration can be determined at a later date; the blue magic global doesn't utilize TP modifications for any blue spells at the moment anyway.

Approved. Sorry for the wait, mrhappyasthma.

@ibm2431 ibm2431 added merge ready reviewed and deemed ready to merge and removed hold Requests have been made to merge reviewed Has been reviewed by at least one Staff Member labels Apr 9, 2020
@mrhappyasthma
Copy link
Contributor Author

Wow thanks for digging so deeply into this. I know my contributions have been sporadic and irregular. So I really appreciate you doing all this work on behalf of this PR.

@zircon-tpl zircon-tpl merged commit a96c492 into project-topaz:blue-mage Apr 9, 2020
@mrhappyasthma mrhappyasthma deleted the pinecone_bomb branch April 10, 2020 00:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus Related to a current project focus merge ready reviewed and deemed ready to merge research needed Mechanics need further research
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants