Commit 48d1197f authored by wind2009's avatar wind2009

Fix G・B・ハンター

parent b16a332b
--遺言の仮面
function c22610082.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c22610082.cost)
e1:SetTarget(c22610082.target)
e1:SetOperation(c22610082.activate)
c:RegisterEffect(e1)
end
function c22610082.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c22610082.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return not Duel.IsPlayerAffectedByEffect(tp,4130270)
end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c22610082.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp,true)
end
end
--G・B・ハンター
function c4130270.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_DECK)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_ONFIELD))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(4130270)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
end
--おとり人形
function c7165085.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c7165085.cost)
e1:SetTarget(c7165085.target)
e1:SetOperation(c7165085.activate)
c:RegisterEffect(e1)
end
function c7165085.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c7165085.filter(c)
return c:IsFacedown() and c:GetSequence()~=5
end
function c7165085.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c7165085.filter(chkc) end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return not Duel.IsPlayerAffectedByEffect(tp,4130270) and Duel.IsExistingTarget(c7165085.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler())
end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
Duel.SelectTarget(tp,c7165085.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
end
function c7165085.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFaceup() then
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp,true)
end
return
end
Duel.ConfirmCards(tp,tc)
if tc:IsType(TYPE_TRAP) then
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
if not te then
Duel.ChangePosition(tc,POS_FACEUP)
if Duel.Destroy(tc,REASON_EFFECT)==0 then
Duel.SendtoGrave(tc,REASON_RULE)
end
else
local condition=te:GetCondition()
local cost=te:GetCost()
local target=te:GetTarget()
local operation=te:GetOperation()
if te:GetCode()==EVENT_FREE_CHAIN and te:IsActivatable(tep)
and (not condition or condition(te,tep,eg,ep,ev,re,r,rp))
and (not cost or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (not target or target(te,tep,eg,ep,ev,re,r,rp,0)) then
Duel.ClearTargetCard()
e:SetProperty(te:GetProperty())
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
Duel.ChangePosition(tc,POS_FACEUP)
if tc:GetType()==TYPE_TRAP then
tc:CancelToGrave(false)
end
tc:CreateEffectRelation(te)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
if target then target(te,tep,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
if operation then operation(te,tep,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
else
if Duel.Destroy(tc,REASON_EFFECT)==0 then
Duel.SendtoGrave(tc,REASON_RULE)
end
end
end
end
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp,true)
end
end
--ジャックポット7
function c81171949.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c81171949.cost)
e1:SetTarget(c81171949.target)
e1:SetOperation(c81171949.activate)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(81171949,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c81171949.rmcon)
e2:SetTarget(c81171949.rmtg)
e2:SetOperation(c81171949.rmop)
c:RegisterEffect(e2)
end
function c81171949.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c81171949.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return not Duel.IsPlayerAffectedByEffect(tp,4130270)
end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c81171949.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp,true)
end
end
function c81171949.rmcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and bit.band(r,REASON_EFFECT)~=0 and bit.band(r,REASON_RETURN)==0
end
function c81171949.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c81171949.filter(c)
return c:IsCode(81171949) and c:GetFlagEffect(81171949)~=0
end
function c81171949.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then
c:RegisterFlagEffect(81171949,RESET_EVENT+RESETS_STANDARD,0,0)
if Duel.IsExistingMatchingCard(c81171949.filter,tp,LOCATION_REMOVED,0,3,nil) then
local WIN_REASON_JACKPOT7=0x19
Duel.Win(tp,WIN_REASON_JACKPOT7)
end
end
end
No preview for this file type
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