1351 lines
36 KiB
C#
1351 lines
36 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using Godot;
|
|
using Godot.Bridge;
|
|
using Godot.NativeInterop;
|
|
|
|
[ScriptPath("res://Scripts/Envirioment/Fish.cs")]
|
|
public class Fish : Node2D
|
|
{
|
|
private enum State
|
|
{
|
|
None,
|
|
Casting,
|
|
Main,
|
|
Reel
|
|
}
|
|
|
|
public enum FishTypes
|
|
{
|
|
Bass,
|
|
Bluegill,
|
|
Koi,
|
|
Snakehead,
|
|
Gar,
|
|
Catfish,
|
|
Eel,
|
|
Trout,
|
|
Froggit,
|
|
Carp,
|
|
Salmon
|
|
}
|
|
|
|
public class FishEntity
|
|
{
|
|
public FishTypes type;
|
|
|
|
public float size;
|
|
|
|
public float distance;
|
|
|
|
public float lifeTime;
|
|
|
|
public float idle;
|
|
|
|
public float maxLife;
|
|
|
|
public int hp;
|
|
|
|
public int state;
|
|
|
|
public Sprite2D sprite;
|
|
|
|
public Vector2 dir;
|
|
|
|
public Vector2 target;
|
|
|
|
public void Flee()
|
|
{
|
|
state = 3;
|
|
idle = 0f;
|
|
}
|
|
|
|
public float GetSize()
|
|
{
|
|
return Mathf.Lerp(difficulty[type][0], difficulty[type][1], size);
|
|
}
|
|
}
|
|
|
|
public new class MethodName : Node2D.MethodName
|
|
{
|
|
public static readonly StringName StartFish = "StartFish";
|
|
|
|
public new static readonly StringName _EnterTree = "_EnterTree";
|
|
|
|
public new static readonly StringName _Process = "_Process";
|
|
|
|
public static readonly StringName GetRandomPoint = "GetRandomPoint";
|
|
|
|
public static readonly StringName GameLoop = "GameLoop";
|
|
|
|
public static readonly StringName Fail = "Fail";
|
|
|
|
public static readonly StringName CancelReel = "CancelReel";
|
|
|
|
public static readonly StringName CastTexture = "CastTexture";
|
|
|
|
public static readonly StringName FishLoop = "FishLoop";
|
|
|
|
public static readonly StringName RemoveFish = "RemoveFish";
|
|
|
|
public static readonly StringName SpawnFish = "SpawnFish";
|
|
|
|
public static readonly StringName SetAnims = "SetAnims";
|
|
|
|
public static readonly StringName FishScale = "FishScale";
|
|
|
|
public static readonly StringName FishFanEventD2 = "FishFanEventD2";
|
|
|
|
public static readonly StringName FishSign = "FishSign";
|
|
}
|
|
|
|
public new class PropertyName : Node2D.PropertyName
|
|
{
|
|
public static readonly StringName partyPos = "partyPos";
|
|
|
|
public static readonly StringName cursor = "cursor";
|
|
|
|
public static readonly StringName cast = "cast";
|
|
|
|
public static readonly StringName reelMusic = "reelMusic";
|
|
|
|
public static readonly StringName castMusic = "castMusic";
|
|
|
|
public static readonly StringName part = "part";
|
|
|
|
public static readonly StringName prompt = "prompt";
|
|
|
|
public static readonly StringName texs = "texs";
|
|
|
|
public static readonly StringName fishTex = "fishTex";
|
|
|
|
public static readonly StringName state = "state";
|
|
|
|
public static readonly StringName combo = "combo";
|
|
|
|
public static readonly StringName promptDir = "promptDir";
|
|
|
|
public static readonly StringName time = "time";
|
|
|
|
public static readonly StringName spawn = "spawn";
|
|
|
|
public static readonly StringName promptTime = "promptTime";
|
|
|
|
public static readonly StringName fishNames = "fishNames";
|
|
|
|
public static readonly StringName promptAngle = "promptAngle";
|
|
}
|
|
|
|
public new class SignalName : Node2D.SignalName
|
|
{
|
|
}
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
private Node2D[] partyPos;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
private Sprite2D cursor;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
private Sprite2D cast;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
private AudioStream reelMusic;
|
|
|
|
[Export(PropertyHint.None, "")]
|
|
private AudioStream castMusic;
|
|
|
|
private CpuParticles2D part;
|
|
|
|
private Node2D prompt;
|
|
|
|
private static readonly Dictionary<FishTypes, int[]> difficulty = new Dictionary<FishTypes, int[]>
|
|
{
|
|
{
|
|
FishTypes.Bass,
|
|
new int[2] { 3, 6 }
|
|
},
|
|
{
|
|
FishTypes.Bluegill,
|
|
new int[2] { 2, 4 }
|
|
},
|
|
{
|
|
FishTypes.Koi,
|
|
new int[2] { 3, 8 }
|
|
},
|
|
{
|
|
FishTypes.Snakehead,
|
|
new int[2] { 8, 12 }
|
|
},
|
|
{
|
|
FishTypes.Gar,
|
|
new int[2] { 8, 15 }
|
|
},
|
|
{
|
|
FishTypes.Catfish,
|
|
new int[2] { 7, 15 }
|
|
},
|
|
{
|
|
FishTypes.Eel,
|
|
new int[2] { 3, 7 }
|
|
},
|
|
{
|
|
FishTypes.Trout,
|
|
new int[2] { 3, 6 }
|
|
},
|
|
{
|
|
FishTypes.Froggit,
|
|
new int[2] { 2, 8 }
|
|
},
|
|
{
|
|
FishTypes.Carp,
|
|
new int[2] { 4, 6 }
|
|
},
|
|
{
|
|
FishTypes.Salmon,
|
|
new int[2] { 5, 7 }
|
|
}
|
|
};
|
|
|
|
private Texture2D[] texs = new Texture2D[5]
|
|
{
|
|
GD.Load<Texture2D>("res://Sprites/Props/Fish/FishBobber2.tres"),
|
|
GD.Load<Texture2D>("res://Sprites/Props/Fish/FishBobber.tres"),
|
|
GD.Load<Texture2D>("res://Sprites/Props/Fish/FishBobber3.tres"),
|
|
GD.Load<Texture2D>("res://Sprites/Props/Fish/FishBobber4.tres"),
|
|
GD.Load<Texture2D>("res://Sprites/Props/Fish/FishShadow.tres")
|
|
};
|
|
|
|
private Texture2D[] fishTex = Array.Empty<Texture2D>();
|
|
|
|
private const float radius = 100f;
|
|
|
|
private const int max = 5;
|
|
|
|
private Coroutine action;
|
|
|
|
private State state;
|
|
|
|
private int combo;
|
|
|
|
private int promptDir;
|
|
|
|
private float time;
|
|
|
|
private float spawn;
|
|
|
|
private float promptTime;
|
|
|
|
private FishEntity fishing;
|
|
|
|
private string[] fishNames;
|
|
|
|
public List<FishEntity> fishes = new List<FishEntity>();
|
|
|
|
private readonly float[] promptAngle = new float[4] { 180f, 0f, 90f, 270f };
|
|
|
|
private void StartFish()
|
|
{
|
|
if (SaveFile.current.followers.Count > 0)
|
|
{
|
|
TextSystem.GetText("FishCant");
|
|
}
|
|
else if (!SaveFile.HasFlag(SaveFile.Flags.AfterDinnerDay1))
|
|
{
|
|
TextSystem.GetText("KanakoFishD1");
|
|
}
|
|
else
|
|
{
|
|
Main.inEvent = Coroutine.Start(Routine());
|
|
}
|
|
}
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
fishNames = FileAccess.Open(Texts.textFolder + "FishNames.txt", FileAccess.ModeFlags.Read).GetAsText(skipCr: true).Split('\n');
|
|
part = cast.GetChild<CpuParticles2D>(0);
|
|
prompt = cast.GetChild<Node2D>(1);
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
Coroutine coroutine = action;
|
|
if (coroutine != null && coroutine.done)
|
|
{
|
|
action = null;
|
|
}
|
|
FishScale();
|
|
}
|
|
|
|
private IEnumerator Routine()
|
|
{
|
|
state = State.None;
|
|
combo = 0;
|
|
time = 0f;
|
|
spawn = 0f;
|
|
if (SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing) && !SaveFile.HasFlag(SaveFile.Flags.KanakoFishFirstTalk))
|
|
{
|
|
SaveFile.AddFlag(SaveFile.Flags.KanakoFishFirstTalk);
|
|
TextSystem.GetText("KanakoFishD2");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
TextSystem.GetText("FishPrompt");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (TextSystem.lastPrompt != 0)
|
|
{
|
|
yield break;
|
|
}
|
|
Party.ChangeCollider(state: false);
|
|
IList<Node2D> list = partyPos;
|
|
Party.MoveTo(Common.PosFromNode(in list), 0.5f, align: true, Entity.Direction.West);
|
|
while (!Party.IsStopped())
|
|
{
|
|
yield return null;
|
|
}
|
|
Coroutine c = Coroutine.Start(CameraController.Pan(base.GlobalPosition + 50f * Vector2.Left, 0.5f));
|
|
Audio.ChangeMusic(castMusic, 1f);
|
|
while (true)
|
|
{
|
|
if (c.done)
|
|
{
|
|
Coroutine routine = Audio.routine;
|
|
if (routine == null || routine.done)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
yield return null;
|
|
}
|
|
SetAnims();
|
|
state = State.Casting;
|
|
for (int i = 0; i < fishes.Count; i++)
|
|
{
|
|
if (GodotObject.IsInstanceValid(fishes[i].sprite))
|
|
{
|
|
fishes[i].sprite.QueueFree();
|
|
}
|
|
}
|
|
fishes.Clear();
|
|
while (GameLoop())
|
|
{
|
|
yield return null;
|
|
}
|
|
state = State.None;
|
|
cursor.Visible = false;
|
|
Party.UpdateAnim();
|
|
c = Coroutine.Start(CameraController.PanToObj(Player.instance, 0.5f));
|
|
while (!c.done)
|
|
{
|
|
yield return null;
|
|
}
|
|
Party.ChangeCollider(state: true);
|
|
Room.current.DoMusic(0);
|
|
Player.instance.ResetFollowStep();
|
|
}
|
|
|
|
private Vector2 GetRandomPoint(float mult = 1f)
|
|
{
|
|
return (Vector2.Up * (float)GD.RandRange(0.0, 100f * mult)).Rotated(Mathf.DegToRad(GD.RandRange(0, 360)));
|
|
}
|
|
|
|
private bool GameLoop()
|
|
{
|
|
time += Main.deltaTime;
|
|
Coroutine coroutine = action;
|
|
if (coroutine != null && !coroutine.done)
|
|
{
|
|
return true;
|
|
}
|
|
switch (state)
|
|
{
|
|
case State.Casting:
|
|
FishLoop();
|
|
if (!cursor.Visible)
|
|
{
|
|
cursor.GlobalPosition = base.GlobalPosition;
|
|
cursor.Visible = true;
|
|
break;
|
|
}
|
|
cursor.RotationDegrees += Main.deltaTime * -0.75f;
|
|
cursor.GlobalPosition += Main.GetDirection().Normalized() * 2f;
|
|
cursor.Position = cursor.Position.LimitLength(85f);
|
|
if (Input.IsActionJustPressed(Main.keys[4]))
|
|
{
|
|
action = Coroutine.Start(Cast());
|
|
state = State.Main;
|
|
return true;
|
|
}
|
|
if (!Input.IsActionJustPressed(Main.keys[5]) && !Input.IsActionJustPressed(Main.keys[6]))
|
|
{
|
|
break;
|
|
}
|
|
Audio.PlaySound(Audio.commonSounds[0]);
|
|
return false;
|
|
case State.Main:
|
|
FishLoop();
|
|
CastTexture();
|
|
if (Input.IsActionJustPressed(Main.keys[4]))
|
|
{
|
|
if (fishing != null)
|
|
{
|
|
for (int j = 0; j < fishes.Count; j++)
|
|
{
|
|
if (fishes[j] != fishing)
|
|
{
|
|
fishes[j].state = 3;
|
|
}
|
|
}
|
|
Audio.PlaySound("snd_grab.wav");
|
|
Player.instance.anim.Play("FishReel");
|
|
if (SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing))
|
|
{
|
|
Party.party[1].oEntity.anim.Play("SitLook2");
|
|
}
|
|
Player.instance.shakeIntensity = 1f;
|
|
part.Emitting = true;
|
|
state = State.Reel;
|
|
BattleDR.ShowFloatingText(Texts.common[123], cast.GlobalPosition);
|
|
}
|
|
else
|
|
{
|
|
CancelReel();
|
|
}
|
|
}
|
|
else if ((Input.IsActionJustPressed(Main.keys[5]) || Input.IsActionJustPressed(Main.keys[6])) && fishing == null)
|
|
{
|
|
CancelReel();
|
|
}
|
|
break;
|
|
case State.Reel:
|
|
Player.instance.shake = 5f;
|
|
FishLoop();
|
|
if (!prompt.Visible)
|
|
{
|
|
promptTime = 80f;
|
|
promptDir = GD.RandRange(0, 3);
|
|
prompt.RotationDegrees = promptAngle[promptDir];
|
|
prompt.Visible = true;
|
|
}
|
|
if (promptTime > 0f)
|
|
{
|
|
prompt.Modulate = ((Mathf.Sin(time * 0.2f) > 0f) ? Main.colorWhite : Main.colorDark);
|
|
promptTime -= Main.deltaTime;
|
|
for (int i = 0; i <= 3; i++)
|
|
{
|
|
if (Input.IsActionJustPressed(Main.keys[i]))
|
|
{
|
|
if (i == promptDir)
|
|
{
|
|
fishing.hp--;
|
|
action = Coroutine.Start(PromptSuccess());
|
|
}
|
|
else
|
|
{
|
|
Fail();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Fail();
|
|
}
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private void Fail()
|
|
{
|
|
Audio.PlaySound("snd_break1.wav");
|
|
BattleDR.ShowFloatingText(Texts.common[122], cast.GlobalPosition);
|
|
combo = 0;
|
|
state = State.Casting;
|
|
RemoveFish(0);
|
|
fishing = null;
|
|
CancelReel();
|
|
if (SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing))
|
|
{
|
|
Party.party[1].oEntity.anim.Play("SitDraw");
|
|
}
|
|
}
|
|
|
|
private IEnumerator PromptSuccess()
|
|
{
|
|
Audio.PlaySound("snd_shineselect.wav");
|
|
prompt.Modulate = Main.colorYellow;
|
|
for (float a = 0f; a < 20f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
prompt.Modulate = Main.colorWhite;
|
|
prompt.Visible = false;
|
|
if (fishing.hp <= 0)
|
|
{
|
|
combo++;
|
|
action = Coroutine.Start(Cast(back: true));
|
|
}
|
|
}
|
|
|
|
private void CancelReel()
|
|
{
|
|
part.Emitting = false;
|
|
prompt.Visible = false;
|
|
action = Coroutine.Start(Cast(back: true));
|
|
}
|
|
|
|
private void CastTexture()
|
|
{
|
|
cast.Texture = texs[(fishing != null) ? 3 : ((Mathf.Sin(time * 0.2f) > 0f) ? 1 : 2)];
|
|
}
|
|
|
|
private void FishLoop()
|
|
{
|
|
for (int num = fishes.Count - 1; num >= 0; num--)
|
|
{
|
|
if (fishing == null && (fishes[num].state == 1 || fishes[num].state == 2) && fishes[num].distance < 16f)
|
|
{
|
|
fishes[num].idle = 0f;
|
|
fishes[num].state = 4;
|
|
}
|
|
switch (fishes[num].state)
|
|
{
|
|
case 0:
|
|
if (fishes[num].lifeTime > 60f)
|
|
{
|
|
fishes[num].state = 1;
|
|
fishes[num].idle = GD.RandRange(60, 200);
|
|
}
|
|
break;
|
|
case 1:
|
|
if (fishes[num].lifeTime > 1600f)
|
|
{
|
|
fishes[num].Flee();
|
|
}
|
|
else if (fishes[num].idle <= 0f)
|
|
{
|
|
fishes[num].state = 2;
|
|
fishes[num].target = base.GlobalPosition + GetRandomPoint(0.8f);
|
|
fishes[num].dir = fishes[num].sprite.GlobalPosition.DirectionTo(fishes[num].target);
|
|
}
|
|
else
|
|
{
|
|
fishes[num].idle -= Main.deltaTime;
|
|
}
|
|
break;
|
|
case 2:
|
|
if (fishes[num].sprite.GlobalPosition.DistanceTo(fishes[num].target) > 5f)
|
|
{
|
|
fishes[num].sprite.GlobalPosition += fishes[num].dir * 0.25f * Main.deltaTime;
|
|
}
|
|
else
|
|
{
|
|
fishes[num].state = 0;
|
|
}
|
|
break;
|
|
case 3:
|
|
if (fishes[num].idle < 60f)
|
|
{
|
|
fishes[num].idle += Main.deltaTime;
|
|
}
|
|
else
|
|
{
|
|
RemoveFish(num);
|
|
}
|
|
break;
|
|
case 4:
|
|
if (fishes[num].idle < 30f)
|
|
{
|
|
fishes[num].idle += Main.deltaTime;
|
|
break;
|
|
}
|
|
fishes[num].idle = 0f;
|
|
fishes[num].state = 5;
|
|
break;
|
|
case 5:
|
|
if (fishes[num].distance > 1f)
|
|
{
|
|
fishes[num].sprite.GlobalPosition += fishes[num].sprite.GlobalPosition.DirectionTo(cast.GlobalPosition) * Mathf.Clamp(fishes[num].distance / 2f, 0f, 1f) * 0.2f * Main.deltaTime;
|
|
break;
|
|
}
|
|
fishes[num].idle = 0f;
|
|
if (fishing != null)
|
|
{
|
|
fishes[num].state = 3;
|
|
break;
|
|
}
|
|
Audio.PlaySound("snd_swallow_ch1.wav");
|
|
Main.Particle("WaterBurst", fishes[num].sprite.GlobalPosition);
|
|
fishing = fishes[num];
|
|
fishes[num].state = 6;
|
|
break;
|
|
case 6:
|
|
if (state == State.Reel)
|
|
{
|
|
break;
|
|
}
|
|
if (fishes[num].idle < 60f)
|
|
{
|
|
fishes[num].idle += Main.deltaTime;
|
|
break;
|
|
}
|
|
if (fishing == fishes[num])
|
|
{
|
|
fishing = null;
|
|
}
|
|
fishes[num].Flee();
|
|
BattleDR.ShowFloatingText(Texts.common[122], cast.GlobalPosition);
|
|
break;
|
|
}
|
|
}
|
|
if (spawn > 0f)
|
|
{
|
|
spawn -= Main.deltaTime;
|
|
}
|
|
else if ((state == State.Main || state == State.Casting) && fishes.Count < 5)
|
|
{
|
|
spawn = GD.RandRange(120, 300);
|
|
SpawnFish();
|
|
}
|
|
}
|
|
|
|
private void RemoveFish(int i)
|
|
{
|
|
fishes[i].sprite.QueueFree();
|
|
fishes.RemoveAt(i);
|
|
}
|
|
|
|
private void SpawnFish()
|
|
{
|
|
fishes.Add(new FishEntity
|
|
{
|
|
type = (FishTypes)GD.RandRange(0, 10),
|
|
size = (float)GD.RandRange(0.5, 1.2999999523162842),
|
|
distance = 99999f,
|
|
maxLife = GD.RandRange(1600, 2800)
|
|
});
|
|
List<FishEntity> list = fishes;
|
|
FishEntity fishEntity = list[list.Count - 1];
|
|
Dictionary<FishTypes, int[]> dictionary = difficulty;
|
|
List<FishEntity> list2 = fishes;
|
|
float num = dictionary[list2[list2.Count - 1].type][0];
|
|
Dictionary<FishTypes, int[]> dictionary2 = difficulty;
|
|
List<FishEntity> list3 = fishes;
|
|
float to = dictionary2[list3[list3.Count - 1].type][1];
|
|
List<FishEntity> list4 = fishes;
|
|
fishEntity.hp = Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp(num, to, list4[list4.Count - 1].size)), 3, 8);
|
|
List<FishEntity> list5 = fishes;
|
|
FishEntity fishEntity2 = list5[list5.Count - 1];
|
|
Sprite2D obj = new Sprite2D
|
|
{
|
|
Texture = texs[4],
|
|
Scale = Vector2.Zero,
|
|
Position = GetRandomPoint(0.8f)
|
|
};
|
|
Sprite2D node = obj;
|
|
fishEntity2.sprite = obj;
|
|
AddChild(node, forceReadableName: false, InternalMode.Disabled);
|
|
}
|
|
|
|
private IEnumerator Cast(bool back = false)
|
|
{
|
|
cursor.Visible = false;
|
|
if (!back)
|
|
{
|
|
Player.instance.anim.Play("FishCast");
|
|
}
|
|
else
|
|
{
|
|
Audio.PlaySound("snd_splash.wav");
|
|
part.Emitting = false;
|
|
Player.instance.anim.PlayBackwards("FishCast");
|
|
FishEntity fishEntity = fishing;
|
|
if (fishEntity != null && fishEntity.hp <= 0)
|
|
{
|
|
fishing.sprite.Visible = false;
|
|
}
|
|
}
|
|
Audio.PlaySound("snd_swing.wav");
|
|
float a;
|
|
for (a = 0f; a < 5f; a += Main.deltaTime)
|
|
{
|
|
yield return null;
|
|
}
|
|
cast.Visible = true;
|
|
cast.Texture = texs[0];
|
|
Vector2 sp = Player.instance.GlobalPosition + Vector2.Up * 32f;
|
|
Vector2 m = sp.Lerp(cursor.GlobalPosition, 0.5f) + Vector2.Up * 50f;
|
|
a = 0f;
|
|
for (float b = 60f; a < b; a += Main.deltaTime)
|
|
{
|
|
cast.GlobalPosition = Common.Beizier(sp, m, cursor.GlobalPosition, back ? (1f - a / b) : (a / b));
|
|
yield return null;
|
|
}
|
|
if (back)
|
|
{
|
|
cast.Visible = false;
|
|
state = State.Casting;
|
|
FishEntity fishEntity2 = fishing;
|
|
if (fishEntity2 != null && fishEntity2.hp <= 0)
|
|
{
|
|
BattleDR.ShowFloatingText(Texts.common[124], Player.instance.GlobalPosition);
|
|
Texts.TextBlock[] diagClone = Texts.GetDiagClone("FishGet");
|
|
Audio.PlaySound("snd_item_ch1.wav");
|
|
Player.instance.anim.Play("SideIdleHat");
|
|
float b = fishing.GetSize();
|
|
diagClone[0].text = diagClone[0].text.Replace("[NAME]", fishNames[(int)fishing.type]).Replace("[SIZE]", b.ToString("0.00"));
|
|
diagClone[0].portrait = "Fish" + fishing.type;
|
|
RemoveFish(0);
|
|
if (SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing))
|
|
{
|
|
Party.party[1].oEntity.anim.Play("SitHappy");
|
|
}
|
|
TextSystem.SingleText(diagClone);
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (!SaveFile.current.fishes.ContainsKey((int)fishing.type))
|
|
{
|
|
SaveFile.current.fishes.Add((int)fishing.type, new float[2]);
|
|
}
|
|
SaveFile.current.fishes[(int)fishing.type][0] += 1f;
|
|
if (b > SaveFile.current.fishes[(int)fishing.type][1])
|
|
{
|
|
SaveFile.current.fishes[(int)fishing.type][1] = b;
|
|
}
|
|
fishing = null;
|
|
if (SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing))
|
|
{
|
|
Party.party[1].oEntity.anim.Play("SitDraw");
|
|
}
|
|
Player.instance.anim.Play("FishOut");
|
|
}
|
|
yield break;
|
|
}
|
|
Audio.PlaySound("snd_splash.wav");
|
|
Main.Particle("WaterBurst", cursor.GlobalPosition);
|
|
for (int i = 0; i < fishes.Count; i++)
|
|
{
|
|
if (fishes[i].sprite.GlobalPosition.DistanceTo(cast.GlobalPosition) < 20f)
|
|
{
|
|
fishes[i].Flee();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void SetAnims()
|
|
{
|
|
Party.UpdateFollowerEntities();
|
|
for (int i = 0; i < SaveFile.current.activeParty.Count; i++)
|
|
{
|
|
switch (Party.party[SaveFile.current.activeParty[i]].oEntity.id)
|
|
{
|
|
case Entity.IDs.Clover:
|
|
Party.party[SaveFile.current.activeParty[i]].oEntity.sprite.FlipH = true;
|
|
Party.party[SaveFile.current.activeParty[i]].oEntity.anim.Play("FishOut");
|
|
break;
|
|
case Entity.IDs.Kanako:
|
|
Party.party[SaveFile.current.activeParty[i]].oEntity.sprite.FlipH = false;
|
|
Party.party[SaveFile.current.activeParty[i]].oEntity.anim.Play("SitDraw");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void FishScale()
|
|
{
|
|
float weight = Main.deltaTime * 0.05f;
|
|
for (int i = 0; i < fishes.Count; i++)
|
|
{
|
|
if (state == State.None || fishes[i].state == 3)
|
|
{
|
|
fishes[i].sprite.Scale = fishes[i].sprite.Scale.Lerp(Vector2.Zero, weight);
|
|
}
|
|
else
|
|
{
|
|
fishes[i].sprite.Scale = fishes[i].sprite.Scale.Lerp((Mathf.Clamp(Mathf.InverseLerp(4f, 10f, fishes[i].GetSize()), 0.5f, 1.5f) + Mathf.Sin(fishes[i].lifeTime * 0.1f) * 0.1f) * Vector2.One, weight);
|
|
fishes[i].lifeTime += Main.deltaTime;
|
|
}
|
|
fishes[i].sprite.Modulate = Main.colorClear.Lerp(Main.colorWhite, fishes[i].sprite.Scale.Length());
|
|
if (state == State.Main)
|
|
{
|
|
fishes[i].distance = fishes[i].sprite.GlobalPosition.DistanceTo(cast.GlobalPosition);
|
|
}
|
|
else
|
|
{
|
|
fishes[i].distance = 99999f;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void FishFanEventD2()
|
|
{
|
|
if (SaveFile.HasFlag(SaveFile.Flags.FishGuyTaskDay2))
|
|
{
|
|
TextSystem.GetText("FishFanD2After");
|
|
}
|
|
else if (!SaveFile.HasFlag(SaveFile.Flags.FishGuyFirstTalk))
|
|
{
|
|
TextSystem.GetText("FishFanFirstDiag");
|
|
SaveFile.AddFlag(SaveFile.Flags.FishGuyFirstTalk);
|
|
}
|
|
else if (SaveFile.current.fishes.Count >= 5)
|
|
{
|
|
TextSystem.GetText("FishFanD2Got");
|
|
SaveFile.current.gold += 5;
|
|
SaveFile.AddFlag(SaveFile.Flags.FishGuyTaskDay2);
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("FishFanD2");
|
|
}
|
|
}
|
|
|
|
private void FishSign()
|
|
{
|
|
Main.inEvent = Coroutine.Start(FishSignRoutine());
|
|
}
|
|
|
|
private IEnumerator FishSignRoutine()
|
|
{
|
|
TextSystem.GetText("FishSign");
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
if (TextSystem.lastPrompt == 0)
|
|
{
|
|
TextSystem.GetText("FishInstructions");
|
|
}
|
|
else
|
|
{
|
|
if (TextSystem.lastPrompt != 1)
|
|
{
|
|
yield break;
|
|
}
|
|
if (SaveFile.current.fishes.Count == 0)
|
|
{
|
|
TextSystem.GetText("FishNone");
|
|
yield break;
|
|
}
|
|
foreach (int key in SaveFile.current.fishes.Keys)
|
|
{
|
|
Texts.TextBlock[] diagClone = Texts.GetDiagClone("FishStat");
|
|
diagClone[0].text = diagClone[0].text.Replace("[NAME]", fishNames[key]).Replace("[SIZE]", SaveFile.current.fishes[key][1].ToString("0.00")).Replace("[AMT]", SaveFile.current.fishes[key][0].ToString());
|
|
Texts.TextBlock obj = diagClone[0];
|
|
FishTypes fishTypes = (FishTypes)key;
|
|
obj.portrait = "Fish" + fishTypes;
|
|
TextSystem.SingleText(diagClone);
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
internal static List<MethodInfo> GetGodotMethodList()
|
|
{
|
|
return new List<MethodInfo>(15)
|
|
{
|
|
new MethodInfo(MethodName.StartFish, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName._EnterTree, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName._Process, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, new List<PropertyInfo>
|
|
{
|
|
new PropertyInfo(Variant.Type.Float, "delta", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false)
|
|
}, null),
|
|
new MethodInfo(MethodName.GetRandomPoint, new PropertyInfo(Variant.Type.Vector2, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, new List<PropertyInfo>
|
|
{
|
|
new PropertyInfo(Variant.Type.Float, "mult", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false)
|
|
}, null),
|
|
new MethodInfo(MethodName.GameLoop, new PropertyInfo(Variant.Type.Bool, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.Fail, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.CancelReel, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.CastTexture, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.FishLoop, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.RemoveFish, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, new List<PropertyInfo>
|
|
{
|
|
new PropertyInfo(Variant.Type.Int, "i", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false)
|
|
}, null),
|
|
new MethodInfo(MethodName.SpawnFish, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.SetAnims, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.FishScale, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.FishFanEventD2, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null),
|
|
new MethodInfo(MethodName.FishSign, new PropertyInfo(Variant.Type.Nil, "", PropertyHint.None, "", PropertyUsageFlags.Default, exported: false), MethodFlags.Normal, null, null)
|
|
};
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
|
|
{
|
|
if (method == MethodName.StartFish && args.Count == 0)
|
|
{
|
|
StartFish();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName._EnterTree && args.Count == 0)
|
|
{
|
|
_EnterTree();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName._Process && args.Count == 1)
|
|
{
|
|
_Process(VariantUtils.ConvertTo<double>(in args[0]));
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.GetRandomPoint && args.Count == 1)
|
|
{
|
|
ret = VariantUtils.CreateFrom<Vector2>(GetRandomPoint(VariantUtils.ConvertTo<float>(in args[0])));
|
|
return true;
|
|
}
|
|
if (method == MethodName.GameLoop && args.Count == 0)
|
|
{
|
|
ret = VariantUtils.CreateFrom<bool>(GameLoop());
|
|
return true;
|
|
}
|
|
if (method == MethodName.Fail && args.Count == 0)
|
|
{
|
|
Fail();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.CancelReel && args.Count == 0)
|
|
{
|
|
CancelReel();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.CastTexture && args.Count == 0)
|
|
{
|
|
CastTexture();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishLoop && args.Count == 0)
|
|
{
|
|
FishLoop();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.RemoveFish && args.Count == 1)
|
|
{
|
|
RemoveFish(VariantUtils.ConvertTo<int>(in args[0]));
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.SpawnFish && args.Count == 0)
|
|
{
|
|
SpawnFish();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.SetAnims && args.Count == 0)
|
|
{
|
|
SetAnims();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishScale && args.Count == 0)
|
|
{
|
|
FishScale();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishFanEventD2 && args.Count == 0)
|
|
{
|
|
FishFanEventD2();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishSign && args.Count == 0)
|
|
{
|
|
FishSign();
|
|
ret = default(godot_variant);
|
|
return true;
|
|
}
|
|
return base.InvokeGodotClassMethod(in method, args, out ret);
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
protected override bool HasGodotClassMethod(in godot_string_name method)
|
|
{
|
|
if (method == MethodName.StartFish)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName._EnterTree)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName._Process)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.GetRandomPoint)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.GameLoop)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.Fail)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.CancelReel)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.CastTexture)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishLoop)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.RemoveFish)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.SpawnFish)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.SetAnims)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishScale)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishFanEventD2)
|
|
{
|
|
return true;
|
|
}
|
|
if (method == MethodName.FishSign)
|
|
{
|
|
return true;
|
|
}
|
|
return base.HasGodotClassMethod(in method);
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
|
|
{
|
|
if (name == PropertyName.partyPos)
|
|
{
|
|
partyPos = VariantUtils.ConvertToSystemArrayOfGodotObject<Node2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.cursor)
|
|
{
|
|
cursor = VariantUtils.ConvertTo<Sprite2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.cast)
|
|
{
|
|
cast = VariantUtils.ConvertTo<Sprite2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.reelMusic)
|
|
{
|
|
reelMusic = VariantUtils.ConvertTo<AudioStream>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.castMusic)
|
|
{
|
|
castMusic = VariantUtils.ConvertTo<AudioStream>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.part)
|
|
{
|
|
part = VariantUtils.ConvertTo<CpuParticles2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.prompt)
|
|
{
|
|
prompt = VariantUtils.ConvertTo<Node2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.texs)
|
|
{
|
|
texs = VariantUtils.ConvertToSystemArrayOfGodotObject<Texture2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.fishTex)
|
|
{
|
|
fishTex = VariantUtils.ConvertToSystemArrayOfGodotObject<Texture2D>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.state)
|
|
{
|
|
state = VariantUtils.ConvertTo<State>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.combo)
|
|
{
|
|
combo = VariantUtils.ConvertTo<int>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.promptDir)
|
|
{
|
|
promptDir = VariantUtils.ConvertTo<int>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.time)
|
|
{
|
|
time = VariantUtils.ConvertTo<float>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.spawn)
|
|
{
|
|
spawn = VariantUtils.ConvertTo<float>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.promptTime)
|
|
{
|
|
promptTime = VariantUtils.ConvertTo<float>(in value);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.fishNames)
|
|
{
|
|
fishNames = VariantUtils.ConvertTo<string[]>(in value);
|
|
return true;
|
|
}
|
|
return base.SetGodotClassPropertyValue(in name, in value);
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
|
|
{
|
|
if (name == PropertyName.partyPos)
|
|
{
|
|
GodotObject[] array = partyPos;
|
|
value = VariantUtils.CreateFromSystemArrayOfGodotObject(array);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.cursor)
|
|
{
|
|
value = VariantUtils.CreateFrom(in cursor);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.cast)
|
|
{
|
|
value = VariantUtils.CreateFrom(in cast);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.reelMusic)
|
|
{
|
|
value = VariantUtils.CreateFrom(in reelMusic);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.castMusic)
|
|
{
|
|
value = VariantUtils.CreateFrom(in castMusic);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.part)
|
|
{
|
|
value = VariantUtils.CreateFrom(in part);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.prompt)
|
|
{
|
|
value = VariantUtils.CreateFrom(in prompt);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.texs)
|
|
{
|
|
GodotObject[] array = texs;
|
|
value = VariantUtils.CreateFromSystemArrayOfGodotObject(array);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.fishTex)
|
|
{
|
|
GodotObject[] array = fishTex;
|
|
value = VariantUtils.CreateFromSystemArrayOfGodotObject(array);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.state)
|
|
{
|
|
value = VariantUtils.CreateFrom(in state);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.combo)
|
|
{
|
|
value = VariantUtils.CreateFrom(in combo);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.promptDir)
|
|
{
|
|
value = VariantUtils.CreateFrom(in promptDir);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.time)
|
|
{
|
|
value = VariantUtils.CreateFrom(in time);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.spawn)
|
|
{
|
|
value = VariantUtils.CreateFrom(in spawn);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.promptTime)
|
|
{
|
|
value = VariantUtils.CreateFrom(in promptTime);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.fishNames)
|
|
{
|
|
value = VariantUtils.CreateFrom(in fishNames);
|
|
return true;
|
|
}
|
|
if (name == PropertyName.promptAngle)
|
|
{
|
|
value = VariantUtils.CreateFrom(in promptAngle);
|
|
return true;
|
|
}
|
|
return base.GetGodotClassPropertyValue(in name, out value);
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
internal static List<PropertyInfo> GetGodotPropertyList()
|
|
{
|
|
return new List<PropertyInfo>
|
|
{
|
|
new PropertyInfo(Variant.Type.Array, PropertyName.partyPos, PropertyHint.TypeString, "24/34:Node2D", PropertyUsageFlags.Default | PropertyUsageFlags.ScriptVariable, exported: true),
|
|
new PropertyInfo(Variant.Type.Object, PropertyName.cursor, PropertyHint.NodeType, "Sprite2D", PropertyUsageFlags.Default | PropertyUsageFlags.ScriptVariable, exported: true),
|
|
new PropertyInfo(Variant.Type.Object, PropertyName.cast, PropertyHint.NodeType, "Sprite2D", PropertyUsageFlags.Default | PropertyUsageFlags.ScriptVariable, exported: true),
|
|
new PropertyInfo(Variant.Type.Object, PropertyName.reelMusic, PropertyHint.ResourceType, "AudioStream", PropertyUsageFlags.Default | PropertyUsageFlags.ScriptVariable, exported: true),
|
|
new PropertyInfo(Variant.Type.Object, PropertyName.castMusic, PropertyHint.ResourceType, "AudioStream", PropertyUsageFlags.Default | PropertyUsageFlags.ScriptVariable, exported: true),
|
|
new PropertyInfo(Variant.Type.Object, PropertyName.part, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Object, PropertyName.prompt, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Array, PropertyName.texs, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Array, PropertyName.fishTex, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Int, PropertyName.state, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Int, PropertyName.combo, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Int, PropertyName.promptDir, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Float, PropertyName.time, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Float, PropertyName.spawn, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.Float, PropertyName.promptTime, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.PackedStringArray, PropertyName.fishNames, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false),
|
|
new PropertyInfo(Variant.Type.PackedFloat32Array, PropertyName.promptAngle, PropertyHint.None, "", PropertyUsageFlags.ScriptVariable, exported: false)
|
|
};
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
protected override void SaveGodotObjectData(GodotSerializationInfo info)
|
|
{
|
|
base.SaveGodotObjectData(info);
|
|
StringName name = PropertyName.partyPos;
|
|
GodotObject[] array = partyPos;
|
|
info.AddProperty(name, Variant.CreateFrom(array));
|
|
info.AddProperty(PropertyName.cursor, Variant.From(in cursor));
|
|
info.AddProperty(PropertyName.cast, Variant.From(in cast));
|
|
info.AddProperty(PropertyName.reelMusic, Variant.From(in reelMusic));
|
|
info.AddProperty(PropertyName.castMusic, Variant.From(in castMusic));
|
|
info.AddProperty(PropertyName.part, Variant.From(in part));
|
|
info.AddProperty(PropertyName.prompt, Variant.From(in prompt));
|
|
StringName name2 = PropertyName.texs;
|
|
array = texs;
|
|
info.AddProperty(name2, Variant.CreateFrom(array));
|
|
StringName name3 = PropertyName.fishTex;
|
|
array = fishTex;
|
|
info.AddProperty(name3, Variant.CreateFrom(array));
|
|
info.AddProperty(PropertyName.state, Variant.From(in state));
|
|
info.AddProperty(PropertyName.combo, Variant.From(in combo));
|
|
info.AddProperty(PropertyName.promptDir, Variant.From(in promptDir));
|
|
info.AddProperty(PropertyName.time, Variant.From(in time));
|
|
info.AddProperty(PropertyName.spawn, Variant.From(in spawn));
|
|
info.AddProperty(PropertyName.promptTime, Variant.From(in promptTime));
|
|
info.AddProperty(PropertyName.fishNames, Variant.From(in fishNames));
|
|
}
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
protected override void RestoreGodotObjectData(GodotSerializationInfo info)
|
|
{
|
|
base.RestoreGodotObjectData(info);
|
|
if (info.TryGetProperty(PropertyName.partyPos, out var value))
|
|
{
|
|
partyPos = value.AsGodotObjectArray<Node2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.cursor, out var value2))
|
|
{
|
|
cursor = value2.As<Sprite2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.cast, out var value3))
|
|
{
|
|
cast = value3.As<Sprite2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.reelMusic, out var value4))
|
|
{
|
|
reelMusic = value4.As<AudioStream>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.castMusic, out var value5))
|
|
{
|
|
castMusic = value5.As<AudioStream>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.part, out var value6))
|
|
{
|
|
part = value6.As<CpuParticles2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.prompt, out var value7))
|
|
{
|
|
prompt = value7.As<Node2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.texs, out var value8))
|
|
{
|
|
texs = value8.AsGodotObjectArray<Texture2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.fishTex, out var value9))
|
|
{
|
|
fishTex = value9.AsGodotObjectArray<Texture2D>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.state, out var value10))
|
|
{
|
|
state = value10.As<State>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.combo, out var value11))
|
|
{
|
|
combo = value11.As<int>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.promptDir, out var value12))
|
|
{
|
|
promptDir = value12.As<int>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.time, out var value13))
|
|
{
|
|
time = value13.As<float>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.spawn, out var value14))
|
|
{
|
|
spawn = value14.As<float>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.promptTime, out var value15))
|
|
{
|
|
promptTime = value15.As<float>();
|
|
}
|
|
if (info.TryGetProperty(PropertyName.fishNames, out var value16))
|
|
{
|
|
fishNames = value16.As<string[]>();
|
|
}
|
|
}
|
|
}
|