Commit 87197bb1 authored by Tang Xinwei's avatar Tang Xinwei Committed by GitHub

Merge pull request #14 from kiritosoft/fix--不知火流-転生の陣--ダイガスタ・エメラル

Fix  不知火流 転生の陣  ダイガスタ・エメラル
parents fa62ae25 de864b67
...@@ -13,6 +13,7 @@ function c10352095.initial_effect(c) ...@@ -13,6 +13,7 @@ function c10352095.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP) e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE) e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetCondition(c10352095.con)
e2:SetValue(c10352095.value) e2:SetValue(c10352095.value)
c:RegisterEffect(e2) c:RegisterEffect(e2)
e1:SetLabelObject(e2) e1:SetLabelObject(e2)
...@@ -41,6 +42,9 @@ function c10352095.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,6 +42,9 @@ function c10352095.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Equip(tp,e:GetHandler(),tc) Duel.Equip(tp,e:GetHandler(),tc)
end end
end end
function c10352095.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0
end
function c10352095.value(e,c) function c10352095.value(e,c)
return e:GetLabel() return e:GetLabel()
end end
...@@ -12,7 +12,7 @@ function c37119142.initial_effect(c) ...@@ -12,7 +12,7 @@ function c37119142.initial_effect(c)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37119142,0)) e2:SetDescription(aux.Stringid(37119142,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BE_MATERIAL) e2:SetCode(EVENT_BE_MATERIAL)
...@@ -55,7 +55,11 @@ function c37119142.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -55,7 +55,11 @@ function c37119142.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c37119142.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,check) end if chk==0 then return Duel.IsExistingTarget(c37119142.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,check) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c37119142.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,check) local g=Duel.SelectTarget(tp,c37119142.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,check)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) if e:GetLabel()==0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
end
end end
function c37119142.thop(e,tp,eg,ep,ev,re,r,rp) function c37119142.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -6,12 +6,10 @@ function c40005099.initial_effect(c) ...@@ -6,12 +6,10 @@ function c40005099.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,40005099+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,40005099+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon&tograve
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40005099,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e2:SetCountLimit(1)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c40005099.condition) e2:SetCondition(c40005099.condition)
...@@ -19,19 +17,6 @@ function c40005099.initial_effect(c) ...@@ -19,19 +17,6 @@ function c40005099.initial_effect(c)
e2:SetTarget(c40005099.target) e2:SetTarget(c40005099.target)
e2:SetOperation(c40005099.operation) e2:SetOperation(c40005099.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(40005099,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c40005099.condition)
e3:SetCost(c40005099.cost)
e3:SetTarget(c40005099.target2)
e3:SetOperation(c40005099.operation2)
c:RegisterEffect(e3)
end end
function c40005099.condition(e,tp,eg,ep,ev,re,r,rp) function c40005099.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
...@@ -43,33 +28,50 @@ end ...@@ -43,33 +28,50 @@ end
function c40005099.filter1(c,e,tp) function c40005099.filter1(c,e,tp)
return c:IsRace(RACE_ZOMBIE) and c:IsDefense(0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_ZOMBIE) and c:IsDefense(0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c40005099.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c40005099.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c40005099.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40005099.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c40005099.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c40005099.filter2(c) function c40005099.filter2(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsDefense(0) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsDefense(0)
end end
function c40005099.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c40005099.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c40005099.filter2(chkc) end if chkc then
if chk==0 then return Duel.IsExistingTarget(c40005099.filter2,tp,LOCATION_REMOVED,0,1,nil) end if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c40005099.filter1(chkc,e,tp)
local g=Duel.SelectTarget(tp,c40005099.filter2,tp,LOCATION_REMOVED,0,1,1,nil) else
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c40005099.filter2(chkc)
end
end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c40005099.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsExistingTarget(c40005099.filter2,tp,LOCATION_REMOVED,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(40005099,0),aux.Stringid(40005099,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(40005099,0))
else
op=Duel.SelectOption(tp,aux.Stringid(40005099,1))+1
end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40005099.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
else
e:SetCategory(CATEGORY_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c40005099.filter2,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
end end
function c40005099.operation2(e,tp,eg,ep,ev,re,r,rp) function c40005099.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if e:GetLabel()==0 then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN) if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
else
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
end end
end end
...@@ -3,7 +3,7 @@ function c51684157.initial_effect(c) ...@@ -3,7 +3,7 @@ function c51684157.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51684157,0)) e1:SetDescription(aux.Stringid(51684157,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
...@@ -54,7 +54,10 @@ function c51684157.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,7 +54,10 @@ function c51684157.target(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(c51684157.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,check) return Duel.IsExistingMatchingCard(c51684157.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,check)
end end
if l2==0 then if l2==0 then
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
end end
end end
function c51684157.activate(e,tp,eg,ep,ev,re,r,rp) function c51684157.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -3,30 +3,16 @@ function c581014.initial_effect(c) ...@@ -3,30 +3,16 @@ function c581014.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,4,2) aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--ret&draw --ret&draw&spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(581014,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e1:SetCountLimit(1)
e1:SetCost(c581014.cost) e1:SetCost(c581014.cost)
e1:SetTarget(c581014.target1) e1:SetTarget(c581014.target1)
e1:SetOperation(c581014.operation1) e1:SetOperation(c581014.operation1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(581014,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCost(c581014.cost)
e2:SetTarget(c581014.target2)
e2:SetOperation(c581014.operation2)
c:RegisterEffect(e2)
end end
function c581014.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c581014.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
...@@ -40,36 +26,54 @@ function c581014.filter2(c,e,tp) ...@@ -40,36 +26,54 @@ function c581014.filter2(c,e,tp)
return not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c581014.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c581014.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter1(chkc) end if chkc then
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil) end if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter1(chkc)
local g=Duel.SelectTarget(tp,c581014.filter1,tp,LOCATION_GRAVE,0,3,3,nil) else
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter2(chkc,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end
end end
function c581014.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter2(chkc,e,tp) end local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return b1 or b2 end
and Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end local op=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if b1 and b2 then
local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) op=Duel.SelectOption(tp,aux.Stringid(581014,1),aux.Stringid(581014,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) elseif b1 then
end op=Duel.SelectOption(tp,aux.Stringid(581014,1))
function c581014.operation1(e,tp,eg,ep,ev,re,r,rp) else
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) op=Duel.SelectOption(tp,aux.Stringid(581014,2))+1
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) e:SetLabel(op)
local g=Duel.GetOperatedGroup() if op==0 then
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if ct==3 then local g=Duel.SelectTarget(tp,c581014.filter1,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.BreakEffect() Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.Draw(tp,1,REASON_EFFECT) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
end end
function c581014.operation2(e,tp,eg,ep,ev,re,r,rp) function c581014.operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() if e:GetLabel()==0 then
if tc:IsRelateToEffect(e) then local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
else
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end end
end 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