Commit b8afc03e authored by 未闻皂名's avatar 未闻皂名

2021/11/21 新增:恶魔与幻龙新卡,为下次大更新引入简化函数做准备

parent cea3f104
Pipeline #6965 passed with stages
in 5 minutes and 30 seconds
No preview for this file type
......@@ -33,12 +33,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp)
if ft<=0 then return end
if ft>=2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=Duel.GetMZoneCount(tp)
if ct<1 then return end
if ct>2 then ct=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,ft,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,ct,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -30,12 +30,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp)
if ft<=0 then return end
if ft>=2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=Duel.GetMZoneCount(tp)
if ct<1 then return end
if ct>2 then ct=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -38,12 +38,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp)
if ft<=0 then return end
if ft>=2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=Duel.GetMZoneCount(tp)
if ct<1 then return end
if ct>2 then ct=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,ft,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,ct,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
......
......@@ -40,7 +40,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local ct=Duel.GetMZoneCount(tp)
if ct<1 then return end
if ct>2 then ct=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -45,8 +45,10 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext()
end
local ct=Duel.GetMZoneCount(tp)
if ct<1 then return end
if ct>2 then ct=2 end
if ct>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
local m=120203012
local cm=_G["c"..m]
cm.name="王家魔族·高潮摇滚"
function cm.initial_effect(c)
--Damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--Tribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetLabelObject(e1)
e2:SetValue(cm.tricheck)
c:RegisterEffect(e2)
end
--Damage
function cm.filter(c)
return c:IsFaceup() and c:IsLevelAbove(7)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN) and e:GetLabel()==1
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
local dam=math.abs(c:GetAttack()-tc:GetAttack())
if dam>0 then
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
end
--Tribute
function cm.trifilter(c)
return c:IsLevelAbove(7) and c:IsRace(RACE_FIEND)
end
function cm.tricheck(e,c)
local g=c:GetMaterial()
if g:IsExists(cm.trifilter,2,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
\ No newline at end of file
local m=120203014
local list={120155024,120203037}
local cm=_G["c"..m]
cm.name="梦幻刃龙 建造梦"
function cm.initial_effect(c)
aux.AddCodeList(c,list[1],list[2])
--Fusion Material
aux.AddFusionProcCode2(c,list[1],list[2],true,true)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Destroy
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_FZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_FZONE,0,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,2,2,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -193,13 +193,13 @@ function RushDuel.AddMaximumProcedure(c,max_atk,left_code,right_code)
e8:SetValue(1)
c:RegisterEffect(e8)
--Leave Field
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_LEAVE_FIELD_P)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_LEAVE_FIELD_P)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e9:SetCondition(RushDuel.IsMaximumMode)
e9:SetOperation(RushDuel.LeaveOperation)
c:RegisterEffect(e9)
e9:SetOperation(RushDuel.LeaveOperation)
c:RegisterEffect(e9)
end
function RushDuel.MaximumSummonFilter(c,e,tp,left_code,right_code)
return c:IsCode(left_code,right_code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
......@@ -262,12 +262,12 @@ function RushDuel.IsHasDefense(c)
end
--Select Effect
function RushDuel.BaseSelectEffect(c,eff1hint,eff1con,eff1op,eff2hint,eff2con,eff2op)
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_IGNITION)
e:SetRange(LOCATION_MZONE)
e:SetTarget(RushDuel.SelectEffectTarget(eff1con,eff2con))
e:SetOperation(RushDuel.SelectEffectOperation(eff1hint,eff1con,eff1op,eff2hint,eff2con,eff2op))
return e
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_IGNITION)
e:SetRange(LOCATION_MZONE)
e:SetTarget(RushDuel.SelectEffectTarget(eff1con,eff2con))
e:SetOperation(RushDuel.SelectEffectOperation(eff1hint,eff1con,eff1op,eff2hint,eff2con,eff2op))
return e
end
function RushDuel.SelectEffectCondition(eff1con,eff2con)
return function(e,tp,eg,ep,ev,re,r,rp)
......@@ -298,4 +298,12 @@ function RushDuel.SelectEffectOperation(eff1hint,eff1con,eff1op,eff2hint,eff2con
elseif select==2 then eff2op(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--Special Summon Count
function RushDuel.GetSPCount(tp,max)
local ct=Duel.GetMZoneCount(tp)
if ct<1 then return 0 end
if ct>max then ct=max end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
return ct
end
\ No newline at end of file
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