Commit 01104343 authored by mercury233's avatar mercury233 Committed by Unicorn369

fix SelectEffectYn hint

parent e0fa050b
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.RegularExpressions;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
public class Ocgcore : ServantWithCardDescription public class Ocgcore : ServantWithCardDescription
...@@ -3235,18 +3236,32 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3235,18 +3236,32 @@ public class Ocgcore : ServantWithCardDescription
code = r.ReadInt32(); code = r.ReadInt32();
gps = r.ReadShortGPS(); gps = r.ReadShortGPS();
r.ReadByte(); r.ReadByte();
int cr = 95; int cr = r.ReadInt32();
if (Config.ClientVersion >= 0x233c)
{
int cp = r.ReadInt32();
if (cp > 0)
cr = cp;
}
desc = GameStringManager.get(cr);
card = GCS_cardGet(gps, false); card = GCS_cardGet(gps, false);
desc = desc.Replace("[%ls]", "「" + card.get_data().Name + "」");
if (card != null) if (card != null)
{ {
string displayname = "「" + card.get_data().Name + "」";
if (cr == 0)
{
desc = GameStringManager.get(200);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, GameStringManager.formatLocation(gps), 1);
desc = forReplaceFirst.Replace(desc, displayname, 1);
}
else if (cr == 221)
{
desc = GameStringManager.get(221);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, GameStringManager.formatLocation(gps), 1);
desc = forReplaceFirst.Replace(desc, displayname, 1);
desc = desc + "\n" + GameStringManager.get(223);
}
else
{
desc = GameStringManager.get(cr);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, displayname, 1);
}
string hin = ES_hint + ",\n" + desc; string hin = ES_hint + ",\n" + desc;
RMSshow_yesOrNo("return", hin, new messageSystemValue { value = "1", hint = "yes" }, new messageSystemValue { value = "0", hint = "no" }); RMSshow_yesOrNo("return", hin, new messageSystemValue { value = "1", hint = "yes" }, new messageSystemValue { value = "0", hint = "no" });
card.add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting"); card.add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting");
...@@ -8595,16 +8610,9 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8595,16 +8610,9 @@ public class Ocgcore : ServantWithCardDescription
{ {
BinaryMaster binaryMaster = new BinaryMaster(); BinaryMaster binaryMaster = new BinaryMaster();
for (int i = 0; i < allCardsInSelectMessage.Count; i++) for (int i = 0; i < allCardsInSelectMessage.Count; i++)
{
if (Config.ClientVersion>=0x133d)
{ {
binaryMaster.writer.Write((short)allCardsInSelectMessage[i].counterSELcount); binaryMaster.writer.Write((short)allCardsInSelectMessage[i].counterSELcount);
} }
else
{
binaryMaster.writer.Write((byte)allCardsInSelectMessage[i].counterSELcount);
}
}
sendReturn(binaryMaster.get()); sendReturn(binaryMaster.get());
} }
else else
......
...@@ -122,5 +122,30 @@ public static class GameStringManager ...@@ -122,5 +122,30 @@ public static class GameStringManager
} }
return a; return a;
} }
internal static string formatLocation(uint location, uint sequence)
{
if (location == 0x8)
{
if (sequence < 5)
return get(1003);
else if (sequence == 5)
return get(1008);
else
return get(1009);
}
uint filter = 1;
int i = 1000;
for (; filter != 0x100 && filter != location; filter <<= 1)
++i;
if (filter == location)
return get(i);
else
return "???";
}
internal static string formatLocation(GPS gps)
{
return formatLocation(gps.location, gps.sequence);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment