Commit 2bac247d authored by Huangnan's avatar Huangnan

Merge branch 'new-fusion' into 'master'

Add 神炎竜ルベリオン アマゾネスの秘術 影牢の呪縛 to new fusion

See merge request mycard/pre-release-database-cdb!196
parents e4f32a5e fef7d8cd
...@@ -80,17 +80,17 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,17 +80,17 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
local dg=sg:Select(tp,1,1,nil) local dg=sg:Select(tp,1,1,nil)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
--Once this turn, if you Fusion Summon a "Lunalight" monster, you can also banish monsters from your grave as material --Once this turn, if you Fusion Summon a "Lunalight" monster, you can also banish monsters from your grave as material
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_FUSION_MATERIAL) e1:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTargetRange(LOCATION_GRAVE,0) e1:SetTargetRange(LOCATION_GRAVE,0)
e1:SetTarget(function(_,c) return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) end) e1:SetTarget(function(_,c) return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) end)
e1:SetOperation(function() return FusionSpell.FUSION_OPERATION_BANISH end) e1:SetOperation(function() return FusionSpell.FUSION_OPERATION_BANISH end)
e1:SetValue(function(fusion_effect,c) return c and c:IsSetCard(0xdf) and c:IsControler(fusion_effect:GetHandlerPlayer()) end) e1:SetValue(function(fusion_effect,c) return c and c:IsSetCard(0xdf) and c:IsControler(fusion_effect:GetHandlerPlayer()) end)
e1:SetReset(RESET_PHASE|PHASE_END) e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
end end
end end
......
...@@ -10,26 +10,26 @@ end ...@@ -10,26 +10,26 @@ end
---@param c Card ---@param c Card
function s.fusfilter(c) function s.fusfilter(c)
return c:IsRace(RACE_MACHINE) return c:IsRace(RACE_MACHINE)
end end
---@type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION ---@type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION
function s.stage_x_operation(e,tc,tp,stage,mg_fuison_spell,mg_all) function s.stage_x_operation(e,tc,tp,stage,mg_fuison_spell,mg_all)
--- register if the summon is finished --- register if the summon is finished
if stage==FusionSpell.STAGE_AT_SUMMON_OPERATION_FINISH then if stage==FusionSpell.STAGE_AT_SUMMON_OPERATION_FINISH then
-- if base ATK is 0, do nothing -- if base ATK is 0, do nothing
local atk=tc:GetBaseAttack() local atk=tc:GetBaseAttack()
if atk<=0 then if atk<=0 then
return return
end end
---increase ATK ---increase ATK
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetBaseAttack()) e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
--- do damage on end phase --- do damage on end phase
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=FusionSpell.CreateSummonEffect(c,{ local e1=FusionSpell.CreateSummonEffect(c,{
pre_select_mat_location=LOCATION_ONFIELD, pre_select_mat_location=LOCATION_ONFIELD,
pre_select_mat_opponent_location=LOCATION_ONFIELD, pre_select_mat_opponent_location=LOCATION_ONFIELD,
extra_target=s.extra_target extra_target=s.extra_target
}) })
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(s.cost) e1:SetCost(s.cost)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -16,6 +16,9 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -16,6 +16,9 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function s.extra_target(e,tp,eg,ep,ev,re,r,rp,chk) function s.extra_target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return true
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE) Duel.SetChainLimit(aux.FALSE)
end end
......
...@@ -45,7 +45,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
-- Can only use Dragon or Machine "Cyber" monsters as Fusion Material this turn -- Can only use Dragon or Machine "Cyber" monsters as Fusion Material this turn
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL) e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
...@@ -55,7 +55,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(s.fuslimit) e1:SetValue(s.fuslimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
--Can also banish monsters from your GY as material once when you Fusion Summon this turn --Can also banish monsters from your GY as material once when you Fusion Summon this turn
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(id,2)) e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
...@@ -63,7 +63,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,7 +63,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
e2:SetTargetRange(LOCATION_GRAVE,0) e2:SetTargetRange(LOCATION_GRAVE,0)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(s.mttg) e2:SetTarget(s.mttg)
e2:SetOperation(function() return FusionSpell.FUSION_OPERATION_BANISH end) e2:SetOperation(function() return FusionSpell.FUSION_OPERATION_BANISH end)
e2:SetValue(1) e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
......
--神炎竜ルベリオン
local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,68468459,aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_DARK),1,true,true)
--spsummon
local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=LOCATION_GRAVE|LOCATION_ONFIELD|LOCATION_REMOVED,
mat_operation_code_map={
{ [LOCATION_DECK] = FusionSpell.FUSION_OPERATION_GRAVE },
{ [0xff] = FusionSpell.FUSION_OPERATION_SHUFFLE }
},
extra_target=s.extra_target
})
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetCost(s.spcost)
c:RegisterEffect(e1)
end
function s.branded_fusion_check(tp,sg,fc)
return aux.gffcheck(sg,Card.IsFusionCode,68468459,function(c) return c:IsFusionAttribute(ATTRIBUTE_DARK) and (not c:IsHasEffect(6205579)) end)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
---@param c Card
function s.fusfilter(c)
return (not c:IsCode(id)) and c:IsLevelBelow(8)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function s.extra_target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return true
end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
end
--影牢の呪縛
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableCounterPermit(0x16)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(s.ctcon)
e2:SetOperation(s.ctop)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(s.atkcon)
e3:SetValue(s.atkval)
c:RegisterEffect(e3)
-- Each time you Fusion Summon a "Shaddoll" Fusion Monster, you can remove 3 Spellstone Counters from this card to use 1 appropriate face-up monster your opponent controls as 1 of the Fusion Materials.
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e4:SetRange(LOCATION_FZONE)
e4:SetCondition(s.extra_material_con)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetTarget(function(_,mc) return mc:IsFaceup() and mc:IsType(TYPE_MONSTER) end)
e4:SetCost(s.extra_material_cost)
e4:SetOperation(function() return FusionSpell.FUSION_OPERATION_INHERIT end)
e4:SetValue(function(fusion_effect,tc) return tc and tc:IsSetCard(0x9d) and c:IsControler(fusion_effect:GetHandlerPlayer()) end)
e4:SetLabel(1) --- at most 1 material per fusion effect
c:RegisterEffect(e4)
end
function s.cfilter(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsReason(REASON_EFFECT)
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(s.cfilter,nil)
e:GetHandler():AddCounter(0x16,ct)
end
function s.atkcon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
end
function s.atkval(e,c)
return e:GetHandler():GetCounter(0x16)*-100
end
function s.extra_material_con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanRemoveCounter(tp,0x16,3,REASON_ACTION)
end
---@param e Effect
function s.extra_material_cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return e:GetHandler():IsCanRemoveCounter(tp,0x16,3,REASON_ACTION)
end
e:GetHandler():RemoveCounter(tp,0x16,3,REASON_ACTION)
end
--アマゾネスの秘術
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter
})
e1:SetDescription(aux.Stringid(id,0))
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(aux.bfgcost)
e2:SetOperation(s.fusop)
c:RegisterEffect(e2)
end
function s.fusfilter(c)
return c:IsSetCard(0x4)
end
function s.fusop(e,tp,eg,ep,ev,re,r,rp)
--Once this turn, if you Fusion Summon an "Amazoness" Fusion Monster this turn, you can also send 1 "Amazoness" monster from your Extra Deck to the GY as material.
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e1:SetCountLimit(1)
e1:SetTargetRange(LOCATION_EXTRA,0)
e1:SetTarget(function(_,c) return c:IsAbleToGrave() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x4) end)
e1:SetOperation(function() return FusionSpell.FUSION_OPERATION_GRAVE end)
e1:SetValue(function(fusion_effect,c) return c and c:IsSetCard(0x4) and c:IsControler(fusion_effect:GetHandlerPlayer()) end)
e1:SetLabel(1) --- at most 1 material per fusion effect
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
...@@ -15,16 +15,16 @@ end ...@@ -15,16 +15,16 @@ end
---@param c Card ---@param c Card
function s.fusfilter(c) function s.fusfilter(c)
return c:IsSetCard(0xdf) return c:IsSetCard(0xdf)
end end
---@type FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION ---@type FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION
function s.pre_select_mat_location(tc,tp) function s.pre_select_mat_location(tc,tp)
local res=LOCATION_HAND|LOCATION_ONFIELD local res=LOCATION_HAND|LOCATION_ONFIELD
if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then
res=res|LOCATION_DECK|LOCATION_EXTRA res=res|LOCATION_DECK|LOCATION_EXTRA
end end
return res return res
end end
function s.cfilter(c) function s.cfilter(c)
......
This diff is collapsed.
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