Commit dc4752e2 authored by argon.sun's avatar argon.sun

new

parent 86bf6c68
...@@ -1030,8 +1030,7 @@ int32 card::leave_field_redirect(uint32 reason) { ...@@ -1030,8 +1030,7 @@ int32 card::leave_field_redirect(uint32 reason) {
return 0; return 0;
filter_effect(EFFECT_LEAVE_FIELD_REDIRECT, &es); filter_effect(EFFECT_LEAVE_FIELD_REDIRECT, &es);
for(int32 i = 0; i < es.count; ++i) { for(int32 i = 0; i < es.count; ++i) {
pduel->lua->add_param(reason, PARAM_TYPE_INT); redirect = es[i]->get_value(this, 0);
redirect = es[i]->get_value(this, 1);
if((redirect & LOCATION_HAND) && !is_affected_by_effect(EFFECT_CANNOT_TO_HAND) && pduel->game_field->is_player_can_send_to_hand(current.controler, this)) if((redirect & LOCATION_HAND) && !is_affected_by_effect(EFFECT_CANNOT_TO_HAND) && pduel->game_field->is_player_can_send_to_hand(current.controler, this))
return redirect; return redirect;
else if((redirect & LOCATION_DECK) && !is_affected_by_effect(EFFECT_CANNOT_TO_DECK) && pduel->game_field->is_player_can_send_to_deck(current.controler, this)) else if((redirect & LOCATION_DECK) && !is_affected_by_effect(EFFECT_CANNOT_TO_DECK) && pduel->game_field->is_player_can_send_to_deck(current.controler, this))
...@@ -1058,8 +1057,7 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) { ...@@ -1058,8 +1057,7 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
filter_effect(EFFECT_REMOVE_REDIRECT, &es); filter_effect(EFFECT_REMOVE_REDIRECT, &es);
else return 0; else return 0;
for(int32 i = 0; i < es.count; ++i) { for(int32 i = 0; i < es.count; ++i) {
pduel->lua->add_param(reason, PARAM_TYPE_INT); redirect = es[i]->get_value(this, 0);
redirect = es[i]->get_value(this, 1);
if((redirect & LOCATION_HAND) && !is_affected_by_effect(EFFECT_CANNOT_TO_HAND) && pduel->game_field->is_player_can_send_to_hand(current.controler, this)) if((redirect & LOCATION_HAND) && !is_affected_by_effect(EFFECT_CANNOT_TO_HAND) && pduel->game_field->is_player_can_send_to_hand(current.controler, this))
return redirect; return redirect;
if((redirect & LOCATION_DECK) && !is_affected_by_effect(EFFECT_CANNOT_TO_DECK) && pduel->game_field->is_player_can_send_to_deck(current.controler, this)) if((redirect & LOCATION_DECK) && !is_affected_by_effect(EFFECT_CANNOT_TO_DECK) && pduel->game_field->is_player_can_send_to_deck(current.controler, this))
......
...@@ -72,6 +72,7 @@ field::field(duel* pduel) { ...@@ -72,6 +72,7 @@ field::field(duel* pduel) {
core.deck_reversed = FALSE; core.deck_reversed = FALSE;
core.remove_brainwashing = FALSE; core.remove_brainwashing = FALSE;
core.effect_damage_step = FALSE; core.effect_damage_step = FALSE;
core.shuffle_check_disabled = FALSE;
nil_event.event_code = 0; nil_event.event_code = 0;
nil_event.event_cards = 0; nil_event.event_cards = 0;
nil_event.event_player = PLAYER_NONE; nil_event.event_player = PLAYER_NONE;
......
...@@ -4724,6 +4724,14 @@ int32 field::adjust_step(uint16 step) { ...@@ -4724,6 +4724,14 @@ int32 field::adjust_step(uint16 step) {
core.units.begin()->step = -1; core.units.begin()->step = -1;
return FALSE; return FALSE;
} }
if(core.shuffle_hand_check[0])
shuffle(0, LOCATION_HAND);
if(core.shuffle_hand_check[1])
shuffle(1, LOCATION_HAND);
if(core.shuffle_deck_check[0])
shuffle(0, LOCATION_DECK);
if(core.shuffle_deck_check[1])
shuffle(1, LOCATION_DECK);
return TRUE; return TRUE;
} }
} }
......
--グレイヴ·キーパー
function c11448373.initial_effect(c)
--todeck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c11448373.rmtarget)
e1:SetValue(LOCATION_DECKSHF)
c:RegisterEffect(e1)
end
function c11448373.rmtarget(e,c)
return c:IsReason(REASON_BATTLE)
end
--恵災いの像
function c12160911.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12160911,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c12160911.condition)
e1:SetTarget(c12160911.target)
e1:SetOperation(c12160911.operation)
c:RegisterEffect(e1)
end
function c12160911.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and rp~=tp and bit.band(r,REASON_EFFECT)==REASON_EFFECT
end
function c12160911.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
end
function c12160911.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 c13409151.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13409151,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c13409151.postg)
e1:SetOperation(c13409151.posop)
c:RegisterEffect(e1)
end
function c13409151.filter(c)
return c:IsFaceup() and c:GetCode()~=13409151 and c:IsCanTurnSet()
end
function c13409151.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c13409151.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c13409151.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c13409151.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENCE)
end
end
--ヘルフレイムエンペラー
function c19847532.initial_effect(c)
--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)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19847532,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCondition(c19847532.condition)
e2:SetTarget(c19847532.target)
e2:SetOperation(c19847532.operation)
c:RegisterEffect(e2)
end
function c19847532.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE
end
function c19847532.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c19847532.cfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToRemoveAsCost()
end
function c19847532.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19847532.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(c19847532.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
local dg=Duel.GetMatchingGroup(c19847532.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local ct=dg:GetCount()
if ct>5 then ct=5 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c19847532.cfilter,tp,LOCATION_GRAVE,0,1,ct,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.SetTargetParam(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,rg:GetCount(),0,0)
end
function c19847532.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c19847532.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--ヴァンパイアジェネシス
function c22056710.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)
--spsummon proc
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c22056710.hspcon)
e2:SetOperation(c22056710.hspop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22056710,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c22056710.sptg)
e3:SetOperation(c22056710.spop)
c:RegisterEffect(e3)
end
function c22056710.hspfilter(c)
return c:IsFaceup() and c:IsCode(53839837) and c:IsAbleToRemoveAsCost()
end
function c22056710.hspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c22056710.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c22056710.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c22056710.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c22056710.cfilter(c,e,tp)
return c:IsRace(RACE_ZOMBIE) and c:IsDiscardable()
and Duel.IsExistingTarget(c22056710.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetOriginalLevel())
end
function c22056710.spfilter(c,e,tp,lv)
local clv=c:GetLevel()
return clv>0 and clv<lv and c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22056710.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22056710.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g1=Duel.SelectMatchingCard(tp,c22056710.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SendtoGrave(g1,REASON_COST+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c22056710.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,g1:GetFirst():GetOriginalLevel())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
end
function c22056710.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 c25343280.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)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25343280,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(c25343280.target)
e2:SetOperation(c25343280.operation)
c:RegisterEffect(e2)
end
function c25343280.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(2) and c:IsRace(RACE_ZOMBIE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c25343280.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c25343280.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c25343280.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>4 then ft=4 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c25343280.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c25343280.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--第一の棺
function c31076103.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31076103,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCondition(c31076103.condition)
e2:SetOperation(c31076103.operation)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(31076103,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_REPEAT)
e3:SetCountLimit(1)
e3:SetCondition(c31076103.condition)
e3:SetCost(c31076103.spcost)
e3:SetTarget(c31076103.sptg)
e3:SetOperation(c31076103.spop)
c:RegisterEffect(e3)
--tograve
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c31076103.tgcon)
e4:SetOperation(c31076103.tgop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetOperation(c31076103.tgop)
c:RegisterEffect(e5)
end
function c31076103.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c31076103.cfilter1(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c31076103.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if not Duel.IsExistingMatchingCard(c31076103.cfilter1,tp,LOCATION_SZONE,0,1,nil,4081094) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(31076103,2))
local g=Duel.SelectMatchingCard(tp,c31076103.cfilter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,4081094)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
elseif not Duel.IsExistingMatchingCard(c31076103.cfilter1,tp,LOCATION_SZONE,0,1,nil,78697395) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(31076103,2))
local g=Duel.SelectMatchingCard(tp,c31076103.cfilter1,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,78697395)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
end
function c31076103.cfilter2(c,code)
return c:IsFaceup() and c:IsCode(code) and c:IsAbleToGraveAsCost()
end
function c31076103.cfilter3(c)
local code=c:GetCode()
return c:IsFaceup() and (code==31076103 or code==4081094 or code==78697395) and c:IsAbleToGraveAsCost()
end
function c31076103.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c31076103.cfilter2,tp,LOCATION_SZONE,0,1,nil,4081094)
and Duel.IsExistingMatchingCard(c31076103.cfilter2,tp,LOCATION_SZONE,0,1,nil,78697395) end
local g=Duel.GetMatchingGroup(c31076103.cfilter3,tp,LOCATION_SZONE,0,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c31076103.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c31076103.spfilter(c,e,tp)
return c:IsCode(25343280) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c31076103.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,c31076103.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)>0 then
g:GetFirst():CompleteProcedure()
end
end
function c31076103.cfilter4(c)
local code=c:GetCode()
return code==31076103 or code==4081094 or code==78697395
end
function c31076103.cfilter5(c)
local code=c:GetCode()
return c:IsFaceup() and (code==31076103 or code==4081094 or code==78697395)
end
function c31076103.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c31076103.cfilter4,1,nil)
end
function c31076103.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c31076103.cfilter5,tp,LOCATION_SZONE,0,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
end
--第二の棺
function c4081094.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SSET)
c:RegisterEffect(e1)
end
--スペシャルハリケーン
function c42598242.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c42598242.cost)
e1:SetTarget(c42598242.target)
e1:SetOperation(c42598242.activate)
c:RegisterEffect(e1)
end
function c42598242.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c42598242.filter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and c:IsDestructable()
end
function c42598242.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c42598242.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c42598242.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c42598242.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c42598242.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--人投げトロール
function c43714890.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43714890,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c43714890.cost)
e1:SetTarget(c43714890.target)
e1:SetOperation(c43714890.operation)
c:RegisterEffect(e1)
end
function c43714890.cfilter(c)
local tp=c:GetType()
return bit.band(tp,TYPE_NORMAL)~=0 and bit.band(tp,TYPE_TOKEN)==0
end
function c43714890.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c43714890.cfilter,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,c43714890.cfilter,1,1,nil)
Duel.Release(sg,REASON_COST)
end
function c43714890.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c43714890.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 c48659020.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48659020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c48659020.target)
e1:SetOperation(c48659020.operation)
c:RegisterEffect(e1)
end
function c48659020.filter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c48659020.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c48659020.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c48659020.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c48659020.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ヌビアガード
function c51616747.initial_effect(c)
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51616747,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c51616747.condition)
e1:SetTarget(c51616747.target)
e1:SetOperation(c51616747.operation)
c:RegisterEffect(e1)
end
function c51616747.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c51616747.filter(c)
return c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToDeck()
end
function c51616747.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c51616747.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51616747.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c51616747.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c51616747.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
--ナイトメアテーベ
function c51838385.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(c51838385.atkcon)
e1:SetValue(1500)
c:RegisterEffect(e1)
end
function c51838385.atkcon(e)
local tp=e:GetHandlerPlayer()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_SZONE,0)
return ct==0 or (ct==1 and Duel.GetFieldCard(tp,LOCATION_SZONE,5))
end
--オアシスの使者
function c6103294.initial_effect(c)
--atk 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_BATTLE_TARGET)
e1:SetCondition(c6103294.atkcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetTarget(c6103294.cfilter2)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e3:SetTarget(c6103294.cfilter2)
c:RegisterEffect(e3)
end
function c6103294.cfilter1(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLevelBelow(3)
end
function c6103294.cfilter2(e,c)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(3)
end
function c6103294.atkcon(e)
return Duel.IsExistingMatchingCard(c6103294.cfilter1,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--再生ミイラ
function c70821187.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70821187,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c70821187.condition)
e1:SetTarget(c70821187.target)
e1:SetOperation(c70821187.operation)
c:RegisterEffect(e1)
end
function c70821187.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and rp~=tp and bit.band(r,REASON_EFFECT)==REASON_EFFECT
end
function c70821187.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c70821187.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)==1 then
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
--第三の棺
function c78697395.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SSET)
c:RegisterEffect(e1)
end
--恵みの像
function c85166216.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85166216,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c85166216.condition)
e1:SetTarget(c85166216.target)
e1:SetOperation(c85166216.operation)
c:RegisterEffect(e1)
end
function c85166216.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and rp~=tp and bit.band(r,REASON_EFFECT)==REASON_EFFECT
end
function c85166216.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,2000)
end
function c85166216.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--みつこぶラクーダ
function c86988864.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86988864,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c86988864.condition)
e1:SetCost(c86988864.cost)
e1:SetTarget(c86988864.target)
e1:SetOperation(c86988864.operation)
c:RegisterEffect(e1)
end
function c86988864.cfilter(c)
return c:IsFaceup() and c:IsCode(86988864)
end
function c86988864.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c86988864.cfilter,tp,LOCATION_MZONE,0,3,nil)
end
function c86988864.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c86988864.cfilter,2,nil) end
local g=Duel.SelectReleaseGroup(tp,c86988864.cfilter,2,2,nil)
Duel.Release(g,REASON_COST)
end
function c86988864.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,3) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3)
end
function c86988864.operation(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 c87010442.initial_effect(c)
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87010442,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c87010442.condition)
e1:SetTarget(c87010442.target)
e1:SetOperation(c87010442.operation)
c:RegisterEffect(e1)
end
function c87010442.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:GetBattlePosition()==POS_FACEDOWN_DEFENCE and c:IsRelateToBattle() and c:IsFaceup()
end
function c87010442.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,0,0,1-tp,LOCATION_HAND)
end
function c87010442.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
--マジックブラスト
function c91819979.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c91819979.damtg)
e1:SetOperation(c91819979.damop)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(91819979,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c91819979.thcon)
e2:SetTarget(c91819979.thtg)
e2:SetOperation(c91819979.thop)
c:RegisterEffect(e2)
end
function c91819979.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c91819979.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c91819979.cfilter,tp,LOCATION_MZONE,0,1,nil) end
local ct=Duel.GetMatchingGroupCount(c91819979.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct*200)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
end
function c91819979.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetMatchingGroupCount(c91819979.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.Damage(p,ct*200,REASON_EFFECT)
end
function c91819979.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
end
function c91819979.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
local dt=Duel.GetDrawCount(tp)
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
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)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c91819979.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
_replace_count=_replace_count+1
if _replace_count<=_replace_max and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
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