Commit 366517aa authored by mercury233's avatar mercury233

add 23PR

parent fbdeef5e
--千六百七十七万工房
function c1259814.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1259814,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1)
e1:SetTarget(c1259814.tg)
e1:SetOperation(c1259814.op)
c:RegisterEffect(e1)
end
function c1259814.filter(c)
if not c:IsFaceup() then return false end
if not c:IsRace(RACE_MACHINE) then return true end
local ct=0
local attr=1
for i=1,7 do
if c:IsAttribute(attr) then ct=ct+1 end
attr=attr<<1
end
return ct<6
end
function c1259814.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1259814.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1259814.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c1259814.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c1259814.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetValue(ATTRIBUTE_ALL-ATTRIBUTE_DIVINE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(RACE_MACHINE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
--エクストクス・ハイドラ
local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,s.mfilter,2,63,true)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(s.atktg)
e1:SetValue(s.atkval)
c:RegisterEffect(e1)
--material check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.regcon)
e2:SetOperation(s.regop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,5))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(s.drcon)
e3:SetTarget(s.drtg)
e3:SetOperation(s.drop)
c:RegisterEffect(e3)
end
function s.mfilter(c,fc)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsOnField() and c:IsControler(fc:GetControler())
end
function s.checkfilter(c,rtype)
return c:IsType(rtype)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
if #g==0 then return end
if g:IsExists(s.checkfilter,1,nil,TYPE_FUSION) then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0))
end
if g:IsExists(s.checkfilter,1,nil,TYPE_SYNCHRO) then
c:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
if g:IsExists(s.checkfilter,1,nil,TYPE_XYZ) then
c:RegisterFlagEffect(id+o*2,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
if g:IsExists(s.checkfilter,1,nil,TYPE_PENDULUM) then
c:RegisterFlagEffect(id+o*3,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
end
if g:IsExists(s.checkfilter,1,nil,TYPE_LINK) then
c:RegisterFlagEffect(id+o*4,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4))
end
end
function s.atktg(e,c)
if not c:IsFaceup() then return false end
local ec=e:GetHandler()
local b1=ec:GetFlagEffect(id)>0 and c:IsType(TYPE_FUSION)
local b2=ec:GetFlagEffect(id+o)>0 and c:IsType(TYPE_SYNCHRO)
local b3=ec:GetFlagEffect(id+o*2)>0 and c:IsType(TYPE_XYZ)
local b4=ec:GetFlagEffect(id+o*3)>0 and c:IsType(TYPE_PENDULUM)
local b5=ec:GetFlagEffect(id+o*4)>0 and c:IsType(TYPE_LINK)
return b1 or b2 or b3 or b4 or b5
end
function s.atkval(e,c)
return -c:GetBaseAttack()
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and ev>=1000
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local val=math.floor(ev/1000)
if chk==0 then return Duel.IsPlayerCanDraw(tp,val) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(val)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,val)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if d>0 then
Duel.Draw(p,d,REASON_EFFECT)
end
end
--液状巨人ダイダラタント
function c39943352.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--xyz material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39943352,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,39943352)
e1:SetTarget(c39943352.xyztg)
e1:SetOperation(c39943352.xyzop)
c:RegisterEffect(e1)
--pzone move 1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39943352,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,39943353)
e2:SetCost(c39943352.pencost1)
e2:SetTarget(c39943352.pentg)
e2:SetOperation(c39943352.penop1)
c:RegisterEffect(e2)
--pzone move 2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(39943352,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,39943354)
e3:SetCondition(c39943352.pencon2)
e3:SetTarget(c39943352.pentg)
e3:SetOperation(c39943352.penop2)
c:RegisterEffect(e3)
end
c39943352.pendulum_level=4
function c39943352.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c39943352.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c39943352.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c39943352.filter,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanOverlay() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c39943352.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c39943352.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsImmuneToEffect(e) and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
function c39943352.pencost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c39943352.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c39943352.pmfilter(c)
return c:IsType(TYPE_PENDULUM)
end
function c39943352.penop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then return end
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c39943352.pmfilter),tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(39943352,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c39943352.pmfilter),tp,LOCATION_GRAVE,0,1,1,nil)
Duel.BreakEffect()
Duel.SendtoExtraP(g,nil,REASON_EFFECT)
end
end
function c39943352.pencon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c39943352.penop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
--トライエッジ・マスター
function c52445243.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--synchro summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,52445243)
e1:SetCondition(c52445243.con)
e1:SetTarget(c52445243.tg)
e1:SetOperation(c52445243.op)
c:RegisterEffect(e1)
--material check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c52445243.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c52445243.valcheck(e,c)
e:GetLabelObject():SetLabel(0)
local g=c:GetMaterial()
if #g>=3 then
e:GetLabelObject():SetLabel(1|2|4)
return
end
local b1=g:IsExists(Card.IsLevel,1,nil,1) and g:IsExists(Card.IsLevel,1,nil,5)
local b2=g:IsExists(Card.IsLevel,1,nil,2) and g:IsExists(Card.IsLevel,1,nil,4)
local b3=g:IsExists(Card.IsLevel,2,nil,3)
if b1 then
e:GetLabelObject():SetLabel(1)
end
if b2 then
e:GetLabelObject():SetLabel(2)
end
if b3 then
e:GetLabelObject():SetLabel(4)
end
end
function c52445243.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetLabel()~=0
end
function c52445243.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=e:GetLabel()
local des=ct&1>0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
local draw=ct&2>0 and Duel.IsPlayerCanDraw(tp,1)
local tun=ct&4>0 and not c:IsType(TYPE_TUNER)
if chk==0 then return des or draw or tun end
e:SetCategory(0)
if des then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_ALL,LOCATION_ONFIELD)
e:SetCategory(CATEGORY_DESTROY)
end
if draw then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:SetCategory(e:GetCategory()|CATEGORY_DRAW)
end
end
function c52445243.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
local des=ct&1>0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,aux.ExceptThisCard(e))
local draw=ct&2>0 and Duel.IsPlayerCanDraw(tp,1)
local tun=ct&4>0 and not c:IsType(TYPE_TUNER) and c:IsRelateToChain() and c:IsFaceup()
if des then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
if draw or tun then Duel.BreakEffect() end
end
if draw then
Duel.Draw(tp,1,REASON_EFFECT)
if tun then Duel.BreakEffect() end
end
if tun then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
--綱引犬会
--not fully implemented
function c65938950.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetCode(EVENT_DRAW)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(c65938950.drcon)
e2:SetCost(c65938950.drcost)
e2:SetTarget(c65938950.drtg)
e2:SetOperation(c65938950.drop)
c:RegisterEffect(e2)
--loss lp
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EVENT_CUSTOM+65938950)
e3:SetRange(LOCATION_FZONE)
e3:SetTarget(c65938950.lptg)
e3:SetOperation(c65938950.lpop)
c:RegisterEffect(e3)
end
function c65938950.drcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RULE and tp==Duel.GetTurnPlayer()
end
function c65938950.tdfilter(c)
return not c:IsPublic() and c:IsType(TYPE_TUNER)
end
function c65938950.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=eg:Filter(c65938950.tdfilter,1,nil)
if chk==0 then return #tg>0 end
local tunp=Duel.GetTurnPlayer()
local tc=tg:GetFirst()
if #tg>1 then
Duel.Hint(HINT_SELECTMSG,tunp,HINTMSG_CONFIRM)
tc=tg:Select(tunp,1,1,nil):GetFirst()
end
Duel.ConfirmCards(1-tunp,tc)
Duel.ShuffleHand(tunp)
end
function c65938950.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tunp=Duel.GetTurnPlayer()
if chk==0 then return Duel.IsPlayerCanDraw(tunp,2) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tunp,2)
end
function c65938950.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tunp=Duel.GetTurnPlayer()
local cp=e:GetHandlerPlayer()
if Duel.Draw(tunp,2,REASON_EFFECT)>0 and tunp~=cp then
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+65938950,e,0,cp,0,0)
end
end
function c65938950.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,0,0)
end
function c65938950.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lp=Duel.GetLP(tp)
Duel.SetLP(tp,lp-2000)
if Duel.GetLP(tp)<lp and c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
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