Commit 4b650142 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro-scripts into develop

parents 1c8a21cd 90cb264c
......@@ -28,7 +28,7 @@ function c11593137.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,2000)
end
function c11593137.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
local g=eg:Filter(c11593137.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
......
......@@ -20,6 +20,7 @@ function c13556444.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c13556444.spfilter(c,e,tp,tid)
return c:GetTurnID()==tid and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsReason(REASON_DESTROY)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c13556444.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -37,6 +37,7 @@ function c21521304.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
......
......@@ -71,7 +71,7 @@ end
function s.efilter(e,re)
if Duel.GetTurnPlayer()==e:GetHandlerPlayer() and e:GetHandlerPlayer()~=re:GetOwnerPlayer()
and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) then
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION) or 0
return LOCATION_ONFIELD&loc~=0
end
return false
......
......@@ -18,7 +18,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
......
......@@ -22,7 +22,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+o)
e2:SetCountLimit(1,id+o)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
......
......@@ -63,6 +63,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local fg=g:Filter(Card.IsRelateToChain,nil)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or not sc:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
if fg:GetCount()~=2 then return end
if Duel.SpecialSummon(fg,0,tp,tp,false,false,POS_FACEUP)~=0 then
for tc in aux.Next(fg) do
......
......@@ -27,7 +27,7 @@ function c29223325.desfilter(c,tp,ft)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and Duel.GetSZoneCount(tp,c)>ft
end
function c29223325.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c29223325.desfilter(chkc) and chkc~=e:GetHandler() end
if chkc then return chkc:IsOnField() and c29223325.desfilter(chkc,tp,0) and chkc~=e:GetHandler() end
if chk==0 then
if not Duel.IsExistingMatchingCard(c29223325.filter,tp,LOCATION_DECK,0,1,nil) then return false end
local ft=0
......
......@@ -20,7 +20,7 @@ function c30922149.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(p) then return end
local ct=Duel.GetFieldGroupCount(p,LOCATION_DECK,0)
local ac=0
if ct==0 then ac=1 end
if ct==1 then ac=1 end
if ct>1 then
Duel.Hint(HINT_SELECTMSG,p,aux.Stringid(30922149,0))
if ct==2 then ac=Duel.AnnounceNumber(p,1,2)
......
......@@ -67,18 +67,18 @@ end
function s.filter(c,e)
return c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function s.thfilters(c)
return c:IsFaceup() and c:IsAllTypes(TYPE_CONTINUOUS|TYPE_TRAP) and c:IsSetCard(0x1c1)
function s.thfilters(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsAllTypes(TYPE_CONTINUOUS|TYPE_TRAP) and c:IsSetCard(0x1c1)
end
function s.sgselect(g)
return g:IsExists(s.thfilters,1,nil)
function s.sgselect(g,tp)
return g:IsExists(s.thfilters,1,nil,tp)
end
function s.thtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(s.sgselect,2,2) end
if chk==0 then return g:CheckSubGroup(s.sgselect,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:SelectSubGroup(tp,s.sgselect,false,2,2)
local sg=g:SelectSubGroup(tp,s.sgselect,false,2,2,tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,#sg,0,0)
end
......
......@@ -197,4 +197,4 @@ function c33900648.costchk(e,te_or_c,tp)
end
function c33900648.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500)
end
\ No newline at end of file
end
......@@ -58,7 +58,7 @@ function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
......
......@@ -27,6 +27,7 @@ function c35618217.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_REMOVE)
e3:SetCondition(aux.bpcon)
e3:SetOperation(c35618217.actop)
c:RegisterEffect(e3)
end
......
......@@ -23,6 +23,7 @@ function c39913299.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c39913299.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
......
......@@ -54,7 +54,7 @@ function c4810828.discost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function c4810828.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
......
......@@ -85,4 +85,4 @@ function c50140163.eqop(e,tp,eg,ep,ev,re,r,rp)
end
function c50140163.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
\ No newline at end of file
end
......@@ -23,6 +23,7 @@ function s.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(s.drcon)
e2:SetOperation(s.regop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(s.regcon)
......
......@@ -22,7 +22,6 @@ function s.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(s.repcon)
e3:SetOperation(s.repop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
......
......@@ -95,10 +95,12 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
else
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local exg=Duel.GetMatchingGroup(s.exgfilter,tp,LOCATION_EXTRA,0,nil,mg,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=exg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local msg=mg:SelectSubGroup(tp,s.exgselect,false,1,#mg,sc,c)
Duel.XyzSummon(tp,sc,msg,#msg,#msg)
if exg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=exg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local msg=mg:SelectSubGroup(tp,s.exgselect,false,1,#mg,sc,c)
Duel.XyzSummon(tp,sc,msg,#msg,#msg)
end
end
end
......@@ -33,7 +33,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
function s.mvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase() and e:GetHandler():GetFlagEffect(id)==0
return Duel.IsMainPhase() and Duel.GetTurnCount()~=e:GetHandler():GetFlagEffectLabel(id)
end
function s.mvfilter(c,tp)
local r=LOCATION_REASON_TOFIELD
......@@ -68,7 +68,7 @@ function s.mvop(e,tp,eg,ep,ev,re,r,rp)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2,Duel.GetTurnCount()+1)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -104,4 +104,4 @@ function c87257460.spop(e,tp,eg,ep,ev,re,r,rp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
\ No newline at end of file
end
......@@ -59,7 +59,7 @@ function s.checkop1(e,tp,eg,ep,ev,re,r,rp)
end
function s.checkop2(e,tp,eg,ep,ev,re,r,rp)
if re and re:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER) then
local ct=Duel.GetFlagEffect(re:GetHandlerPlayer(),id)
local ct=Duel.GetFlagEffect(re:GetHandlerPlayer(),id) or 0
Duel.ResetFlagEffect(re:GetHandlerPlayer(),id)
if ct>1 then
local ra=0
......
......@@ -62,6 +62,7 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_GRAVE,nil)
g1:Merge(g2)
if g1:GetCount()==0 then return end
aux.GCheckAdditional=s.gcheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g1:SelectSubGroup(tp,aux.TRUE,false,1,2)
......
......@@ -81,6 +81,7 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local exg=Duel.GetMatchingGroup(s.exgfilter,tp,LOCATION_EXTRA,0,nil,mg,c)
if #exg==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=exg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
......
......@@ -10,7 +10,6 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--equip or draw
local e2=Effect.CreateEffect(c)
......@@ -25,9 +24,6 @@ function s.initial_effect(c)
e2:SetOperation(s.tsop)
c:RegisterEffect(e2)
end
function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function s.eqilter(c)
return c:GetOriginalType()&TYPE_MONSTER~=0
end
......
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