490 lines
14 KiB
C#
490 lines
14 KiB
C#
using System.Collections.Generic;
|
|
using Godot;
|
|
|
|
public partial class Talk
|
|
{
|
|
private static List<StringName> possible = new List<StringName>();
|
|
|
|
private static List<int> mult = new List<int>();
|
|
|
|
public static void DoTalk()
|
|
{
|
|
possible.Clear();
|
|
mult.Clear();
|
|
Party.StopMoving();
|
|
if (Player.instance.followers.Count == 0 || SaveFile.current.activeParty.Count == 1)
|
|
{
|
|
TextSystem.GetText("TalkNoPartner");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.Day1End, activate: false))
|
|
{
|
|
if (SaveFile.current.values[5] > 11)
|
|
{
|
|
if (Room.current.id == Room.IDs.Hospital)
|
|
{
|
|
TextSystem.GetText("KanakoD1Talk");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.WildEastSouth)
|
|
{
|
|
TextSystem.GetText("KanakoFishD1");
|
|
return;
|
|
}
|
|
}
|
|
if (!SaveFile.HasFlag(SaveFile.Flags.SchoolFountainSealed) && SaveFile.HasFlag(SaveFile.Flags.BearingFought) && !SaveFile.HasFlag(SaveFile.Flags.WeirdStart) && !HasFlag(SaveFile.Flags.KanakoTalkPostBearingF))
|
|
{
|
|
if (SaveFile.HasFlag(SaveFile.Flags.BearingSpared))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostBearSpare");
|
|
}
|
|
else if (SaveFile.HasFlag(SaveFile.Flags.BearingCaught))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostBearCatch");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostBearFight");
|
|
}
|
|
return;
|
|
}
|
|
if (SaveFile.current.values[5] == 10)
|
|
{
|
|
if (SaveFile.HasFlag(SaveFile.Flags.SchoolCheckedLock))
|
|
{
|
|
if (Room.current.id == Room.IDs.SchoolCloset)
|
|
{
|
|
TextSystem.GetText("KanakoTalkSchoolLockedTrapdoor");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkSchoolLocked2");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkSchoolLocked");
|
|
}
|
|
return;
|
|
}
|
|
if (SaveFile.current.values[5] == 11)
|
|
{
|
|
if (SaveFile.HasFlag(SaveFile.Flags.WardenTalkEndDay1))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostWardenDay1");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostTrapdoor");
|
|
}
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWFoxRoom)
|
|
{
|
|
if (!SaveFile.HasFlag(SaveFile.Flags.FoxDefeated) && SaveFile.HasFlag(SaveFile.Flags.FoxFirstTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkFoxQuest");
|
|
}
|
|
else if (SaveFile.HasFlag(SaveFile.Flags.FoxGotItem))
|
|
{
|
|
if (Items.HasItem(Items.IDs.FoxNecklace))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostFoxNecklace");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostFox");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkFoxRoom");
|
|
}
|
|
return;
|
|
}
|
|
if (SaveFile.current.flags.Contains(SaveFile.Flags.WeirdStart))
|
|
{
|
|
if (Room.current.id == Room.IDs.SchoolDWLake && !HasFlag(SaveFile.Flags.KanakoLakeWeird))
|
|
{
|
|
TextSystem.GetText("KanakoLakeWeird");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWFortPrison && !SaveFile.HasFlag(SaveFile.Flags.LuncherFought))
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearPrisonWeird");
|
|
return;
|
|
}
|
|
}
|
|
else if (SaveFile.current.values[5] < 10)
|
|
{
|
|
if (Room.current.id == Room.IDs.SchoolDWFortTreasure)
|
|
{
|
|
SchoolTreasureRoom instance = SchoolTreasureRoom.instance;
|
|
if (instance != null && instance.started)
|
|
{
|
|
TextSystem.GetText("TreasureRoomEvent3");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.BearFortTreasureTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearTreasureRoom");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.BearFortTreasureRoom) && !HasFlag(SaveFile.Flags.KanakoTalkTreasurePost))
|
|
{
|
|
if (SaveFile.HasFlag(SaveFile.Flags.BearFortGotTreasure) && !SaveFile.HasFlag(SaveFile.Flags.BearFortTreasureInvFull))
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearTreasureWon");
|
|
}
|
|
else if (SaveFile.HasFlag(SaveFile.Flags.BearFortTreasureInvFull))
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearTreasureFull");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearTreasureLost");
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWFortPrison)
|
|
{
|
|
if (!HasFlag(SaveFile.Flags.KanakoTalkBearPrison))
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearPrison");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.LuncherFought, activate: false))
|
|
{
|
|
TextSystem.GetText("KanakoTalkBearPrison2");
|
|
return;
|
|
}
|
|
}
|
|
if (SaveFile.current.values[5] != 2)
|
|
{
|
|
if (Room.current.id == Room.IDs.SchoolDWFortBigCorridor && !HasFlag(SaveFile.Flags.KanakoTalkFortBigCorridor))
|
|
{
|
|
TextSystem.GetText("KanakoTalkFortBigCorridor");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWFortRest && !HasFlag(SaveFile.Flags.KanakoTalkBreakRoom))
|
|
{
|
|
TextSystem.GetText("KanakoBreakRoomTalk");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWFortLeft)
|
|
{
|
|
if (!SaveFile.HasFlag(SaveFile.Flags.BBallPlayedOnce) && !HasFlag(SaveFile.Flags.BBallKanakoTalk1))
|
|
{
|
|
TextSystem.GetText("KanakoBBallRoom");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.BBallPlayedOnce) && !SaveFile.HasFlag(SaveFile.Flags.BearFortLeftMinigame) && !HasFlag(SaveFile.Flags.BBallKanakoTalk2))
|
|
{
|
|
TextSystem.GetText("KanakoBBallLost");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.BearFortLeftMinigame) && !HasFlag(SaveFile.Flags.BBallKanakoTalk3))
|
|
{
|
|
TextSystem.GetText("KanakoBBallWon");
|
|
return;
|
|
}
|
|
}
|
|
if ((Room.current.id == Room.IDs.SchoolDWFortFirstPuzzle || Room.current.id == Room.IDs.SchoolDWFortressRightmost) && !HasFlag(SaveFile.Flags.KanakoTalkBFortFirstPRoom))
|
|
{
|
|
TextSystem.GetText("KanakoInsideFortTalk");
|
|
return;
|
|
}
|
|
if (SaveFile.current.flags.Contains(SaveFile.Flags.BeatMemoryGame) && !HasFlag(SaveFile.Flags.KanakoMemoryGameRoomAfter))
|
|
{
|
|
TextSystem.GetText("KanakoPostMemGame");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWPenny && ((MemoryGame)Room.current.eventPointers[1]).running && !HasFlag(SaveFile.Flags.KanakoMemoryGameInProgress))
|
|
{
|
|
TextSystem.GetText("KanakoTalkDuringMemGame");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWPenny && !HasFlag(SaveFile.Flags.KanakoMemoryGameRoomBefore))
|
|
{
|
|
TextSystem.GetText("KanakoBeforeMemoryGame");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWBridge && !HasFlag(SaveFile.Flags.KanakoLandscapeDiag))
|
|
{
|
|
TextSystem.GetText("KanakoLandscapeTalk");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWCenter && !HasFlag(SaveFile.Flags.KanakoTownDiag))
|
|
{
|
|
TextSystem.GetText("KanakoTownDiag");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.SchoolDWLake && !HasFlag(SaveFile.Flags.KanakoLakeTalk))
|
|
{
|
|
TextSystem.GetText("KanakoLakeTalk");
|
|
return;
|
|
}
|
|
if (HasFlag(SaveFile.Flags.DidApprehendTutorial, activate: false) && !HasFlag(SaveFile.Flags.KanakoTalkAfterTutorial))
|
|
{
|
|
TextSystem.GetText("KanakoAfterWardenTutorial");
|
|
return;
|
|
}
|
|
if (SaveFile.current.apprehended.Count >= 2 && !SaveFile.HasFlag(SaveFile.Flags.WardenInnocentTalk) && !HasFlag(SaveFile.Flags.KanakoApprehendTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkApprehend");
|
|
return;
|
|
}
|
|
if (SaveFile.current.values[6] > 3 && !HasFlag(SaveFile.Flags.WeaponTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkWeapon");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.DarkPrisonNorth && !HasFlag(SaveFile.Flags.BearingFought, activate: false) && !HasFlag(SaveFile.Flags.KanakoTalkNorthPrisonTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPrisonNorth");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.DarkPrisonSouth && !HasFlag(SaveFile.Flags.BearingDefeated, activate: false) && !HasFlag(SaveFile.Flags.DarkPrisonSouthTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkJailSouth");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.DarkPrisonRight)
|
|
{
|
|
if (!HasFlag(SaveFile.Flags.WardenExposited, activate: false) && !HasFlag(SaveFile.Flags.DarkPrisonRightTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkJailRight");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.WardenExposited) && !SaveFile.HasFlag(SaveFile.Flags.WarpDoorFirst) && !HasFlag(SaveFile.Flags.KTalkPrisonRightBD))
|
|
{
|
|
TextSystem.GetText("KTalkDoorFirst");
|
|
return;
|
|
}
|
|
}
|
|
if (SaveFile.current.values[5] >= 1 && !HasFlag(SaveFile.Flags.KanakoBearTalk))
|
|
{
|
|
TextSystem.GetText("KanakoBearTalk");
|
|
return;
|
|
}
|
|
if (SaveFile.current.values[5] != 1)
|
|
{
|
|
if (SaveFile.current.values[5] < 1 && !HasFlag(SaveFile.Flags.KanakoFirstDWTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkAfterRescue");
|
|
return;
|
|
}
|
|
if ((Room.current.id == Room.IDs.SchoolDWAfterKanako2 || Room.current.id == Room.IDs.SchoolDWAfterKanako) && !HasFlag(SaveFile.Flags.KanakoRoomAfterRescueTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPencilRoom");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (!HasFlag(SaveFile.Flags.Day2End, activate: false) && !SaveFile.HasFlag(SaveFile.Flags.WeirdStart))
|
|
{
|
|
if (Room.current.id == Room.IDs.WildEastSouth && !HasFlag(SaveFile.Flags.KanakoFishFirstTalk))
|
|
{
|
|
TextSystem.GetText("KanakoFishD2");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.Hospital)
|
|
{
|
|
TextSystem.GetText("KanakoD1Talk");
|
|
return;
|
|
}
|
|
if (SaveFile.current.values[5] >= 23)
|
|
{
|
|
if (SaveFile.HasFlag(SaveFile.Flags.RangerEvent) && !HasFlag(SaveFile.Flags.RangerTalk))
|
|
{
|
|
TextSystem.GetText("KanakoRangerTalk");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.KanakoFountainTalk))
|
|
{
|
|
TextSystem.GetText("KanakoFountainTalk");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.KanakoTosterTalk))
|
|
{
|
|
TextSystem.GetText("KanakoToasterTalk");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.UpstairsTalk2))
|
|
{
|
|
TextSystem.GetText("KanakoUpstairsTalk2");
|
|
return;
|
|
}
|
|
}
|
|
else if (SaveFile.current.values[5] == 22)
|
|
{
|
|
if (SaveFile.current.followers.Contains(Entity.IDs.BunBun))
|
|
{
|
|
if (!HasFlag(SaveFile.Flags.FirstUpstairsTalk))
|
|
{
|
|
TextSystem.GetText("KanakoUpstairsFirstTalk");
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.UpstairsTalk2))
|
|
{
|
|
TextSystem.GetText("KanakoUpstairsTalk2");
|
|
return;
|
|
}
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWPostTram4)
|
|
{
|
|
TextSystem.GetText("KanakoTalkCityEndDW2");
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (SaveFile.current.values[5] == 21)
|
|
{
|
|
if (!SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing) && !HasFlag(SaveFile.Flags.AxisSoloTalk))
|
|
{
|
|
TextSystem.GetText("AxisSoloTalk");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWPostTram3 && !SaveFile.HasFlag(SaveFile.Flags.KanakoFollowing) && !HasFlag(SaveFile.Flags.AxisTrashPuzzleTalk))
|
|
{
|
|
TextSystem.GetText("AxisTrashPuzzleTalk");
|
|
return;
|
|
}
|
|
}
|
|
else if (SaveFile.current.values[5] == 20)
|
|
{
|
|
if (Room.current.id == Room.IDs.ChujinDWInsideTrain)
|
|
{
|
|
TextSystem.GetText("KanakoTramTalk");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWFactoryStation)
|
|
{
|
|
if (!Room.current.tempValue.ContainsKey(ChujinDWEvents.tram))
|
|
{
|
|
Room.current.tempValue.Add(ChujinDWEvents.tram, 0);
|
|
}
|
|
GD.Print(Room.current.tempValue[ChujinDWEvents.tram]);
|
|
TextSystem.GetText("KanakoTramTalk" + Room.current.tempValue[ChujinDWEvents.tram]);
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.ClawTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkPostClaw");
|
|
return;
|
|
}
|
|
goto IL_0ac6;
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWFactoryLeft && !SaveFile.HasFlag(SaveFile.Flags.FactoryPuzzle2) && !HasFlag(SaveFile.Flags.TalkFactoryLeft))
|
|
{
|
|
TextSystem.GetText("KanakoTalkFactoryLeft");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWFactoryRight && !HasFlag(SaveFile.Flags.TalkFactoryRight))
|
|
{
|
|
TextSystem.GetText("KanakoTalkCh2SplitGate");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.DW2TownTVEvent) && !HasFlag(SaveFile.Flags.AxisPuzzleTalk))
|
|
{
|
|
TextSystem.GetText("AxisPuzzleTalk");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.AxisFollowing) && !HasFlag(SaveFile.Flags.AxisFirstTalk))
|
|
{
|
|
TextSystem.GetText("AxisFirstTalk");
|
|
return;
|
|
}
|
|
if ((Room.current.id == Room.IDs.ChujinDWSouthPuzzle || Room.current.id == Room.IDs.ChujinDWBeforeTown) && !HasFlag(SaveFile.Flags.KanakoTalkWaterGun))
|
|
{
|
|
TextSystem.GetText("KanakoTalkCapacitorRoom");
|
|
return;
|
|
}
|
|
if (SaveFile.HasFlag(SaveFile.Flags.DW2Overview) && !HasFlag(SaveFile.Flags.DW2PlanTalk))
|
|
{
|
|
TextSystem.GetText("DW2PlanTalk");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWLongSlide)
|
|
{
|
|
if (!SaveFile.HasFlag(SaveFile.Flags.AxisEvent))
|
|
{
|
|
if (Player.instance.GlobalPosition.Y < 60f)
|
|
{
|
|
TextSystem.GetText("KanakoTalkDW2Slide");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoTalkDW2Slide2");
|
|
}
|
|
return;
|
|
}
|
|
if (!HasFlag(SaveFile.Flags.AxisTalkSlide))
|
|
{
|
|
TextSystem.GetText("AxisTalkSlide");
|
|
return;
|
|
}
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWFirstCorridor)
|
|
{
|
|
TextSystem.GetText("KanakoTalkDW2FirstCorridor");
|
|
return;
|
|
}
|
|
if (Room.current.id == Room.IDs.ChujinDWEntrance && !HasFlag(SaveFile.Flags.KanakoRedLetterDWEntTalk))
|
|
{
|
|
TextSystem.GetText("KanakoTalkRedLetterDW");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
goto IL_0ac6;
|
|
IL_0ac6:
|
|
for (int i = 1; i < 5; i++)
|
|
{
|
|
if (SaveFile.current.activeParty.Contains(i))
|
|
{
|
|
mult.Add(i);
|
|
}
|
|
}
|
|
switch (mult[Main.RandomRange(0, mult.Count - 1)])
|
|
{
|
|
case 1:
|
|
if (SaveFile.current.flags.Contains(SaveFile.Flags.WeirdStart))
|
|
{
|
|
TextSystem.GetText("KanakoNoTalkWeird");
|
|
}
|
|
else
|
|
{
|
|
TextSystem.GetText("KanakoNoTalk");
|
|
}
|
|
break;
|
|
case 2:
|
|
TextSystem.GetText("AxisNoTalk");
|
|
break;
|
|
case 3:
|
|
TextSystem.GetText("JuneNoTalk");
|
|
break;
|
|
case 4:
|
|
TextSystem.GetText("MelodyNoTalk");
|
|
break;
|
|
}
|
|
}
|
|
|
|
private static bool HasFlag(SaveFile.Flags f, bool activate = true)
|
|
{
|
|
if (SaveFile.current.flags.Contains(f))
|
|
{
|
|
return true;
|
|
}
|
|
if (activate)
|
|
{
|
|
SaveFile.AddFlag(f);
|
|
}
|
|
return false;
|
|
}
|
|
}
|