1569 lines
42 KiB
C#
1569 lines
42 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Godot;
|
|
using Godot.Collections;
|
|
|
|
public partial class Acts
|
|
{
|
|
public enum IDs
|
|
{
|
|
None = -1,
|
|
Check,
|
|
NonLethalShot,
|
|
Apprehend,
|
|
ExecutionerBlow,
|
|
TalkTestEnemy,
|
|
HugTestEnemy,
|
|
NOT_SET,
|
|
AvoidTestEnemy,
|
|
HealBell,
|
|
ShieldBarrier,
|
|
SharpShoot,
|
|
KAction,
|
|
Spare,
|
|
SharpenPenceller,
|
|
RubEraser,
|
|
AAction,
|
|
ACT,
|
|
JAction,
|
|
InsultEraser,
|
|
ScribbleEraser,
|
|
PencilBefriend,
|
|
PencilBerate,
|
|
EraserTalk,
|
|
EraserBerate,
|
|
UseItem,
|
|
PennyDeath,
|
|
PennyBerate,
|
|
PennyConvince,
|
|
EncourageKanako,
|
|
MopperCheer,
|
|
MopperDirt,
|
|
MopperClean,
|
|
FoxForgive,
|
|
FoxPlead,
|
|
FoxBerate,
|
|
Foxfire,
|
|
HeatWave,
|
|
HealShower,
|
|
AxisAtkUP,
|
|
UnnerveGas,
|
|
BearingTalkDown,
|
|
BearingBrace,
|
|
BearingPlead,
|
|
AxisSiren,
|
|
BellCover,
|
|
BellShush,
|
|
BellIgnore,
|
|
AxisParadox,
|
|
AxisRequest,
|
|
StaplerRefill,
|
|
StaplerPress,
|
|
StaplerPet,
|
|
GearSpin,
|
|
GearOil,
|
|
SpinSelf,
|
|
Homerun,
|
|
Wrench,
|
|
Drill,
|
|
MelodyDance,
|
|
HealingSonata,
|
|
StranglingThreads,
|
|
RulerStraight,
|
|
RulerBad,
|
|
Flee
|
|
}
|
|
|
|
public static Acts instance;
|
|
|
|
public static List<Battlers> actors;
|
|
|
|
public static Coroutine DoActRoutine(StringName name, Battlers target, Battlers[] actors = null)
|
|
{
|
|
if (instance == null)
|
|
{
|
|
instance = new Acts();
|
|
}
|
|
if (actors == null)
|
|
{
|
|
actors = new Battlers[1] { BattleDR.current.allBattlers[BattleDR.current.currentActor] };
|
|
}
|
|
Acts.actors = new List<Battlers>(actors);
|
|
BattleDR.inputCD = 5f;
|
|
return Coroutine.Start((IEnumerator)instance.GetType().GetMethod(name).Invoke(instance, new object[1] { target }));
|
|
}
|
|
|
|
public IEnumerator Check(Battlers target)
|
|
{
|
|
Audio.PlaySound("snd_mercyadd.wav");
|
|
actors[0].entity.anim.Play("ActDo");
|
|
BattleDR.current.ResetEnemyHighlight();
|
|
DWMenu.instance.soul.Visible = false;
|
|
DWMenu.instance.battleText2.Visible = false;
|
|
DWMenu.instance.battleDesc.GetParent<Control>().Visible = false;
|
|
Coroutine.Start(BattleDR.ActEffect(actors[0]));
|
|
string[] array = (string[])Texts.checks[target.id].Clone();
|
|
array[0] = ("* " + target.name.ToUpper() + ": @1 AT @2 DF\n" + array[0]).Replace("@1", target.ATK.ToString()).Replace("@2", target.DEF.ToString());
|
|
BattleDR.DoDiag(array);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.anim.Play("BattleIdle");
|
|
DWMenu.instance.soul.Visible = true;
|
|
}
|
|
|
|
public IEnumerator Spare(Battlers target)
|
|
{
|
|
GD.Print(target.posID);
|
|
if (target.CanSpare())
|
|
{
|
|
Audio.PlaySound("snd_spare_ch1.wav");
|
|
BattleDR.DoDiag(new string[1] { Texts.battleNarration[0].Replace("[NAME]", actors[0].name).Replace("[TARGET]", target.name) });
|
|
BattleDR.ShowFloatingText(Texts.common[102], target.entity.GlobalPosition + Vector2.Left * 16f, Main.colorYellow);
|
|
Coroutine c = null;
|
|
if (BattleDR.lastResult != BattleDR.EndState.Special && !target.dontFlee)
|
|
{
|
|
c = Coroutine.Start(target.entity.Slide(Vector2.Right, 60f, 2f, useSprite: true));
|
|
}
|
|
Coroutine.Start(BattleDR.ActEffect(target, 0f));
|
|
((Node2D)Main.Particle("AttackShine", target.entity.GlobalPosition + target.center, 4086, BattleDR.current, localSpace: false)).Scale = new Vector2(-1f, 1f);
|
|
BattleDR.RemoveEnemy(target, BattleDR.EndState.Spared);
|
|
if (BattleDR.lastResult != BattleDR.EndState.Special && !target.dontFlee)
|
|
{
|
|
while (true)
|
|
{
|
|
Coroutine coroutine = c;
|
|
if (coroutine == null || coroutine.done)
|
|
{
|
|
break;
|
|
}
|
|
target.entity.Modulate = target.entity.Modulate.Lerp(Main.colorClear, 0.1f);
|
|
yield return null;
|
|
}
|
|
target.Delete();
|
|
}
|
|
else
|
|
{
|
|
BattleDR.current.resultAmts[2][1]++;
|
|
SaveFile.current.values[1]++;
|
|
target.entity.anim.Pause();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { Texts.battleNarration[1].Replace("[NAME]", actors[0].name).Replace("[TARGET]", target.name) });
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator Foxfire(Battlers target)
|
|
{
|
|
Audio.PlaySound("snd_spellcast_ch1.wav");
|
|
BattleDR.DoDiag(new string[1] { Texts.battleNarration[2].Replace("[NAME]", actors[0].name) });
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
Node2D node2D = GD.Load<PackedScene>("res://Objects/Particles/Foxfire.tscn").Instantiate<Node2D>(PackedScene.GenEditState.Disabled);
|
|
BattleDR.current.AddChild(node2D, forceReadableName: false, Node.InternalMode.Disabled);
|
|
node2D.ZIndex = 3000;
|
|
node2D.GlobalPosition = target.entity.GlobalPosition + target.center;
|
|
int num = Mathf.RoundToInt((float)actors[0].MAGIC * 10f) + 35;
|
|
if (target.entity.HasMeta("WeakFire"))
|
|
{
|
|
num = Mathf.RoundToInt((float)num * 1.5f);
|
|
}
|
|
BattleDR.current.DoDamage(actors[0], target, 1f, miss: false, noTP: true, dontKill: false, showNumber: true, num);
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator NonLethalShot(Battlers target)
|
|
{
|
|
actors[0].entity.anim.Stop();
|
|
for (float a = 0f; a < 10f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.currentAnim = Entity.Animations.AttackReady;
|
|
BattleDR.DoDiag(new string[1] { GetNarration(3, target) });
|
|
for (float a = 0f; a < 5f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
Main.Particle("AttackShine", actors[0].atkPartOffset, 4086, actors[0].entity);
|
|
Main.Particle(Party.party[actors[0].internalID].hitPart, target.center, 4086, target.entity);
|
|
for (float a = 0f; a < 5f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
BattleDR.current.DoDamage(actors[0], target, 0.85f, miss: false, noTP: true, dontKill: true);
|
|
if (target.HP == 1)
|
|
{
|
|
BattleDR.ShowFloatingText(Texts.common[103], target.center + target.entity.GlobalPosition);
|
|
}
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.currentAnim = Entity.Animations.BattleIdle;
|
|
}
|
|
|
|
public IEnumerator FirstBattleEvent()
|
|
{
|
|
while (!BattleDR.current.started)
|
|
{
|
|
yield return null;
|
|
}
|
|
TextSystem.GetText("KanakoFirstBattle");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator WardenTutorial(int state = 0)
|
|
{
|
|
while (!BattleDR.current.started)
|
|
{
|
|
yield return null;
|
|
}
|
|
TextSystem.GetText("WardenTutorial" + (1 + state));
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator EraserBerate(Battlers target)
|
|
{
|
|
AddSpare(target, 35);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(4, target) });
|
|
target.blurbOverride = 4;
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator EraserTalk(Battlers target)
|
|
{
|
|
AddSpare(target, 35);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(5, target) });
|
|
target.blurbOverride = 5;
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
private string GetNarration(int id, Battlers target)
|
|
{
|
|
return Texts.battleNarration[id].Replace("\\n", "\n").Replace("\\t", "\t").Replace("[NAME]", actors[0]?.name)
|
|
.Replace("[TARGET]", target?.name);
|
|
}
|
|
|
|
public IEnumerator RubEraser(Battlers target)
|
|
{
|
|
if (!target.internalFlags.Contains("Rub"))
|
|
{
|
|
target.internalFlags.Add("Rub");
|
|
AddSpare(target, 50);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(6, target) });
|
|
target.blurbOverride = 5;
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(7, target) });
|
|
AddSpare(target, 15);
|
|
target.blurbOverride = 6;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator SharpenPenceller(Battlers target)
|
|
{
|
|
if (target.internalFlags.Contains("Berated"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(8, target) });
|
|
target.blurbOverride = 8;
|
|
}
|
|
else if (target.internalFlags.Contains("Befriend"))
|
|
{
|
|
target.entity.anim.Play("Happy");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(9, target) });
|
|
AddSpare(target, 100);
|
|
target.ATK += 5;
|
|
target.blurbOverride = 3;
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(10, target) });
|
|
target.blurbOverride = 4;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator PencilBefriend(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(11, target) });
|
|
AddSpare(target, 35);
|
|
target.blurbOverride = 5;
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (!target.internalFlags.Contains("Befriend"))
|
|
{
|
|
target.internalFlags.Add("Befriend");
|
|
}
|
|
}
|
|
|
|
public IEnumerator PencilBerate(Battlers target)
|
|
{
|
|
if (target.internalFlags.Contains("Befriend"))
|
|
{
|
|
target.entity.currentAnim = Entity.Animations.Hurt;
|
|
}
|
|
BattleDR.DoDiag(new string[1] { GetNarration(12, target) });
|
|
if (!target.internalFlags.Contains("Berated"))
|
|
{
|
|
target.internalFlags.Add("Berated");
|
|
}
|
|
if (!target.internalFlags.Contains("Befriend"))
|
|
{
|
|
target.blurbOverride = 6;
|
|
AddSpare(target, 25);
|
|
}
|
|
else
|
|
{
|
|
target.spare = 0;
|
|
target.blurbOverride = 7;
|
|
target.MONEY *= 3;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
target.entity.currentAnim = Entity.Animations.Idle;
|
|
}
|
|
|
|
public IEnumerator UseItem(Battlers target)
|
|
{
|
|
Items.IDs id = (Items.IDs)actors[0].selectedAction[2];
|
|
BattleDR.DoDiag(new string[1] { GetNarration(13, target).Replace("[ITEM]", Texts.items[id].name) });
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (Texts.items[id].heal == -2)
|
|
{
|
|
Coroutine.Start(BattleDR.Heal(target, (target.HP <= 0) ? 9999 : (target.MAXHP / 2)));
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
else if (Texts.items[id].heal > 0)
|
|
{
|
|
Coroutine.Start(BattleDR.Heal(target, Texts.items[id].heal));
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
if (Texts.items[id].tp > 0)
|
|
{
|
|
BattleDR.current.TP = Mathf.Clamp(BattleDR.current.TP + Texts.items[id].tp, 0, 100);
|
|
Audio.PlaySound("snd_cardrive.wav", 1f, 1.05f);
|
|
BattleDR.ShowFloatingText("TP UP!", actors[0].entity.GlobalPosition);
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator HugTestEnemy(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { "* You hug Kanako." });
|
|
actors.Add(BattleDR.current.party[1]);
|
|
bool stoppedAnim = !actors[1].entity.anim.IsPlaying();
|
|
Vector2 pos = actors[0].entity.GlobalPosition;
|
|
Vector2 k = actors[1].entity.GlobalPosition + new Vector2(8f, 0f);
|
|
Vector2 h = k + new Vector2(16f, 0f);
|
|
actors[0].entity.doTrail = true;
|
|
actors[0].entity.direction = Entity.Direction.East;
|
|
actors[0].entity.currentAnim = Entity.Animations.Idle;
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = pos.Lerp(h, a / 20f);
|
|
yield return null;
|
|
}
|
|
actors[0].entity.GlobalPosition = k;
|
|
actors[0].entity.doTrail = false;
|
|
actors[0].entity.anim.Play("Hug");
|
|
actors[0].entity.sprite.FlipH = true;
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = h.Lerp(k, a / 20f);
|
|
yield return null;
|
|
}
|
|
actors[1].entity.anim.Play("BlushBattle");
|
|
for (float a = 0f; a < 60f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (BattleDR.current.tempFlags.Contains("KanakoHug"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { "* . . . . ." }, new string[1] { "KanakoBlushFlustered" });
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { "* C-Cole?! \n* What are you doing...?!" }, new string[1] { "KanakoBlushFlustered" });
|
|
BattleDR.current.tempFlags.Add("KanakoHug");
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.anim.PlayBackwards();
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = k.Lerp(h, a / 20f);
|
|
yield return null;
|
|
}
|
|
actors[0].entity.currentAnim = Entity.Animations.Idle;
|
|
actors[0].entity.UpdateAnim(force: true);
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.doTrail = true;
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = h.Lerp(pos, a / 20f);
|
|
yield return null;
|
|
}
|
|
actors[0].entity.GlobalPosition = pos;
|
|
actors[0].entity.doTrail = false;
|
|
actors[0].entity.UpdateAnim(force: true);
|
|
actors[1].entity.UpdateAnim(force: true);
|
|
if (stoppedAnim)
|
|
{
|
|
actors[1].entity.anim.Stop();
|
|
}
|
|
}
|
|
|
|
private static void AddSpare(Battlers target, int percent, bool sound = true)
|
|
{
|
|
if (sound)
|
|
{
|
|
Audio.PlaySound("snd_mercyadd.wav");
|
|
}
|
|
target.spare = Mathf.Clamp(target.spare + percent, 0, 100);
|
|
BattleDR.ShowFloatingText(percent + "%", target.entity.GlobalPosition, Main.colorYellow);
|
|
}
|
|
|
|
public IEnumerator TalkTestEnemy(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { "* " + actors[0].name + " attempts to talk to the cactus.\n* Unsurprisingly, it doesn't reply." });
|
|
AddSpare(target, 50);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator AvoidTestEnemy(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { "* " + actors[0].name + " avoids touching the cactus.\n* Somehow, you feel it is relieved by this." });
|
|
AddSpare(target, 100);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator Dream(Battlers target)
|
|
{
|
|
yield break;
|
|
}
|
|
|
|
public IEnumerator EncourageKanako(Battlers target)
|
|
{
|
|
if (!BattleDR.current.tempFlags.Contains("WeirdStart") && !SaveFile.current.flags.Contains(SaveFile.Flags.WeirdStart))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(14, target) });
|
|
Audio.PlaySound("snd_boost.wav");
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(15, target) });
|
|
}
|
|
Party.party[1].atkMod = new int[2]
|
|
{
|
|
1,
|
|
Mathf.CeilToInt((float)Party.party[1].ATK * 1.2f)
|
|
};
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator Apprehend(Battlers target)
|
|
{
|
|
Vector2 p = target.entity.Position;
|
|
Vector2 cup = Vector2.Up * 128f;
|
|
Vector2 tp = p + Vector2.Left * 64f;
|
|
BattleDR.DoDiag(new string[1] { GetNarration(16, target) });
|
|
float hp = target.HPPercent();
|
|
BattleDR current = BattleDR.current;
|
|
Sprite2D obj = new Sprite2D
|
|
{
|
|
Texture = GD.Load<Texture2D>("res://Sprites/Bullets/Cage.tres"),
|
|
SelfModulate = Main.colorClear,
|
|
Position = p + cup,
|
|
ZIndex = 3500,
|
|
Scale = target.cageSize
|
|
};
|
|
Sprite2D node = obj;
|
|
Sprite2D cage = obj;
|
|
current.AddChild(node, forceReadableName: false, Node.InternalMode.Disabled);
|
|
yield return null;
|
|
float t = 0f;
|
|
while (true)
|
|
{
|
|
target.entity.Position = target.entity.Position.Lerp(tp + Vector2.Right * Common.SinOverTime(0.5f * Mathf.Clamp(hp, 0.1f, 1f)) * 128f, Main.deltaTime * 0.1f);
|
|
if (cage.SelfModulate.A >= 1f)
|
|
{
|
|
if (Input.IsActionJustPressed(Main.keys[4]))
|
|
{
|
|
break;
|
|
}
|
|
cage.Position = cage.Position.Lerp(tp + cup + Vector2.Right * Common.SinOverTime(-0.25f) * 36f, Main.deltaTime * 0.2f);
|
|
if (cage.Position.Y < -120f)
|
|
{
|
|
cage.Position = new Vector2(cage.Position.X, -120f);
|
|
}
|
|
}
|
|
else if (cage.SelfModulate.A < 1f)
|
|
{
|
|
cage.SelfModulate = Main.colorClear.Lerp(Main.colorWhite, t);
|
|
t += Main.deltaTime * 0.15f;
|
|
}
|
|
yield return null;
|
|
}
|
|
Audio.PlaySound("snd_spearrise_ch1.wav");
|
|
cup = cage.Position;
|
|
t = 80f;
|
|
bool skipText = false;
|
|
for (float a = 0f; a < t; a += Main.deltaTime)
|
|
{
|
|
target.entity.Position = target.entity.Position.Lerp(tp + Vector2.Right * Common.SinOverTime(0.5f * Mathf.Clamp(hp, 0.1f, 1f)) * 128f, Main.deltaTime * 0.1f);
|
|
cage.Position = cup.Lerp(cup + Vector2.Down * 300f, a / t);
|
|
if (cage.GlobalPosition.DistanceTo(target.entity.GlobalPosition + target.center) < Mathf.Lerp(32f, 2f, hp))
|
|
{
|
|
CameraController.Shake(20f);
|
|
target.entity.Shake(30f);
|
|
cage.Reparent(target.entity);
|
|
cage.Position = target.center;
|
|
Audio.PlaySound("snd_impact_ch1.wav");
|
|
if ((target.resistArrest > 0f && target.HPPercent() > target.resistArrest) || target.resistArrest > 1f)
|
|
{
|
|
float x;
|
|
for (x = 0f; x < 30f; x += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
target.entity.Shake(30f, 3f);
|
|
for (x = 0f; x < 30f; x += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
Audio.PlaySound("snd_explosion.wav");
|
|
CameraController.Shake(30f, 3f);
|
|
cage.Reparent(BattleDR.current);
|
|
cup = cage.GlobalPosition;
|
|
Vector2 end = cup + new Vector2(200f, 300f);
|
|
Vector2 mid = new Vector2(Mathf.Lerp(cup.X, end.X, 0.5f), cup.Y - 200f);
|
|
x = 0f;
|
|
for (float b = 150f; x < b; x += Main.deltaTime)
|
|
{
|
|
cage.GlobalPosition = Common.Beizier(cup, mid, end, x / b);
|
|
cage.RotationDegrees += Main.deltaTime * 2f;
|
|
yield return null;
|
|
}
|
|
if (target.resistArrest > 1f)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(17, target) });
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(18, target) });
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
skipText = true;
|
|
break;
|
|
}
|
|
Audio.PlaySound("snd_mercyadd.wav");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(19, target) });
|
|
BattleDR.ShowFloatingText(Texts.common[104], target.entity.GlobalPosition);
|
|
for (float b = 0f; b < 30f; b += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (BattleDR.lastResult == BattleDR.EndState.Special)
|
|
{
|
|
BattleDR.current.forceEnd = true;
|
|
cup = target.entity.Position;
|
|
for (float b = 0f; b < 20f; b += Main.deltaTime)
|
|
{
|
|
target.entity.Position = cup.Lerp(p, b / 20f);
|
|
yield return null;
|
|
}
|
|
BattleDR.current.resultAmts[4][1]++;
|
|
BattleDR.current.busy = Coroutine.Start(BattleDR.current.EndBattle());
|
|
}
|
|
else
|
|
{
|
|
for (float b = 0f; b < 20f; b += Main.deltaTime)
|
|
{
|
|
target.entity.Modulate = Main.colorWhite.Lerp(Main.colorClear, b / 20f);
|
|
yield return null;
|
|
}
|
|
target.entity.Visible = false;
|
|
BattleDR.RemoveEnemy(target, BattleDR.EndState.Apprehended);
|
|
}
|
|
yield break;
|
|
}
|
|
yield return null;
|
|
}
|
|
if (!skipText)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(20, target) });
|
|
Audio.PlaySound("snd_error.wav");
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
cup = target.entity.Position;
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
target.entity.Position = cup.Lerp(p, a / 20f);
|
|
yield return null;
|
|
}
|
|
cage.QueueFree();
|
|
target.entity.Position = p;
|
|
}
|
|
|
|
public IEnumerator ExecutionerBlow(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(21, target) });
|
|
actors[0].entity.anim.Play("Execution_Jump");
|
|
Vector2 start = actors[0].entity.GlobalPosition;
|
|
Vector2 targetP = target.entity.GlobalPosition + target.center + new Vector2(-40f, -15f);
|
|
Vector2 m = start.Lerp(targetP, 0.6f) + new Vector2(0f, -60f);
|
|
actors[0].entity.doTrail = true;
|
|
Audio.PlaySound("snd_jump_ch1.wav");
|
|
float a = 0f;
|
|
float b;
|
|
for (b = 30f; a < b; a += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = Common.Beizier(start, m, targetP, Mathf.SmoothStep(0f, 1f, a / b));
|
|
yield return null;
|
|
}
|
|
actors[0].entity.anim.Play("Execution");
|
|
actors[0].entity.Shake(30f, 1f);
|
|
b = 0f;
|
|
for (a = 20f; b < a; b += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.doTrail = false;
|
|
actors[0].entity.anim.Play("Execution_2");
|
|
a = 0f;
|
|
for (b = 5f; a < b; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.anim.Play("Execution_3");
|
|
m = target.entity.GlobalPosition + new Vector2(-25f, 0f);
|
|
Audio.PlaySound("snd_rudebuster_swing.wav");
|
|
b = 0f;
|
|
for (a = 5f; b < a; b += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = targetP.Lerp(m, b / a);
|
|
yield return null;
|
|
}
|
|
Main.Particle(Party.party[actors[0].internalID].hitPart, target.center, 4086, target.entity);
|
|
BattleDR.current.DoDamage(actors[0], target, 1.5f, miss: false, noTP: true);
|
|
Audio.PlaySound("snd_heavydamage.wav");
|
|
CameraController.Shake(20f, 4f);
|
|
for (a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.doTrail = true;
|
|
a = 0f;
|
|
for (b = 20f; a < b; a += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = m.Lerp(start, Mathf.SmoothStep(0f, 1f, a / b));
|
|
yield return null;
|
|
}
|
|
actors[0].entity.GlobalPosition = start;
|
|
actors[0].entity.doTrail = false;
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator HealBell(Battlers target)
|
|
{
|
|
Audio.PlaySound("snd_spellcast_ch1.wav");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(22, target) });
|
|
Node2D node2D = GD.Load<PackedScene>("res://Objects/Particles/HealBell.tscn").Instantiate<Node2D>(PackedScene.GenEditState.Disabled);
|
|
BattleDR.current.AddChild(node2D, forceReadableName: false, Node.InternalMode.Disabled);
|
|
node2D.ZIndex = 3000;
|
|
node2D.GlobalPosition = target.entity.GlobalPosition + new Vector2(0f, -64f);
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
for (float a = 0f; a < 90f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
Coroutine.Start(BattleDR.Heal(target, Mathf.FloorToInt((float)(actors[0].MAGIC * 10) * (1f + Main.RandomRange(-0.1f, 0.1f)))));
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator ShieldBarrier(Battlers target)
|
|
{
|
|
Audio.PlaySound("snd_spellcast_ch1.wav");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(23, target) });
|
|
BattleDR.current.soul.Visible = true;
|
|
BattleDR.current.soul.GlobalPosition = BattleDR.current.party[0].entity.GlobalPosition + BattleDR.current.party[0].center;
|
|
if (BattleDR.current.shield == null)
|
|
{
|
|
BattleDR.current.soul.AddChild(BattleDR.current.shield = GD.Load<PackedScene>("res://Objects/Particles/ShieldFx.tscn").Instantiate<Node2D>(PackedScene.GenEditState.Disabled), forceReadableName: false, Node.InternalMode.Disabled);
|
|
}
|
|
Audio.PlaySound("snd_boost.wav", 0.9f, 1.1f);
|
|
BattleDR.current.shield.Position = Vector2.Up;
|
|
for (float a = 0f; a < 100f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
BattleDR.current.soul.Visible = false;
|
|
BattleDR.current.shield.Scale = Vector2.One * 0.4f;
|
|
}
|
|
|
|
public IEnumerator PennyDeath(Battlers target)
|
|
{
|
|
int[] selectedAction = Party.party[0].selectedAction;
|
|
if (selectedAction != null && selectedAction[0] == 2 && Party.party[0].selectedAction[2] == 28 && actors[0].id == Entity.IDs.Kanako && target.hpLastTurn == 1)
|
|
{
|
|
for (float a = 0f; a < 60f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
target.HP = 1;
|
|
if (!BattleDR.current.tempFlags.Contains("WeirdStart"))
|
|
{
|
|
BattleDR.current.tempFlags.Add("WeirdStart");
|
|
target.entity.replaceAnim.Add(new Array<Variant> { "Idle", "Weak1" });
|
|
target.lockAnim = true;
|
|
target.entity.currentAnim = Entity.Animations.Idle;
|
|
Audio.music.VolumeDb = Mathf.LinearToDb(0.66f);
|
|
BattleDR.current.bgColor = Main.colorWhite.Lerp(Main.colorBlack, 0.5f);
|
|
TextSystem.GetText("PenniltonWeird1");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
BattleDR.current.forceMes = 6;
|
|
yield break;
|
|
}
|
|
if (!BattleDR.current.tempFlags.Contains("Weird2"))
|
|
{
|
|
BattleDR.current.tempFlags.Add("Weird2");
|
|
target.entity.replaceAnim.Clear();
|
|
target.entity.replaceAnim.Add(new Array<Variant> { "Idle", "Weak2" });
|
|
target.entity.currentAnim = Entity.Animations.Idle;
|
|
Audio.music.VolumeDb = Mathf.LinearToDb(0.33f);
|
|
BattleDR.current.bgColor = Main.colorWhite.Lerp(Main.colorBlack, 0.75f);
|
|
TextSystem.GetText("PenniltonWeird2");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
BattleDR.current.forceMes = 6;
|
|
yield break;
|
|
}
|
|
if (!BattleDR.current.tempFlags.Contains("Weird3"))
|
|
{
|
|
BattleDR.current.tempFlags.Add("Weird3");
|
|
target.entity.replaceAnim.Clear();
|
|
target.entity.replaceAnim.Add(new Array<Variant> { "Idle", "Weak3" });
|
|
target.entity.replaceAnim.Add(new Array<Variant> { "Idle", "Weak3" });
|
|
target.entity.currentAnim = Entity.Animations.Idle;
|
|
Audio.music.VolumeDb = Mathf.LinearToDb(0f);
|
|
BattleDR.current.bgColor = Main.colorBlack;
|
|
TextSystem.GetText("PenniltonWeird3");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
target.callEventOnDefeat = IDs.None;
|
|
BattleDR.current.forceMes = 7;
|
|
SaveFile.AddFlag(SaveFile.Flags.WeirdStart);
|
|
yield break;
|
|
}
|
|
}
|
|
if (!target.fleeing)
|
|
{
|
|
BattleDR.current.fleeing.Add(Coroutine.Start(BattleDR.Flee(target)));
|
|
}
|
|
}
|
|
|
|
public IEnumerator PennyBerate(Battlers target)
|
|
{
|
|
if (BattleDR.current.tempFlags.Contains("WeirdStart"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(24, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
yield break;
|
|
}
|
|
BattleDR.DoDiag(new string[1] { GetNarration(25, target) });
|
|
AddSpare(target, 17);
|
|
target.atkMod = new int[2] { 2, 10 };
|
|
target.defMod = new int[2] { 2, -10 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator PennyConvince(Battlers target)
|
|
{
|
|
if (BattleDR.current.tempFlags.Contains("WeirdStart"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(26, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
yield break;
|
|
}
|
|
BattleDR.DoDiag(new string[1] { GetNarration(27, target) });
|
|
AddSpare(target, Main.RandomRange(7, 15));
|
|
target.atkMod = new int[2] { 3, -5 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator MopperCheer(Battlers target)
|
|
{
|
|
string[] text = new string[2]
|
|
{
|
|
GetNarration(28, target),
|
|
""
|
|
};
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (target.internalFlags.Contains("Mess"))
|
|
{
|
|
target.blurbOverride = 5;
|
|
text[1] = GetNarration(29, target);
|
|
}
|
|
else if (!target.internalFlags.Contains("Clean"))
|
|
{
|
|
text[1] = GetNarration(30, target);
|
|
}
|
|
else
|
|
{
|
|
target.blurbOverride = 6;
|
|
AddSpare(target, 50);
|
|
text[1] = GetNarration(31, target);
|
|
}
|
|
BattleDR.DoDiag(text);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator MopperDirt(Battlers target)
|
|
{
|
|
if (!target.internalFlags.Contains("Mess"))
|
|
{
|
|
target.internalFlags.Add("Mess");
|
|
target.MONEY *= 3;
|
|
}
|
|
target.spare = 0;
|
|
target.blurbOverride = 4;
|
|
target.entity.anim.Play("Hurt");
|
|
BattleDR.DoDiag(new string[2]
|
|
{
|
|
GetNarration(32, target),
|
|
GetNarration(33, target)
|
|
});
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator MopperClean(Battlers target)
|
|
{
|
|
if (target.internalFlags.Contains("Mess"))
|
|
{
|
|
target.blurbOverride = 5;
|
|
BattleDR.DoDiag(new string[1] { GetNarration(34, target) });
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(35, target) });
|
|
target.blurbOverride = 6;
|
|
if (!target.internalFlags.Contains("Clean"))
|
|
{
|
|
target.internalFlags.Add("Clean");
|
|
AddSpare(target, 50);
|
|
}
|
|
else
|
|
{
|
|
AddSpare(target, 15);
|
|
}
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator FoxPlead(Battlers target)
|
|
{
|
|
if (target.spare < 50)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(36, target) });
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(37, target) });
|
|
}
|
|
AddSpare(target, 7);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator BearingBrace(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(38, target) });
|
|
for (int i = 0; i < BattleDR.current.party.Count; i++)
|
|
{
|
|
if (BattleDR.current.party[i].HP > 0)
|
|
{
|
|
BattleDR.current.party[i].entity.anim.Play("Defend");
|
|
BattleDR.current.party[i].defMod = new int[2]
|
|
{
|
|
3,
|
|
Mathf.Max(10, Mathf.CeilToInt((float)BattleDR.current.party[i].DEF * 0.33f))
|
|
};
|
|
}
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator BearingTalkDown(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[2]
|
|
{
|
|
GetNarration(39, target),
|
|
GetNarration(40, target)
|
|
});
|
|
AddSpare(target, 3);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator BearingPlead(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[2]
|
|
{
|
|
GetNarration(41, target),
|
|
GetNarration(40, target)
|
|
});
|
|
AddSpare(target, 7);
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator FoxForgive(Battlers target)
|
|
{
|
|
if (actors[0].id != Entity.IDs.Kanako)
|
|
{
|
|
if (target.spare < 50)
|
|
{
|
|
BattleDR.DoDiag(new string[2]
|
|
{
|
|
GetNarration(42, target),
|
|
GetNarration(43, target)
|
|
});
|
|
target.blurbOverride = 14;
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[2]
|
|
{
|
|
GetNarration(42, target),
|
|
GetNarration(44, target)
|
|
});
|
|
target.blurbOverride = 8;
|
|
AddSpare(target, 3);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[2]
|
|
{
|
|
GetNarration(42, target),
|
|
GetNarration(45, target)
|
|
});
|
|
target.blurbOverride = 8;
|
|
AddSpare(target, 3);
|
|
target.atkMod = new int[2] { 4, -15 };
|
|
target.defMod = new int[2] { 4, -15 };
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator AxisRequest(Battlers target)
|
|
{
|
|
AddSpare(target, 4);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(46, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (Main.RandomRange(0, 100) <= 50)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(47, target) });
|
|
target.atkMod = new int[2] { 3, -10 };
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(48, target) });
|
|
target.defMod = new int[2] { 3, -10 };
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator AxisParadox(Battlers target)
|
|
{
|
|
AddSpare(target, 5);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(49, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (actors[0].id == Entity.IDs.Kanako)
|
|
{
|
|
if (!target.internalFlags.Contains("KDiag"))
|
|
{
|
|
target.internalFlags.Add("KDiag");
|
|
TextSystem.GetText("AxisParadoxKanako");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
yield break;
|
|
}
|
|
}
|
|
else if (!target.internalFlags.Contains("CDiag"))
|
|
{
|
|
target.internalFlags.Add("CDiag");
|
|
TextSystem.GetText("AxisParadoxCole");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
BattleDR.DoDiag(new string[1] { GetNarration(50, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator BellCover(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(51, target) });
|
|
AddSpare(target, 3);
|
|
actors[0].defMod = new int[2] { 3, 10 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator BellShush(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(52, target) });
|
|
AddSpare(target, 3);
|
|
target.defMod = new int[2] { 3, -10 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator BellIgnore(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(53, target) });
|
|
AddSpare(target, 4);
|
|
target.atkMod = new int[2] { 3, -10 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator StaplerRefill(Battlers target)
|
|
{
|
|
yield break;
|
|
}
|
|
|
|
public IEnumerator StaplerPress(Battlers target)
|
|
{
|
|
target.entity.anim.Play("Hurt");
|
|
target.entity.Shake(10f, 1f);
|
|
if (target.internalFlags.Contains("Empty"))
|
|
{
|
|
AddSpare(target, 5);
|
|
Audio.PlaySound("snd_break1.wav");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(54, target) });
|
|
}
|
|
else
|
|
{
|
|
Audio.PlaySound("snd_switchpull_n.wav");
|
|
AddSpare(target, 35);
|
|
Main.Particle("StapleOut", new Vector2(-10f, -15f), 10, target.entity);
|
|
if (!target.internalFlags.Contains("Press"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(55, target) });
|
|
target.internalFlags.Add("Press");
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(56, target) });
|
|
target.skipAttack = true;
|
|
target.internalFlags.Add("Empty");
|
|
BattleDR.current.tempFlags.Add("StaplerEmpty");
|
|
target.entity.replaceAnim.Add(new Array<Variant> { "Idle", "Sad" });
|
|
}
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
target.entity.UpdateAnim(force: true);
|
|
}
|
|
|
|
public IEnumerator StaplerPet(Battlers target)
|
|
{
|
|
if (target.internalFlags.Contains("Empty"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(57, target) });
|
|
}
|
|
else
|
|
{
|
|
AddSpare(target, 50);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(58, target) });
|
|
target.entity.anim.Play("Happy");
|
|
target.blurbOverride = 3;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator GearSpin(Battlers target)
|
|
{
|
|
if (!target.internalFlags.Contains("Oil"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(59, target) });
|
|
AddSpare(target, 15);
|
|
target.blurbOverride = 6;
|
|
}
|
|
else
|
|
{
|
|
target.entity.anim.Play("Happy");
|
|
AddSpare(target, 45);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(60, target) });
|
|
target.blurbOverride = 3;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator GearOil(Battlers target)
|
|
{
|
|
if (!target.internalFlags.Contains("Oil"))
|
|
{
|
|
AddSpare(target, 15);
|
|
BattleDR.DoDiag(new string[1] { GetNarration(61, target) });
|
|
target.internalFlags.Add("Oil");
|
|
target.blurbOverride = 2;
|
|
}
|
|
else
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(62, target) });
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator SpinSelf(Battlers target)
|
|
{
|
|
actors[0].entity.anim.Play("Spinning");
|
|
bool flag = false;
|
|
for (int i = 0; i < BattleDR.current.enemies.Count; i++)
|
|
{
|
|
if (BattleDR.current.enemies[i].id == Entity.IDs.Gearzerd)
|
|
{
|
|
AddSpare(BattleDR.current.enemies[i], 40, !flag);
|
|
flag = true;
|
|
target.blurbOverride = 4;
|
|
}
|
|
else if (BattleDR.current.enemies[i].id == Entity.IDs.Wrench)
|
|
{
|
|
AddSpare(BattleDR.current.enemies[i], 25, !flag);
|
|
flag = true;
|
|
}
|
|
else if (BattleDR.current.enemies[i].id == Entity.IDs.Drill)
|
|
{
|
|
AddSpare(BattleDR.current.enemies[i], 20, !flag);
|
|
flag = true;
|
|
}
|
|
}
|
|
BattleDR.DoDiag(new string[1] { GetNarration(63, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
actors[0].entity.anim.Play("BattleIdle");
|
|
}
|
|
|
|
public IEnumerator AxisAtkUP(Battlers target)
|
|
{
|
|
Audio.PlaySound("snd_boost.wav");
|
|
Audio.PlaySound("snd_cardrive.wav");
|
|
actors[0].entity.anim.Play("SpinAtk");
|
|
Node2D[] part = new Node2D[SaveFile.current.activeParty.Count];
|
|
for (int i = 0; i < SaveFile.current.activeParty.Count; i++)
|
|
{
|
|
if (Party.party[SaveFile.current.activeParty[i]].HP > 0)
|
|
{
|
|
part[i] = (Node2D)Main.Particle("AtkUp", Party.party[SaveFile.current.activeParty[i]].center, 1, Party.party[SaveFile.current.activeParty[i]].entity);
|
|
Party.party[SaveFile.current.activeParty[i]].atkMod = new int[2]
|
|
{
|
|
3,
|
|
15 + actors[0].MAGIC * 2
|
|
};
|
|
}
|
|
}
|
|
BattleDR.DoDiag(new string[1] { GetNarration(64, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
for (int j = 0; j < part.Length; j++)
|
|
{
|
|
if (GodotObject.IsInstanceValid(part[j]))
|
|
{
|
|
part[j].QueueFree();
|
|
}
|
|
}
|
|
}
|
|
|
|
public IEnumerator HealShower(Battlers target)
|
|
{
|
|
actors[0].entity.anim.Play("SpinAtk");
|
|
Audio.PlaySound("snd_boost.wav");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(65, target) });
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
for (int i = 0; i < SaveFile.current.activeParty.Count; i++)
|
|
{
|
|
Coroutine.Start(BattleDR.Heal(Party.party[SaveFile.current.activeParty[i]], 30 + 10 * actors[0].MAGIC, playParticles: true, doColor: true, showText: true, i == 0));
|
|
}
|
|
for (float a = 0f; a < 30f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator HeatWave(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(66, target) });
|
|
actors[0].entity.anim.Play("SpinAtk");
|
|
actors[0].entity.doTrail = true;
|
|
Vector2 start = actors[0].entity.GlobalPosition;
|
|
Vector2 center = BattleDR.current.GlobalPosition + new Vector2(0f - BattleDR.partyPos[1][1].X, BattleDR.partyPos[1][1].Y);
|
|
Node part = Main.Particle("AxisFlame", actors[0].center, 1, actors[0].entity);
|
|
float a = 0f;
|
|
float c = 0f;
|
|
float b = 180f;
|
|
while (a <= b)
|
|
{
|
|
float s = Mathf.DegToRad(0f - Mathf.Lerp(0f, 720f, a / b));
|
|
actors[0].entity.GlobalPosition = actors[0].entity.GlobalPosition.Lerp(center + new Vector2(Mathf.Cos(s) * 65f, Mathf.Sin(s) * 90f - 40f), Main.deltaTime * 0.1f);
|
|
if (c <= 0f)
|
|
{
|
|
Audio.PlaySound("snd_steamworks_13_vent.wav");
|
|
c = 15f;
|
|
}
|
|
yield return null;
|
|
a += Main.deltaTime;
|
|
c -= Main.deltaTime;
|
|
}
|
|
Vector2 p = actors[0].entity.GlobalPosition;
|
|
int num = Mathf.RoundToInt((float)actors[0].ATK * 0.8f + (float)(actors[0].MAGIC * 3));
|
|
for (int i = 0; i < BattleDR.current.enemies.Count; i++)
|
|
{
|
|
BattleDR.current.DoDamage(actors[0], BattleDR.current.enemies[i], 1f, miss: false, noTP: true, dontKill: false, showNumber: true, Mathf.RoundToInt((float)num * (BattleDR.current.enemies[i].entity.HasMeta("WeakFire") ? 1.5f : 1f)));
|
|
}
|
|
part.QueueFree();
|
|
b = 0f;
|
|
for (c = 10f; b <= c; b += Main.deltaTime)
|
|
{
|
|
actors[0].entity.GlobalPosition = p.Lerp(start, b / c);
|
|
yield return null;
|
|
}
|
|
actors[0].entity.doTrail = false;
|
|
actors[0].entity.GlobalPosition = start;
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator UnnerveGas(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(67, target) });
|
|
float a;
|
|
for (a = 0f; a < 5f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
Audio.PlaySound("snd_fall2.wav");
|
|
Sprite2D sprite = new Sprite2D
|
|
{
|
|
Texture = GD.Load<Texture2D>("res://Sprites/Bullets/AxisBomb.tres"),
|
|
ZIndex = 3000,
|
|
Scale = Vector2.One * 0.75f
|
|
};
|
|
BattleDR.current.AddChild(sprite, forceReadableName: false, Node.InternalMode.Disabled);
|
|
Vector2 s = actors[0].entity.GlobalPosition + new Vector2(15f, -25f);
|
|
Vector2 t = target.entity.GlobalPosition + target.center;
|
|
Vector2 m = new Vector2(Mathf.Lerp(s.X, t.X, 0.5f), Mathf.Min(s.Y, t.Y) - 60f);
|
|
a = 0f;
|
|
for (float b = 60f; a < b; a += Main.deltaTime)
|
|
{
|
|
sprite.GlobalPosition = Common.Beizier(s, m, t, a / b);
|
|
yield return null;
|
|
}
|
|
CameraController.Shake(20f);
|
|
Audio.PlaySound("snd_badexplosion.wav");
|
|
sprite.QueueFree();
|
|
BattleDR.ShowFloatingText(Texts.common[105], target.entity.GlobalPosition + new Vector2(-20f, 0f));
|
|
Main.Particle("AxisSmokeBomb", target.center, 1, target.entity);
|
|
for (float b = 0f; b < 30f; b += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
target.defMod = new int[2]
|
|
{
|
|
3,
|
|
-20 + -3 * actors[0].MAGIC
|
|
};
|
|
}
|
|
|
|
public IEnumerator AxisSiren(Battlers target)
|
|
{
|
|
actors[0].entity.anim.Play("SpinAtk");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(68, target) });
|
|
Node part = Main.Particle("AxisSiren", new Vector2(0f, -36f), 1, actors[0].entity);
|
|
BattleDR.current.focusAtk = actors[0].posID;
|
|
for (int i = 0; i < BattleDR.current.enemies.Count; i++)
|
|
{
|
|
BattleDR.current.enemies[i].entity.Shake(30f, 2f);
|
|
BattleDR.ShowFloatingText(Texts.common[106], BattleDR.current.enemies[i].entity.GlobalPosition + new Vector2(-20f, 0f));
|
|
}
|
|
actors[0].defMod = new int[2] { 1, -15 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
part.QueueFree();
|
|
}
|
|
|
|
public IEnumerator Wrench(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(69, target) });
|
|
AddSpare(target, (actors[1].HP > 0) ? 50 : 100);
|
|
target.blurbOverride = 4;
|
|
if (actors[1].HP > 0)
|
|
{
|
|
actors[1].entity.anim.Play("Hurt");
|
|
}
|
|
Vector2 p = target.entity.GlobalPosition;
|
|
int z = target.entity.ZIndex;
|
|
target.entity.ZIndex = 4000;
|
|
target.entity.anim.Play("Fix");
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
target.entity.GlobalPosition = target.entity.GlobalPosition.Lerp(actors[1].entity.GlobalPosition + new Vector2(Common.SinOverTime(0.75f) * 8f + 45f, -16f), Main.deltaTime * 0.2f);
|
|
target.entity.RotationDegrees = -90f + Common.SinOverTime(0.5f) * 15f;
|
|
yield return null;
|
|
}
|
|
target.entity.anim.Play("Idle");
|
|
target.entity.RotationDegrees = 0f;
|
|
target.entity.ZIndex = z;
|
|
target.entity.GlobalPosition = p;
|
|
Coroutine.Start(BattleDR.Heal(actors[1], (actors[1].HP > 0) ? 50 : 9999));
|
|
}
|
|
|
|
public IEnumerator Drill(Battlers target)
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(70, target) });
|
|
AddSpare(target, 65);
|
|
target.atkMod = new int[2] { 1, 20 };
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator RulerStraight(Battlers target)
|
|
{
|
|
actors[0].entity.anim.Play("TPose");
|
|
if (!target.internalFlags.Contains("Bad"))
|
|
{
|
|
BattleDR.DoDiag(new string[1] { GetNarration(71, target) });
|
|
target.blurbOverride = 4;
|
|
AddSpare(target, 50);
|
|
}
|
|
else
|
|
{
|
|
target.blurbOverride = 6;
|
|
BattleDR.DoDiag(new string[1] { GetNarration(73, target) });
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
|
|
public IEnumerator RulerBad(Battlers target)
|
|
{
|
|
target.entity.anim.Play("Hurt");
|
|
BattleDR.DoDiag(new string[1] { GetNarration(72, target) });
|
|
for (int i = 0; i < BattleDR.current.enemies.Count; i++)
|
|
{
|
|
if (BattleDR.current.enemies[i].entity.id == Entity.IDs.Ruler)
|
|
{
|
|
AddSpare(BattleDR.current.enemies[i], 35);
|
|
BattleDR.current.enemies[i].blurbOverride = 5;
|
|
}
|
|
}
|
|
if (!target.internalFlags.Contains("Bad"))
|
|
{
|
|
target.internalFlags.Add("Bad");
|
|
target.MONEY *= 3;
|
|
}
|
|
while (BattleDR.current.diag.Count > 0)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
}
|