Commit 960687a8 authored by argon.sun's avatar argon.sun

new scripts

parent 647af79b
......@@ -375,6 +375,8 @@ public:
#define EVENT_BATTLE_DAMAGE 1143
#define EVENT_TOSS_DICE 1150
#define EVENT_TOSS_COIN 1151
#define EVENT_TOSS_COIN_NEGATE 1152
#define EVENT_TOSS_DICE_NEGATE 1153
#define EVENT_LEVEL_UP 1200
#define EVENT_PHASE 0x1000
#define EVENT_PHASE_START 0x2000
......
......@@ -3247,7 +3247,7 @@ int32 field::toss_coin(uint16 step, uint8 playerid, uint8 count) {
core.coin_result[i] = pduel->get_next_integer(0, 1);
pduel->write_buffer8(core.coin_result[i]);
}
raise_event((card*)0, EVENT_TOSS_COIN, core.reason_effect, 0, core.reason_player, playerid, count);
raise_event((card*)0, EVENT_TOSS_COIN_NEGATE, core.reason_effect, 0, core.reason_player, playerid, count);
process_instant_event();
return FALSE;
} else {
......@@ -3257,6 +3257,8 @@ int32 field::toss_coin(uint16 step, uint8 playerid, uint8 count) {
}
}
case 1: {
raise_event((card*)0, EVENT_TOSS_COIN, core.reason_effect, 0, core.reason_player, playerid, count);
process_instant_event();
return TRUE;
}
}
......@@ -3290,7 +3292,7 @@ int32 field::toss_dice(uint16 step, uint8 playerid, uint8 count) {
core.dice_result[i] = pduel->get_next_integer(1, 6);
pduel->write_buffer8(core.dice_result[i]);
}
raise_event((card*)0, EVENT_TOSS_DICE, core.reason_effect, 0, core.reason_player, playerid, count);
raise_event((card*)0, EVENT_TOSS_DICE_NEGATE, core.reason_effect, 0, core.reason_player, playerid, count);
process_instant_event();
return FALSE;
} else {
......@@ -3300,6 +3302,8 @@ int32 field::toss_dice(uint16 step, uint8 playerid, uint8 count) {
}
}
case 1: {
raise_event((card*)0, EVENT_TOSS_DICE, core.reason_effect, 0, core.reason_player, playerid, count);
process_instant_event();
return TRUE;
}
}
......
--忍者義賊ゴエゴエ
function c10236520.initial_effect(c)
--handes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10236520,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c10236520.condition)
e1:SetTarget(c10236520.target)
e1:SetOperation(c10236520.operation)
c:RegisterEffect(e1)
end
function c10236520.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=5
end
function c10236520.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,1-tp,LOCATION_HAND)
end
function c10236520.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,2)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
end
--白い忍者
function c1571945.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1571945,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c1571945.target)
e1:SetOperation(c1571945.operation)
c:RegisterEffect(e1)
end
function c1571945.filter(c)
return c:IsDefence() and c:IsDestructable()
end
function c1571945.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1571945.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c1571945.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c1571945.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsDefence() and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--機甲忍法ゴールド·コンバージョン
function c16272453.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c16272453.condition)
e1:SetTarget(c16272453.target)
e1:SetOperation(c16272453.activate)
c:RegisterEffect(e1)
end
function c16272453.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x61)
end
function c16272453.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16272453.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c16272453.dfilter(c)
return c:IsFaceup() and c:IsSetCard(0x61) and c:IsDestructable()
end
function c16272453.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
local g=Duel.GetMatchingGroup(c16272453.dfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c16272453.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16272453.dfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local ct=Duel.Destroy(g,REASON_EFFECT)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
--No.12 機甲忍者クリムゾン·シャドー
function c19333131.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,5),2)
c:EnableReviveLimit()
--attack up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19333131,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c19333131.cost)
e1:SetOperation(c19333131.operation)
c:RegisterEffect(e1)
end
function c19333131.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c19333131.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c19333131.etarget)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
end
function c19333131.etarget(e,c)
return c:IsFaceup() and c:IsSetCard(0x2b)
end
--覆面忍者ヱビス
function c22512406.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22512406,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c22512406.thcon)
e1:SetTarget(c22512406.thtg)
e1:SetOperation(c22512406.thop)
c:RegisterEffect(e1)
end
function c22512406.cfilter1(c)
return c:IsFaceup() and c:IsSetCard(0x2b) and c:GetCode()~=22512406
end
function c22512406.cfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x2b)
end
function c22512406.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c22512406.cfilter1,tp,LOCATION_MZONE,0,1,nil)
end
function c22512406.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c22512406.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c22512406.cfilter2,tp,LOCATION_MZONE,0,nil)
local dt=Duel.GetMatchingGroupCount(c22512406.filter,tp,0,LOCATION_ONFIELD,nil)
e:SetLabel(ct)
return dt>=ct
end
local g=Duel.GetMatchingGroup(c22512406.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,e:GetLabel(),0,0)
end
function c22512406.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c22512406.cfilter2,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c22512406.filter,tp,0,LOCATION_ONFIELD,nil)
if ct>g:GetCount() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:Select(tp,ct,ct,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,10236520))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--機甲忍者アース
function c22812068.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c22812068.spcon)
c:RegisterEffect(e1)
end
function c22812068.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)>0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
......@@ -69,6 +69,7 @@ function c26082117.excon(e)
return Duel.IsExistingMatchingCard(c26082117.exfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end
function c26082117.splimit(e,se,sp,st,spos,tgp)
if bit.band(spos,POS_FACEDOWN) then return true end
return not Duel.IsExistingMatchingCard(c26082117.exfilter,tgp,LOCATION_ONFIELD,0,1,nil)
end
function c26082117.descon(e)
......
......@@ -17,7 +17,7 @@ function c26834022.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_SPELL and Duel.IsChainInactivatable(ev)
end
function c26834022.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98891840.filter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c26834022.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if eg:GetFirst():IsDestructable() then
eg:GetFirst():CreateEffectRelation(e)
......@@ -26,7 +26,7 @@ function c26834022.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c26834022.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c98891840.filter,p,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c26834022.filter,p,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.NegateActivation(ev)
local ec=eg:GetFirst()
......
......@@ -32,6 +32,7 @@ function c2766877.operation(e,tp,eg,ep,ev,re,r,rp)
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(1)
......
--機甲忍者フレイム
function c33034646.initial_effect(c)
--lv up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33034646,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c33034646.target)
e1:SetOperation(c33034646.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c33034646.filter(c)
return c:IsFaceup() and c:IsSetCard(0x2b)
end
function c33034646.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c33034646.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33034646.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c33034646.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c33034646.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
......@@ -9,7 +9,7 @@ function c36562627.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_TOSS_COIN)
e2:SetCode(EVENT_TOSS_COIN_NEGATE)
e2:SetCondition(c36562627.coincon)
e2:SetOperation(c36562627.coinop)
c:RegisterEffect(e2)
......
--速攻の黒い忍者
function c41006930.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41006930,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c41006930.rmcost)
e1:SetTarget(c41006930.rmtg)
e1:SetOperation(c41006930.rmop)
c:RegisterEffect(e1)
end
function c41006930.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function c41006930.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41006930.cfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c41006930.cfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c41006930.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,41006930)==0 and e:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,41006930,RESET_PHASE+PHASE_END,0,1)
end
function c41006930.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c41006930.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c41006930.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
......@@ -17,7 +17,7 @@ function c52228131.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_TRAP and Duel.IsChainInactivatable(ev)
end
function c52228131.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98891840.filter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c52228131.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if eg:GetFirst():IsDestructable() then
eg:GetFirst():CreateEffectRelation(e)
......@@ -26,7 +26,7 @@ function c52228131.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c52228131.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c98891840.filter,p,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c52228131.filter,p,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.NegateActivation(ev)
local ec=eg:GetFirst()
......
--成金忍者
function c58911105.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58911105,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c58911105.cost)
e1:SetTarget(c58911105.target)
e1:SetOperation(c58911105.operation)
c:RegisterEffect(e1)
end
function c58911105.costfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c58911105.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58911105.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local cg=Duel.SelectMatchingCard(tp,c58911105.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST)
end
function c58911105.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x2b) and
(c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN))
end
function c58911105.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c58911105.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c58911105.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c58911105.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
local spos=0
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then spos=spos+POS_FACEUP_DEFENCE end
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN) then spos=spos+POS_FACEDOWN_DEFENCE end
Duel.SpecialSummon(tc,0,tp,tp,false,false,spos)
end
--機甲忍者エアー
function c69023354.initial_effect(c)
--lv down
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(69023354,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c69023354.target)
e1:SetOperation(c69023354.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c69023354.filter(c)
return c:IsFaceup() and c:IsSetCard(0x2b)
end
function c69023354.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c69023354.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c69023354.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c69023354.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c69023354.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(-1)
tc:RegisterEffect(e1)
end
end
--忍法 変化の術
function c70861343.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(c70861343.target)
e1:SetOperation(c70861343.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c70861343.desop)
c:RegisterEffect(e2)
end
function c70861343.cfilter(c,e,tp)
local lv=c:GetLevel()
return c:IsFaceup() and lv>0 and c:IsSetCard(0x2b)
and Duel.IsExistingMatchingCard(c70861343.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,lv+3,e,tp)
end
function c70861343.filter(c,lv,e,tp)
return c:GetLevel()<=lv and c:IsRace(RACE_BEAST+RACE_WINDBEAST+RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c70861343.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.CheckReleaseGroup(tp,c70861343.cfilter,1,nil,e,tp) end
local rg=Duel.SelectReleaseGroup(tp,c70861343.cfilter,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetLevel()+3)
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c70861343.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c70861343.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e:GetLabel(),e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
c:SetCardTarget(tc)
end
end
function c70861343.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if not tc or tc:IsStatus(STATUS_DESTROY_CONFIRMED) then return end
Duel.Destroy(tc,REASON_EFFECT)
end
--女忍者ヤエ
function c82005435.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82005435,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c82005435.cost)
e1:SetTarget(c82005435.target)
e1:SetOperation(c82005435.operation)
c:RegisterEffect(e1)
end
function c82005435.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c82005435.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82005435.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,c82005435.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST+REASON_DISCARD)
end
function c82005435.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c82005435.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82005435.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(c82005435.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end
function c82005435.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(c82005435.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
--機甲忍者ブレード·ハート
function c82944432.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,c82944432.xyzfilter,2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82944432,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c82944432.cost)
e1:SetTarget(c82944432.target)
e1:SetOperation(c82944432.operation)
c:RegisterEffect(e1)
end
function c82944432.xyzfilter(c)
return c:IsRace(RACE_WARRIOR) and c:GetLevel()==4
end
function c82944432.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c82944432.filter(c)
return c:IsFaceup() and c:IsSetCard(0x2b) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function c82944432.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c82944432.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c82944432.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c82944432.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c82944432.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
--スノーマンイーター
function c87483942.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87483942,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_FLIP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetTarget(c87483942.sptg)
e1:SetOperation(c87483942.spop)
c:RegisterEffect(e1)
--only 1 exist
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetCondition(c87483942.excon)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_SPSUMMON_CONDITION)
e4:SetValue(c87483942.splimit)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SELF_DESTROY)
e5:SetCondition(c87483942.descon)
c:RegisterEffect(e5)
end
function c87483942.filter(c,e,tp)
return c:IsSetCard(0x2b) and c:GetCode()~=87483942 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENCE)
end
function c87483942.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c87483942.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c87483942.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c87483942.filter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENCE)
end
end
function c87483942.exfilter(c,fid)
return c:IsFaceup() and c:GetCode()==87483942 and (fid==nil or c:GetFieldID()<fid)
end
function c87483942.excon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c87483942.exfilter,c:GetControler(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c87483942.splimit(e,se,sp,st,spos,tgp)
if bit.band(spos,POS_FACEDOWN) then return true end
return not Duel.IsExistingMatchingCard(c87483942.exfilter,tgp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c87483942.descon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c87483942.exfilter,c:GetControler(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,c:GetFieldID())
end
--忍法 空蝉の術
function c89628781.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c89628781.target)
e1:SetOperation(c89628781.operation)
c:RegisterEffect(e1)
end
function c89628781.filter(c)
return c:IsFaceup() and c:IsSetCard(0x2b)
end
function c89628781.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c89628781.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c89628781.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c89628781.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c89628781.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetTarget(c89628781.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
end
end
function c89628781.indtg(e,c)
return e:GetHandler():GetFirstCardTarget()==c
end
\ No newline at end of file
--忍者マスター HANZO
function c95027497.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95027497,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c95027497.tg1)
e1:SetOperation(c95027497.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95027497,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetTarget(c95027497.tg2)
e2:SetOperation(c95027497.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c95027497.filter1(c)
return c:IsSetCard(0x61) and c:IsAbleToHand()
end
function c95027497.filter2(c)
return c:IsSetCard(0x2b) and c:GetCode()~=95027497 and c:IsAbleToHand()
end
function c95027497.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95027497.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95027497.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c95027497.filter1,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 c95027497.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95027497.filte2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95027497.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c95027497.filter2,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
\ No newline at end of file
--機甲忍者アクア
function c96427353.initial_effect(c)
--disable attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(96427353,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c96427353.condition)
e1:SetCost(c96427353.cost)
e1:SetTarget(c96427353.target)
e1:SetOperation(c96427353.operation)
c:RegisterEffect(e1)
end
function c96427353.cfilter(c)
return c:IsSetCard(0x2b) and c:IsType(TYPE_MONSTER)
end
function c96427353.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttackTarget()==nil
and Duel.IsExistingMatchingCard(c96427353.cfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c96427353.cost(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 c96427353.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
end
function c96427353.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableAttack()
end
......@@ -456,6 +456,8 @@ EVENT_ATTACK_DISABLED =1142
EVENT_BATTLE_DAMAGE =1143
EVENT_TOSS_DICE =1150
EVENT_TOSS_COIN =1151
EVENT_TOSS_COIN_NEGATE =1152
EVENT_TOSS_DICE_NEGATE =1153
EVENT_LEVEL_UP =1200
EVENT_PHASE =0x1000
EVENT_PHASE_START =0x2000
......
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