Commit 43baa1be authored by 花桃白音's avatar 花桃白音

fix somebug as fileinfo in path&check

parent db7c72af
No preview for this file type
......@@ -126,8 +126,10 @@ namespace cardvisa
}
else
{
checkDirectory();
string dir = Application.StartupPath + "\\checkin";
Director(dir,"excdb");
MessageBox.Show("压缩处理完成");
}
}
private void button3_Click(object sender, EventArgs e)
......@@ -327,17 +329,17 @@ namespace cardvisa
}
}));
}
public void checkDirectory(string path = "checkout")
public void checkDirectory()
{
string dir = Application.StartupPath + "\\";
if (!Directory.Exists(dir)) Directory.CreateDirectory(dir + "checkin");
if (!Directory.Exists(dir)) Directory.CreateDirectory(dir + "checkout");
if (!Directory.Exists(dir+ "checkin")) Directory.CreateDirectory(dir + "checkin");
if (!Directory.Exists(dir+ "checkout")) Directory.CreateDirectory(dir + "checkout");
List<string> dirs = new List<string> { "temp", "pics", "pics\\field", "script", "text", "deck", "NotAllowedFiles" };
string targetfile = Application.StartupPath + "\\" + path + "\\package.cdb";
string targetfile = Application.StartupPath + "\\" + "checkout" + "\\package.cdb";
CommonHandler.CreateCDBFiles(targetfile);
foreach (var item in dirs)
{
string temp = dir + "\\" + item;
string temp = dir + "\\checkout\\" + item;
if (!string.IsNullOrEmpty(temp))
{
if (!Directory.Exists(temp)) Directory.CreateDirectory(temp);
......@@ -735,8 +737,8 @@ namespace cardvisa
}
else
{
if (fsinfo.FullName.Contains(".lua") && mode == "ascdb") flag = "script";
if ((fsinfo.FullName.Contains(".jpg") || fsinfo.FullName.Contains(".png")) && fsinfo.FullName.Contains("thumbnail") != true) flag = "pics";
if (fsinfo.FullName.Contains(".lua") && (mode == "ascdb" || mode=="excdb")) flag = "script";
if (((fsinfo.FullName.Contains(".jpg") || fsinfo.FullName.Contains(".png")) && fsinfo.FullName.Contains("thumbnail") != true)) flag = "pics";
if (fsinfo.FullName.Contains(".txt")) flag = "text";
if (fsinfo.FullName.Contains(".zip")) flag = "zip";
}
......@@ -747,14 +749,16 @@ namespace cardvisa
if (fsinfo.FullName.Contains(".cdb")) flag = "cdb";
if (fsinfo.FullName.Contains(".zip")) flag = "cdb";
}
swtodo(fsinfo, flag, flag == "excdb" ? true : false);
swtodo(fsinfo, flag, mode == "excdb" ? true : false);
}
}
}
public void swtodo(FileSystemInfo fsinfo, string flag,bool allowedfile = false)
{
int icd = 0;
if (int.TryParse(fsinfo.Name.Replace(fsinfo.Extension, "").Replace("c", ""), out icd)) allowedfile = cdbh.cardlist.Contains(icd) ? true : false;
if (int.TryParse(fsinfo.Name.Replace(fsinfo.Extension, "").Replace("c", ""), out icd)) {
allowedfile = (allowedfile || cdbh.cardlist.Contains(icd)) ? true : false;
}
switch (flag)
{
case "text":
......
--D4C
function c111004.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c111004.tg)
e1:SetCost(c111004.cost)
e1:SetOperation(c111004.op)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
c:RegisterEffect(e2)
end
function c111004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()~=tp end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
end
function c111004.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(1-tp,LOCATION_MZONE) end
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
e:SetLabelObject(g)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c111004.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local a=Duel.CreateToken(tp,111005)
Duel.SpecialSummonStep(a,0,tp,1-tp,false,false,POS_FACEUP_ATTACK)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(tc:GetBaseAttack())
a:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(tc:GetBaseDefense())
a:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetValue(tc:GetOriginalCode())
a:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e4:SetValue(tc:GetOriginalAttribute())
a:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CHANGE_RACE)
e5:SetValue(tc:GetOriginalRace())
a:RegisterEffect(e5)
if tc:IsType(TYPE_XYZ) or tc:IsType(TYPE_LINK) then
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_CHANGE_LEVEL)
e6:SetValue(1)
a:RegisterEffect(e6)
else
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_CHANGE_LEVEL)
e6:SetValue(tc:GetOriginalLevel())
a:RegisterEffect(e6)
end
--Destroy
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PHASE+PHASE_END)
e7:SetRange(LOCATION_ONFIELD)
e7:SetOperation(c111004.deop)
a:RegisterEffect(e7)
a:CopyEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,1)
Duel.SpecialSummonComplete()
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_TODECK)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetLabel(a:GetCode())
e2:SetLabelObject(a)
e2:SetTarget(c111004.datg)
e2:SetOperation(c111004.daop)
c:RegisterEffect(e2)
end
function c111004.deop(e,tp,eg,ep,ev,re,r,rp)
local x=e:GetHandler():GetCode()
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,e:GetHandler():GetCode())
Duel.SendtoDeck(g,nil,2,REASON_EFFECT+REASON_RULE)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c111004.xfil(c,x)
return c:IsCode(x)
end
function c111004.datg(e,tp,eg,ep,ev,re,r,rp,chk)
local a=e:GetLabel()
local x=e:GetLabelObject()
if chk==0 then return eg:IsContains(x) and Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,a) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,nil)
end
function c111004.daop(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetLabel()
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_MZONE,nil,a)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT+REASON_RULE)
local atk=g:GetSum(Card.GetAttack)
local def=g:GetSum(Card.GetDefense)
Duel.Damage(1-tp,atk+def,REASON_EFFECT)
end
--
local m=111006
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
c:EnableReviveLimit()
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(cm.dircon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.indcon)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
cm.material_type=TYPE_SYNCHRO
function cm.dircon(e)
return e:GetHandler():GetColumnGroup():Filter(Card.IsType,nil,TYPE_MONSTER)==0
end
function cm.indcon(e)
local c=e:GetHandler()
return c:GetSequence()>4
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e2:SetCondition(cm.damcon)
e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetDescription(aux.Stringid(m,3))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
e3:SetValue(DOUBLE_DAMAGE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
--attack limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(cm.atlimit)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetTarget(cm.eftg)
e5:SetLabelObject(e4)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e5)
end
function cm.damcon(e)
return e:GetHandler():GetBattleTarget()~=nil
end
function cm.atlimit(e,c)
return cm.IsLeft(e:GetHandler(),c)
end
function cm.eftg(e,c)
return cm.IsLeft(c,e:GetHandler())
end
function cm.IsLeft(c,mc)
local tp=mc:GetControler()
local Col=aux.GetColumn(mc,tp)
return cm.IsLeftCard(c,tp,Col)
end
function cm.IsLeftCard(c,tp,Col)
local Col_1=aux.GetColumn(c,tp)
if c:IsType(TYPE_FIELD) then return true end
return Col_1~=Col
end
\ No newline at end of file
--冬日滑雪·红帽
local m=111007
local cm=_G["c"..m]
function cm.initial_effect(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.cfilter2(c,tp)
return (c:IsReason(REASON_EFFECT) or c:IsReason(REASON_BATTLE)) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP) and c:IsType(TYPE_MONSTER)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
if eg:IsContains(e:GetHandler()) then return false end
return eg:IsExists(cm.cfilter2,1,nil,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local hg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if hg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=hg:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
end
\ No newline at end of file
{"ygopath":"D:\\MyCardLibrary\\ygopro\\expansions\\222DIY.cdb","pathcheck":false,"packDIY":true,"regs":null}
\ No newline at end of file
{"ygopath":"E:\\MyCardLibrary\\ygopro\\ygopro222.exe","pathcheck":false,"packDIY":true,"regs":null}
\ No newline at end of file
68b5fe98c2d51ad25704d3c6b1edff9fe5f14c3e
e069cfd0605ddd08cfec87f917ab3cd2e82acc13
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