Commit 21ab67bb authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into master

parents a838e5d1 bdf37f76
...@@ -15,10 +15,10 @@ function c14778250.spcon(e,c) ...@@ -15,10 +15,10 @@ function c14778250.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c)
end end
function c14778250.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function c14778250.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,c) local g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:SelectUnselect(nil,tp,false,true,1,1) local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then if tc then
......
...@@ -28,13 +28,12 @@ end ...@@ -28,13 +28,12 @@ end
function c17548456.desop(e,tp,eg,ep,ev,re,r,rp) function c17548456.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT) if Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c17548456.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(17548456,1)) then
end Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c17548456.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp) local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c17548456.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if sg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(17548456,1)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.BreakEffect() local sp=sg:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(sp,0,tp,tp,false,false,POS_FACEUP)
local sp=sg:Select(tp,1,1,nil) end
Duel.SpecialSummon(sp,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -16,18 +16,35 @@ function s.initial_effect(c) ...@@ -16,18 +16,35 @@ function s.initial_effect(c)
e1:SetTarget(s.eqtg) e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop) e1:SetOperation(s.eqop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to deck --adjust(disablecheck)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_ADJUST)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(0xff)
e2:SetRange(LOCATION_MZONE) e2:SetLabelObject(e1)
e2:SetCountLimit(1) e2:SetOperation(s.adjustop)
e2:SetCondition(s.tdcon)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.tdcon)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
if Duel.GetLP(tp)<Duel.GetLP(1-tp) then
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CAN_FORBIDDEN)
else
e1:SetProperty(EFFECT_FLAG_DELAY)
end
end end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp) function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
...@@ -42,9 +59,6 @@ function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,9 +59,6 @@ function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end and Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,LOCATION_MZONE)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
if Duel.GetLP(tp)<Duel.GetLP(1-tp) then
e:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CAN_FORBIDDEN)
else e:SetProperty(EFFECT_FLAG_DELAY) end
end end
function s.eqlimit(e,c) function s.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled() return e:GetOwner()==c and not c:IsDisabled()
......
...@@ -40,13 +40,7 @@ function c30312361.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,13 +40,7 @@ function c30312361.operation(e,tp,eg,ep,ev,re,r,rp)
--copy name, base atk --copy name, base atk
local code=tc:GetOriginalCode() local code=tc:GetOriginalCode()
local ba=tc:GetBaseAttack() local ba=tc:GetBaseAttack()
local e1=Effect.CreateEffect(c) local e1=aux.BecomeOriginalCode(c,tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......
...@@ -43,7 +43,7 @@ function c30603688.spcon(e,c) ...@@ -43,7 +43,7 @@ function c30603688.spcon(e,c)
and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,c) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,c)
end end
function c30603688.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function c30603688.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,c) local g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:SelectUnselect(nil,tp,false,true,1,1) local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then if tc then
......
...@@ -18,7 +18,7 @@ function c39730727.initial_effect(c) ...@@ -18,7 +18,7 @@ function c39730727.initial_effect(c)
e3:SetCategory(CATEGORY_DRAW) e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_ACTIVATE_CONDITION)
e3:SetRange(LOCATION_FZONE) e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c39730727.drcon) e3:SetCondition(c39730727.drcon)
......
...@@ -28,6 +28,7 @@ function c50584941.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,6 +28,7 @@ function c50584941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c50584941.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,c50584941.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetOriginalCode()) e:SetLabel(g:GetFirst():GetOriginalCode())
e:SetLabelObject(g:GetFirst())
end end
function c50584941.filter(c,code) function c50584941.filter(c,code)
return c:IsFaceup() and c:IsSetCard(0x1045) and c:IsType(TYPE_SYNCHRO) and not c:IsCode(code) return c:IsFaceup() and c:IsSetCard(0x1045) and c:IsType(TYPE_SYNCHRO) and not c:IsCode(code)
...@@ -37,6 +38,7 @@ function c50584941.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -37,6 +38,7 @@ function c50584941.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then if chk==0 then
if e:GetLabel()~=1 then return false end if e:GetLabel()~=1 then return false end
e:SetLabel(0) e:SetLabel(0)
e:SetLabelObject(nil)
return true return true
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
...@@ -46,12 +48,13 @@ function c50584941.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,12 +48,13 @@ function c50584941.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local code=e:GetLabel() local code=e:GetLabel()
local name=e:GetLabelObject():GetOriginalCodeRule()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(code) e1:SetValue(name)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD) tc:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD)
......
...@@ -74,7 +74,7 @@ function c6218704.splimit(e,se,sp,st) ...@@ -74,7 +74,7 @@ function c6218704.splimit(e,se,sp,st)
return true return true
end end
function c6218704.hspfilter(c,tp,sc) function c6218704.hspfilter(c,tp,sc)
return c:IsCode(13331639) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevel(12) and c:IsFaceup() return c:IsCode(13331639) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevel(12)
and c:IsControler(tp) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL) and c:IsControler(tp) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end end
function c6218704.hspcon(e,c) function c6218704.hspcon(e,c)
......
...@@ -23,7 +23,7 @@ function c66947414.initial_effect(c) ...@@ -23,7 +23,7 @@ function c66947414.initial_effect(c)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetOperation(c66947414.checkop) e4:SetOperation(c66947414.checkop)
c:RegisterEffect(e4,0) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(66947414,0)) e5:SetDescription(aux.Stringid(66947414,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
......
...@@ -19,6 +19,7 @@ function c67906797.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -19,6 +19,7 @@ function c67906797.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
local tc=g:GetMinGroup(Card.GetSequence):GetFirst() local tc=g:GetMinGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
tc:SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
if Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 then if Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 then
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=1 then return end if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=1 then return end
......
...@@ -18,6 +18,7 @@ function c94693857.initial_effect(c) ...@@ -18,6 +18,7 @@ function c94693857.initial_effect(c)
e3:SetDescription(aux.Stringid(94693857,0)) e3:SetDescription(aux.Stringid(94693857,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
......
...@@ -1776,3 +1776,20 @@ end ...@@ -1776,3 +1776,20 @@ end
function Auxiliary.MimighoulFlipCondition(e,tp,eg,ep,ev,re,r,rp) function Auxiliary.MimighoulFlipCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase() return Duel.IsMainPhase()
end end
---The name of `c` becomes the original name of `tc`
---@param c Card
---@param tc Card
---@param reset? integer defult: RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END
---@return Effect
function Auxiliary.BecomeOriginalCode(c,tc,reset)
reset=reset or (RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local code=tc:GetOriginalCodeRule()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(code)
e1:SetReset(reset)
c:RegisterEffect(e1)
return e1
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