Commit 509df8ca authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

update Castle of Dragon Souls, Berserking, Beast Rising, Myutant Clash (#2061)

parent 0ca6ddd3
......@@ -5,10 +5,6 @@ function c13513663.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetTarget(c13513663.target1)
e1:SetOperation(c13513663.operation)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
......@@ -18,8 +14,9 @@ function c13513663.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCost(c13513663.cost2)
e2:SetTarget(c13513663.target2)
e2:SetCountLimit(1)
e2:SetCost(c13513663.cost)
e2:SetTarget(c13513663.target)
e2:SetOperation(c13513663.operation)
c:RegisterEffect(e2)
--spsummon
......@@ -37,44 +34,17 @@ end
function c13513663.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToRemoveAsCost()
end
function c13513663.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then
if Duel.GetCurrentPhase()==PHASE_DAMAGE then
return Duel.IsExistingMatchingCard(c13513663.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
return true
end
if Duel.GetCurrentPhase()==PHASE_DAMAGE or (
e:GetHandler():GetFlagEffect(13513663)==0
and Duel.IsExistingMatchingCard(c13513663.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(13513663,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c13513663.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
e:GetHandler():RegisterFlagEffect(13513663,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
else
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
end
end
function c13513663.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return e:GetHandler():GetFlagEffect(13513663)==0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c13513663.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c13513663.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13513663.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c13513663.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:GetHandler():RegisterFlagEffect(13513663,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c13513663.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c13513663.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -2,26 +2,15 @@
function c5466615.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5466615,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,5466615+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c5466615.target)
e1:SetOperation(c5466615.activate)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(5466615,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,5466615+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(5466615,2))
e3:SetDescription(aux.Stringid(5466615,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
......@@ -38,12 +27,22 @@ function c5466615.tgfilter(c)
end
function c5466615.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return aux.NegateEffectMonsterFilter(chkc) and chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingMatchingCard(c5466615.tgfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c5466615.tgfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(5466615,0)) then
e:SetCategory(CATEGORY_REMOVE+CATEGORY_DISABLE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c5466615.activate)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c5466615.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -4,10 +4,6 @@ function c56535497.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetTarget(c56535497.target1)
e1:SetOperation(c56535497.operation)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
......@@ -17,46 +13,28 @@ function c56535497.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCondition(c56535497.condition2)
e2:SetTarget(c56535497.target2)
e2:SetCountLimit(1)
e2:SetCondition(c56535497.condition)
e2:SetTarget(c56535497.target)
e2:SetOperation(c56535497.operation)
c:RegisterEffect(e2)
end
function c56535497.filter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST)
end
function c56535497.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if Duel.GetCurrentPhase()==PHASE_DAMAGE or
(Duel.IsExistingTarget(c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil) and Duel.SelectYesNo(tp,aux.Stringid(56535497,0))) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,2))
local rg=Duel.SelectTarget(tp,c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(rg:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,3))
Duel.SelectTarget(tp,c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,rg:GetFirst())
e:GetHandler():RegisterFlagEffect(56535497,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
else
e:SetLabelObject(nil)
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
end
end
function c56535497.condition2(e,tp,eg,ep,ev,re,r,rp)
function c56535497.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if Duel.GetTurnPlayer()==tp then return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
else return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon() end
end
function c56535497.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c56535497.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetHandler():GetFlagEffect(56535497)==0
and Duel.IsExistingTarget(c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil) end
if chk==0 then return Duel.IsExistingTarget(c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,2))
local rg=Duel.SelectTarget(tp,c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(rg:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,3))
Duel.SelectTarget(tp,c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,rg:GetFirst())
e:GetHandler():RegisterFlagEffect(56535497,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c56535497.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
......
......@@ -4,11 +4,6 @@ function c84962466.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetTarget(c84962466.target1)
e1:SetOperation(c84962466.operation)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
......@@ -18,8 +13,10 @@ function c84962466.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetCondition(aux.dscon)
e2:SetTarget(c84962466.target2)
e2:SetCost(c84962466.cost)
e2:SetTarget(c84962466.target)
e2:SetOperation(c84962466.operation)
c:RegisterEffect(e2)
end
......@@ -30,34 +27,18 @@ end
function c84962466.filter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR)
end
function c84962466.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c84962466.filter(chkc) end
if chk==0 then
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or Duel.IsExistingMatchingCard(c84962466.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
if Duel.GetCurrentPhase()==PHASE_DAMAGE or
(Duel.IsExistingMatchingCard(c84962466.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(84962466,0))) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c84962466.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(rg:GetFirst():GetBaseAttack())
Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c84962466.filter,tp,LOCATION_MZONE,0,1,1,nil)
e:GetHandler():RegisterFlagEffect(84962466,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(EFFECT_FLAG_DAMAGE_STEP) end
end
function c84962466.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c84962466.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(84962466)==0
and Duel.IsExistingMatchingCard(c84962466.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
function c84962466.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84962466.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c84962466.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(rg:GetFirst():GetBaseAttack())
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c84962466.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c84962466.filter(chkc) end
if chk==0 then return e:IsCostChecked() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c84962466.filter,tp,LOCATION_MZONE,0,1,1,nil)
e:GetHandler():RegisterFlagEffect(84962466,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c84962466.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
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