Commit e1c6e71a authored by nanahira's avatar nanahira

current

parent f1d818e8
No preview for this file type
--百慕 依偎的浅眠·一夏
local m=37564455
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
cm.Senya_name_with_prism=true
function cm.initial_effect(c)
Senya.PrismCommonEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetCountLimit(1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return Senya.CheckPrism(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():GetOverlayGroup():IsExists(cm.spfilter,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not cm.sptg(e,tp,eg,ep,ev,re,r,rp,0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=e:GetHandler():GetOverlayGroup():FilterSelect(tp,cm.spfilter,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--百慕 海流杂技·沛托尼娅
local m=37564456
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
cm.Senya_name_with_prism=true
function cm.initial_effect(c)
Senya.PrismCommonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.discon)
e1:SetCost(cm.discost)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g then return false end
local c=e:GetHandler()
return Duel.IsChainDisablable(ev)
and g:IsExists(function(c) return c:IsFaceup() and Senya.CheckPrism(c) and c:GetSummonLocation()==LOCATION_EXTRA end,1,nil)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--百慕 希望之光星·雫
local m=37564457
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
function cm.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_SEASERPENT),2,3)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(37564765,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLED)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_AVAILABLE_BD)
e4:SetCost(Senya.SelfToHandCost)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(cm.eftg)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
function cm.atkfilter(c)
return c:IsFaceup() and Senya.CheckPrism(c) and c:GetBaseAttack()>=0
end
function cm.atkval(e,c)
local lg=c:GetLinkedGroup():Filter(cm.atkfilter,nil)
return lg:GetSum(Card.GetBaseAttack)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cm.eftg(e,c)
local lg=e:GetHandler():GetLinkedGroup()
return c:IsType(TYPE_EFFECT) and lg:IsContains(c)
end
\ No newline at end of file
--百慕 无穷之瞳·莉特
local m=37564459
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
function cm.initial_effect(c)
Senya.AddXyzProcedureCustom(c,nil,cm.xyzcheck,1,3,nil,cm.ovop)
Senya.PrismDamageCheckRegister(c,false)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(cm.adcon)
e3:SetTarget(cm.adtg)
e5:SetValue(0)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetLabel(2)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCost(cm.cost)
e3:SetCondition(Senya.PrismDamageCheckCondition)
e3:SetOperation(Senya.PrismDamageCheckOperation)
c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.xyzcheck(g,xyzc)
if #g==1 and cm.ovfilter(g:GetFirst()) then return true end
if g:IsExists(function(c) return not c:IsXyzLevel(xyzc,5) end,1,nil) then return false end
return Senya.PrismXyzCheck(2,2)(g)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsXyzType(TYPE_XYZ) and Senya.CheckPrism(c) and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
function cm.ovop(e,tp,g,c)
if #g==1 then
local og=g:GetFirst():GetOverlayGroup()
Duel.SendtoGrave(og,REASON_COST)
end
end
function cm.adcon(e)
local c=e:GetHandler()
return c:GetBattleTarget() and c:GetBattleTarget():IsSummonType(SUMMON_TYPE_SPECIAL)
and Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL
end
function cm.adtg(e,c)
return c==e:GetHandler():GetBattleTarget() and c:GetBattleTarget():IsSummonType(SUMMON_TYPE_SPECIAL)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(m)==0 end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function cm.filter(c,e,tp)
return c:IsCode(m) and e:GetHandler():IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,c)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c:GetRank())
local sc=g:GetFirst()
if sc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
......@@ -271,9 +271,9 @@ function cm.MustMaterialCheck(v,tp,code)
return true
end
--xyz summon of prim
function cm.AddXyzProcedureRank(c,rk,f,minct,maxct,xm,...)
function cm.AddXyzProcedureRank(c,rk,f,minct,maxct,xm,exop,...)
local ext_params={...}
return cm.AddXyzProcedureCustom(c,cm.XyzProcedureRankFilter(rk,f,ext_params),cm.XyzProcedureRankCheck,minct,maxct,xm)
return cm.AddXyzProcedureCustom(c,cm.XyzProcedureRankFilter(rk,f,ext_params),cm.XyzProcedureRankCheck,minct,maxct,xm,exop)
end
function cm.XyzProcedureRankFilter(rk,f,ext_params)
return function(c,xyzc)
......@@ -298,7 +298,7 @@ function cm.XyzProcedureCustomCheck(g,xyzc,tp,gf)
if g:IsExists(cm.XyzProcedureCustomTuneMagicianCheck,1,nil,g) then return false end
return not gf or gf(g,xyzc,tp)
end
function cm.AddXyzProcedureCustom(c,func,gf,minc,maxc,xm,...)
function cm.AddXyzProcedureCustom(c,func,gf,minc,maxc,xm,exop,...)
local ext_params={...}
c:EnableReviveLimit()
local maxc=maxc or minc
......@@ -309,7 +309,7 @@ function cm.AddXyzProcedureCustom(c,func,gf,minc,maxc,xm,...)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.XyzProcedureCustomCondition(func,gf,minc,maxc,ext_params))
e1:SetTarget(cm.XyzProcedureCustomTarget(func,gf,minc,maxc,ext_params))
e1:SetOperation(cm.XyzProcedureCustomOperation(xm))
e1:SetOperation(cm.XyzProcedureCustomOperation(xm,exop))
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
return e1
......@@ -378,9 +378,10 @@ function cm.XyzProcedureCustomTarget(func,gf,minct,maxct,ext_params)
else return false end
end
end
function cm.XyzProcedureCustomOperation(xm)
function cm.XyzProcedureCustomOperation(xm,exop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local g=e:GetLabelObject()
if exop then exop(e,tp,g,c) end
c:SetMaterial(g)
cm.OverlayGroup(c,g,xm,true)
g:DeleteGroup()
......
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