Commit 551543f8 authored by argon.sun's avatar argon.sun

fix & new scripts

parent 74cbf991
......@@ -1241,9 +1241,9 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
}
for (int i = 0; i < count; ++i) {
pcard = *(mainGame->dField.deck[player].rbegin() + i);
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code));
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(pcard->code));
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(code);
mainGame->logParam.push_back(pcard->code);
float shift = -0.15f;
if (player == 1) shift = 0.15f;
pcard->dPos = irr::core::vector3df(shift, 0, 0);
......
......@@ -6,6 +6,7 @@ function c10132124.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(c10132124.spcon)
e1:SetTarget(c10132124.sptg)
......
--覚醒戦士 クーフーリン
function c10789972.initial_effect(c)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10789972,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c10789972.cost)
e1:SetOperation(c10789972.operation)
c:RegisterEffect(e1)
end
function c10789972.cfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToRemoveAsCost()
end
function c10789972.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10789972.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c10789972.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
e:SetLabel(g:GetFirst():GetAttack())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c10789972.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_STANDBY,2)
c:RegisterEffect(e1)
end
end
......@@ -7,36 +7,28 @@ function c14154221.initial_effect(c)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetDescription(aux.Stringid(14154221,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c14154221.check)
e2:SetCountLimit(1)
e2:SetCondition(c14154221.condition)
e2:SetTarget(c14154221.target)
e2:SetOperation(c14154221.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(14154221,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(14154221)
e3:SetTarget(c14154221.target)
e3:SetOperation(c14154221.operation)
c:RegisterEffect(e3)
end
function c14154221.cfilter(c)
local st=c:GetSummonType()
return st>=(SUMMON_TYPE_SPECIAL+150) and st<(SUMMON_TYPE_SPECIAL+180)
end
function c14154221.check(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(14154221)==0 and eg:IsExists(c14154221.cfilter,1,nil) then
c:RegisterFlagEffect(14154221,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.RaiseSingleEvent(c,14154221,e,r,rp,0,0)
end
function c14154221.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c14154221.cfilter,1,nil)
end
function c14154221.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
......
......@@ -14,33 +14,40 @@ function c15854426.initial_effect(c)
e2:SetOperation(c15854426.check)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(15854426,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(15854426)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_TO_HAND)
e3:SetCountLimit(1)
e3:SetCondition(c15854426.condition)
e3:SetTarget(c15854426.target)
e3:SetOperation(c15854426.operation)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c15854426.cfilter(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:GetDestination()==LOCATION_HAND
end
function c15854426.check(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(15854426)==0 and eg:IsExists(c15854426.cfilter,1,nil,tp) then
c:RegisterFlagEffect(15854426,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.RaiseSingleEvent(c,15854426,e,r,rp,0,0)
local tc=eg:GetFirst()
while tc do
if tc:IsControler(tp) and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_WIND) and tc:GetDestination()==LOCATION_HAND then
tc:RegisterFlagEffect(15854426,RESET_EVENT+0x15e0000,0,1)
end
tc=eg:GetNext()
end
end
function c15854426.cfilter(c)
return c:GetFlagEffect(15854426)~=0
end
function c15854426.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c15854426.cfilter,1,nil)
end
function c15854426.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WIND)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c15854426.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(c15854426.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......
--ドリアードの祈り
function c23965037.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,99414168))
end
--ジャベリンビートル
function c26932788.initial_effect(c)
c:EnableReviveLimit()
end
......@@ -35,15 +35,13 @@ function c27383110.filter(c,e,tp,m)
end
function c27383110.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return false end
local mg=Duel.GetRitualMaterial(tp,nil)
local mg=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(c27383110.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c27383110.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local mg=Duel.GetRitualMaterial(tp,nil)
local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c27383110.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
......
--マジシャン·オブ·ブラックカオス
function c30208479.initial_effect(c)
c:EnableReviveLimit()
end
--ハングリーバーガー
function c30243636.initial_effect(c)
c:EnableReviveLimit()
end
--スカルライダーの復活
function c31066283.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,99721536))
end
--ƥʯ
function c31812496.initial_effect(c)
--deepen damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c31812496.dcon)
e1:SetOperation(c31812496.dop)
c:RegisterEffect(e1)
end
function c31812496.dcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and Duel.GetAttackTarget()==c
end
function c31812496.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,Duel.GetBattleDamage(ep)*2)
end
--デビルズ·ミラー
function c31890399.initial_effect(c)
c:EnableReviveLimit()
end
......@@ -7,22 +7,18 @@ function c32835363.initial_effect(c)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetDescription(aux.Stringid(32835363,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c32835363.regop)
e2:SetCountLimit(1)
e2:SetOperation(c32835363.damcon)
e2:SetTarget(c32835363.damtg)
e2:SetOperation(c32835363.damop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(32835363,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(32835363)
e3:SetTarget(c32835363.damtg)
e3:SetOperation(c32835363.damop)
c:RegisterEffect(e3)
end
function c32835363.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(32835363)~=0 then return end
function c32835363.damcon(e,tp,eg,ep,ev,re,r,rp)
local d1=false
local d2=false
local tc=eg:GetFirst()
......@@ -38,24 +34,22 @@ function c32835363.regop(e,tp,eg,ep,ev,re,r,rp)
elseif d1 then evt_p=tp
elseif d2 then evt_p=1-tp
else return end
Duel.RaiseSingleEvent(e:GetHandler(),32835363,e,0,0,evt_p,0)
e:GetHandler():RegisterFlagEffect(32835363,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:SetLabel(evt_p)
end
function c32835363.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetPlayer(ep)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
local damp=e:GetLabel()
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,ep,800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,damp,800)
end
function c32835363.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if ep==PLAYER_ALL then
Duel.Damage(tp,d,REASON_EFFECT)
Duel.Damage(1-tp,d,REASON_EFFECT)
else
Duel.Damage(ep,d,REASON_EFFECT)
end
if not e:GetHandler():IsRelateToEffect(e) then return end
local damp=e:GetLabel()
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if damp==PLAYER_ALL then
Duel.Damage(tp,d,REASON_EFFECT)
Duel.Damage(1-tp,d,REASON_EFFECT)
else
Duel.Damage(damp,d,REASON_EFFECT)
end
end
--灼熱の試練
function c33031674.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,60258960))
end
--スーパー·ウォー·ライオン
function c33951077.initial_effect(c)
c:EnableReviveLimit()
end
--ローガーディアン
function c3627449.initial_effect(c)
c:EnableReviveLimit()
end
--チャクラの復活
function c39399168.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,65393205))
end
--ジャベリンビートルの契約
function c41182875.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,26932788))
end
--イリュージョンの儀式
function c41426869.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c41426869.target)
e1:SetOperation(c41426869.activate)
c:RegisterEffect(e1)
end
function c41426869.filter(c,e,tp,m)
if c:GetCode()~=64631466 or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
local result=false
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
return result
end
function c41426869.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return false end
local mg=Duel.GetRitualMaterial(tp,nil)
return Duel.IsExistingMatchingCard(c41426869.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c41426869.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local mg=Duel.GetRitualMaterial(tp,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c41426869.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,64631466))
end
--踊りによる誘発
function c43417563.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,4849037))
end
--ローの祈り
function c43694075.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,3627449))
end
--スチームロイド
function c44729197.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_START)
e1:SetOperation(c44729197.operation)
c:RegisterEffect(e1)
end
function c44729197.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetAttackTarget()==nil then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
if c==Duel.GetAttacker() then
e1:SetValue(500)
else e1:SetValue(-500) end
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
e1:SetCondition(c44729197.condtion)
e1:SetValue(c44729197.val)
c:RegisterEffect(e1)
end
function c44729197.condtion(e)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL
end
function c44729197.val(e,c)
if Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()~=nil then return 500
elseif e:GetHandler()==Duel.GetAttackTarget() then return -500
else return 0 end
end
--リチュアの儀水鏡
function c46159582.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c46159582.target)
e1:SetOperation(c46159582.activate)
c:RegisterEffect(e1)
aux.AddRitualProcEqual(c,c46159582.ritual_filter)
--salvage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46159582,0))
......@@ -20,42 +13,8 @@ function c46159582.initial_effect(c)
e1:SetOperation(c46159582.op)
c:RegisterEffect(e1)
end
function c46159582.filter(c,e,tp,m)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsSetCard(0x3a)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,c)
end
return result
end
function c46159582.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return false end
local mg=Duel.GetRitualMaterial(tp,nil)
return Duel.IsExistingMatchingCard(c46159582.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c46159582.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local mg=Duel.GetRitualMaterial(tp,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c46159582.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
function c46159582.ritual_filter(c)
return c:IsSetCard(0x3a) and bit.band(c:GetType(),0x81)==0x81
end
function c46159582.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
......
--ダンシング·ソルジャー
function c4849037.initial_effect(c)
c:EnableReviveLimit()
end
--仮面魔獣マスクド·ヘルレイザー
function c49064413.initial_effect(c)
c:EnableReviveLimit()
end
--軍隊ピラニア
function c50823978.initial_effect(c)
--deepen damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c50823978.dcon)
e1:SetOperation(c50823978.dop)
c:RegisterEffect(e1)
end
function c50823978.dcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and c==Duel.GetAttacker() and Duel.GetAttackTarget()==nil
end
function c50823978.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,Duel.GetBattleDamage(ep)*2)
end
--ボーガニアン
function c52090844.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(52090844,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_REPEAT)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c52090844.condition)
e1:SetTarget(c52090844.target)
e1:SetOperation(c52090844.operation)
c:RegisterEffect(e1)
end
function c52090844.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c52090844.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(600)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,600)
end
function c52090844.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--破滅の儀式
function c52913738.initial_effect(c)
--Activate
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,30646525))
--To Deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c52913738.target)
e1:SetOperation(c52913738.activate)
e1:SetDescription(aux.Stringid(52913738,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c52913738.regcon)
e1:SetCost(c52913738.regcost)
e1:SetOperation(c52913738.regop)
c:RegisterEffect(e1)
--To Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(52913738,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c52913738.regcon)
e2:SetCost(c52913738.regcost)
e2:SetOperation(c52913738.regop)
c:RegisterEffect(e2)
end
function c52913738.filter(c,e,tp,m)
if c:GetCode()~=30646525 or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
local result=false
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
return result
end
function c52913738.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return false end
local mg=Duel.GetRitualMaterial(tp,nil)
return Duel.IsExistingMatchingCard(c52913738.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c52913738.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local mg=Duel.GetRitualMaterial(tp,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c52913738.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c52913738.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
......
--Lξ
function c53530069.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53530069,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_REPEAT)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c53530069.condition)
e1:SetTarget(c53530069.target)
e1:SetOperation(c53530069.operation)
c:RegisterEffect(e1)
end
function c53530069.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and e:GetHandler():IsAttack()
end
function c53530069.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c53530069.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) and c:IsRelateToEffect(e) then
Duel.Recover(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
--ファイヤー·トルーパー
function c53927679.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53927679,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCost(c53927679.cost)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c53927679.tg)
e1:SetOperation(c53927679.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c53927679.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c53927679.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c53927679.op(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
--炎帝近衛兵
function c54040221.initial_effect(c)
--to deck and draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(54040221,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c54040221.tg)
e1:SetOperation(c54040221.op)
c:RegisterEffect(e1)
end
function c54040221.filter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToDeck()
end
function c54040221.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c54040221.filter(chkc) end
if chk==0 then return true end
if Duel.IsExistingTarget(c54040221.filter,tp,LOCATION_GRAVE,0,4,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c54040221.filter,tp,LOCATION_GRAVE,0,4,4,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
end
function c54040221.op(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=4 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==4 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
--カオス·ソルジャー
function c5405694.initial_effect(c)
c:EnableReviveLimit()
end
--ライオンの儀式
function c54539105.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,33951077))
end
......@@ -55,9 +55,9 @@ function c54702678.disop(e,tp,eg,ep,ev,re,r,rp)
end
function c54702678.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c54702678.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
--カオスの儀式
function c55761792.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,5405694))
end
--泣き神の石像
function c5763020.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5763020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c5763020.spcost)
e1:SetTarget(c5763020.sptg)
e1:SetOperation(c5763020.spop)
c:RegisterEffect(e1)
end
function c5763020.costfilter(c)
return c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost()
end
function c5763020.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c5763020.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c5763020.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c5763020.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)
end
function c5763020.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 or not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--大地讃頌
function c59820352.initial_effect(c)
aux.AddRitualProcEqual(c,c59820352.ritual_filter)
end
function c59820352.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_EARTH)
end
--救世の儀式
function c60234913.initial_effect(c)
--Activate
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,61757117))
--untargetable
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c60234913.target)
e1:SetOperation(c60234913.activate)
e1:SetDescription(aux.Stringid(60234913,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c60234913.utcost)
e1:SetTarget(c60234913.uttg)
e1:SetOperation(c60234913.utop)
c:RegisterEffect(e1)
--untargetable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60234913,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c60234913.utcost)
e2:SetTarget(c60234913.uttg)
e2:SetOperation(c60234913.utop)
c:RegisterEffect(e2)
end
function c60234913.spfilter(c,e,tp,m)
if c:GetCode()~=61757117 or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
local result=false
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
return result
end
function c60234913.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return false end
local mg=Duel.GetRitualMaterial(tp,nil)
return Duel.IsExistingMatchingCard(c60234913.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c60234913.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local mg=Duel.GetRitualMaterial(tp,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c60234913.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c60234913.utcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
......
--伝説の爆炎使い
function c60258960.initial_effect(c)
c:EnableReviveLimit()
c:EnableCounterPermit(0x3001)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c60258960.acop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60258960,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c60258960.descost)
e2:SetTarget(c60258960.destg)
e2:SetOperation(c60258960.desop)
c:RegisterEffect(e2)
end
function c60258960.acop(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x3001,1)
end
end
function c60258960.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x3001,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x3001,1,REASON_COST)
end
function c60258960.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c60258960.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
--奇跡の方舟
function c60365591.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,86327225))
end
--大邪神の儀式
function c60369732.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,62420419))
end
--要塞クジラ
function c62337487.initial_effect(c)
c:EnableReviveLimit()
end
--大邪神レシェフ
function c62420419.initial_effect(c)
c:EnableReviveLimit()
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62420419,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c62420419.cost)
e1:SetTarget(c62420419.target)
e1:SetOperation(c62420419.operation)
c:RegisterEffect(e1)
end
function c62420419.cfilter(c)
return c:IsDiscardable() and c:IsType(TYPE_SPELL)
end
function c62420419.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62420419.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c62420419.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c62420419.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c62420419.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--究極竜騎士
function c62873545.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,5405694,23995346,true,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c62873545.splimit)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c62873545.atkval)
c:RegisterEffect(e2)
end
c62873545.material_count=2
c62873545.material={5405694,23995346}
function c62873545.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c62873545.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON)
end
function c62873545.atkval(e,c)
return Duel.GetMatchingGroupCount(c62873545.filter,c:GetControler(),LOCATION_MZONE,0,c)*500
end
--チャクラ
function c65393205.initial_effect(c)
c:EnableReviveLimit()
end
......@@ -27,9 +27,13 @@ function c67169062.tgfilter(c,e)
end
function c67169062.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:IsExists(c67169062.tgfilter,1,nil,e) then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
--奈落との契約
function c69035382.initial_effect(c)
aux.AddRitualProcEqual(c,c69035382.ritual_filter)
end
function c69035382.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_DARK)
end
--ゼラ
function c69123138.initial_effect(c)
c:EnableReviveLimit()
end
--合成魔術
function c72446038.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,84385264))
end
--白竜の聖騎士
function c73398797.initial_effect(c)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73398797,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(c73398797.descon)
e1:SetTarget(c73398797.destg)
e1:SetOperation(c73398797.desop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(73398797,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c73398797.spcost)
e2:SetTarget(c73398797.sptg)
e2:SetOperation(c73398797.spop)
c:RegisterEffect(e2)
if not c73398797.global_check then
c73398797.global_check=true
c73398797[0]=true
c73398797[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c73398797.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c73398797.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c73398797.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsCode(89631139) then
c73398797[tc:GetControler()]=false
end
end
function c73398797.clear(e,tp,eg,ep,ev,re,r,rp)
c73398797[0]=true
c73398797[1]=true
end
function c73398797.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsPosition(POS_FACEDOWN_DEFENCE)
end
function c73398797.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetAttackTarget(),1,0,0)
end
function c73398797.desop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d:IsRelateToBattle() then
Duel.Destroy(d,REASON_EFFECT)
end
end
function c73398797.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c73398797[tp] and e:GetHandler():IsReleaseable()end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,89631139))
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+RESET_END)
Duel.RegisterEffect(e1,tp)
Duel.Release(e:GetHandler(),REASON_COST)
end
function c73398797.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c73398797.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73398797.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c73398797.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,c73398797.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--カオス-黒魔術の儀式
function c76792184.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,30208479))
end
--亀の誓い
function c76806714.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,91782219))
end
--要塞クジラの誓い
function c77454922.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,62337487))
end
--ガルマソードの誓い
function c78577570.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,90844184))
end
--リバースソウル
function c78864369.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c78864369.target)
e1:SetOperation(c78864369.activate)
c:RegisterEffect(e1)
end
function c78864369.filter(c)
return c:IsType(TYPE_FLIP) and c:IsAbleToDeck()
end
function c78864369.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c78864369.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c78864369.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c78864369.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c78864369.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
\ No newline at end of file
--ハンバーガーのレシピ
function c80811661.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,30243636))
end
--ゼラの儀式
function c81756897.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,69123138))
end
--悪魔鏡の儀式
function c81933259.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,31890399))
end
--エンド·オブ·ザ·ワールド
function c8198712.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c8198712.target)
e1:SetOperation(c8198712.activate)
c:RegisterEffect(e1)
aux.AddRitualProcEqual(c,c8198712.ritual_filter)
end
function c8198712.filter(c,e,tp,m)
local cd=c:GetCode()
if (cd~=72426662 and cd~=46427957) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,c)
end
return result
end
function c8198712.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return false end
local mg=Duel.GetRitualMaterial(tp,nil)
local res=Duel.IsExistingMatchingCard(c8198712.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c8198712.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local mg=Duel.GetRitualMaterial(tp,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c8198712.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
function c8198712.ritual_filter(c)
local code=c:GetCode()
return c==72426662 or c==46427957
end
--ライカン·スロープ
function c84385264.initial_effect(c)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84385264,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c84385264.damcon)
e1:SetTarget(c84385264.damtg)
e1:SetOperation(c84385264.damop)
c:RegisterEffect(e1)
end
function c84385264.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c84385264.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_NORMAL)*200
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c84385264.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_NORMAL)*200
Duel.Damage(p,dam,REASON_EFFECT)
end
--プリンセス人魚
function c85802526.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85802526,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_REPEAT)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c85802526.condition)
e1:SetTarget(c85802526.target)
e1:SetOperation(c85802526.operation)
c:RegisterEffect(e1)
end
function c85802526.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c85802526.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
end
function c85802526.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Recover(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
--天界王 シナト
function c86327225.initial_effect(c)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86327225,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c86327225.damcon)
e1:SetTarget(c86327225.damtg)
e1:SetOperation(c86327225.damop)
c:RegisterEffect(e1)
end
function c86327225.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
and bit.band(bc:GetBattlePosition(),POS_DEFENCE)~=0
end
function c86327225.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local dam=bc:GetBaseAttack()
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c86327225.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--ガルマソード
function c90844184.initial_effect(c)
c:EnableReviveLimit()
end
--踊る妖精
function c90925163.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(90925163,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_REPEAT)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c90925163.condition)
e1:SetTarget(c90925163.target)
e1:SetOperation(c90925163.operation)
c:RegisterEffect(e1)
end
function c90925163.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and e:GetHandler():IsDefence()
end
function c90925163.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c90925163.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsPosition(POS_FACEUP_DEFENCE) then
Duel.Recover(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
--クラブ·タートル
function c91782219.initial_effect(c)
c:EnableReviveLimit()
end
--仮面魔獣の儀式
function c94377247.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,49064413))
end
......@@ -8,35 +8,26 @@ function c95714077.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95714077,0))
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(95714077)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c95714077.thcon)
e2:SetTarget(c95714077.thtg)
e2:SetOperation(c95714077.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetOperation(c95714077.regop)
c:RegisterEffect(e3)
end
function c95714077.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x58) and c:GetFlagEffect(95714077)==0 then
c:RegisterFlagEffect(95714077,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.RaiseSingleEvent(c,95714077,e,r,rp,0,0)
end
function c95714077.thcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x58)
end
function c95714077.filter(c)
return c:IsSetCard(0x58) and c:IsLevelBelow(4) and c:IsAbleToHand()
end
function c95714077.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsFaceup() and c:IsRelateToEffect(e)
if chk==0 then return c:IsFaceup() and c:IsRelateToEffect(e) and not c:IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(c95714077.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
--闇の支配者との契約
function c96420087.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,97642679))
end
--闇の支配者-ゾーク
function c97642679.initial_effect(c)
c:EnableReviveLimit()
--dice
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97642679,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c97642679.target)
e1:SetOperation(c97642679.operation)
c:RegisterEffect(e1)
end
function c97642679.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
local g1=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
local g2=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,0,nil)
if g1:GetCount()~=0 and g2:GetCount()~=0 then
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
end
end
function c97642679.operation(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.TossDice(tp,1)
if d==1 or d==2 then
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
elseif d==6 then
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,0,nil)
Duel.Destroy(g,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
--白竜降臨
function c9786492.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,73398797))
end
--覚醒の証
function c9845733.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,10789972))
end
--精霊術師 ドリアード
function c99414168.initial_effect(c)
c:EnableReviveLimit()
--Attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(0xf)
c:RegisterEffect(e1)
end
--スカルライダー
function c99721536.initial_effect(c)
c:EnableReviveLimit()
end
......@@ -694,3 +694,99 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
Duel.SetFusionMaterial(g1)
end
end
function Auxiliary.AddRitualProcGreater(c,filter)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(Auxiliary.RPGTarget(filter))
e1:SetOperation(Auxiliary.RPGOperation(filter))
c:RegisterEffect(e1)
end
function Auxiliary.RPGFilter(c,filter,e,tp,m)
if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
local result=false
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
m:AddCard(c)
else
result=m:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
return result
end
function Auxiliary.RPGTarget(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(Auxiliary.RPGFilter,tp,LOCATION_HAND,0,1,nil,filter,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function Auxiliary.RPGOperation(filter)
return function(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPGFilter,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
function Auxiliary.AddRitualProcEqual(c,filter)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(Auxiliary.RPETarget(filter))
e1:SetOperation(Auxiliary.RPEOperation(filter))
c:RegisterEffect(e1)
end
function Auxiliary.RPEFilter(c,filter,e,tp,m)
if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) then return false end
local result=false
if m:IsContains(c) then
m:RemoveCard(c)
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,c)
m:AddCard(c)
else
result=m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,c)
end
return result
end
function Auxiliary.RPETarget(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(Auxiliary.RPEFilter,tp,LOCATION_HAND,0,1,nil,filter,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function Auxiliary.RPEOperation(filter)
return function(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.RPEFilter,tp,LOCATION_HAND,0,1,1,nil,filter,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment