Commit 12935e7c authored by DailyShana's avatar DailyShana

improve undo and update data

parent 75593d88
......@@ -46,7 +46,6 @@ public class MyConfig : XMLReader
/// 语言
/// </summary>
public const string TAG_LANGUAGE = "language";
public const string TAG_AUTO_LEN = "autolength";
/// <summary>
/// 临时文件
/// </summary>
......
......@@ -87,7 +87,7 @@ public string[] Str
public long[] GetSetCode()
{
long[] setcodes = new long[SETCODE_MAX];
for (int i = 0,k=0; i < SETCODE_MAX; k +=0x10,i++)
for (int i = 0,k = 0; i < SETCODE_MAX; k += 0x10, i++)
{
setcodes[i] = (this.setcode >> k) & 0xffff;
}
......
......@@ -23,14 +23,23 @@ public class FileDeleted
public bool deleted = false;
public List<long> ids = new List<long>();
}
public class DBcopied
{
public bool copied = false;
public Card[] NewCards;
public bool replace;
public Card[] OldCards;
}
public List<FileModified> undoModified;
public List<FileDeleted> undoDeleted;
public List<DBcopied> undoCopied;
public CardEdit(IDataForm dataform)
{
this.dataform = dataform;
this.undoSQL = new List<string>();
this.undoModified = new List<FileModified>();
this.undoDeleted = new List<FileDeleted>();
this.undoCopied = new List<DBcopied>();
}
#region 添加
......@@ -61,6 +70,7 @@ public bool AddCard()
undoSQL.Add(DataBase.GetDeleteSQL(c));
undoModified.Add(new FileModified());
undoDeleted.Add(new FileDeleted());
undoCopied.Add(new DBcopied());
dataform.Search(true);
dataform.SetCard(c);
return true;
......@@ -118,11 +128,13 @@ public bool ModCard(bool modfiles)
modify.delold = delold;
undoModified.Add(modify);
undoDeleted.Add(new FileDeleted());
undoCopied.Add(new DBcopied());
}
else
{
undoModified.Add(new FileModified());
undoDeleted.Add(new FileDeleted());
undoCopied.Add(new DBcopied());
}
}
else
......@@ -131,6 +143,7 @@ public bool ModCard(bool modfiles)
undoSQL.Add(DataBase.GetUpdateSQL(oldCard));
undoModified.Add(new FileModified());
undoDeleted.Add(new FileDeleted());
undoCopied.Add(new DBcopied());
}
if (DataBase.Command(dataform.GetOpenFile(), sql) > 0)
{
......@@ -178,6 +191,7 @@ public bool DelCards(bool deletefiles)
undoSQL.Add(undo);
undoDeleted.Add(delete);
undoModified.Add(new FileModified());
undoCopied.Add(new DBcopied());
return true;
}
else
......@@ -252,6 +266,13 @@ public void Undo()
YGOUtil.CardDelete(id, dataform.GetPath(), YGOUtil.DeleteOption.RESTORE);
}
undoDeleted.RemoveAt(undoDeleted.Count - 1);
if (undoCopied[undoCopied.Count - 1].copied)
{
DBcopied lastcopied = undoCopied[undoCopied.Count - 1];
DataBase.DeleteDB(dataform.GetOpenFile(), lastcopied.NewCards);
DataBase.CopyDB(dataform.GetOpenFile(), !lastcopied.replace, lastcopied.OldCards);
}
undoCopied.RemoveAt(undoCopied.Count - 1);
dataform.Search(true);
}
#endregion
......
......@@ -238,7 +238,7 @@ public static Card[] Read(string DB,bool reNewLine, params string[] SQLs)
/// <param name="cards">卡片集合</param>
/// <param name="ignore">是否忽略存在</param>
/// <returns>更新数x2</returns>
public static int CopyDB(string DB, bool ignore,params Card[] cards)
public static int CopyDB(string DB, bool ignore, params Card[] cards)
{
int result = 0;
if ( File.Exists(DB) &&cards!=null)
......@@ -264,7 +264,35 @@ public static int CopyDB(string DB, bool ignore,params Card[] cards)
return result;
}
#endregion
#region 删除记录
public static int DeleteDB(string DB, params Card[] cards)
{
int result = 0;
if (File.Exists(DB) && cards != null)
{
using (SQLiteConnection con = new SQLiteConnection(@"Data Source=" + DB))
{
con.Open();
using (SQLiteTransaction trans = con.BeginTransaction())
{
using (SQLiteCommand cmd = new SQLiteCommand(con))
{
foreach (Card c in cards)
{
cmd.CommandText = DataBase.GetDeleteSQL(c);
result += cmd.ExecuteNonQuery();
}
}
trans.Commit();
}
con.Close();
}
}
return result;
}
#endregion
#region 压缩数据库
public static void Compression(string db)
{
......
......@@ -1113,11 +1113,6 @@ public void SaveCards(Card[] cards)
return;
bool replace = false;
Card[] oldcards = DataBase.Read(nowCdbFile, true, "");
string undo = "";
foreach (Card c in cards)
{
undo += DataBase.GetDeleteSQL(c);
}
if (oldcards != null && oldcards.Length != 0)
{
int i = 0;
......@@ -1129,16 +1124,26 @@ public void SaveCards(Card[] cards)
{
i += 1;
if (i == 1)
{
replace = MyMsg.Question(LMSG.IfReplaceExistingCard);
undo += DataBase.GetInsertSQL(oc, !replace);
break;
}
}
}
if (i > 0)
break;
}
}
cardedit.undoSQL.Add(undo);
cardedit.undoSQL.Add("");
cardedit.undoModified.Add(new CardEdit.FileModified());
cardedit.undoDeleted.Add(new CardEdit.FileDeleted());
DataBase.CopyDB(nowCdbFile, !replace, cards);
CardEdit.DBcopied copied = new CardEdit.DBcopied();
copied.copied = true;
copied.NewCards = cards;
copied.replace = replace;
copied.OldCards = oldcards;
cardedit.undoCopied.Add(copied);
Search(srcCard, true);
btn_undo.Enabled = true;
}
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
connectionString="Data Source=.;Initial Catalog=DBName;Integrated Security=True"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- auto enter length -->
<add key="autolength" value="30" />
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="english" />
<!-- Check system language when running program first time -->
<add key="check_system_language" value="true" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- check update when opening application automatically -->
<add key="auto_check_update" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
IME = true 使用輸入法,正常顯示文字,反應變慢
IME = false English
-->
<add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
<!-- MSE path-->
<add key="mse_path" value="E:\\git\\MagicSetEditor2\\mse.exe"/>
</appSettings>
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
connectionString="Data Source=.;Initial Catalog=DBName;Integrated Security=True"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="english" />
<!-- Check system language when running program first time -->
<add key="check_system_language" value="true" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- check update when opening application automatically -->
<add key="auto_check_update" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
IME = true 使用輸入法,正常顯示文字,反應變慢
IME = false English
-->
<add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
<!-- MSE path-->
<add key="mse_path" value="E:\\git\\MagicSetEditor2\\mse.exe"/>
</appSettings>
</configuration>
\ No newline at end of file
......@@ -274,14 +274,14 @@ copy_info=false或者自由时点的效果则只返回这个效果
如果forced为true则不会检查c对e的免疫效果
●bool Card.IsHasEffect(Card c, int code)
检查c是否受到效果种类是code的效果的影响
●void Card.ResetEffect(Card c, int id, int reset_type)
以重置类型为reset_type、重置种类为id手动重置c受到的效果的影响
重置类型只能是以下类型,对应的重置种类为
RESET_EVENT 发生事件重置 id为事件
RESET_PHASE 阶段结束重置 id为阶段
RESET_CODE 重置指定code的效果 id为效果的种类code,只能重置EFFECT_TYPE_SINGLE的永续型效果
RESET_COPY 重置复制的效果 id为copy_id
RESET_CARD 重置卡片的效果 id为效果owner的卡号
●void Card.ResetEffect(Card c, int reset_code, int reset_type)
以重置类型为reset_type、重置种类为reset_code手动重置c受到的效果的影响
reset_type只能是以下类型,对应的重置种类为
RESET_EVENT 发生事件重置 reset_code为事件
RESET_PHASE 阶段结束重置 reset_code为阶段
RESET_CODE 重置指定code的效果 reset_code为效果的种类code,只能重置EFFECT_TYPE_SINGLE的永续型效果
RESET_COPY 重置复制的效果 reset_code为copy_id
RESET_CARD 重置卡片的效果 reset_code为效果owner的卡号
●int Card.GetEffectCount(Card c, int code)
返回c受到影响的种类是code的效果的数量
●Effect Card.RegisterFlagEffect(Card c, int code, int reset_flag, int property, int reset_count[, int label, int desc])
......@@ -575,7 +575,8 @@ EFFECT_COUNT_CODE_SINGLE 同一张卡多个效果公共使用次数(不
o_range值影响的对方区域
如果property属性中指定了EFFECT_FLAG_ABSOLUTE_RANGE标志,
那么s_range指玩家1受到影响的区域,o_range指玩家2受到影响的区域
如果这是一个特殊召唤手续(EFFECT_SPSUMMON_PROC)的效果,
如果这是一个召唤(覆盖)/限制召唤(覆盖)/特殊召唤手续
(EFFECT_SUMMON_PROC/EFFECT_LIMIT_SUMMON_PROC/EFFECT_SPSUMMON_PROC等)的效果,
并且property指定了EFFECT_FLAG_SPSUM_PARAM标志,
那么s_range表示特殊召唤到的哪个玩家的场地,
o_range表示可选择的表示形式
......@@ -1018,12 +1019,12 @@ Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TARGET_CARDS)
过滤函数,让玩家player从场上·手卡选择min-max张不等于ex的满足条件f的可解放的卡(非上级召唤用)
●Group Duel.GetTributeGroup(Card c)
返回用于通常召唤c可解放(上级召唤用)的卡片组
●int Duel.GetTributeCount(Card c[, Group mg])
返回[mg中]用于通常召唤c的祭品数量
●int Duel.GetTributeCount(Card c[, Group mg, bool ex=false])
返回[mg中]用于通常召唤c的祭品数量,ex=true则允许对方场上的怪兽(太阳神之翼神龙-球体形)
此数量不一定等于Duel.GetTributeGroup的返回值中的卡片数量
因为某些卡可以作为两个祭品来使用
●Group Duel.SelectTribute(int player, Card c, int min, int max[, Group mg])
让玩家player[从mg中]选择用于通常召唤c的min-max个祭品
●Group Duel.SelectTribute(int player, Card c, int min, int max[, Group mg, bool ex=false])
让玩家player[从mg中]选择用于通常召唤c的min-max个祭品,ex=true则允许对方场上的怪兽(太阳神之翼神龙-球体形)
●int Duel.GetTargetCount(function f, int player, int s, int o, Card ex|nil, ...)
基本同Duel.GetMatchingGroupCount,不同之处在于需要追加判定卡片是否能成为当前正在处理的效果的对象
●bool Duel.IsExistingTarget(function f, int player, int s, int o, int count, Card ex|nil, ...)
......@@ -1105,6 +1106,17 @@ void Duel.SetTargetParam(inte param)
让player以reason原因移除指定位置的min-max张叠放卡,返回值表示是否成功
●void Duel.Hint(int hint_type, int player, int desc)
给玩家player发送hint_type类型的消息提示,提示内容为desc
#hint_type只能为以下类型:
#HINT_SELECTMSG 将提示内容写入缓存,用于选择卡片的提示,例如Duel.SelectMatchingCard等
#HINT_OPSELECTED 向player提示“对方选择了:...”,常用于向对方玩家提示选择发动了什么效果
#HINT_CARD 此时desc应为卡号,手动显示卡片发动的动画,常用于提示不入连锁的处理
#HINT_RACE 此时desc应为种族,向player提示“对方宣言了:...”种族
#HINT_ATTRIB 此时desc应为属性,向player提示“对方宣言了:...”属性
#HINT_CODE 此时desc应为卡号,向player提示“对方宣言了:...”卡片
#HINT_NUMBER 此时desc视为单纯的数字,向player提示“对方选择了:...”数字
#HINT_MESSAGE 弹出一个对话框显示信息
#HINT_EVENT 将提示内容写入缓存,用于时点的提示信息(诱发即时效果的提示)
#HINT_EFFECT 同HINT_CARD
●void Duel.HintSelection(Group g)
手动为g显示被选为对象的动画效果,并记录这些卡被选为对象
●bool Duel.SelectEffectYesNo(int player, Card c)
......
No preview for this file type
......@@ -3,21 +3,19 @@
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
connectionString="Data Source=.;Initial Catalog=DBName;Integrated Security=True"
providerName="System.Data.SqlClient" /> -->
connectionString="Data Source=.;Initial Catalog=DBName;Integrated Security=True"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- auto enter length -->
<add key="autolength" value="30" />
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="Chinese" />
<add key="language" value="english" />
<!-- Check system language when running program first time -->
<add key="check_system_language" value="false" />
<add key="check_system_language" value="true" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
......@@ -37,15 +35,15 @@
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
IME = true 使用輸入法,正常顯示文字,反應變慢
IME = false English
-->
IME = true 使用輸入法,正常顯示文字,反應變慢
IME = false English
-->
<add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
<!-- MSE path-->
<add key="mse_path" value="E:\\git\\MagicSetEditor2\\mse.exe" />
<add key="mse_path" value="E:\\git\\MagicSetEditor2\\mse.exe"/>
</appSettings>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
<connectionStrings>
<!-- Example connection to a SQL Server Database on localhost. -->
<!-- <add name="ExampleConnectionString"
connectionString="Data Source=.;Initial Catalog=DBName;Integrated Security=True"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<appSettings>
<!-- access these values via the property:
</connectionStrings>
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<!-- auto enter length -->
<add key="autolength" value="30" />
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="english" />
<!-- Check system language when running program first time -->
<add key="check_system_language" value="true" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- check update when opening application automatically -->
<add key="auto_check_update" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
<!-- auto enter length -->
<add key="autolength" value="30" />
<!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="Chinese" />
<!-- Check system language when running program first time -->
<add key="check_system_language" value="false" />
<!-- async load data -->
<add key="async" value="false" />
<!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- delete,modify with card's files image script -->
<add key="opera_with_cards_file" value="true" />
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true" />
<!-- check update when opening application automatically -->
<add key="auto_check_update" value="true" />
<!-- Cut Images Setting -->
<add key="image_quilty" value="100" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="14,46,149,120" />
<!-- CodeEdiotr Setting
IME = true 使用輸入法,正常顯示文字,反應變慢
IME = false English
-->
<add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
</appSettings>
<add key="IME" value="false" />
<add key="wordwrap" value="true" />
<add key="tabisspace" value="false" />
<add key="fontname" value="Consolas" />
<add key="fontsize" value="14.5" />
<!-- MSE path-->
<add key="mse_path" value="E:\\git\\MagicSetEditor2\\mse.exe" />
</appSettings>
</configuration>
\ No newline at end of file
......@@ -274,14 +274,14 @@ copy_info=false或者自由时点的效果则只返回这个效果
如果forced为true则不会检查c对e的免疫效果
●bool Card.IsHasEffect(Card c, int code)
检查c是否受到效果种类是code的效果的影响
●void Card.ResetEffect(Card c, int id, int reset_type)
以重置类型为reset_type、重置种类为id手动重置c受到的效果的影响
重置类型只能是以下类型,对应的重置种类为
RESET_EVENT 发生事件重置 id为事件
RESET_PHASE 阶段结束重置 id为阶段
RESET_CODE 重置指定code的效果 id为效果的种类code,只能重置EFFECT_TYPE_SINGLE的永续型效果
RESET_COPY 重置复制的效果 id为copy_id
RESET_CARD 重置卡片的效果 id为效果owner的卡号
●void Card.ResetEffect(Card c, int reset_code, int reset_type)
以重置类型为reset_type、重置种类为reset_code手动重置c受到的效果的影响
reset_type只能是以下类型,对应的重置种类为
RESET_EVENT 发生事件重置 reset_code为事件
RESET_PHASE 阶段结束重置 reset_code为阶段
RESET_CODE 重置指定code的效果 reset_code为效果的种类code,只能重置EFFECT_TYPE_SINGLE的永续型效果
RESET_COPY 重置复制的效果 reset_code为copy_id
RESET_CARD 重置卡片的效果 reset_code为效果owner的卡号
●int Card.GetEffectCount(Card c, int code)
返回c受到影响的种类是code的效果的数量
●Effect Card.RegisterFlagEffect(Card c, int code, int reset_flag, int property, int reset_count[, int label, int desc])
......@@ -575,7 +575,8 @@ EFFECT_COUNT_CODE_SINGLE 同一张卡多个效果公共使用次数(不
o_range值影响的对方区域
如果property属性中指定了EFFECT_FLAG_ABSOLUTE_RANGE标志,
那么s_range指玩家1受到影响的区域,o_range指玩家2受到影响的区域
如果这是一个特殊召唤手续(EFFECT_SPSUMMON_PROC)的效果,
如果这是一个召唤(覆盖)/限制召唤(覆盖)/特殊召唤手续
(EFFECT_SUMMON_PROC/EFFECT_LIMIT_SUMMON_PROC/EFFECT_SPSUMMON_PROC等)的效果,
并且property指定了EFFECT_FLAG_SPSUM_PARAM标志,
那么s_range表示特殊召唤到的哪个玩家的场地,
o_range表示可选择的表示形式
......@@ -1018,12 +1019,12 @@ Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TARGET_CARDS)
过滤函数,让玩家player从场上·手卡选择min-max张不等于ex的满足条件f的可解放的卡(非上级召唤用)
●Group Duel.GetTributeGroup(Card c)
返回用于通常召唤c可解放(上级召唤用)的卡片组
●int Duel.GetTributeCount(Card c[, Group mg])
返回[mg中]用于通常召唤c的祭品数量
●int Duel.GetTributeCount(Card c[, Group mg, bool ex=false])
返回[mg中]用于通常召唤c的祭品数量,ex=true则允许对方场上的怪兽(太阳神之翼神龙-球体形)
此数量不一定等于Duel.GetTributeGroup的返回值中的卡片数量
因为某些卡可以作为两个祭品来使用
●Group Duel.SelectTribute(int player, Card c, int min, int max[, Group mg])
让玩家player[从mg中]选择用于通常召唤c的min-max个祭品
●Group Duel.SelectTribute(int player, Card c, int min, int max[, Group mg, bool ex=false])
让玩家player[从mg中]选择用于通常召唤c的min-max个祭品,ex=true则允许对方场上的怪兽(太阳神之翼神龙-球体形)
●int Duel.GetTargetCount(function f, int player, int s, int o, Card ex|nil, ...)
基本同Duel.GetMatchingGroupCount,不同之处在于需要追加判定卡片是否能成为当前正在处理的效果的对象
●bool Duel.IsExistingTarget(function f, int player, int s, int o, int count, Card ex|nil, ...)
......@@ -1105,6 +1106,17 @@ void Duel.SetTargetParam(inte param)
让player以reason原因移除指定位置的min-max张叠放卡,返回值表示是否成功
●void Duel.Hint(int hint_type, int player, int desc)
给玩家player发送hint_type类型的消息提示,提示内容为desc
#hint_type只能为以下类型:
#HINT_SELECTMSG 将提示内容写入缓存,用于选择卡片的提示,例如Duel.SelectMatchingCard等
#HINT_OPSELECTED 向player提示“对方选择了:...”,常用于向对方玩家提示选择发动了什么效果
#HINT_CARD 此时desc应为卡号,手动显示卡片发动的动画,常用于提示不入连锁的处理
#HINT_RACE 此时desc应为种族,向player提示“对方宣言了:...”种族
#HINT_ATTRIB 此时desc应为属性,向player提示“对方宣言了:...”属性
#HINT_CODE 此时desc应为卡号,向player提示“对方宣言了:...”卡片
#HINT_NUMBER 此时desc视为单纯的数字,向player提示“对方选择了:...”数字
#HINT_MESSAGE 弹出一个对话框显示信息
#HINT_EVENT 将提示内容写入缓存,用于时点的提示信息(诱发即时效果的提示)
#HINT_EFFECT 同HINT_CARD
●void Duel.HintSelection(Group g)
手动为g显示被选为对象的动画效果,并记录这些卡被选为对象
●bool Duel.SelectEffectYesNo(int player, Card c)
......
No preview for this file type
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