Commit fc323e65 authored by POLYMER's avatar POLYMER

fix

parent 83b7e0af
--投身革命的战士
local m=11451445
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,99518961)
--spsummon procedure
......@@ -48,7 +47,16 @@ function cm.effectfilter(e,ct)
return aux.IsCodeListed(te:GetHandler(),99518961)
end
function cm.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
if not (c:IsLevelBelow(3) and c:IsType(TYPE_NORMAL)) then return false end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_WARRIOR)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
c:RegisterEffect(e1)
local res=c:IsCanBeSpecialSummoned(e,0,tp,false,false)
e1:Reset()
return res
end
function cm.spcon(e,c)
if c==nil then return true end
......@@ -64,13 +72,12 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_WARRIOR)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
tc:RegisterEffect(e1)
end
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
......@@ -90,29 +90,47 @@ function cm.adcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,tp)
end
function cm.adtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and (Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 or Duel.IsExistingMatchingCard(cm.spfilter2,tp,0,LOCATION_GRAVE,1,nil,e,1-tp)) and Duel.IsPlayerCanSpecialSummon(1-tp) end
local att=ATTRIBUTE_ALL
if Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)==0 then
att=0
for i=1,7 do
if Duel.IsExistingMatchingCard(cm.spfilter2,tp,0,LOCATION_GRAVE,1,nil,e,1-tp,1<<i) then att=att|(1<<i) end
end
end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and att>0 and Duel.IsPlayerCanSpecialSummon(1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local aat=Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL)
local aat=Duel.AnnounceAttribute(tp,1,att)
e:SetLabel(aat)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_HAND)
end
function cm.spfilter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function cm.spfilter2(c,e,tp,att)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(att)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
c:RegisterEffect(e1)
--Duel.AdjustAll()
local res=c:IsCanBeSpecialSummoned(e,0,tp,false,false)
e1:Reset()
return res
end
function cm.adop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local att=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(cm.spfilter2,tp,0,LOCATION_HAND,nil,e,1-tp)
if #g==0 then g=Duel.GetMatchingGroup(cm.spfilter2,tp,0,LOCATION_GRAVE,nil,e,1-tp) end
local g=Duel.GetMatchingGroup(cm.spfilter2,tp,0,LOCATION_HAND,nil,e,1-tp,att)
if #g==0 then g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter2),tp,0,LOCATION_GRAVE,nil,e,1-tp,att) end
local sg=g:Select(1-tp,1,1,nil)
if #sg>0 and Duel.SpecialSummon(sg,0,1-tp,1-tp,false,false,POS_FACEUP)>0 then
if #sg>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(att)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
sg:GetFirst():RegisterEffect(e1)
--Duel.AdjustAll()
Duel.SpecialSummon(sg,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
function cm.filter2(c,re,tp,r)
......
......@@ -21,7 +21,6 @@ function cm.initial_effect(c)
e0:SetDescription(1165)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PHASE+PHASE_BATTLE)
e0:SetCountLimit(1)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_GRAVE)
e0:SetCondition(cm.xyzcon)
......@@ -162,9 +161,10 @@ function cm.xyzop2(e,tp,chk)
if chk==0 then return true end
end
function cm.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSpecialSummonable(SUMMON_TYPE_XYZ)
return e:GetHandler():IsSpecialSummonable(SUMMON_TYPE_XYZ) and e:GetHandler():GetFlagEffect(m)==0
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SpecialSummonRule(tp,e:GetHandler(),SUMMON_TYPE_XYZ)
end
......
......@@ -56,18 +56,22 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_END)
e4:SetOperation(s.limop)
Duel.RegisterEffect(e4,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(s.limop)
Duel.RegisterEffect(e2,tp)
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,id)
e:Reset()
end
function s.limop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
e:Reset()
end
......@@ -62,7 +62,7 @@ function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
if not s.globle_check[tp] then
s.globle_check[tp]=true
--setcard mentioned
local g=Duel.GetMatchingGroup(aux.NOT(Card.IsCode),0,0xff,0,nil,id)
local g=Duel.GetMatchingGroup(aux.NOT(Card.IsCode),tp,0xff,0,nil,id)
cregister=Card.RegisterEffect
csetcard=Card.IsSetCard
disexistingtarget=Duel.IsExistingTarget
......
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