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

new scripts

parent c586756c
......@@ -233,7 +233,7 @@ int32 card::is_set_card(uint32 set_code) {
return FALSE;
}
uint32 card::get_type() {
if(!(current.location & 0x1c))
if(!(current.location & 0x1e))
return data.type;
if (temp.type != 0xffffffff)
return temp.type;
......
......@@ -296,6 +296,8 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo
}
int32 field::select_place(uint16 step, uint8 playerid, uint32 flag, uint8 count) {
if(step == 0) {
if(count == 0)
return TRUE;
if(core.units.begin()->type == PROCESSOR_SELECT_PLACE)
pduel->write_buffer8(MSG_SELECT_PLACE);
else
......
......@@ -4291,6 +4291,10 @@ int32 field::refresh_location_info(uint16 step) {
int32 count2 = get_useable_count(p, loc, PLAYER_NONE, 0, &flag);
if(count1 > count2)
count1 = count2;
if(count1 == 0) {
core.units.begin()->step = 4;
return FALSE;
}
core.units.begin()->arg1 = count1;
if(loc == LOCATION_SZONE)
flag = ((flag << 8) & 0xff00) | 0xffff00ff;
......@@ -4313,7 +4317,7 @@ int32 field::refresh_location_info(uint16 step) {
player[peffect->get_handler_player()].disabled_location |= selflag;
else
player[peffect->get_handler_player()].disabled_location |= selflag << 8;
peffect->value = ((int32)peffect->value & 0xffff) | (selflag << 16);
peffect->value = ((int32)peffect->value) | (selflag << 16);
core.units.begin()->step = 2;
return FALSE;
}
......@@ -4338,6 +4342,10 @@ int32 field::refresh_location_info(uint16 step) {
int32 count2 = get_useable_count(p, loc, PLAYER_NONE, 0, &flag);
if(count1 > count2)
count1 = count2;
if(count1 == 0) {
core.units.begin()->step = 6;
return FALSE;
}
core.units.begin()->arg1 = count1;
if(loc == LOCATION_SZONE)
flag = ((flag << 8) & 0xff00) | 0xffff00ff;
......@@ -4360,7 +4368,7 @@ int32 field::refresh_location_info(uint16 step) {
player[peffect->get_handler_player()].disabled_location |= selflag;
else
player[peffect->get_handler_player()].disabled_location |= selflag << 8;
peffect->value = ((int32)peffect->value & 0xffff) | (selflag << 16);
peffect->value = ((int32)peffect->value) | (selflag << 16);
core.units.begin()->step = 4;
return FALSE;
}
......
--デッキロック
function c1149109.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c1149109.target)
c:RegisterEffect(e1)
--disable search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_TO_HAND)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
c:RegisterEffect(e2)
--disable spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
c:RegisterEffect(e3)
end
function c1149109.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
c:SetTurnCounter(0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(c1149109.desop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
c:RegisterEffect(e1)
end
function c1149109.desop(e,tp,eg,ep,ev,re,r,rp)
if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==2 then
Duel.Destroy(c,REASON_EFFECT)
end
end
--惑星からの物体A
function c14729426.initial_effect(c)
--return to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14729426,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_START)
e1:SetOperation(c14729426.operation)
c:RegisterEffect(e1)
end
function c14729426.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler()==Duel.GetAttackTarget() then
local a=Duel.GetAttacker()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(14729426,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c14729426.cttg)
e1:SetOperation(c14729426.ctop)
e1:SetLabelObject(a)
e1:SetLabel(a:GetRealFieldID())
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
end
end
function c14729426.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local a=e:GetLabelObject()
if a:IsControler(1-tp) and a:GetRealFieldID()==e:GetLabel() then
Duel.SetTargetCard(a)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
end
function c14729426.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--サモンリミッター
function c23516703.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--disable summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c23516703.tg)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e4)
if not c23516703.global_check then
c23516703.global_check=true
c23516703[0]=0
c23516703[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(c23516703.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
ge2:SetOperation(c23516703.checkop)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_SPSUMMON_SUCCESS)
ge3:SetOperation(c23516703.checkop)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge4:SetOperation(c23516703.clear)
Duel.RegisterEffect(ge4,0)
end
end
function c23516703.tg(e,sc,sp,st)
return c23516703[sp]>=2
end
function c23516703.checkop(e,tp,eg,ep,ev,re,r,rp)
local s1=false
local s2=false
local tc=eg:GetFirst()
while tc do
if tc:GetSummonPlayer()==0 then s1=true
else s2=true end
tc=eg:GetNext()
end
if s1 then c23516703[0]=c23516703[0]+1 end
if s2 then c23516703[1]=c23516703[1]+1 end
end
function c23516703.clear(e,tp,eg,ep,ev,re,r,rp)
c23516703[0]=0
c23516703[1]=0
end
--コールド·エンチャンター
function c24661486.initial_effect(c)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24661486,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c24661486.cost)
e1:SetTarget(c24661486.target)
e1:SetOperation(c24661486.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c24661486.atkval)
c:RegisterEffect(e2)
end
function c24661486.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 c24661486.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsCanAddCounter(0x15,1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x15,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,0x15,1)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0)
end
function c24661486.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsCanAddCounter(0x15,1) then
tc:AddCounter(0x15,1)
end
end
function c24661486.atkval(e,c)
return Duel.GetCounter(0,1,1,0x15)*300
end
--アイス·ブリザード·マスター
function c32750510.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(c32750510.spcon)
e1:SetOperation(c32750510.spop)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32750510,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c32750510.target)
e2:SetOperation(c32750510.operation)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(32750510,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c32750510.descost)
e3:SetTarget(c32750510.destg)
e3:SetOperation(c32750510.desop)
c:RegisterEffect(e3)
end
function c32750510.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
and Duel.CheckReleaseGroup(c:GetControler(),Card.IsAttribute,2,nil,ATTRIBUTE_WATER)
end
function c32750510.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsAttribute,2,2,nil,ATTRIBUTE_WATER)
Duel.Release(g,REASON_COST)
end
function c32750510.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsCanAddCounter(0x15,1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x15,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,0x15,1)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0)
end
function c32750510.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsCanAddCounter(0x15,1) then
tc:AddCounter(0x15,1)
end
end
function c32750510.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c32750510.desfilter(c)
return c:GetCounter(0x15)~=0 and c:IsDestructable()
end
function c32750510.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32750510.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c32750510.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c32750510.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c32750510.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
--ディスクライダー
function c41113025.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41113025,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c41113025.cost)
e1:SetOperation(c41113025.operation)
c:RegisterEffect(e1)
end
function c41113025.cfilter(c)
return c:GetType()==TYPE_TRAP and c:IsAbleToRemoveAsCost()
end
function c41113025.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41113025.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c41113025.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(cg,POS_FACEUP,REASON_COST)
end
function c41113025.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
end
end
--ファントム·ドラゴン
function c49879995.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49879995,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c49879995.spcon)
e1:SetTarget(c49879995.sptg)
e1:SetOperation(c49879995.spop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_USE_EXTRA_MZONE)
e2:SetValue(2)
c:RegisterEffect(e2)
end
function c49879995.cfilter(c,tp)
return c:GetSummonPlayer()==1-tp
end
function c49879995.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c49879995.cfilter,1,nil,tp)
end
function c49879995.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
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c49879995.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--グリード·クエーサー
function c50263751.initial_effect(c)
--base attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c50263751.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENCE)
c:RegisterEffect(e2)
--lvup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetOperation(c50263751.operation)
c:RegisterEffect(e2)
end
function c50263751.atkval(e,c)
return c:GetLevel()*300
end
function c50263751.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsRelateToBattle() and e:GetHandler():IsFaceup()
end
function c50263751.operation(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
local lv=bc:GetLevel()
if lv>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1ff0000)
e:GetHandler():RegisterEffect(e1)
end
end
--ダイスインパクト
function c59905358.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c59905358.condition)
e1:SetTarget(c59905358.target)
e1:SetOperation(c59905358.activate)
c:RegisterEffect(e1)
end
function c59905358.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainNegatable(ev) then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex=Duel.GetOperationInfo(ev,CATEGORY_DICE)
return ex
end
function c59905358.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c59905358.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--血の沼地
function c60627999.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c60627999.target)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetCondition(c60627999.descon)
c:RegisterEffect(e2)
--disable spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e3:SetTarget(c60627999.acttg)
c:RegisterEffect(e3)
end
function c60627999.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
c:SetTurnCounter(0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(c60627999.desop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
c:RegisterEffect(e1)
end
function c60627999.desop(e,tp,eg,ep,ev,re,r,rp)
if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==2 then
Duel.Destroy(c,REASON_EFFECT)
end
end
function c60627999.descon(e)
return Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler(),TYPE_SPELL+TYPE_TRAP)
end
function c60627999.acttg(e,c)
return c:IsFacedown() and c:GetSequence()~=5
end
--アルケミー·サイクル
function c65384019.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c65384019.condition)
e1:SetTarget(c65384019.target)
e1:SetOperation(c65384019.activate)
c:RegisterEffect(e1)
end
function c65384019.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c65384019.filter(c)
return c:IsFaceup() and c:GetBaseAttack()~=0
end
function c65384019.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65384019.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c65384019.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c65384019.filter,tp,LOCATION_MZONE,0,nil)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(0)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(65384019,RESET_EVENT+0x17a0000+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(65384019,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCondition(c65384019.drcon)
e2:SetTarget(c65384019.drtg)
e2:SetOperation(c65384019.drop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c65384019.drfilter(c)
return c:GetFlagEffect(65384019)~=0
end
function c65384019.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c65384019.drfilter,1,nil)
end
function c65384019.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c65384019.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--デスサイズ·キラー
function c66973070.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66973070,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c66973070.atkcost)
e1:SetOperation(c66973070.operation)
c:RegisterEffect(e1)
end
function c66973070.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,e:GetHandler(),RACE_INSECT) end
local sg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,e:GetHandler(),RACE_INSECT)
Duel.Release(sg,REASON_COST)
end
function c66973070.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--能力調整
function c74741494.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c74741494.target)
e1:SetOperation(c74741494.activate)
c:RegisterEffect(e1)
end
function c74741494.filter(c)
return c:IsFaceup() and c:IsLevelAbove(2)
end
function c74741494.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74741494.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c74741494.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c74741494.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
......@@ -3,7 +3,7 @@ function c84290642.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84290642,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
......@@ -20,7 +20,7 @@ function c84290642.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 Duel.IsExistingTarget(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)
Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c84290642.activate(e,tp,eg,ep,ev,re,r,rp)
......
--始祖神鳥シムルグ
function c86489182.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetValue(TYPE_NORMAL+TYPE_MONSTER)
c:RegisterEffect(e1)
--decrease tribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DECREASE_TRIBUTE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e2:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND))
e2:SetValue(0x10001)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_DECREASE_TRIBUTE_SET)
c:RegisterEffect(e3)
--summon success
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(86489182,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCondition(c86489182.condition)
e4:SetTarget(c86489182.target)
e4:SetOperation(c86489182.operation)
c:RegisterEffect(e4)
--tribute check
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c86489182.valcheck)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
function c86489182.valcheck(e,c)
local g=c:GetMaterial()
if g:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_WIND)==g:GetCount() then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c86489182.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE and e:GetLabel()==1
end
function c86489182.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c86489182.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -8,7 +8,7 @@ function c93542102.initial_effect(c)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c93542102.cona)
e1:SetTarget(c93542102.tg)
e1:SetTarget(c93542102.tga)
e1:SetOperation(c93542102.opa)
c:RegisterEffect(e1)
--confirm
......@@ -18,7 +18,7 @@ function c93542102.initial_effect(c)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c93542102.cond)
e2:SetTarget(c93542102.tg)
e2:SetTarget(c93542102.tgd)
e2:SetOperation(c93542102.opd)
c:RegisterEffect(e2)
end
......@@ -31,9 +31,14 @@ end
function c93542102.cfilter(c)
return c:IsLevelBelow(4) and c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER)
end
function c93542102.tg(e,tp,eg,ep,ev,re,r,rp,chk)
function c93542102.tga(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.IsExistingMatchingCard(c93542102.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c93542102.tgd(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c93542102.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
......
--デストラクション·ジャマー
function c98956134.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c98956134.condition)
e1:SetCost(c98956134.cost)
e1:SetTarget(c98956134.target)
e1:SetOperation(c98956134.activate)
c:RegisterEffect(e1)
end
function c98956134.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainNegatable(ev) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)-tg:GetCount()>0
end
function c98956134.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 c98956134.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c98956134.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment