Commit a2032cf1 authored by POLYMER's avatar POLYMER

fix

parent 8cb2cff2
No preview for this file type
......@@ -105,8 +105,9 @@ function c28303030.Operation(f,gf,minct,maxct)
end
c:SetMaterial(mg)
c:RegisterFlagEffect(28303030,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1,mg:GetFirst():GetLevel())
local check=mg:GetClassCount(Card.GetLevel)==1
Duel.Overlay(c,mg)
if mg:GetClassCount(Card.GetLevel)==1 then
if check then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
......
--向破晓起誓的双忍 萨琪娜&米卡娅
function c75009001.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c75009001.damcon)
e1:SetOperation(c75009001.damop)
c:RegisterEffect(e1)
--chain attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75009001,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,75009001)
e2:SetCondition(c75009001.chacon)
e2:SetTarget(c75009001.chatg)
e2:SetOperation(c75009001.chaop)
c:RegisterEffect(e2)
--eff
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75009001,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1,15009001)
e3:SetTarget(c75009001.efftg)
e3:SetOperation(c75009001.effop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75009001,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,15009001)
e4:SetCondition(c75009001.effcon)
e4:SetTarget(c75009001.efftg)
e4:SetOperation(c75009001.effop)
c:RegisterEffect(e4)
end
function c75009001.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and c==Duel.GetAttacker()
end
function c75009001.damop(e,tp,eg,ep,ev,re,r,rp)
local x=0
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
if tc:GetAttack()<tc:GetBaseAttack() then x=x+(tc:GetBaseAttack()-tc:GetAttack()) end
if tc:GetDefense()<tc:GetBaseDefense() then x=x+(tc:GetBaseDefense()-tc:GetDefense()) end
tc=g:GetNext()
end
Duel.ChangeBattleDamage(ep,ev+x)
end
function c75009001.chacon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and aux.bdocon(e,tp,eg,ep,ev,re,r,rp)
end
function c75009001.chatg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c75009001.chaop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
function c75009001.effcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c75009001.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c75009001.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-700)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(function(e,c)
return e:GetOwner():GetAttack()>c:GetDefense() end)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-700)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(function(e,c)
return e:GetOwner():GetAttack()>c:GetDefense() end)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetRange(LOCATION_MZONE)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(function(e,c)
return e:GetOwner():GetAttack()>c:GetDefense() end)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c75009001.edamtg)
e1:SetOperation(c75009001.edamop)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(function(e,c)
return e:GetOwner():GetAttack()>c:GetDefense() end)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
function c75009001.edamtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(700)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,700)
end
function c75009001.edamop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--漆黑的忍者 吉尔格鲁斯
function c75009002.initial_effect(c)
--code
aux.EnableChangeCode(c,75030023,LOCATION_MZONE+LOCATION_GRAVE)
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
e1:SetCondition(function(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and not c:IsCode(75030023) and c:IsSetCard(0x75e,0x754) end,tp,LOCATION_MZONE,0,1,nil) end)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
e2:SetCondition(function(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and not c:IsCode(75030023) and c:IsSetCard(0x75e,0x754) end,tp,LOCATION_MZONE,0,1,nil) end)
c:RegisterEffect(e2)
--battle
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetCondition(function(e)
return e:GetHandler():IsAttackPos() end)
e2:SetTarget(c75009002.atktg)
e2:SetOperation(c75009002.atkop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCountLimit(1,75009002)
e3:SetCondition(aux.bdocon)
e3:SetTarget(c75009002.sptg)
e3:SetOperation(c75009002.spop)
c:RegisterEffect(e3)
end
function c75009002.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c75009002.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttacker()
if Duel.NegateAttack() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c:GetDefense()/2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
c:RegisterEffect(e1)
Duel.CalculateDamage(c,bc,true)
end
end
function c75009002.spfil(c,e,tp)
return c:IsLevelBelow(7) and c:IsSetCard(0x75e,0x754) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75009002.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c75009002.spfil,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c75009002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c75009002.spfil,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) then
local sg=Duel.SelectMatchingCard(tp,c75009002.spfil,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
--白夜王子的忍者活动 神威
function c75009003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,75009003)
e1:SetCondition(c75009003.spcon)
e1:SetTarget(c75009003.sptg)
e1:SetOperation(c75009003.spop)
c:RegisterEffect(e1)
--extra att
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--eff
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75009003,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1,15009003)
e3:SetTarget(c75009003.efftg)
e3:SetOperation(c75009003.effop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75009003,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,15009003)
e4:SetCondition(c75009003.effcon)
e4:SetTarget(c75009003.efftg)
e4:SetOperation(c75009003.effop)
c:RegisterEffect(e4)
end
function c75009003.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
end
function c75009003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c75009003.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)
end
end
function c75009003.effcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c75009003.ctfil(c)
return c:IsSetCard(0x75e,0x750) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(1) and c:IsAbleToGraveAsCost()
end
function c75009003.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c75009003.ctfil,tp,LOCATION_DECK,0,1,nil) and g:GetCount()>0 end
local tc=Duel.SelectMatchingCard(tp,c75009003.ctfil,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
e:SetLabel(tc:GetLevel())
Duel.SendtoGrave(tc,REASON_COST)
end
function c75009003.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=e:GetLabel()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and lv and lv>0 then
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-lv*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-lv*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
--暗杀还是美人计? 卡米拉
function c75009004.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,75009004)
e1:SetCondition(c75009004.spcon)
e1:SetTarget(c75009004.sptg)
e1:SetOperation(c75009004.spop)
c:RegisterEffect(e1)
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(function(e,c)
return e:GetHandler():GetLevel()>c:GetLevel() and c:IsLevelAbove(1) end)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(function(e,c)
return c:IsLevelAbove(1) end)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--damage
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end)
e3:SetTarget(c75009004.damtg)
e3:SetOperation(c75009004.damop)
c:RegisterEffect(e3)
end
function c75009004.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsLocation(LOCATION_MZONE)
end
function c75009004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c75009004.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e2)
end
end
function c75009004.tarfil(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function c75009004.targck(g)
return g:GetClassCount(Card.GetAttack)==g:GetCount()
end
function c75009004.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c75009004.tarfil,tp,0,LOCATION_MZONE,nil,e)
if chk==0 then return g:CheckSubGroup(c75009004.targck,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g:SelectSubGroup(tp,c75009004.targck,false,2,2)
Duel.SetTargetCard(sg)
Duel.SetTargetPlayer(1-tp)
local tc1=sg:GetFirst()
local tc2=sg:GetNext()
local xatk=math.abs(tc1:GetAttack()-tc2:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,xatk)
end
function c75009004.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==2 then
local tc1=g:GetFirst()
local tc2=g:GetNext()
local xatk=math.abs(tc1:GetAttack()-tc2:GetAttack())
if xatk>0 then
Duel.Damage(p,xatk,REASON_EFFECT)
end
end
end
--平常心的最高峰 琳&芙萝莉娜
function c75009005.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(function(e)
local tp=e:GetHandlerPlayer()
local a,d=Duel.GetBattleMonster(tp)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and a and a==e:GetHandler() and d end)
e2:SetTarget(function(e,c)
local bc=e:GetHandler():GetBattleTarget()
return bc and c==bc and c:GetBaseAttack()>c:GetAttack() and c:GetBaseDefense()>c:GetDefense() end)
e2:SetValue(function(e,c)
return c:GetBaseAttack() end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(function(e,c)
return c:GetBaseDefense() end)
c:RegisterEffect(e3)
--pos
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75009005,0))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetTarget(c75009005.postg)
e3:SetOperation(c75009005.posop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75009005,0))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c75009005.poscon)
e4:SetTarget(c75009005.postg)
e4:SetOperation(c75009005.posop)
c:RegisterEffect(e4)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,75009005)
e4:SetTarget(c75009005.sptg)
e4:SetOperation(c75009005.spop)
c:RegisterEffect(e4)
end
function c75009005.poscon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c75009005.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,LOCATION_ONFIELD)
end
function c75009005.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
function c75009005.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x75e,0x755) and not c:IsCode(75009005) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c75009005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c75009005.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c75009005.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c75009005.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local b1=Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil)
if (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) and (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(75009005,4)) then
local op=2
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(75009005,2),aux.Stringid(75009005,3))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(75009005,2))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(75009005,3))+1
end
if op==0 then
local sc=Duel.SelectMatchingCard(tp,Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil):GetFirst()
Duel.XyzSummon(tp,sc,nil)
elseif op==1 then
local sc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil):GetFirst()
Duel.SynchroSummon(tp,sc,nil)
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