Commit ade84bba authored by Momobako's avatar Momobako

Merge branch 'master' of https://github.com/purerosefallen/ygopro-222DIY into beta

parents 138ea4a4 3bdf54f2
......@@ -69,17 +69,22 @@ after_build:
- rm -rf ygopro-scripts-master ygopro-scripts-master.zip
- mkdir replay
- cp -rf ../../expansions .
- cp -rf ../../gframe .
- cp -rf ../../ocgcore .
- cp -rf ../../premake .
- cp -rf ../../cards.cdb .
- cp -rf ../../textures .
- cp -rf ../../*.lua .
- cp -rf ../../lflist.conf .
- cp -rf ../../strings.conf .
- cp -rf ../../system.conf .
- mv -f ../../expansions .
- mv -f ../../gframe .
- mv -f ../../ocgcore .
- mv -f ../../premake .
- mv -f ../../event .
- mv -f ../../lua .
- mv -f ../../sqlite3 .
- mv -f ../../cards.cdb .
- mv -f ../../textures .
- mv -f ../../premake4.lua .
- mv -f ../../premake5.lua .
- mv -f ../../lflist.conf .
- mv -f ../../strings.conf .
- mv -f ../../system.conf .
- cp -rf ../../ygopro.exe .
- mv -f ../../premake5.exe .
- cd ..
- mkdir redis
......@@ -89,7 +94,7 @@ after_build:
- rm -rf Redis-x64-3.2.100.zip
- cd ..
- cp -rf ../cards.cdb windbot
- cp -rf ygopro/cards.cdb windbot
- cp -rf config.json config.user.json
- cp -rf ../node-v9.1.0-win-x64.zip .
- 7z x node-v9.1.0-win-x64.zip
......
@echo off
set irrklang_pro=1
premake5 vs2015
msbuild build\ygo.sln /m /property:Configuration=Release
del /f ygopro.exe
move bin\release\ygopro.exe .
pause
\ No newline at end of file
No preview for this file type
For keeping the dir.
No preview for this file type
......@@ -12,8 +12,6 @@ function c1156013.initial_effect(c)
c:RegisterEffect(e0)
--
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetDescription(aux.Stringid(1156013,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
......
......@@ -53,7 +53,7 @@ function c1156015.lkfilter(c,lc,tp)
if c:IsType(TYPE_MONSTER) then
return flag and c:IsRace(RACE_SPELLCASTER)
else
return flag and c:IsType(TYPE_SPELL)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
end
function c1156015.lvfilter(c)
......@@ -131,11 +131,11 @@ function c1156015.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
end
--
function c1156015.op2(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
if (re:GetHandler():IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and not re:GetHandler():IsImmuneToEffect(e) then
re:GetHandler():CancelToGrave()
if Duel.MoveToField(re:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEDOWN,true) then
Duel.ConfirmCards(1-tp,re:GetHandler())
Duel.RaiseEvent(re:GetHandler(),EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
re:GetHandler():CancelToGrave()
end
end
end
......
--Psychether Dreamer, Iman
function c17029601.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--scale change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LSCALE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetRange(LOCATION_PZONE)
e2:SetValue(c17029601.scaleval)
c:RegisterEffect(e2)
--scale change
local e3=e2:Clone()
e3:SetCode(EFFECT_CHANGE_RSCALE)
c:RegisterEffect(e3)
--material
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(17029601,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_PZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,17029601)
e4:SetTarget(c17029601.mattg)
e4:SetOperation(c17029601.matop)
c:RegisterEffect(e4)
--Spell in Grave
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_ADD_TYPE)
e5:SetRange(LOCATION_GRAVE)
e5:SetValue(TYPE_SPELL)
c:RegisterEffect(e5)
--spsummon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(17029601,1))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e6:SetCountLimit(1,17029701)
e6:SetTarget(c17029601.sptg)
e6:SetOperation(c17029601.spop)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e7)
--Banish & add
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(17029601,2))
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetCode(EVENT_TO_GRAVE)
e8:SetCategory(CATEGORY_TOHAND)
e8:SetCountLimit(1,17029801)
e8:SetCondition(c17029601.thcon)
e8:SetCost(aux.bfgcost)
e8:SetTarget(c17029601.thtg)
e8:SetOperation(c17029601.thop)
c:RegisterEffect(e8)
--declare & special summon
local e9=Effect.CreateEffect(c)
e9:SetDescription(aux.Stringid(17029601,3))
e9:SetCategory(CATEGORY_SPECIAL_SUMMON)
e9:SetType(EFFECT_TYPE_IGNITION)
e9:SetRange(LOCATION_GRAVE)
e9:SetCountLimit(1,17029901)
e9:SetTarget(c17029601.revtg)
e9:SetOperation(c17029601.revop)
c:RegisterEffect(e9)
end
function c17029601.scfilter(c)
return c:IsSetCard(0x720) and c:IsType(TYPE_SPELL)
end
function c17029601.scaleval(e,c)
if Duel.GetMatchingGroupCount(c17029601.scfilter,c:GetControler(),LOCATION_GRAVE,0,nil)<11 then
return Duel.GetMatchingGroupCount(c17029601.scfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
else
return 10
end
end
function c17029601.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x720)
end
function c17029601.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0x720) and not c:IsType(TYPE_TOKEN)
end
function c17029601.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c17029601.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c17029601.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c17029601.matfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c17029601.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c17029601.matop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsFaceup()
and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c17029601.matfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
function c17029601.spfilter(c,e,tp)
return c:IsSetCard(0x720) and c:IsType(TYPE_SPELL)
and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),0x720,0x21,1000,1000,4,RACE_FAIRY,ATTRIBUTE_LIGHT,POS_FACEUP_ATTACK)
end
function c17029601.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c17029601.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c17029601.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c17029601.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c17029601.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and Duel.IsPlayerCanSpecialSummonMonster(tp,tc:GetCode(),0x720,0x11,1000,1000,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
tc:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK)
tc:AddMonsterAttributeComplete()
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_NORMAL+TYPE_MONSTER)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(0)
tc:RegisterEffect(e2,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(0)
tc:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetValue(1000)
tc:RegisterEffect(e4,true)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(1000)
tc:RegisterEffect(e5,true)
end
end
function c17029601.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_OVERLAY) and re:IsHasType(0x720)
end
function c17029601.thfilter(c,e,tp)
return c:IsSetCard(0x720) and not c:IsCode(17029601)
end
function c17029601.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c17029601.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c17029601.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c17029601.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c17029601.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 c17029601.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER)
end
function c17029601.revop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
c17029611.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCardFilter(tp,table.unpack(c17029611.announce_filter))
Duel.SetTargetParam(ac)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+0x47e0000)
c:RegisterEffect(e1,true)
end
end
end
\ No newline at end of file
--Psychether Guide, Luuht
function c17029602.initial_effect(c)
--Activate, to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029602,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029602+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029602.thtg)
e1:SetOperation(c17029602.thop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029602+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c17029602.spcon)
e2:SetTarget(c17029602.sptg)
e2:SetOperation(c17029602.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029602,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029602.revcon)
e3:SetTarget(c17029602.revtg)
e3:SetOperation(c17029602.revop)
c:RegisterEffect(e3)
end
function c17029602.thfilter(c)
return c:IsSetCard(0x720) and c:IsAbleToHand() and not c:IsCode(17029602)
end
function c17029602.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029602.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c17029602.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c17029602.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c17029602.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x720)
end
function c17029602.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029602.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c17029602.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029602,0x720,0x11,1000,1000,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029602.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029603,0x720,0x11,1000,1000,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029602.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
end
end
function c17029602.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029602.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029602)
end
function c17029602.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029602.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029602.revfilter(c)
return not c:IsPublic()
end
function c17029602.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029602.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029602.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029602.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Psychether Guide, Fidelle
function c17029603.initial_effect(c)
--salvage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029603,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029603+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029603.thtg)
e1:SetOperation(c17029603.thop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029603,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029603+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c17029603.spcon)
e2:SetTarget(c17029603.sptg)
e2:SetOperation(c17029603.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029603,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029603.revcon)
e3:SetTarget(c17029603.revtg)
e3:SetOperation(c17029603.revop)
c:RegisterEffect(e3)
end
function c17029603.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and c:IsAbleToHand() and not c:IsCode(17029603)
end
function c17029603.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(c17029603.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c17029603.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c17029603.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 c17029603.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x720)
end
function c17029603.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029603.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c17029603.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029603,0x720,0x11,1000,1000,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029603.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029603,0x720,0x11,1000,1000,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029603.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
Duel.SpecialSummonComplete()
end
end
function c17029603.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029603.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029603)
end
function c17029603.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029603.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029603.revfilter(c)
return not c:IsPublic()
end
function c17029603.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029603.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029603.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029603.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Psychether Magician, Bombasta
function c17029604.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029604,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029604+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c17029604.descost)
e1:SetTarget(c17029604.destg)
e1:SetOperation(c17029604.desop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029604,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029604+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c17029604.spcost)
e2:SetTarget(c17029604.sptg)
e2:SetOperation(c17029604.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029604,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029604.revcon)
e3:SetTarget(c17029604.revtg)
e3:SetOperation(c17029604.revop)
c:RegisterEffect(e3)
end
function c17029604.costfilter(c,ft)
return c:IsAbleToGraveAsCost()
end
function c17029604.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c17029604.costfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,c,ft) end
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if ft<=0 then
g=Duel.SelectMatchingCard(tp,c17029604.costfilter,tp,LOCATION_MZONE,0,1,1,c,ft)
else
g=Duel.SelectMatchingCard(tp,c17029604.costfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,c,ft)
end
Duel.SendtoGrave(g,REASON_COST)
end
function c17029604.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c17029604.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c17029604.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and c:IsAbleToRemoveAsCost()
end
function c17029604.cfcost(c)
return c:IsCode(17029609) and c:IsAbleToRemoveAsCost()
end
function c17029604.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c17029604.cfilter,tp,LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c17029604.cfcost,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(17029609,1))) then
local tg=Duel.GetFirstMatchingCard(c17029604.cfcost,tp,LOCATION_GRAVE,0,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,c17029604.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function c17029604.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029604,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029604.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029604,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029604.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(17029604,3))
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_SSET)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e5:SetCondition(c17029604.tgcon)
e5:SetTarget(c17029604.tgtg)
e5:SetOperation(c17029604.tgop)
e5:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e5,true)
local e6=e5:Clone()
e6:SetCode(EVENT_MSET)
c:RegisterEffect(e6,true)
Duel.SpecialSummonComplete()
end
end
function c17029604.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029604.tgcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function c17029604.grfilter(c)
return c:IsFacedown() and c:IsAbleToGrave()
end
function c17029604.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsExistingMatchingCard(c17029604.grfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER)
end
function c17029604.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
c17029604.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCardFilter(tp,table.unpack(c17029604.announce_filter))
Duel.SetTargetParam(ac)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
local g=Duel.SelectMatchingCard(tp,c17029604.grfilter,tp,0,LOCATION_ONFIELD,1,2,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
function c17029604.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029604)
end
function c17029604.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029604.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029604.revfilter(c)
return not c:IsPublic()
end
function c17029604.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029604.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029604.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029604.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Psychether Knight, Lancella
function c17029605.initial_effect(c)
--ATK + DEF change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029605,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029605+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029605.atktg)
e1:SetOperation(c17029605.atkop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029605,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029605+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c17029605.spcost)
e2:SetTarget(c17029605.sptg)
e2:SetOperation(c17029605.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029605,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029605.revcon)
e3:SetTarget(c17029605.revtg)
e3:SetOperation(c17029605.revop)
c:RegisterEffect(e3)
end
function c17029605.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FAIRY)
end
function c17029605.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029605.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c17029605.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c17029605.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(tc:GetBaseAttack()+500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(tc:GetBaseDefense()+500)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function c17029605.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and c:IsAbleToRemoveAsCost()
end
function c17029605.cfcost(c)
return c:IsCode(17029609) and c:IsAbleToRemoveAsCost()
end
function c17029605.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c17029605.cfilter,tp,LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c17029605.cfcost,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(17029609,1))) then
local tg=Duel.GetFirstMatchingCard(c17029605.cfcost,tp,LOCATION_GRAVE,0,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,c17029605.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function c17029605.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029605,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029605.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029605,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029605.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(17029605,3))
e5:SetCategory(CATEGORY_ATKCHANGE)
e5:SetHintTiming(TIMING_DAMAGE_STEP)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetCountLimit(1)
e5:SetCondition(c17029605.atkcon1)
e5:SetTarget(c17029605.atktg1)
e5:SetOperation(c17029605.atkop1)
e5:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e5,true)
Duel.SpecialSummonComplete()
end
end
function c17029605.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029605.atkcon1(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d~=nil and d:IsFaceup() and ((a:GetControler()==tp and a:IsSetCard(0x720) and a:IsRelateToBattle())
or (d:GetControler()==tp and d:IsSetCard(0x720) and d:IsRelateToBattle()))
end
function c17029605.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER)
end
function c17029605.atkop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
c17029605.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCardFilter(tp,table.unpack(c17029605.announce_filter))
Duel.SetTargetParam(ac)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsRelateToBattle() or not d:IsRelateToBattle() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetOwnerPlayer(tp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
if a:GetControler()==tp then
e1:SetValue(d:GetAttack()/2)
a:RegisterEffect(e1)
else
e1:SetValue(a:GetAttack()/2)
d:RegisterEffect(e1)
end
end
end
function c17029605.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029605)
end
function c17029605.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029605.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029605.revfilter(c)
return not c:IsPublic()
end
function c17029605.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029605.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029605.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029605.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Psychether Librarian, Kuval
function c17029606.initial_effect(c)
--Excavate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029606,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029606+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029606.exctg)
e1:SetOperation(c17029606.excop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029606,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029606+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c17029606.spcost)
e2:SetTarget(c17029606.sptg)
e2:SetOperation(c17029606.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029606,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029606.revcon)
e3:SetTarget(c17029606.revtg)
e3:SetOperation(c17029606.revop)
c:RegisterEffect(e3)
end
function c17029606.exctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<5 then return false end
local g=Duel.GetDecktopGroup(tp,5)
return g:FilterCount(Card.IsAbleToHand,nil)>0
end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c17029606.excfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x720) and c:IsType(TYPE_SPELL)
end
function c17029606.excop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.ConfirmDecktop(p,5)
local g=Duel.GetDecktopGroup(p,5)
if g:GetCount()>0 then
Duel.DisableShuffleCheck()
if g:IsExists(c17029606.excfilter,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c17029606.excfilter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
end
Duel.ShuffleDeck(p)
end
end
function c17029606.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and c:IsAbleToRemoveAsCost()
end
function c17029606.cfcost(c)
return c:IsCode(17029609) and c:IsAbleToRemoveAsCost()
end
function c17029606.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c17029606.cfilter,tp,LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c17029606.cfcost,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(17029609,1))) then
local tg=Duel.GetFirstMatchingCard(c17029606.cfcost,tp,LOCATION_GRAVE,0,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,c17029606.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function c17029606.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029606,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029606.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029606,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029606.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(17029606,3))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCode(EVENT_PREDRAW)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c17029606.thcon)
e5:SetTarget(c17029606.thtg)
e5:SetOperation(c17029606.thop)
e5:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e5,true)
Duel.SpecialSummonComplete()
end
end
function c17029606.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029606.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
end
function c17029606.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029606) and c:IsAbleToHand() and c:IsFaceup()
end
function c17029606.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c17029606.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c17029606.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c17029606.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
else e:SetLabel(0) end
end
function c17029606.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetLabel()==1 and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c17029606.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029606)
end
function c17029606.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029606.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029606.revfilter(c)
return not c:IsPublic()
end
function c17029606.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029606.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029606.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029606.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Psychether Maiden, Jezebel
function c17029607.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029607,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029607+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029607.tdtg)
e1:SetOperation(c17029607.tdop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029607,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029607+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c17029607.spcost)
e2:SetTarget(c17029607.sptg)
e2:SetOperation(c17029607.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029607,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029607.revcon)
e3:SetTarget(c17029607.revtg)
e3:SetOperation(c17029607.revop)
c:RegisterEffect(e3)
end
function c17029607.tdfilter(c)
return c:IsFaceup() and c:IsSetCard(0x720) and not c:IsCode(17029607) and c:IsAbleToHand()
end
function c17029607.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c17029607.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c17029607.tdfilter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c17029607.tdfilter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c17029607.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,2,nil,REASON_EFFECT)
Duel.ShuffleDeck(tp)
end
end
function c17029607.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and c:IsAbleToRemoveAsCost()
end
function c17029607.cfcost(c)
return c:IsCode(17029609) and c:IsAbleToRemoveAsCost()
end
function c17029607.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c17029607.cfilter,tp,LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c17029607.cfcost,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(17029609,1))) then
local tg=Duel.GetFirstMatchingCard(c17029607.cfcost,tp,LOCATION_GRAVE,0,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,c17029607.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function c17029607.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029607,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029607.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029607,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029607.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
--draw
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(17029607,3))
e5:SetCategory(CATEGORY_DRAW)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_TO_HAND)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c17029607.drcon)
e5:SetTarget(c17029607.drtg)
e5:SetOperation(c17029607.drop)
e5:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e5)
Duel.SpecialSummonComplete()
end
end
function c17029607.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029607.drfilter(c,tp)
return c:IsSetCard(0x720) and c:IsType(TYPE_SPELL)
end
function c17029607.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c17029607.drfilter,1,nil,tp)
end
function c17029607.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c17029607.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c17029607.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029607)
end
function c17029607.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029607.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029607.revfilter(c)
return not c:IsPublic()
end
function c17029607.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029607.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029607.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029607.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Psychether Priestess, Joan
function c17029608.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029608,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029608+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029608.tgtg)
e1:SetOperation(c17029608.tgop)
c:RegisterEffect(e1)
--Activate, SS self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029608,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,17029608+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c17029608.spcost)
e2:SetTarget(c17029608.sptg)
e2:SetOperation(c17029608.spop)
c:RegisterEffect(e2)
--reveal
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029608,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c17029608.revcon)
e3:SetTarget(c17029608.revtg)
e3:SetOperation(c17029608.revop)
c:RegisterEffect(e3)
end
function c17029608.tgfilter(c)
return c:IsSetCard(0x720) and c:IsAbleToGrave()
end
function c17029608.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c17029608.tgfilter,tp,LOCATION_DECK,0,nil)
return g:GetClassCount(Card.GetCode)>1
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK)
end
function c17029608.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c17029608.tgfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,tg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg2=g:Select(tp,1,1,nil)
tg1:Merge(tg2)
Duel.SendtoGrave(tg1,REASON_EFFECT)
end
function c17029608.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and c:IsAbleToRemoveAsCost()
end
function c17029608.cfcost(c)
return c:IsCode(17029609) and c:IsAbleToRemoveAsCost()
end
function c17029608.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c17029608.cfilter,tp,LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c17029608.cfcost,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(17029609,1))) then
local tg=Duel.GetFirstMatchingCard(c17029608.cfcost,tp,LOCATION_GRAVE,0,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,c17029608.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function c17029608.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17029608,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c17029608.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,17029608,0x720,0x21,1500,1500,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17029602,4))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c17029608.valct)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+0x47e0000)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(17029608,3))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EFFECT_DESTROY_REPLACE)
e5:SetRange(LOCATION_MZONE)
e5:SetTarget(c17029608.reptg)
e5:SetValue(c17029608.repval)
e5:SetOperation(c17029608.repop)
e5:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e5,true)
Duel.SpecialSummonComplete()
end
end
function c17029608.valct(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c17029608.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x720) and c:IsLocation(LOCATION_ONFIELD)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT)
end
function c17029608.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c17029608.repfilter,1,nil,tp,e:GetHandler()) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c17029608.repval(e,c)
return c17029608.repfilter(c,e:GetHandlerPlayer())
end
function c17029608.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
function c17029608.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720) and not c:IsCode(17029608)
end
function c17029608.revcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17029608.cfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler())
end
function c17029608.revfilter(c)
return not c:IsPublic()
end
function c17029608.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029608.revfilter,tp,0,LOCATION_HAND,1,nil) end
end
function c17029608.revop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c17029608.revfilter,tp,0,LOCATION_HAND,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Lucidity of the Psychether
function c17029609.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17029609,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17029609+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c17029609.revtg)
e1:SetOperation(c17029609.revop)
c:RegisterEffect(e1)
end
function c17029609.revfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FAIRY)
end
function c17029609.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsExistingMatchingCard(c17029609.revfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER)
end
function c17029609.revop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
c17029611.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCardFilter(tp,table.unpack(c17029611.announce_filter))
Duel.SetTargetParam(ac)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
local g1=Duel.GetMatchingGroup(c17029609.revfilter,tp,LOCATION_MZONE,0,nil)
local tc=g1:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g1:GetNext()
end
end
end
--Fragments of Psychether
function c17029610.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,17029610+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c17029610.discond)
e1:SetTarget(c17029610.distg)
e1:SetOperation(c17029610.disop)
c:RegisterEffect(e1)
end
function c17029610.disfilter(c)
return c:IsFaceup() and c:IsSetCard(0x720)
end
function c17029610.discond(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c17029610.disfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c17029610.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c17029610.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateEffect(ev) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--Psychether Dream Weaver, Ariette
function c17029611.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),4,2)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17029611,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,17029611)
e3:SetCondition(c17029611.drcon)
e3:SetCost(c17029611.drcost)
e3:SetTarget(c17029611.drtg)
e3:SetOperation(c17029611.drop)
c:RegisterEffect(e3)
--Declare and to top
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(17029611,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetRange(LOCATION_MZONE)
e4:SetCategory(CATEGORY_TODECK)
e4:SetCountLimit(1,17029621)
e4:SetCondition(c17029611.tdcon)
e4:SetTarget(c17029611.tdtg)
e4:SetOperation(c17029611.tdop)
c:RegisterEffect(e4)
end
function c17029611.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_SPELL)
end
function c17029611.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c17029611.tgfilter(c)
return c:IsSetCard(0x720) and c:IsDiscardable()
end
function c17029611.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17029611.tgfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c17029611.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,c17029611.tgfilter,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
function c17029611.afilter(c,tp)
return c:IsType(TYPE_SPELL) and c:GetPreviousControler()==tp
and c:IsSetCard(0x720)
end
function c17029611.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:Filter(c17029611.afilter,nil,tp)
return g:GetCount()>0
end
function c17029611.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER)
end
function c17029611.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
c17029611.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCardFilter(tp,table.unpack(c17029611.announce_filter))
Duel.SetTargetParam(ac)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
end
end
\ No newline at end of file
--Psychether Dream Overseer, Helmretta
function c17029612.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),4,3)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--confirm
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(17029612,1))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetCountLimit(1,17029612)
e5:SetCondition(c17029612.cfcon)
e5:SetCost(c17029612.cfcost)
e5:SetTarget(c17029612.cftg)
e5:SetOperation(c17029612.cfop)
c:RegisterEffect(e5)
--Banish
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(17029612,0))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetRange(LOCATION_MZONE)
e6:SetCategory(CATEGORY_REMOVE)
e6:SetCountLimit(1,17029622)
e6:SetCondition(c17029612.rmcon)
e6:SetTarget(c17029612.rmtg)
e6:SetOperation(c17029612.rmop)
c:RegisterEffect(e6)
end
function c17029612.cfcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_SPELL)
end
function c17029612.cfcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c17029612.revfilter(c)
return not c:IsPublic()
end
function c17029612.cftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil)
or Duel.IsExistingMatchingCard(c17029612.revfilter,tp,0,LOCATION_HAND,1,nil)) end
Duel.SetChainLimit(c17029612.chlimit)
end
function c17029612.chlimit(e,ep,tp)
return tp==ep
end
function c17029612.handfilter(c)
return not c:IsPublic()
end
function c17029612.cfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
Duel.ConfirmCards(tp,g)
local g2=Duel.GetMatchingGroup(c17029612.handfilter,tp,0,LOCATION_HAND,nil)
if g2:GetCount()>0 then
local tc=g2:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g2:GetNext()
end
end
end
function c17029612.afilter(c,tp)
return c:IsType(TYPE_SPELL) and c:GetPreviousControler()==tp
and c:IsSetCard(0x720)
end
function c17029612.bfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x720)
end
function c17029612.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(c17029612.bfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
local ct=g1:GetClassCount(Card.GetCode)
return eg:IsExists(c17029611.afilter,1,nil,tp) and ct>2
end
function c17029612.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c17029612.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
......@@ -53,8 +53,32 @@ function c22250102.atkop(e,tp,eg,ep,ev,re,r,rp)
if ac:IsRelateToBattle() and tc:IsRelateToBattle() and c:IsRelateToEffect(e) then
if c:IsPosition(POS_DEFENSE) then Duel.ChangePosition(c,POS_FACEUP_ATTACK) end
if (c22250102.IsRiviera(ac) and ac:IsControler(tp) and tc~=nil and ac~=c) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-300)
e1:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-300)
e1:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e1)
Duel.CalculateDamage(c,tc)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-300)
e1:SetReset(RESET_EVENT+0xfe0000)
ac:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-300)
e1:SetReset(RESET_EVENT+0xfe0000)
ac:RegisterEffect(e1)
Duel.CalculateDamage(c,ac)
end
end
......
......@@ -40,16 +40,15 @@ function c22250161.filter(c,e,zone)
return c22250161.IsRiviera(c) and c:IsType(TYPE_MONSTER) and c:IsSummonable(true,e,0,zone)
end
function c22250161.stg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local zone=e:GetHandler():GetLinkedZone()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and zone~=0 and Duel.IsExistingMatchingCard(c22250161.filter,tp,LOCATION_HAND,0,1,nil,e,0,zone) end
local c=e:GetHandler()
local zone=c:GetLinkedZone()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and zone~=0 and Duel.GetMZoneCount(tp,g,tp,LOCATION_REASON_TOFIELD,zone)>0 and Duel.IsExistingMatchingCard(c22250161.filter,tp,LOCATION_HAND,0,1,nil,e,0,zone) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c22250161.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=e:GetHandler():GetLinkedZone()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 or zone==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 or zone==0 or Duel.GetMZoneCount(tp,g,tp,LOCATION_REASON_TOFIELD,zone)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c22250161.filter,tp,LOCATION_HAND,0,1,1,nil,e,0,zone)
local tc=g:GetFirst()
......
......@@ -6,6 +6,7 @@ function c22251102.initial_effect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(2,22251102+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c22251102.cost)
e1:SetTarget(c22251102.target)
......@@ -45,7 +46,6 @@ end
function c22251102.target(e,tp,eg,ep,ev,re,r,rp,chk)
local flag=Duel.GetFlagEffect(tp,22251102)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
if e:GetLabel()==0 then e:SetProperty(EFFECT_FLAG_PLAYER_TARGET) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
......@@ -55,8 +55,9 @@ function c22251102.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
elseif e:GetLabel()==1 then
while Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>2 do
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT,nil)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
while Duel.GetFieldGroupCount(p,LOCATION_HAND,0)>2 do
Duel.DiscardHand(p,Card.IsDiscardable,1,1,REASON_EFFECT,nil)
end
end
end
......
......@@ -55,7 +55,7 @@ function c22251502.IsRiviera(c)
return m and m.named_with_Riviera
end
function c22251502.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c22251502.IsRiviera(c)
end
function c22251502.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c22251502.thfilter(chkc) end
......
......@@ -50,10 +50,10 @@ function c33700176.op(e,tp,eg,ep,ev,re,r,rp)
Duel.SSet(tp,c)
end
end
function c3700176.thfilter(c,tp)
function c33700176.thfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c3700176.thcon(e,tp,eg,ep,ev,re,r,rp)
function c33700176.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c3700176.thfilter,1,nil,tp)
end
function c33700176.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -41,23 +41,17 @@ function cm.seqcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end
if c:IsRelateToEffect(e) and c:IsControler(tp) then
local seq=c:GetSequence()
if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end
flag=(flag ^ 0xff)
local flag=0xff
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag & ~(0x1 << seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag & ~(0x1 << seq+1) end
Duel.Hint(HINT_SELECTMSG,tp,571)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
local nseq=math.log(s,2)
Duel.MoveSequence(c,nseq)
end
end
......
......@@ -5,6 +5,7 @@ xpcall(function() require("expansions/script/c37564765") end,function() require(
function cm.initial_effect(c)
local ct=Senya.master_rule_3_flag and 3 or 2
Senya.AddXyzProcedureRank(c,nil,nil,ct,ct)
Senya.AddSummonMusic(c,aux.Stringid(m,4),SUMMON_TYPE_XYZ)
Senya.MokouReborn(c,7,m,false,cm.dogcon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
......
......@@ -27,24 +27,19 @@ function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
if not cm.rmtg(e,tp,eg,ep,ev,re,r,rp,0) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsControler(tp) then
local seq=c:GetSequence()
if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end
flag=(flag ^ 0xff)
local flag=0xff
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag & ~(0x1 << seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag & ~(0x1 << seq+1) end
Duel.Hint(HINT_SELECTMSG,tp,571)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
local nseq=math.log(s,2)
Duel.MoveSequence(c,nseq)
end
local g=c:GetColumnGroup():Filter(function(c) return c:IsControler(1-tp) end,nil)
......
--超盖亚黑魔术师
local m=37564341
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
function cm.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND | LOCATION_GRAVE)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE | EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET | 0x14000)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
end
function cm.spfilter(c)
return c:IsAbleToRemoveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,3,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,3,3,nil)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function cm.filter(c)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local maxc=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER):GetClassCount(Card.GetCode)
if chkc then return chkc:IsOnField() and cm.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return maxc>0 and Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,maxc,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
function cm.efilter(e,te)
return te:IsActiveType(TYPE_SPELL | TYPE_TRAP) and te:GetOwner()~=e:GetHandler()
end
......@@ -55,7 +55,7 @@ function cm.rmv(rg)
local te=tc:GetActivateEffect()
if not te then return end
local pr1,pr2=te:GetProperty()
pr2=pr2-(pr2 & EFFECT_FLAG2_COF)
pr2=pr2 & ~EFFECT_FLAG2_COF
te:SetProperty(pr1,pr2)
te:SetHintTiming(0,0)
rg:RemoveCard(tc)
......
--妖精传说-不莱梅
local m=50008003
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.linkfilter,2,2)
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.indval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetCost(cm.cost)
e4:SetTarget(cm.sumtg)
e4:SetOperation(cm.sumop)
c:RegisterEffect(e4)
--spsummon limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,1)
e5:SetTarget(cm.sumlimit)
c:RegisterEffect(e5)
end
function cm.linkfilter(c)
return c:GetAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER)
end
function cm.indval(e,re,tp)
return tp~=e:GetHandlerPlayer()
end
---
function cm.cfilter(c)
return (c:IsRace(RACE_SPELLCASTER) or c:IsType(TYPE_SPELL)) and c:IsAbleToRemoveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.filter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsSummonable(true,nil)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not se:IsActiveType(TYPE_SPELL) and se:IsHasType(EFFECT_TYPE_ACTIONS) and c:IsLocation(LOCATION_GRAVE+LOCATION_DECK)
end
\ No newline at end of file
--妖精传说-爱丽儿
local m=50008004
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:GetAttack()==1850 and c:IsRace(RACE_SPELLCASTER)) and c:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgfilter(c,e,tp)
return c:GetAttack()==1850 and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGrave()
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
end
--
function cm.filter(c,e,tp)
local lv=c:GetLevel()
return lv>0 and c:GetAttack()==1850 and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_EXTRA,0,1,nil,lv+4,e,tp)
end
function cm.exfilter(c,lv,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_SYNCHRO) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or not c:IsRelateToEffect(e) then return end
local rg=Group.FromCards(c,tc)
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.exfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetLevel()+4,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--妖精传说-奥劳拉
local m=50008005
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.linkfilter,2,2)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(cm.immcon)
e1:SetValue(cm.efilter)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(cm.immcon)
e2:SetValue(cm.indval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--activate limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(cm.aclimit1)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(1,0)
e5:SetCondition(cm.econ1)
e5:SetValue(cm.elimit)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetOperation(cm.aclimit3)
c:RegisterEffect(e6)
local e7=e5:Clone()
e7:SetCondition(cm.econ2)
e7:SetTargetRange(0,1)
c:RegisterEffect(e7)
--copy effect
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,0))
e8:SetCategory(CATEGORY_TODECK)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetProperty(EFFECT_FLAG_CARD_TARGET)
e8:SetCountLimit(1,m)
e8:SetCost(cm.cpcost)
e8:SetTarget(cm.cptg)
e8:SetOperation(cm.cpop)
c:RegisterEffect(e8)
end
function cm.linkfilter(c)
return c:GetAttack()==1850 and c:IsRace(RACE_SPELLCASTER)
end
function cm.immcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.efilter(e,te)
local tc=te:GetHandler()
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner() and tc:GetBaseAttack()>=1850
end
function cm.indval(e,c)
return c:GetBaseAttack()>=1850
end
--
function cm.aclimit1(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp or not re:IsActiveType(TYPE_SPELL) or re:IsActiveType(TYPE_EQUIP) then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
function cm.econ1(e)
return e:GetHandler():GetFlagEffect(m)~=0
end
function cm.aclimit3(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not re:IsActiveType(TYPE_SPELL) or re:IsActiveType(TYPE_EQUIP) then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
function cm.econ2(e)
return e:GetHandler():GetFlagEffect(m)~=0
end
function cm.elimit(e,re,tp)
return re:IsActiveType(TYPE_SPELL) and not re:IsActiveType(TYPE_EQUIP) and not re:GetHandler():IsImmuneToEffect(e)
end
--
function cm.costfilter(c)
return (c:IsRace(RACE_SPELLCASTER) or c:IsType(TYPE_SPELL)) and c:IsDiscardable()
end
function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_DISCARD+REASON_COST)
end
function cm.cpfilter(c)
return (c:IsType(TYPE_QUICKPLAY) or c:GetType()==TYPE_SPELL) and c:IsAbleToDeck() and c:CheckActivateEffect(false,true,false)~=nil
end
function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingTarget(cm.cpfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.cpfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.ClearTargetCard()
g:GetFirst():CreateEffectRelation(e)
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,0,0,0)
end
function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
if not te:GetHandler():IsRelateToEffect(e) then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect()
Duel.SendtoDeck(te:GetHandler(),nil,2,REASON_EFFECT)
end
\ No newline at end of file
--妖精传说-糖果屋
local m=50008006
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,cm.sfilter,aux.NonTuner(cm.sfilter),1)
c:EnableReviveLimit()
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CLIENT_HIN)
e3:SetCountLimit(1)
e3:SetCondition(cm.drcon)
e3:SetCost(cm.drcost)
e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop)
c:RegisterEffect(e3)
--To grave
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.rmcon)
e4:SetTarget(cm.rmtg)
e4:SetOperation(cm.rmop)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,4))
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLED)
e5:SetCondition(cm.rmcon1)
e5:SetTarget(cm.rmtg1)
e5:SetOperation(cm.rmop1)
c:RegisterEffect(e5)
end
function cm.sfilter(c)
return c:IsRace(RACE_SPELLCASTER)
end
function cm.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsControler(tp) and c:GetAttack()==1850
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,e,tp)
local ct=g:GetClassCount(Card.GetCode)
return ct>=4
end
function cm.rmcon1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,e,tp)
local ct=g:GetClassCount(Card.GetCode)
return ct>=6
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,e,tp)
local ct=g:GetClassCount(Card.GetCode)
return ct>=2
end
function cm.drcost(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_DISCARD+REASON_COST)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--
function cm.rmfilter(c,ft)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGrave()
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.rmfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_HAND+LOCATION_ONFIELD)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and (g2:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(m,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
if g2:GetCount()>0 and (g1:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(m,3))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
--
function cm.rmtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function cm.rmop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--梅露可 天涯游者
local m=50008100
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m..1)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(cm.atkcon)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
end
function cm.filter(c)
return c:IsFaceup() and mil.is_series(c,'mlk')
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thfilter(c)
return mil.is_series(c,'mlk') and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.Destroy(tc,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
\ No newline at end of file
--梅露可 飘落绵雪
local m=50008101
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetOperation(cm.repop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(cm.indcon)
e3:SetOperation(cm.indop)
c:RegisterEffect(e3)
end
function cm.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and mil.is_series(c,'mlk')
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT))
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,c,tp)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.filter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
end
--
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.spfilter(c,e,tp)
return mil.is_series(c,'mlk') and not c:IsCode(m) 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.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2)
end
\ No newline at end of file
--梅露可 舍身研究者
local m=50008102
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(0,1)
e1:SetValue(function(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end)
e1:SetCondition(function(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp))
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.spcon)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(cm.immcon)
e3:SetOperation(cm.immop)
c:RegisterEffect(e3)
end
function cm.cfilter(c,tp)
return c:IsFaceup() and mil.is_series(c,'mlk') and c:IsControler(tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_PZONE,0) and Duel.GetFieldCard(tp,LOCATION_PZONE,1)
end
function cm.filter(c,e,tp)
return mil.is_series(c,'mlk') 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.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if Duel.Destroy(dg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.immcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
function cm.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
\ No newline at end of file
--梅露可 残黑的乖心
local m=50008103
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--tohand & destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m..1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetCondition(cm.immcon)
e4:SetOperation(cm.immop)
c:RegisterEffect(e4)
end
function cm.thfilter1(c)
return mil.is_series(c,'mlk')
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function cm.thfilter(c,e,tp)
return mil.is_series(c,'mlk') and c:IsFaceup() and c:IsType(TYPE_PENDULUM) and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable()
and Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT)
end
end
function cm.spfilter(c,e,tp)
return mil.is_series(c,'mlk') and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_PZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_PZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.immcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
\ No newline at end of file
--梅露可 刺痛的荆棘牙
local m=50008104
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,cm.lcheck)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(cm.matcheck)
c:RegisterEffect(e1)
--effect gain
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(cm.regcon)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
end
function cm.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function cm.matfilter(c)
return mil.is_series(c,'mlk')
end
function cm.matcheck(e,c)
local g=c:GetMaterial():Filter(cm.matfilter,nil)
local atk=g:GetCount()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*300)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
---
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.tgtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial():Filter(cm.matfilter,nil)
if g:GetCount()>=1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(cm.tgtg)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
if g:GetCount()>=2 then
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(cm.drcon)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
if g:GetCount()>=3 then
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.con)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
--梅露可 矿山守护者
local m=50008105
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2)
c:EnableReviveLimit()
--effect gain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.regcon)
e1:SetOperation(cm.regop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(cm.tdcon)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial():Filter(cm.matfilter,nil)
if g:GetCount()>=1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
--
function cm.matfilter(c)
return mil.is_series(c,'mlk')
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial():Filter(cm.matfilter,nil)
return g:GetCount()>=2
end
function cm.tdfilter(c)
return c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.tdfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
\ No newline at end of file
--梅露可 妖毒穿弩炮
local m=50008106
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_PIERCE)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(cm.pirtg))
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.drcon)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(cm.indcon)
e3:SetOperation(cm.indop)
c:RegisterEffect(e3)
end
function cm.pirtg(c)
return mil.is_series(c,'mlk')
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
\ No newline at end of file
--梅露可 螺拗的晶灿灰
local m=50008107
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
aux.AddLinkProcedure(c,nil,2)
c:EnableReviveLimit()
--effect gain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.regcon)
e1:SetOperation(cm.regop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,6))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(cm.drcon)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
function cm.matfilter(c)
return mil.is_series(c,'mlk')
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial():Filter(cm.matfilter,nil)
if g:GetCount()>=1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.limcon)
e1:SetOperation(cm.limop)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_CHAIN_END)
e3:SetOperation(cm.limop2)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
if g:GetCount()>=2 then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_MSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SET_POSITION)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetValue(POS_FACEUP_ATTACK)
e5:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e5)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
if g:GetCount()>=3 then
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,4))
e6:SetCategory(CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCost(cm.rmcost)
e6:SetTarget(cm.rmtg)
e6:SetOperation(cm.rmop)
e6:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e6)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
if g:GetCount()>=4 then
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(m,5))
e7:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e7:SetCode(EVENT_CHAINING)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetCondition(cm.negcon)
e7:SetTarget(cm.negtg)
e7:SetOperation(cm.negop)
e7:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e7)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
end
end
function cm.limfilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.limcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.limfilter,1,nil,tp)
end
function cm.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(cm.chainlm)
elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(cm,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function cm.limop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(m)~=0 then
Duel.SetChainLimitTillChainEnd(cm.chainlm)
end
e:GetHandler():ResetFlagEffect(m)
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
function cm.rmcost(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 cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial():Filter(cm.matfilter,nil)
return g:GetCount()>=5
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--梅露可物语
local m=50008108
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(cm.atkfilter))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.drtg)
e4:SetOperation(cm.drop)
c:RegisterEffect(e4)
end
function cm.atkfilter(c)
return mil.is_series(c,'mlk')
end
function cm.filter(c)
return mil.is_series(c,'mlk') and c:IsType(TYPE_PENDULUM) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToDeck()
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil)
if g:GetCount()<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,3,3,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--永劫的幻梦
local m=50008109
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(cm.gcost)
e2:SetTarget(cm.gtg)
e2:SetOperation(cm.gop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return mil.is_series(c,'mlk') and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.gcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function cm.gfilter(c)
return c:IsFaceup() and mil.is_series(c,'mlk')
end
function cm.gtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and cm.gfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.gfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.gfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.gop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0 then
Duel.BreakEffect()
local tc=Duel.GetFirstTarget()
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--梅露可 纵牵的耀丝
local m=50008110
local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_mlk=true
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
--effect gain
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(cm.regcon)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
end
function cm.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup()
local tc=g:GetFirst()
local atk=0
while tc do
if mil.is_series(tc,'mlk') then
atk=atk+tc:GetBaseAttack()/2
end
tc=g:GetNext()
end
if atk>0 then
atk=atk+1000
end
return atk
end
function cm.matfilter(c)
return mil.is_series(c,'mlk')
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial():Filter(cm.matfilter,nil)
if g:GetCount()>=1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
if g:GetCount()>=2 then
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(cm.descost)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
if g:GetCount()>=3 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(cm.disable)
e3:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e3)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
end
function cm.disable(e,c)
return c:GetAttack()<=2000 and (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT)
end
function cm.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.descost(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 cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
#222DIY
#YGOCC
!setname 0x720 灵以太
#鲶 5 0xfa0-0xfaf
!setname 0xffac Lapin
!setname 0xffad Doe
......@@ -145,6 +148,7 @@
#奇犽 500 0x500-0x50f
!setname 0x50c 奇犽
#is_series_with_rabbit 点兔
#is_series_with_mlk 梅露可
#Miyuki 573 0x570-0x57f global:miyuki
......
@echo off
cd ygopro-server/redis
start redis-server.exe
cd ../windbot
start windbot.exe 2399
start windbot.exe servermode=true serverport=2399
cd ..
node.exe ygopro-server.js
pause
\ No newline at end of file
......@@ -2,12 +2,12 @@
#nickname & gamename should be less than 20 characters
use_d3d = 0
antialias = 2
errorlog = 1
nickname = Player
errorlog = 2
nickname = Komeiji Koishi
gamename = Game
lastdeck = new
textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf
textfont = c:/windows/fonts/simhei.ttf 14
numfont = c:/windows/fonts/arial.ttf
serverport = 7911
lasthost = 127.0.0.1
lastport = 7911
......@@ -25,7 +25,7 @@ control_mode = 0
draw_field_spell = 1
separate_clear_button = 1
#auto_search_limit >= 0: Start search automatically when the user enters N chars
auto_search_limit = -1
auto_search_limit = 2
ignore_deck_changes = 0
enable_sound = 1
enable_music = 1
......
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