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
1 change: 1 addition & 0 deletions scripts/globals/bluemagic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TPMOD_CRITICAL = 1;
TPMOD_DAMAGE = 2;
TPMOD_ACC = 3;
TPMOD_ATTACK = 4;
TPMOD_DURATION = 5;
mrhappyasthma marked this conversation as resolved.
Show resolved Hide resolved

-- The SC the spell makes
SC_IMPACTION = 0;
Expand Down
65 changes: 65 additions & 0 deletions scripts/globals/spells/bluemagic/pinecone_bomb.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
-----------------------------------------
-- Spell: Pinecone Bomb
-- Additional effect: Sleep. Duration of effect varies with TP
-- Spell cost: 48 MP
-- Monster Type: Plantoids
-- Spell Type: Physical (Piercing)
-- Blue Magic Points: 2
-- Stat Bonus: STR+1
-- Level: 36
-- Casting Time: 2.5 seconds
-- Recast Time: 26.5 seconds
-- Skillchain Element(s): Fire (can open Scission or Fusion and can close Liquefaction)
-- Combos: None
-----------------------------------------
require("scripts/globals/bluemagic")
require("scripts/globals/status")
require("scripts/globals/magic")
-----------------------------------------

function onMagicCastingCheck(caster,target,spell)
return 0
end

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_DURATION
params.dmgtype = DMGTYPE_PIERCE
mrhappyasthma marked this conversation as resolved.
Show resolved Hide resolved
params.scattr = SC_LIQUEFACTION
params.numhits = 1
params.multiplier = 2.25
params.tp150 = 2.25
params.tp300 = 2.25
params.azuretp = 2.25
params.duppercap = 37
params.str_wsc = 0.20
params.dex_wsc = 0.0
params.vit_wsc = 0.0
params.agi_wsc = 0.20
params.int_wsc = 0.0
params.mnd_wsc = 0.0
params.chr_wsc = 0.0

local damage = BluePhysicalSpell(caster, target, spell, params)
damage = BlueFinalAdjustments(caster, target, spell, damage, params)

-- After damage is applied (which would have woken the target up from a
-- preexisting sleep, if necesesary), apply the sleep effect for this spell.
if (damage > 0) then
local sleepParams = {}
sleepParams.attribute = tpz.mod.INT
sleepParams.bonus = 0
sleepParams.effect = tpz.effect.SLEEP_II
sleepParams.skillType = tpz.skill.BLUE_MAGIC
local resist = applyResistanceEffect(caster, target, spell, sleepParams)
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.

target:addStatusEffect(sleepParams.effect, power, tick, duration)
mrhappyasthma marked this conversation as resolved.
Show resolved Hide resolved
end
end

return damage
end