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

fix SelectEffectYn hint

parent e0fa050b
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class Ocgcore : ServantWithCardDescription
......@@ -3235,18 +3236,32 @@ public class Ocgcore : ServantWithCardDescription
code = r.ReadInt32();
gps = r.ReadShortGPS();
r.ReadByte();
int cr = 95;
if (Config.ClientVersion >= 0x233c)
{
int cp = r.ReadInt32();
if (cp > 0)
cr = cp;
}
desc = GameStringManager.get(cr);
int cr = r.ReadInt32();
card = GCS_cardGet(gps, false);
desc = desc.Replace("[%ls]", "「" + card.get_data().Name + "」");
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;
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");
......@@ -8596,14 +8611,7 @@ public class Ocgcore : ServantWithCardDescription
BinaryMaster binaryMaster = new BinaryMaster();
for (int i = 0; i < allCardsInSelectMessage.Count; i++)
{
if (Config.ClientVersion>=0x133d)
{
binaryMaster.writer.Write((short)allCardsInSelectMessage[i].counterSELcount);
}
else
{
binaryMaster.writer.Write((byte)allCardsInSelectMessage[i].counterSELcount);
}
binaryMaster.writer.Write((short)allCardsInSelectMessage[i].counterSELcount);
}
sendReturn(binaryMaster.get());
}
......
......@@ -12,7 +12,7 @@ public static class GameStringManager
public static List<hashedString> hashedStrings = new List<hashedString>();
public static List<hashedString> xilies = new List<hashedString>();
public static List<hashedString> xilies = new List<hashedString>();
public static int helper_stringToInt(string str)
{
......@@ -86,7 +86,7 @@ public static class GameStringManager
return re;
}
internal static string get_unsafe(int hashCode)
internal static string get_unsafe(int hashCode)
{
string re = "";
foreach (hashedString s in hashedStrings)
......@@ -100,7 +100,7 @@ public static class GameStringManager
return re;
}
internal static string get(int description)
internal static string get(int description)
{
string a = "";
if (description < 10000)
......@@ -122,5 +122,30 @@ public static class GameStringManager
}
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