Commit 614b7bd8 authored by mercury233's avatar mercury233

fix

parent 3934fb95
......@@ -56,13 +56,16 @@ function c100278027.eqop(e,tp,eg,ep,ev,re,r,rp)
mt.zw_equip_monster(tc,tp,c)
end
end
function c100278027.discon(e)
function c100278027.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x107e) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function c100278027.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local eg=c:GetEquipGroup()
return #eg>0 and eg:IsExists(Card.IsSetCard,1,nil,0x107e)
local g=c:GetEquipGroup()
return #g>0 and g:IsExists(c100278027.cfilter,1,nil)
end
function c100278027.disfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT) and c:GetAttack()>0
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c100278027.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c100278027.disfilter(chkc) end
......@@ -88,6 +91,7 @@ function c100278027.disop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.AdjustInstantly()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -42,7 +42,8 @@ end
function c100425034.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then
local g=Group.FromCards(c,tc)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -76,6 +77,7 @@ function c100425034.efop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
......
......@@ -7,7 +7,6 @@ function c101105004.initial_effect(c)
e1:SetDescription(aux.Stringid(101105004,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105004)
......@@ -22,7 +21,7 @@ function c101105004.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105004)
e2:SetCost(c101105004.spcost)
......@@ -43,7 +42,7 @@ function c101105004.discost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c101105004.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsDisabled() end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c101105004.disop(e,tp,eg,ep,ev,re,r,rp)
......
--いくらの軍貫
--Roe Suship
--scripted by XyleN5967
function c101105012.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105012)
e1:SetCountLimit(1,101105012+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101105012.sprcon)
c:RegisterEffect(e1)
--to hand or special summon
......@@ -32,25 +32,32 @@ function c101105012.sprcon(e,c)
and Duel.IsExistingMatchingCard(c101105012.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c101105012.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
local g=Duel.GetDecktopGroup(tp,3)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3
and (g:IsExists(Card.IsAbleToHand,1,nil) or ft>0
and Duel.IsPlayerCanSpecialSummon(tp) and not Duel.IsPlayerAffectedByEffect(tp,63060238) and not Duel.IsPlayerAffectedByEffect(tp,97148796)) end
end
function c101105012.filter(c,e,tp)
return c:IsCode(101105011) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
function c101105012.filter(c,e,tp,ft)
return c:IsCode(101105011) and (c:IsAbleToHand() or ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c101105012.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,3)
if #g<3 then return end
Duel.ConfirmDecktop(tp,3)
local tg=g:Filter(c101105012.filter,nil,e,tp)
if #tg>0 and Duel.SelectYesNo(tp,aux.Stringid(101105012,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=tg:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
if #g>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=g:Filter(c101105012.filter,nil,e,tp,ft)
if #tg>0 and Duel.SelectYesNo(tp,aux.Stringid(101105012,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=tg:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc:IsAbleToHand() and (ft<=0 or not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
Duel.ShuffleDeck(tp)
end
end
......@@ -33,7 +33,7 @@ function c101105013.spfilter(c,e,tp)
return c:IsSetCard(0x70) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(101105013)
end
function c101105013.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c101105013.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......@@ -63,4 +63,4 @@ function c101105013.thop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
\ No newline at end of file
end
......@@ -14,6 +14,7 @@ function c101105014.initial_effect(c)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105014,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105014)
......@@ -64,8 +65,7 @@ function c101105014.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101105014.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local fid=c:GetFieldID()
c:RegisterFlagEffect(101105014,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -89,4 +89,4 @@ function c101105014.thcon(e,tp,eg,ep,ev,re,r,rp)
end
function c101105014.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -14,12 +14,11 @@ function c101105015.initial_effect(c)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105015,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCountLimit(1,id)
e2:SetCountLimit(1,101105015)
e2:SetTarget(c101105015.atktg)
e2:SetOperation(c101105015.atkop)
c:RegisterEffect(e2)
......@@ -51,11 +50,16 @@ end
function c101105015.atkfilter(c)
return c:IsFaceup() and aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE)
end
function c101105015.cfilter(c,atk)
return c101105015.atkfilter(c) and not (c:IsAttack(atk) and c:IsDefense(atk))
end
function c101105015.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101105015.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105015.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101105015.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.GetMatchingGroup(c101105015.atkfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then atk=g:GetSum(Card.GetBaseAttack) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101105015.cfilter(chkc,atk) end
if chk==0 then return g:GetCount()>0 and Duel.IsExistingTarget(c101105015.cfilter,tp,LOCATION_MZONE,0,1,nil,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101105015.cfilter,tp,LOCATION_MZONE,0,1,1,nil,atk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c101105015.atkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -55,7 +55,9 @@ function c101105016.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105016.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101105016.thfilter(c)
return c:IsFacedown() and aux.AtkEqualsDef(c)
......
......@@ -60,8 +60,7 @@ function c101105018.tgfilter(c,lv)
end
function c101105018.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101105018.tcfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105018.tcfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
if chk==0 then return Duel.IsExistingTarget(c101105018.tcfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c101105018.tcfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
......@@ -71,12 +70,13 @@ function c101105018.tgop(e,tp,eg,ep,ev,re,r,rp)
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c101105018.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel())
if sg:GetCount()>0 and Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
local atk=sg:GetFirst():GetLevel()
local sc=sg:GetFirst()
if sc and Duel.SendtoGrave(sc,REASON_EFFECT)~=0 and sc:IsLocation(LOCATION_GRAVE) then
local lv=sc:GetLevel()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*100)
e1:SetValue(lv*100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
......
......@@ -46,7 +46,7 @@ function c101105020.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c101105020.costfilter(c,ft)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_TRAP) and c:IsSetCard(0x15c) and c:IsAbleToGraveAsCost()
and (ft>0 or c:IsOnField() and ft>-1)
and (ft>0 or c:IsLocation(LOCATION_SZONE) and ft>-1)
end
function c101105020.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
......
......@@ -18,6 +18,7 @@ function c101105021.initial_effect(c)
e2:SetDescription(aux.Stringid(101105021,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105021+100)
e2:SetCondition(aux.exccon)
......@@ -28,7 +29,7 @@ function c101105021.initial_effect(c)
end
c101105021.counter_add_list={0x100e}
function c101105021.ctfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
return c:IsFaceup() and c:IsCanAddCounter(0x100e,2)
end
function c101105021.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c101105021.ctfilter(chkc) end
......
......@@ -44,18 +44,16 @@ function c101105022.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,aux.drccheck,false,2,2)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101105022.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -17,7 +17,7 @@ function c101105023.initial_effect(c)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105023,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetCategory(CATEGORY_HANDES+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCost(c101105023.descost)
......@@ -34,7 +34,7 @@ function c101105023.indescost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101105023.indestg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101105023.indesop(e,tp,eg,ep,ev,re,r,rp)
......@@ -62,14 +62,15 @@ function c101105023.descost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101105023.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
e:SetLabelObject(tc)
if chk==0 then return tc and tc:IsControler(1-tp) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
function c101105023.desop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)>0 then
local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToBattle() then
local tc=e:GetLabelObject()
if tc and tc:IsRelateToBattle() and tc:IsControler(1-tp) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......
......@@ -3,6 +3,8 @@
--Script by Kohana Sonogami
function c101105027.initial_effect(c)
c:EnableReviveLimit()
--spirit return
aux.EnableSpiritReturn(c,EVENT_SPSUMMON_SUCCESS)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -12,13 +14,6 @@ function c101105027.initial_effect(c)
e1:SetCountLimit(1,101105027+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101105027.sprcon)
c:RegisterEffect(e1)
--spirit return
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c101105027.retreg)
c:RegisterEffect(e2)
--act limit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105026,0))
......@@ -40,41 +35,6 @@ function c101105027.sprcon(e,c)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101105027.sprfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101105027.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(c101105027.rettg)
e1:SetOperation(c101105027.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function c101105027.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return e:GetHandler():IsAbleToHand()
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c101105027.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c101105027.cfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsFaceup()
end
......@@ -86,7 +46,7 @@ function c101105027.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101105027.actop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
......
......@@ -5,7 +5,7 @@ function c101105028.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105028,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101105028)
e1:SetCondition(c101105028.rmcon)
......@@ -23,7 +23,7 @@ function c101105028.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105028,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,101105028)
e3:SetCondition(c101105028.tgcon)
......@@ -38,7 +38,6 @@ function c101105028.initial_effect(c)
e4:SetRange(LOCATION_REMOVED)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetCountLimit(1,101105028+100)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c101105028.spcon)
e4:SetTarget(c101105028.sptg)
e4:SetOperation(c101105028.spop)
......
......@@ -20,7 +20,7 @@ function c101105030.initial_effect(c)
e2:SetDescription(aux.Stringid(101105030,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101105030+100)
......@@ -38,7 +38,7 @@ end
function c101105030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
local tc=Duel.GetFirstMatchingCard(c101105030.filter,tp,LOCATION_PZONE,0,c,c)
local tc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
......@@ -66,6 +66,8 @@ function c101105030.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101105030.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c101105030.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp,c)
if sg:GetCount()>0 then
......
......@@ -10,7 +10,7 @@ function c101105031.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101105031)
e1:SetCountLimit(1)
e1:SetTarget(c101105031.seqtg)
e1:SetOperation(c101105031.seqop)
c:RegisterEffect(e1)
......@@ -38,8 +38,8 @@ function c101105031.seqfilter(c,e,tp)
end
function c101105031.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c101105031.seqfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)>0
and Duel.IsExistingTarget(c101105031.seqfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101105031.seqfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
......@@ -62,7 +62,8 @@ function c101105031.seqop(e,tp,eg,ep,ev,re,r,rp)
local flag=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~filter)
local seq1=math.log(flag,2)
local seq2=4-math.log(flag,2)
if Duel.MoveSequence(c,seq1)~=0 then
Duel.MoveSequence(c,seq1)
if c:GetSequence()==seq1 then
Duel.MoveSequence(tc,seq2)
if tc:IsFaceup() then
Duel.BreakEffect()
......
......@@ -65,12 +65,14 @@ function c101105042.eqfilter(c)
return c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA)
end
function c101105042.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101105042.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101105042.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
and Duel.IsExistingTarget(c101105042.eqfilter,tp,LOCATION_MZONE,0,1,nil)
and c:CheckUniqueOnField(tp,LOCATION_SZONE) and not c:IsForbidden() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101105042.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function c101105042.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -79,6 +81,7 @@ function c101105042.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
return
end
if not c:CheckUniqueOnField(tp,LOCATION_SZONE) or c:IsForbidden() then return end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
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