Commit fc3ab2da authored by mercury233's avatar mercury233

fix

parent 60595e9c
......@@ -27,7 +27,8 @@ function c100266031.initial_effect(c)
c:RegisterEffect(e2)
end
function c100266031.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(4) and not c:IsCode(100266031)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100266031.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -36,6 +37,7 @@ function c100266031.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c100266031.atkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c100266031.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc then
......
......@@ -18,11 +18,11 @@ function c101012000.initial_effect(c)
end
function c101012000.spfilter2(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsCode(101012000)
and (c:GetPreviousAttributeOnField() & ATTRIBUTE_WATER) > 0
end
function c101012000.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101012000.spfilter2,1,nil,tp)
return eg:IsExists(c101012000.spfilter2,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c101012000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -32,13 +32,12 @@ function c101012000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101012000.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(Duel.GetMatchingGroupCount(Card.IsAttribute,tp,LOCATION_GRAVE,0,nil,ATTRIBUTE_WATER) * 100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -74,15 +74,16 @@ function c101012083.aclimit1(e,re,tp)
end
function c101012083.condition2(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and Duel.GetTurnPlayer()==e:GetControler()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function c101012083.aclimit2(e,re,tp)
return re:IsActiveType(TYPE_SPELL) or re:IsActiveType(TYPE_TRAP)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c101012083.condition3(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)) and Duel.GetTurnPlayer()==e:GetControler()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
and Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function c101012083.aclimit3(e,re,tp)
return re:GetHandler():IsLocation(LOCATION_GRAVE)
return re:GetActivateLocation()==LOCATION_GRAVE
end
......@@ -18,15 +18,16 @@ function c101012084.spfilter(c,e,tp,lv)
end
function c101012084.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4)
and Duel.IsExistingMatchingCard(c101012084.spfilter,tp,LOCATION_HAND,0,1,nil,c:GetLevel(),e,tp)
and (not c:IsForbidden())
and Duel.IsExistingMatchingCard(c101012084.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,c:GetLevel())
and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c101012084.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp)
and chkc:IsType(TYPE_MONSTER) and chkc:IsLevelBelow(4) end
local b=e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (Duel.GetLocationCount(tp,LOCATION_SZONE)>1
or e:GetHandler():IsLocation(LOCATION_SZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and (b and Duel.GetLocationCount(tp,LOCATION_SZONE)>1
or not b and Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and Duel.IsExistingTarget(c101012084.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c101012084.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......@@ -36,12 +37,13 @@ end
function c101012084.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local lv=tc:GetLevel()
local atk=tc:GetAttack()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c101012084.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,lv):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
and (not tc:IsForbidden())
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0
and not tc:IsForbidden() and c:CheckUniqueOnField(tp)
and Duel.Equip(tp,tc,sc) then
if atk>0 then
local e1=Effect.CreateEffect(tc)
......
......@@ -26,7 +26,8 @@ function c101012086.initial_effect(c)
c:RegisterEffect(e2)
end
function c101012086.cfilter(c,tp)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x13f) and Duel.GetMZoneCount(tp,c)>0
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x13f) and c:IsType(TYPE_MONSTER)
and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and Duel.GetMZoneCount(tp,c)>0
end
function c101012086.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012086.cfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,e:GetHandler(),tp) end
......
--Plunder Patrollship Lys
--
--Script by JoyJ
function c101012087.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsSetCard,0x13f),2,true)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101012087,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101012087)
e1:SetCondition(c101012087.spcon)
e1:SetTarget(c101012087.sptg)
e1:SetOperation(c101012087.spop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27346636,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101012087+100)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c101012087.discon)
e2:SetCost(c101012087.discost)
e2:SetTarget(c101012087.distg)
e2:SetOperation(c101012087.disop)
c:RegisterEffect(e2)
end
function c101012087.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c101012087.spfilter(c,e,tp)
return c:IsSetCard(0x13f) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012087.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012087.spfilter,tp,LOCATION_SZONE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE+LOCATION_HAND)
end
function c101012087.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,c101012087.spfilter,tp,LOCATION_SZONE+LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
function c101012087.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c101012087.discfilter(c)
return c:IsDiscardable() and c:IsSetCard(0x13f)
end
function c101012087.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012087.discfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101012087.discfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c101012087.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101012087.thfilter(c)
return c:IsSetCard(0x13f) and c:IsAbleToHand()
end
function c101012087.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re)
and Duel.Destroy(eg,REASON_EFFECT)>0
and c:GetEquipGroup()
and c:GetEquipGroup():IsExists(Card.IsSetCard,1,nil,0x13f)
and Duel.IsExistingMatchingCard(c101012087.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(101012087,2)) then
local g=Duel.SelectMatchingCard(tp,c101012087.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--Plunder Patrollship Lys
--
--Script by JoyJ
function c101012087.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsSetCard,0x13f),2,true)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101012087,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101012087)
e1:SetCondition(c101012087.spcon)
e1:SetTarget(c101012087.sptg)
e1:SetOperation(c101012087.spop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27346636,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101012087+100)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c101012087.discon)
e2:SetCost(c101012087.discost)
e2:SetTarget(c101012087.distg)
e2:SetOperation(c101012087.disop)
c:RegisterEffect(e2)
end
function c101012087.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c101012087.spfilter(c,e,tp)
return c:IsSetCard(0x13f) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101012087.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101012087.spfilter,tp,LOCATION_SZONE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE+LOCATION_HAND)
end
function c101012087.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.SelectMatchingCard(tp,c101012087.spfilter,tp,LOCATION_SZONE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101012087.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c101012087.discfilter(c)
return c:IsDiscardable() and c:IsSetCard(0x13f)
end
function c101012087.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012087.discfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101012087.discfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c101012087.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
end
function c101012087.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x13f)
end
function c101012087.thfilter(c)
return c:IsSetCard(0x13f) and c:IsAbleToHand()
end
function c101012087.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re)
and Duel.Destroy(eg,REASON_EFFECT)>0 and c:IsRelateToEffect(e)
and c:GetEquipGroup()
and c:GetEquipGroup():IsExists(c101012087.eqfilter,1,nil)
and Duel.IsExistingMatchingCard(c101012087.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(101012087,2)) then
local g=Duel.SelectMatchingCard(tp,c101012087.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -82,15 +82,16 @@ function c101012088.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure()
end
end
function c101012088.eqfilter(c)
return ((c:IsType(TYPE_MONSTER) and c:IsSetCard(0x13f)) or c:IsCode(101012089)) and (not c:IsForbidden())
function c101012088.eqfilter(c,ec,tp)
return ((c:IsType(TYPE_MONSTER) and c:IsSetCard(0x13f)) or c:IsCode(101012089)) and not c:IsForbidden()
and c:CheckEquipTarget(ec) and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end
function c101012088.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x13f)
function c101012088.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x13f) and Duel.IsExistingMatchingCard(c101012088.eqfilter,tp,LOCATION_DECK,0,1,nil,c,tp)
end
function c101012088.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101012088.cfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101012088.cfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return Duel.IsExistingTarget(c101012088.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101012088.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
......@@ -102,8 +103,9 @@ function c101012088.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c101012088.eqfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c101012088.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc,tp)
local sc=g:GetFirst()
if not sc then return end
if not Duel.Equip(tp,sc,tc) then return end
--equip limit
local e1=Effect.CreateEffect(c)
......
......@@ -70,7 +70,10 @@ function c101012089.spfilter(c,e,tp)
return c:IsSetCard(0x13f)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil,c:GetAttribute())
and Duel.IsExistingMatchingCard(c101012089.mfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil,c:GetAttribute())
end
function c101012089.mfilter(c,attr)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAttribute(attr)
end
function c101012089.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012089.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
......@@ -81,13 +84,13 @@ function c101012089.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101012089.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local ec=e:GetLabelObject()
if not ec:IsRelateToEffect(e) then return end
Duel.BreakEffect()
Duel.Equip(tp,ec,tc)
if not Duel.Equip(tp,ec,tc,false) then return end
--Atk up
local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -48,11 +48,12 @@ function c101012090.initial_effect(c)
end
function c101012090.drcon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst()
if not e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED) then return end
return rc:IsRelateToBattle() and rc:IsStatus(STATUS_OPPO_BATTLE)
and rc:IsFaceup() and rc:IsSetCard(0x13f) and rc:IsControler(tp)
end
function c101012090.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......@@ -107,4 +108,5 @@ function c101012090.tgop2(e,tp,eg,ep,ev,re,r,rp)
if tc then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
Duel.ShuffleExtra(1-tp)
end
......@@ -16,7 +16,6 @@ function c101012091.initial_effect(c)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101012091,1))
e2:SetCountLimit(1,101012091+EFFECT_COUNT_CODE_DUEL)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
......@@ -49,56 +48,62 @@ function c101012091.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local i=Duel.GetMatchingGroupCount(c101012091.drfilter,p,LOCATION_ONFIELD,0,nil)
if Duel.Draw(p,i+1,REASON_EFFECT)==0 then return end
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,i,i,nil)
if i>0 then
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,i,i,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
end
function c101012091.cfilter(c,tp)
return c:GetSummonLocation()==LOCATION_EXTRA and c:GetPreviousControler()==tp
and c:GetControler()==tp and c:IsSetCard(0x13f) and c:IsFaceup()
function c101012091.exfilter(c,tp)
return c:GetSummonLocation()==LOCATION_EXTRA and c:GetSummonPlayer()==tp and c:IsSetCard(0x13f) and c:IsFaceup()
end
function c101012091.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101012091.cfilter,1,nil,tp)
return eg:IsExists(c101012091.exfilter,1,nil,tp)
end
function c101012091.eqfilter(c,g)
return g:IsContains(c)
end
function c101012091.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
local c=e:GetHandler()
local g=eg:Filter(c101012091.exfilter,nil,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsForbidden()
and c:CheckUniqueOnField(tp,LOCATION_SZONE)
and Duel.IsExistingMatchingCard(c101012091.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,g) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c101012091.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
local g=eg:Filter(c101012091.cfilter,nil,tp)
local tc
if #g==1 then
tc=g:GetFirst()
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
tc=g:Select(tp,1,1,nil):GetFirst()
end
if tc and Duel.Equip(tp,c,tc) then
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c101012091.eqlimit)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(500)
c:RegisterEffect(e2)
if c:IsForbidden() or not c:CheckUniqueOnField(tp,LOCATION_SZONE) then return end
local g=eg:Filter(c101012091.exfilter,nil,tp)
local sg=Duel.SelectMatchingCard(tp,c101012091.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,g)
local tc=sg:GetFirst()
if tc then
Duel.HintSelection(sg)
if Duel.Equip(tp,c,tc) then
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(tc)
e1:SetValue(c101012091.eqlimit)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(500)
c:RegisterEffect(e2)
end
end
end
function c101012091.eqlimit(e,c)
return e:GetOwner()==c
return c==e:GetLabelObject()
end
......@@ -58,7 +58,7 @@ function c101101012.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_REMOVED+LOCATION_GRAVE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
if Duel.GetCurrentPhase()==PHASE_STANDBY and Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
......
......@@ -38,7 +38,6 @@ function c101101015.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101101015.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c101101015.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,3,e:GetHandler())
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c101101015.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -59,8 +58,9 @@ function c101101015.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101101015.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SelectTarget(tp,c101101015.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c101101015.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -40,7 +40,7 @@ function c101101018.cfilter(c,sp)
return c:GetSummonPlayer()==sp
end
function c101101018.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101101018.cfilter,1,nil,1-tp) and not eg:IsContains(e:GetHandler())
return eg:IsExists(c101101018.cfilter,1,nil,1-tp)
end
function c101101018.thcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
......@@ -55,7 +55,9 @@ function c101101018.thfilter(c)
end
function c101101018.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) and Duel.IsExistingMatchingCard(c101101018.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(101101018,2)) then
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND)
and Duel.IsExistingMatchingCard(c101101018.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(101101018,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101101018.thfilter,tp,LOCATION_DECK,0,1,1,nil)
......
......@@ -51,7 +51,7 @@ function c101101034.spfilter(c,e,tp)
return c:IsSetCard(0x250) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101101034.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101101034.confil,1,nil,tp)
return eg:IsExists(c101101034.confil,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c101101034.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -8,9 +8,11 @@ function c101101035.initial_effect(c)
e1:SetCategory(CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(aux.dscon)
e1:SetCost(c101101035.defcost)
e1:SetOperation(c101101035.defop)
c:RegisterEffect(e1)
......@@ -20,8 +22,8 @@ function c101101035.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCountLimit(1)
e2:SetCondition(c101101035.atkcon)
e2:SetCost(c101101035.atkcost)
e2:SetOperation(c101101035.atkop)
c:RegisterEffect(e2)
end
......@@ -51,6 +53,11 @@ function c101101035.atkcon(e,tp,eg,ep,ev,re,r,rp)
and ac:IsPosition(POS_ATTACK)
and bc:IsPosition(POS_ATTACK)
end
function c101101035.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(101101035)==0 end
c:RegisterFlagEffect(101101035,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c101101035.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
......
......@@ -30,9 +30,7 @@ function c101101058.filter(c)
end
function c101101058.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101101058.filter(chkc) end
if chk==0 then
return Duel.IsExistingTarget(c101101058.filter,tp,LOCATION_GRAVE,0,1,nil)
end
if chk==0 then return Duel.IsExistingTarget(c101101058.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101101058.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,0,0)
......@@ -54,10 +52,8 @@ function c101101058.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101101058.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101101058.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101101058.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101101058.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -6,16 +6,11 @@ function c101101067.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DICE+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,101101067)
e1:SetCountLimit(1,101101067+EFFECT_COUNT_CODE_OATH)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101101067.target)
e1:SetOperation(c101101067.activate)
c:RegisterEffect(e1)
--remain field
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e2)
end
c101101067.toss_dice=true
function c101101067.filter(c)
......@@ -29,18 +24,21 @@ function c101101067.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dice1=Duel.TossDice(tp,1)
if (dice1==1 or dice1==6) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c101101067.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
return
elseif c:IsRelateToEffect(e) then
local dice2=Duel.TossDice(tp,1)
if (dice2==1 or dice2==6) then
c:CancelToGrave()
Duel.SendtoHand(c,nil,REASON_EFFECT)
elseif dice2>=2 and dice2<=5 then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
end
end
c:CancelToGrave()
local dice2=Duel.TossDice(tp,1)
if (dice2==1 or dice2==6) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
return
end
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
end
......@@ -13,7 +13,7 @@ function c101101078.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,101101078)
e1:SetCost(c101101078.cost)
e1:SetTarget(c101101078.target)
......
......@@ -11,8 +11,9 @@ function c101101080.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101101080,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101101080)
e2:SetCondition(c101101080.chcon)
......
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