Commit 3cc4a48c authored by POLYMER's avatar POLYMER

fix

parent a9e56d3d
......@@ -158,8 +158,10 @@ function cm.initial_effect(c)
end
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
if Duel.GetRandomNumber then Debug.Message("You can use Duel.GetRandomNumber ."..pcall(Duel.GetRandomNumber,1,20) or "uncorrect form")
else Debug.Message("You cannot use Duel.GetRandomNumber .") end
if Duel.GetRandomNumber then Debug.Message("You can use Duel.GetRandomNumber."..Duel.GetRandomNumber(1,20))
else Debug.Message("You cannot use Duel.GetRandomNumber.") end
if debug and debug.getregistry then Debug.Message("You can use debug.getregistry.")
else Debug.Message("You cannot use debug.getregistry.") end
function cm.filter(g,f,nc,...)
if aux.GetValueType(f)=="function" then return g:Filter(f,nc,...) end
local ng=g:Clone()
......
......@@ -31,7 +31,6 @@ function c22022230.initial_effect(c)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(c22022230.reptg)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(22022230,ACTIVITY_CHAIN,c22022230.chainfilter)
end
function c22022230.condition1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,0xff1)
......
......@@ -40,9 +40,22 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
ec:CancelToGrave()
if Duel.SendtoDeck(ec,nil,2,REASON_EFFECT) then
local rc=re:GetCode()
if Duel.IsExistingMatchingCard(cm.afil,tp,0,LOCATION_DECK,1,nil,rc) then
local g=Duel.GetMatchingGroup(cm.afil,tp,0,LOCATION_DECK,nil,rc):RandomSelect(tp,1,1,nil):GetFirst()
local g4=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_DECK,nil,rc)
if Duel.IsExistingMatchingCard(cm.afil,tp,0,LOCATION_DECK,1,g4) then
local g=Duel.GetMatchingGroup(cm.afil,tp,0,LOCATION_DECK,g4):RandomSelect(tp,1,1,nil):GetFirst()
if g:IsType(TYPE_FIELD) then
local te=g:GetActivateEffect()
Duel.MoveToField(g,1-tp,1-tp,LOCATION_FZONE,POS_FACEUP,true)
Duel.RaiseEvent(g,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
local te=g:GetActivateEffect()
Duel.MoveToField(g,1-tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
end
te:UseCountLimit(1-tp,1,true)
cm.ActivateCard(g,1-tp,e)
if not (g:IsType(TYPE_CONTINUOUS) or g:IsType(TYPE_FIELD) or g:IsType(TYPE_EQUIP)) then
Duel.SendtoGrave(g,REASON_RULE)
end
else
Duel.Draw(1-tp,1,REASON_EFFECT)
end
......
......@@ -93,10 +93,16 @@ function s.aeop(e,tp,eg,ep,ev,re,r,rp)
cm.initial_effect=addinit
local g=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tp,0xff,0xff,nil,ac)
local reg=Card.RegisterEffect
local Isscd={false,false}
for tc in aux.Next(g) do
local Type=Duel.ReadCard(tc,CARDDATA_TYPE)
if Type&TYPE_NORMAL~=0 then Type=Type-TYPE_NORMAL end
tc:SetCardData(CARDDATA_TYPE,Type|TYPE_EFFECT)
local Type=Duel.ReadCard(tc,CARDDATA_TYPE)
local Type2=Type|TYPE_EFFECT
if Type2&TYPE_NORMAL~=0 then Type2=Type2-TYPE_NORMAL end
if Type2~=Type then
tc:SetCardData(CARDDATA_TYPE,Type|TYPE_EFFECT)
--There are some issues with the SetCardData function
if tc:IsLocation(LOCATION_EXTRA) then Isscd[tc:GetControler()]=true end
end
local mt=getmetatable(tc)
local ini=s.initial_effect
s.initial_effect=function() end
......@@ -105,6 +111,10 @@ function s.aeop(e,tp,eg,ep,ev,re,r,rp)
mt.initial_effect=addinit
tc.initial_effect(tc)
end
--If you don't confirm them, there may be bugs
for i=0,1 do
if Isscd[i]==true then Duel.ConfirmCards(i,Duel.GetFieldGroup(i,LOCATION_EXTRA,0)) end
end
else
Debug.Message("需要koishi函数!")
end
......
......@@ -84,15 +84,17 @@ end
function s.addop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=math.max(1,c:GetFlagEffect(id))
Duel.Destroy(c,REASON_REPLACE)
if Duel.Destroy(c,REASON_REPLACE)>0 then
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for i=1,ct do
for tc in aux.Next(g) do
if tc:GetFlagEffect(id)==0 then
tc:CopyEffect(id,RESET_EVENT+RESETS_STANDARD)
for i=1,ct do
for tc in aux.Next(g) do
if tc:GetFlagEffect(id)==0 then
tc:CopyEffect(id,RESET_EVENT+RESETS_STANDARD)
end
if tc:GetFlagEffect(id)<256 then
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
--
end
end
end
\ No newline at end of file
......@@ -63,7 +63,8 @@ function s.initial_effect(c)
s.global_check=true
_SetLP=Duel.SetLP
function Duel.SetLP(p,lp)
if Duel.GetFieldGroup(p,LOCATION_FZONE,0):GetFirst():GetOriginalCode()==id then
local fc=Duel.GetFieldGroup(p,LOCATION_FZONE,0):GetFirst()
if fc and fc:GetOriginalCode()==id then
Duel.Hint(HINT_CARD,0,id)
return
end
......@@ -71,12 +72,14 @@ function s.initial_effect(c)
end
_CheckLPCost=Duel.CheckLPCost
function Duel.CheckLPCost(p,cost)
if Duel.GetFieldGroup(p,LOCATION_FZONE,0):GetFirst():GetOriginalCode()==id then return true end
local fc=Duel.GetFieldGroup(p,LOCATION_FZONE,0):GetFirst()
if fc and fc:GetOriginalCode()==id then return true end
return _CheckLPCost(p,cost)
end
_PayLPCost=Duel.PayLPCost
function Duel.PayLPCost(p,cost)
if Duel.GetFieldGroup(p,LOCATION_FZONE,0):GetFirst():GetOriginalCode()==id then
local fc=Duel.GetFieldGroup(p,LOCATION_FZONE,0):GetFirst()
if fc and fc:GetOriginalCode()==id then
Duel.Hint(HINT_CARD,0,id)
return
end
......@@ -128,7 +131,7 @@ function s.actop(e,tp,eg,ep,ev,re,r,rp)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetRange(LOCATION_FZONE)
e4:SetValue(s.efilter)
c:RegisterEffect(e4,true)
--cannot
......
......@@ -26,7 +26,7 @@ function s.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCountLimit(1,id+o+1)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
......
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