Commit eb36cd54 authored by Huangnan's avatar Huangnan

fix

parent 16e4cc63
Pipeline #37287 passed with stages
in 32 minutes and 35 seconds
No preview for this file type
expansions/pics/16364061.jpg

82 KB | W: | H:

expansions/pics/16364061.jpg

93.5 KB | W: | H:

expansions/pics/16364061.jpg
expansions/pics/16364061.jpg
expansions/pics/16364061.jpg
expansions/pics/16364061.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -49,7 +49,7 @@ function s.initial_effect(c)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e1:SetCountLimit(1)
e1:SetCondition(s.pencon)
e1:SetCost(s.pencost)
e1:SetTarget(s.pentg)
......@@ -92,7 +92,7 @@ function s.initial_effect(c)
ge4:SetCondition(s.con)
ge4:SetOperation(s.op)
Duel.RegisterEffect(ge4,0)
end
end
end
function s.rtg(e,c)
if not (c~=e:GetHandler() and c:IsType(TYPE_SPELL+TYPE_TRAP)) then return false end
......
......@@ -27,12 +27,9 @@ function cm.rccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,lg,e)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local lg=e:GetHandler():GetLinkedGroup()
if lg:IsContains(tc) then
if tc:IsAttackAbove(0) then
Duel.Hint(HINT_CARD,0,m)
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
local tc=eg:GetFirst()
if tc:IsAttackAbove(0) then
Duel.Hint(HINT_CARD,0,m)
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
......@@ -101,7 +101,7 @@ function s.fusop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xcce1) and c:IsSummonPlayer(tp)
return c:IsFaceup() and c:IsSetCard(0xcce1) and c:IsType(TYPE_FUSION) and c:IsSummonPlayer(tp)
end
function s.tgfilter(c,tp,g,e)
return g:IsContains(c) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,c:GetCode(),e,tp)
......
......@@ -61,15 +61,16 @@ function s.thcheck(c)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.thcheck,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.thcheck,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
if chk==0 then return Duel.IsExistingMatchingCard(s.thcheck,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thcheck,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -20,7 +20,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOEXTRA)
......@@ -52,14 +52,14 @@ function cm.exmatcheck(c,lc,tp)
local related,valid=f(te,lc,nil,c,tp)
if related and not te:GetHandler():IsCode(m) then return false end
end
return true
return true
end
function cm.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,not mg or not mg:IsExists(cm.exmatcheck,1,nil,lc,tp)
end
function cm.splimit(e,c)
return not (c:IsSetCard(0xccb,0xccd) or c:IsRace(RACE_FAIRY))
return false
end
function cm.q(c)
return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xccb,0xccd)
......
......@@ -104,8 +104,8 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(3,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.q,tp,1,0,1,1,nil)
if #g>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
......@@ -121,7 +121,10 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(g,REASON_EFFECT)
end
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_EXTRA)
return eg:IsExists(cm.leavecheck,1,nil,1-tp)
end
function cm.leavecheck(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_EXTRA)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -189,9 +189,9 @@ function s.gspop(e,tp,eg,ep,ev,re,r,rp)
local sg=tg:Filter(s.gstfilter,nil,e)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
--if c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsFaceupEx() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)==0 then return end
if c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsFaceupEx() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
--if Duel.SendtoHand(sg,nil,REASON_EFFECT)==0 then return end
--if c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsFaceupEx() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local fid=c:GetFieldID()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
......
......@@ -3,7 +3,7 @@ function c50225005.initial_effect(c)
aux.EnablePendulumAttribute(c,false)
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,50218101,50218102,50218103,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST+REASON_MATERIAL)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -3,7 +3,7 @@ function c50225010.initial_effect(c)
aux.EnablePendulumAttribute(c,false)
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,50218104,50218105,50218106,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST+REASON_MATERIAL)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,aux.ContactFusionSendToDeck(c))
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......
import os
import sys
from sqlite3 import connect
def read_cdb(file, str_, _id = -1):
conn = connect(file)
try:
cursor = conn.cursor()
if int(_id) > -1:
cursor.execute(f"SELECT datas.*, texts.* FROM datas, texts WHERE datas.id = texts.id and ( datas.id={_id}) ")
else:
cursor.execute("select * from datas,texts where datas.id=texts.id")
rows = cursor.fetchall()
conn.close()
if str_ == "rows":
return rows
except Exception as e:
print(f"读取文件时出错: {str(e)}")
conn.close()
return []
def change_cdb(row, file):
opend = False
try:
conn = connect(file)
opend = True
cursor = conn.cursor()
cursor.execute(f"INSERT OR REPLACE INTO datas VALUES({row[0]}, {row[1]}, {row[2]}, {row[3]}, {row[4]}, {row[5]}, {row[6]}, {row[7]}, {row[8]}, {row[9]}, {row[10]});")
cursor.execute(f"INSERT OR REPLACE INTO texts VALUES({row[11]}, '{row[12]}', '{row[13]}', '{row[14]}', '{row[15]}', '{row[16]}', '{row[17]}', '{row[18]}', '{row[19]}', '{row[20]}', '{row[21]}', '{row[22]}', '{row[23]}', '{row[24]}', '{row[25]}', '{row[26]}', '{row[27]}', '{row[28]}', '{row[29]}');")
conn.commit()
conn.close()
return True
except Exception as e:
print(f"写入卡片ID {row[0]} 时出错: {str(e)}")
if opend:
conn.close()
return False
def merge_all_cdbs(source_folder):
# 检查源文件夹是否存在
if not os.path.exists(source_folder):
print(f"错误: 源文件夹 '{source_folder}' 不存在")
return
# 创建目标文件路径(上级目录的FINALE.cdb)
target_file = os.path.join(os.path.dirname(source_folder), 'FINALE.cdb')
# 检查目标文件是否存在
if not os.path.exists(target_file):
print(f"错误: 目标文件 '{target_file}' 不存在")
return
success_count = 0
error_count = 0
total_cards = 0
processed_cards = 0
# 遍历源文件夹中的所有cdb文件
cdb_files = [f for f in os.listdir(source_folder) if f.endswith('.cdb')]
total_files = len(cdb_files)
print(f"找到 {total_files} 个CDB文件需要处理")
for index, filename in enumerate(cdb_files, 1):
if filename.lower() == 'finale.cdb':
continue
source_file = os.path.join(source_folder, filename)
print(f"\n[{index}/{total_files}] 正在处理: {filename}")
try:
# 读取源文件中的所有数据
rows = read_cdb(source_file, "rows")
if not rows:
print(f"警告: {filename} 中没有找到数据")
continue
# 将每行数据写入目标文件
card_count = 0
success_cards = 0
for row in rows:
processed_cards += 1
if change_cdb(row, target_file):
success_cards += 1
card_count += 1
total_cards += card_count
print(f"成功处理: {filename} (共 {card_count} 张卡,成功 {success_cards} 张)")
success_count += 1
except Exception as e:
print(f"处理 {filename} 时出错: {str(e)}")
error_count += 1
print(f"\n合并完成!")
print(f"成功处理: {success_count}/{total_files} 个文件")
print(f"处理失败: {error_count} 个文件")
print(f"总共处理: {total_cards} 张卡,成功写入: {processed_cards} 张")
if __name__ == '__main__':
# 获取当前脚本所在目录
script_dir = os.path.dirname(os.path.abspath(__file__))
# 默认使用脚本所在目录下的source_folder
source_folder = os.path.join(script_dir, 'source_folder')
# 如果命令行提供了参数,则使用参数作为源文件夹
if len(sys.argv) > 1:
source_folder = sys.argv[1]
print(f"开始合并CDB文件到FINALE.cdb")
print(f"源文件夹: {source_folder}")
merge_all_cdbs(source_folder)
\ No newline at end of file
function Auxiliary.PreloadUds()
EFFECT_FLAG_CANNOT_NEGATE = 0
--require(lib) redirect
function require(str)
dofile(str..".lua")
......
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