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

new scripts

parent 2f314a2d
......@@ -623,6 +623,7 @@ public:
#define PROCESSOR_DISCARD_DECK_S 151
#define PROCESSOR_SORT_DECK_S 152
#define PROCESSOR_REMOVEOL_S 160
#define PROCESSOR_MOVETOFIELD_S 161
//Hints
#define HINT_EVENT 1
......
......@@ -511,6 +511,7 @@ int32 scriptlib::duel_move_to_field(lua_State *L) {
pcard->enable_field_effect(FALSE);
pduel->game_field->adjust_instant();
pduel->game_field->move_to_field(pcard, move_player, playerid, destination, positions, enable);
pduel->game_field->core.subunits.begin()->type = PROCESSOR_MOVETOFIELD_S;
return lua_yield(L, 0);
}
int32 scriptlib::duel_return_to_field(lua_State *L) {
......@@ -528,6 +529,7 @@ int32 scriptlib::duel_return_to_field(lua_State *L) {
pduel->game_field->adjust_instant();
pduel->game_field->move_to_field(pcard, pcard->previous.controler, pcard->previous.controler,
pcard->previous.location, pos, TRUE, TRUE);
pduel->game_field->core.subunits.begin()->type = PROCESSOR_MOVETOFIELD_S;
return lua_yield(L, 0);
}
int32 scriptlib::duel_move_sequence(lua_State *L) {
......
......@@ -2807,14 +2807,16 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
uint32 positions = (target->operation_param) & 0xff;
switch(step) {
case 0: {
if(ret && !(target->current.reason & REASON_TEMPORARY))
returns.ivalue[0] = FALSE;
if(ret && (!(target->current.reason & REASON_TEMPORARY) || (target->current.reason_effect->owner != core.reason_effect->owner)))
return TRUE;
if(!(location == LOCATION_SZONE && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL))) {
uint32 flag;
uint32 ct = get_useable_count(playerid, location, move_player, LOCATION_REASON_TOFIELD, &flag);
if(ret && (ct <= 0 || !(target->data.type & TYPE_MONSTER))) {
core.units.begin()->step = 3;
send_to(target, core.reason_effect, REASON_EFFECT, core.reason_player, PLAYER_NONE, LOCATION_GRAVE, 0, 0);
return TRUE;
return FALSE;
}
if(!ct)
return TRUE;
......@@ -2921,6 +2923,14 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
if(enable || ret)
target->enable_field_effect(TRUE);
adjust_instant();
return FALSE;
}
case 3: {
returns.ivalue[0] = TRUE;
return TRUE;
}
case 4: {
returns.ivalue[0] = FALSE;
return TRUE;
}
}
......
......@@ -975,6 +975,14 @@ int32 field::process() {
}
return pduel->bufferlen;
}
case PROCESSOR_MOVETOFIELD_S: {
if (move_to_field(it->step, (card*)it->ptarget, it->arg1, it->arg2)) {
pduel->lua->add_param(returns.ivalue[0], PARAM_TYPE_BOOLEAN);
core.units.pop_front();
} else
core.units.begin()->step++;
return pduel->bufferlen;
}
}
return pduel->bufferlen;
}
......@@ -2706,6 +2714,11 @@ int32 field::process_battle_command(uint16 step) {
}
effect* peffect;
if(peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP)) {
core.units.begin()->step = 39;
core.units.begin()->arg1 = 2;
if(is_player_affected_by_effect(infos.turn_player, EFFECT_BP_TWICE))
core.units.begin()->arg2 = 1;
else core.units.begin()->arg2 = 0;
reset_phase(PHASE_DAMAGE);
if(core.attacker->fieldid_r == afid) {
if(!atk_disabled) {
......@@ -2717,8 +2730,6 @@ int32 field::process_battle_command(uint16 step) {
core.attacker->attacked_count++;
core.attacker->announce_count++;
}
core.units.begin()->step = 39;
core.units.begin()->arg1 = 2;
if(!peffect->value)
add_process(PROCESSOR_PHASE_EVENT, 0, 0, 0, PHASE_BATTLE, 0);
else {
......@@ -2880,6 +2891,7 @@ int32 field::process_battle_command(uint16 step) {
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE;
core.units.begin()->step = 30;
return FALSE;
}
......@@ -2954,6 +2966,7 @@ int32 field::process_battle_command(uint16 step) {
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE;
core.units.begin()->step = 30;
return FALSE;
}
......@@ -2984,6 +2997,7 @@ int32 field::process_battle_command(uint16 step) {
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE;
core.units.begin()->step = 30;
return FALSE;
}
......
--レインボー·ヴェール
function c12735388.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c12735388.target)
e1:SetOperation(c12735388.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(1)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c12735388.discon)
e3:SetOperation(c12735388.disop)
c:RegisterEffect(e3)
end
function c12735388.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c12735388.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c12735388.discon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and (ec==Duel.GetAttacker() or ec==Duel.GetAttackTarget()) and ec:GetBattleTarget():IsFaceup()
end
function c12735388.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget():GetBattleTarget()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2)
end
......@@ -11,11 +11,11 @@ function c1474910.initial_effect(c)
c:RegisterEffect(e1)
end
function c1474910.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
return c:IsFaceup() and c:IsRace(RACE_INSECT) and not c:IsCode(1474910)
end
function c1474910.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() and Duel.CheckReleaseGroup(tp,c1474910.cfilter,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,c1474910.cfilter,1,1,e:GetHandler())
if chk==0 then return e:GetHandler():IsReleaseable() and Duel.CheckReleaseGroup(tp,c1474910.cfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c1474910.cfilter,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Release(g,REASON_COST)
end
......
--次元誘爆
function c1896112.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c1896112.cost)
e1:SetTarget(c1896112.target)
e1:SetOperation(c1896112.operation)
c:RegisterEffect(e1)
end
function c1896112.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsAbleToExtraAsCost()
end
function c1896112.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1896112.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c1896112.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoDeck(g,nil,0,REASON_COST)
end
function c1896112.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1896112.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1896112.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.IsExistingTarget(c1896112.filter,1-tp,LOCATION_REMOVED,0,1,nil,e,1-tp) end
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1>2 then ft1=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c1896112.filter,tp,LOCATION_REMOVED,0,1,ft1,nil,e,tp)
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft2>2 then ft2=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(1-tp,c1896112.filter,1-tp,LOCATION_REMOVED,0,1,ft2,nil,e,1-tp)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,g1:GetCount(),0,0)
end
function c1896112.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local g1=g:Filter(Card.IsControler,nil,tp)
local g2=g:Filter(Card.IsControler,nil,1-tp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1>g1:GetCount() then
local tc=g1:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc=g1:GetNext()
end
end
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft2>g2:GetCount() then
local tc=g2:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP)
tc=g2:GetNext()
end
end
Duel.SpecialSummonComplete()
end
......@@ -11,13 +11,13 @@ function c29843091.initial_effect(c)
c:RegisterEffect(e1)
end
function c29843091.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>2
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>2
and Duel.IsPlayerCanSpecialSummonMonster(tp,29843092,0xf,0x4011,0,1000,2,RACE_BEAST,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENCE,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,0,0)
end
function c29843091.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<3 then return end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)<3 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,29843092,0xf,0x4011,0,1000,2,RACE_BEAST,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENCE,1-tp) then return end
for i=1,3 do
local token=Duel.CreateToken(tp,29843091+i)
......
--ダークビショップデーモン
function c33798491.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c33798491.mtop)
c:RegisterEffect(e1)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c33798491.disop)
c:RegisterEffect(e2)
end
function c33798491.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,500) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c33798491.filter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard()
end
function c33798491.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsExists(c33798491.filter,1,nil,tp) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 or dc==3 or dc==6 then
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
end
--アシッドレイン
function c35956022.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetTarget(c35956022.filter)
e2:SetValue(-500)
c:RegisterEffect(e2)
--Def down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetTarget(c35956022.filter)
e3:SetValue(400)
c:RegisterEffect(e3)
end
function c35956022.filter(e,c)
return c:IsAttribute(ATTRIBUTE_EARTH)
end
--ジェノサイドキングデーモン
function c35975813.initial_effect(c)
--sumlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c35975813.excon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e2)
--maintain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetOperation(c35975813.mtop)
c:RegisterEffect(e3)
--disable and destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(c35975813.disop)
c:RegisterEffect(e4)
--disable
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_BATTLE_END)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(c35975813.disop2)
c:RegisterEffect(e5)
end
function c35975813.exfilter(c)
return c:IsFaceup() and c:IsSetCard(0x45)
end
function c35975813.excon(e)
return not Duel.IsExistingMatchingCard(c35975813.exfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c35975813.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,800) then
Duel.PayLPCost(tp,800)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c35975813.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=2 and dc~=5 then return end
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
function c35975813.disop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if tc and tc:IsType(TYPE_EFFECT) and tc:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x17a0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x17a0000)
tc:RegisterEffect(e2)
end
end
--決戦の火蓋
function c39712330.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c39712330.cost1)
e1:SetTarget(c39712330.target1)
e1:SetOperation(c39712330.activate1)
c:RegisterEffect(e1)
--instant
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39712330,0))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c39712330.condition2)
e2:SetCost(c39712330.cost2)
e2:SetTarget(c39712330.target2)
e2:SetOperation(c39712330.activate2)
c:RegisterEffect(e2)
end
function c39712330.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c39712330.filter(c)
return c:IsType(TYPE_NORMAL) and (c:IsSummonable(true,nil) or c:IsMSetable(true,nil))
end
function c39712330.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
if tn~=tp or (ph~=PHASE_MAIN1 and ph~=PHASE_MAIN2) then return false end
if not Duel.IsExistingMatchingCard(c39712330.cfilter,tp,LOCATION_GRAVE,0,1,nil) then return false end
if Duel.IsExistingMatchingCard(c39712330.filter,tp,LOCATION_HAND,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(39712330,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c39712330.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
e:SetLabel(1)
end
end
function c39712330.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabel()~=1 then return end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c39712330.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()~=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c39712330.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsSummonable(true,nil) and (not tc:IsMSetable(true,nil)
or Duel.SelectOption(tp,aux.Stringid(39712330,2),aux.Stringid(39712330,3))==0) then
Duel.Summon(tp,tc,true,nil)
else Duel.MSet(tp,tc,true,nil) end
end
end
function c39712330.condition2(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return tn==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c39712330.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c39712330.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c39712330.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c39712330.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not e:GetHandler():IsStatus(STATUS_CHAINING) then
local ct=Duel.GetMatchingGroupCount(c39712330.filter,tp,LOCATION_HAND,0,nil)
e:SetLabel(ct)
return ct>0
else return e:GetLabel()>0 end
end
e:SetLabel(e:GetLabel()-1)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c39712330.activate2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c39712330.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil)
local s2=tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectOption(tp,aux.Stringid(39712330,2),aux.Stringid(39712330,3))==0) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
end
end
--ネジマキシキガミ
function c45458027.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -22,9 +23,10 @@ function c45458027.initial_effect(c)
end
function c45458027.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,1,nil,RACE_MACHINE)
and not Duel.IsExistingMatchingCard(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,1,nil,0xffffffff-RACE_MACHINE)
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
return g:GetCount()>0 and g:FilterCount(Card.IsRace,nil,0xffffffff-RACE_MACHINE)==0
end
function c45458027.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) end
......
--サイバネティック·ゾーン
function c47295267.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c47295267.target)
e1:SetOperation(c47295267.operation)
c:RegisterEffect(e1)
end
function c47295267.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION) and c:IsAbleToRemove()
end
function c47295267.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c47295267.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c47295267.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c47295267.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c47295267.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
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(tc)
e1:SetCountLimit(1)
e1:SetOperation(c47295267.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c47295267.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if Duel.ReturnToField(e:GetLabelObject()) then
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetOwner())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetOperation(c47295267.desop)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
tc:RegisterEffect(e2)
end
end
function c47295267.desop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp and e:GetHandler():IsRace(RACE_MACHINE) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
--蜃気楼の筒
function c48017809.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCondition(c48017809.condition)
e1:SetTarget(c48017809.target)
e1:SetOperation(c48017809.activate)
c:RegisterEffect(e1)
end
function c48017809.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsLocation(LOCATION_HAND)
and eg:GetFirst():IsControler(tp) and eg:GetFirst():IsFaceup()
end
function c48017809.target(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 c48017809.activate(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 c50074522.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c50074522.target)
e1:SetOperation(c50074522.operation)
c:RegisterEffect(e1)
end
function c50074522.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsDestructable()
end
function c50074522.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c50074522.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c50074522.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c50074522.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--暗黒魔族ギルファー·デーモン
function c50287060.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50287060,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c50287060.eqcon)
e1:SetTarget(c50287060.eqtg)
e1:SetOperation(c50287060.eqop)
c:RegisterEffect(e1)
end
function c50287060.eqcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c50287060.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c50287060.eqlimit(e,c)
return e:GetOwner()==c
end
function c50287060.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc,true)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c50287060.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(tc)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(-500)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
end
--プリズンクインデーモン
function c52248570.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c52248570.mtop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(52248570,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c52248570.atkcon)
e2:SetTarget(c52248570.atktg)
e2:SetOperation(c52248570.atkop)
c:RegisterEffect(e2)
end
function c52248570.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,1000) then
Duel.PayLPCost(tp,1000)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c52248570.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetEnvironment()==94585852
end
function c52248570.filter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_FIEND)
end
function c52248570.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c52248570.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c52248570.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c52248570.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c52248570.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetEnvironment()~=94585852 then return end
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_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(1000)
tc:RegisterEffect(e1)
end
end
--エクスチェンジ
function c5556668.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c5556668.target)
e1:SetOperation(c5556668.activate)
c:RegisterEffect(e1)
end
function c5556668.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,e:GetHandler()) end
end
function c5556668.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.ConfirmCards(tp,g2)
Duel.ConfirmCards(1-tp,g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local ag1=g2:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local ag2=g1:Select(1-tp,1,1,nil)
Duel.SendtoHand(ag1,tp,REASON_EFFECT)
Duel.SendtoHand(ag2,1-tp,REASON_EFFECT)
end
--デモンバルサム·シード
function c60406591.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c60406591.condition)
e1:SetTarget(c60406591.target)
e1:SetOperation(c60406591.activate)
c:RegisterEffect(e1)
if not c60406591.global_check then
c60406591.global_check=true
c60406591[0]=nil
c60406591[1]=nil
c60406591[2]=nil
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLE_DAMAGE)
ge1:SetOperation(c60406591.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(c60406591.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c60406591.checkop(e,tp,eg,ep,ev,re,r,rp)
c60406591[0]=ep
c60406591[1]=math.floor(ev/500)
c60406591[2]=eg:GetFirst():GetBattleTarget()
end
function c60406591.clear(e,tp,eg,ep,ev,re,r,rp)
c60406591[0]=nil
c60406591[1]=nil
c60406591[2]=nil
end
function c60406591.condition(e,tp,eg,ep,ev,re,r,rp)
return c60406591[0]==tp and eg:GetCount()==1 and eg:GetFirst()==c60406591[2]
end
function c60406591.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c60406591[1]>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>c60406591[1]
and Duel.IsPlayerCanSpecialSummonMonster(tp,60406592,0,0x4011,100,100,1,RACE_PLANT,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,c60406591[1],0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,c60406591[1],0,0)
end
function c60406591.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<c60406591[1]
or not Duel.IsPlayerCanSpecialSummonMonster(tp,60406592,0,0x4011,100,100,1,RACE_PLANT,ATTRIBUTE_DARK) then return end
for i=1,c60406591[1] do
local token=Duel.CreateToken(tp,60406592)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
--デビル·マゼラ
function c6133894.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c6133894.spcon)
e2:SetOperation(c6133894.spop)
c:RegisterEffect(e2)
--handes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(6133894,0))
e3:SetCategory(CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c6133894.hdtg)
e3:SetOperation(c6133894.hdop)
c:RegisterEffect(e3)
end
function c6133894.rfilter(c,code)
return c and c:IsFaceup() and c:IsCode(code)
end
function c6133894.spcon(e,c)
if c==nil then return true end
return (c6133894.rfilter(Duel.GetFieldCard(0,LOCATION_SZONE,5),94585852)
or c6133894.rfilter(Duel.GetFieldCard(1,LOCATION_SZONE,5),94585852))
and Duel.CheckReleaseGroup(c:GetControler(),c6133894.rfilter,1,nil,66073051)
end
function c6133894.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),c6133894.rfilter,1,1,nil,66073051)
Duel.Release(g,REASON_COST)
end
function c6133894.cfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c6133894.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,3)
end
function c6133894.hdop(e,tp,eg,ep,ev,re,r,rp,chk)
if (c6133894.rfilter(Duel.GetFieldCard(0,LOCATION_SZONE,5),94585852)
or c6133894.rfilter(Duel.GetFieldCard(1,LOCATION_SZONE,5),94585852)) then
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,3)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
end
--迅雷の魔王-スカル・デーモン
function c61370518.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c61370518.mtop)
c:RegisterEffect(e1)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c61370518.disop)
c:RegisterEffect(e2)
end
function c61370518.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,500) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c61370518.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 and dc==3 and dc==6 then
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
end
--転生断絶
function c66100045.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_GRAVE,LOCATION_GRAVE)
e2:SetCode(EFFECT_TO_DECK_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2)
end
......@@ -23,10 +23,7 @@ function c69750546.initial_effect(c)
c:RegisterEffect(e2)
end
function c69750546.condition(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsReason(REASON_RETURN) then return false end
if not re then return true end
local code=re:GetHandler():GetCode()
return code~=69537999 and code~=21420702
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c69750546.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
--謙虚な壺
function c70278545.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c70278545.target)
e1:SetOperation(c70278545.activate)
c:RegisterEffect(e1)
end
function c70278545.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function c70278545.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(p,2,2,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
end
--デスルークデーモン
function c72192100.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c72192100.mtop)
c:RegisterEffect(e1)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c72192100.disop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(72192100,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_HAND)
e3:SetCost(c72192100.spcost)
e3:SetTarget(c72192100.sptg)
e3:SetOperation(c72192100.spop)
c:RegisterEffect(e3)
end
function c72192100.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,500) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c72192100.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=3 then return end
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
function c72192100.spcost(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 c72192100.filter(c,e,tp)
return c:IsCode(35975813) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c72192100.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(c72192100.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,c72192100.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c72192100.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ヘルポーンデーモン
function c73219648.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c73219648.mtop)
c:RegisterEffect(e1)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c73219648.disop)
c:RegisterEffect(e2)
--cannot be battle target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetTarget(c73219648.atktg)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c73219648.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,500) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c73219648.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=3 then return end
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
function c73219648.atktg(e,c)
return c:IsFaceup() and c:IsSetCard(0x45) and c:GetCode()~=73219648
end
--マジック·クロニクル
function c74402414.initial_effect(c)
local g=Group.CreateGroup()
g:KeepAlive()
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c74402414.cost)
e1:SetTarget(c74402414.target)
e1:SetOperation(c74402414.activate)
e1:SetLabelObject(g)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c74402414.ctop)
c:RegisterEffect(e2)
--salvage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74402414,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCost(c74402414.thcost)
e3:SetTarget(c74402414.thtg)
e3:SetOperation(c74402414.thop)
e3:SetLabelObject(g)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c74402414.damcon)
e4:SetOperation(c74402414.damop)
e4:SetLabelObject(g)
c:RegisterEffect(e4)
end
function c74402414.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if chk==0 then return hg:GetCount()>0 and hg:FilterCount(Card.IsAbleToGraveAsCost,nil)==hg:GetCount() end
Duel.SendtoGrave(hg,REASON_COST)
end
function c74402414.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function c74402414.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74402414.filter,tp,LOCATION_DECK,0,5,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,5,tp,LOCATION_DECK)
end
function c74402414.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c74402414.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()<5 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local rg=g:Select(1-tp,5,5,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
local tc=rg:GetFirst()
while tc do
tc:RegisterFlagEffect(74402414,RESET_EVENT+0x1fe0000,0,0)
tc=rg:GetNext()
end
e:GetLabelObject():Clear()
e:GetLabelObject():Merge(rg)
end
function c74402414.ctop(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x25,1)
end
end
function c74402414.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x25,2,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x25,2,REASON_COST)
end
function c74402414.thfilter(c)
return c:GetFlagEffect(74402414)~=0 and c:IsAbleToHand()
end
function c74402414.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return e:GetLabelObject():IsContains(chkc) and c74402414.thfilter(chkc) end
if chk==0 then return e:GetLabelObject():IsExists(c74402414.thfilter,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=e:GetLabelObject():FilterSelect(tp,c74402414.thfilter,1,1,nil)
e:GetLabelObject():Sub(g)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,5,tp,LOCATION_DECK)
end
function c74402414.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c74402414.dfilter(c)
return c:GetFlagEffect(74402414)~=0
end
function c74402414.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_ACTIVATED)
end
function c74402414.damop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():FilterCount(c74402414.dfilter,nil)
Duel.Damage(tp,ct*500,REASON_EFFECT)
end
--地獄の番熊
function c75375465.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetTarget(c75375465.indtg)
e1:SetValue(c75375465.indval)
c:RegisterEffect(e1)
end
function c75375465.indtg(e,c)
return c:IsFaceup() and c:IsCode(94585852)
end
function c75375465.indval(e,re,tp)
return e:GetHandler():GetControler()~=tp
end
--ヴィシャス·クロー
function c75524092.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c75524092.target)
e1:SetOperation(c75524092.operation)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--destroy sub
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(c75524092.desreptg)
e4:SetOperation(c75524092.desrepop)
c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_TO_HAND)
e5:SetOperation(c75524092.thop)
c:RegisterEffect(e5)
end
function c75524092.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c75524092.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c75524092.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipTarget():IsReason(REASON_BATTLE) end
return true
end
function c75524092.desfilter(c)
return c~=Duel.GetAttacker() and c~=Duel.GetAttackTarget() and c:IsDestructable()
end
function c75524092.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c75524092.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
if Duel.Destroy(g,REASON_EFFECT)>0 and Duel.Damage(1-tp,600,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,75524093,0,0x4011,2500,2500,7,RACE_FIEND,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(tp,75524093)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)
end
end
end
function c75524092.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsPreviousLocation(LOCATION_DECK) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_USE_AS_COST)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetTarget(c75524092.limittg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_TRIGGER)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_SSET)
Duel.RegisterEffect(e3,tp)
end
end
function c75524092.limittg(e,c)
return c:IsCode(75524092)
end
......@@ -27,14 +27,11 @@ function c78663366.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1)
e1:SetOperation(c78663366.retop)
Duel.RegisterEffect(e1,tp)
c:RegisterFlagEffect(78663366,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,0,1)
end
end
function c78663366.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(78663366)==0 then return end
Duel.ReturnToField(tc)
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
if Duel.ReturnToField(tc) and tc:IsFaceup() then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -43,7 +43,7 @@ end
function c85668449.lrcon(e,tp,eg,ep,ev,re,r,rp)
if tp~=ep then return false end
local lp=Duel.GetLP(ep)
if lp<ev then return false end
if lp<=ev then return false end
local rc=re:GetHandler()
return rc:IsRace(RACE_PSYCHO)
end
......
--インフェルノクインデーモン
function c8581705.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c8581705.mtop)
c:RegisterEffect(e1)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c8581705.disop)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(8581705,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c8581705.atktg)
e3:SetOperation(c8581705.atkop)
c:RegisterEffect(e3)
end
function c8581705.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,500) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c8581705.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=2 and dc~=5 then return end
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
function c8581705.filter(c)
return c:IsFaceup() and c:IsSetCard(0x45)
end
function c8581705.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c8581705.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c8581705.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c8581705.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c8581705.atkop(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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--罰則金
function c92595643.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c92595643.target)
e1:SetOperation(c92595643.activate)
c:RegisterEffect(e1)
end
function c92595643.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,2)
end
function c92595643.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.DiscardHand(p,nil,2,2,REASON_EFFECT+REASON_DISCARD)
end
--炸裂装甲
function c92773018.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c92773018.target1)
e1:SetOperation(c92773018.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(92773018,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c92773018.condition)
e2:SetCost(c92773018.cost)
e2:SetTarget(c92773018.target2)
e2:SetOperation(c92773018.activate)
c:RegisterEffect(e2)
end
function c92773018.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c92773018.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x103) and c:IsAbleToGraveAsCost()
end
function c92773018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c92773018.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c92773018.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c92773018.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc==Duel.GetAttacker() end
if chk==0 then return true end
local tg=Duel.GetAttacker()
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and tp~=Duel.GetTurnPlayer()
and Duel.IsExistingMatchingCard(c92773018.cfilter,tp,LOCATION_MZONE,0,1,nil)
and tg:IsOnField() and tg:IsDestructable() and tg:IsCanBeEffectTarget(e)
and Duel.SelectYesNo(tp,aux.Stringid(92773018,1)) then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c92773018.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
else
e:SetCategory(0)
e:SetProperty(0)
end
end
function c92773018.target2(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 not e:GetHandler():IsStatus(STATUS_CHAINING)
and tg:IsOnField() and tg:IsDestructable() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
end
function c92773018.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ヘイト·バスター
function c93895605.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCondition(c93895605.condition)
e1:SetTarget(c93895605.target)
e1:SetOperation(c93895605.activate)
c:RegisterEffect(e1)
end
function c93895605.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsFaceup() and tc:IsRace(RACE_FIEND)
end
function c93895605.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if chk==0 then return a:IsOnField() and a:IsDestructable() and a:IsCanBeEffectTarget(e)
and d:IsOnField() and d:IsDestructable() and d:IsCanBeEffectTarget(e) end
local g=Group.FromCards(a,d)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function c93895605.activate(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if a:IsRelateToEffect(e) and a:IsAttackable() and not a:IsStatus(STATUS_ATTACK_CANCELED)
and d:IsFaceup() and d:IsRelateToEffect(e) then
Duel.Destroy(g,REASON_EFFECT)
if not a:IsOnField() then
Duel.Damage(1-tp,a:GetAttack(),REASON_EFFECT)
end
end
end
--万魔殿-悪魔の巣窟-
function c94585852.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cost change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_LPCOST_REPLACE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,1)
e2:SetCondition(c94585852.repcon)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(c94585852.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(94585852,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(94585852)
e4:SetTarget(c94585852.target)
e4:SetOperation(c94585852.operation)
c:RegisterEffect(e4)
end
function c94585852.repcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return Duel.GetCurrentPhase()==PHASE_STANDBY and rc:IsSetCard(0x45) and rc:IsType(TYPE_MONSTER)
end
function c94585852.regop(e,tp,eg,ep,ev,re,r,rp)
local lv1=0
local lv2=0
local tc=eg:GetFirst()
while tc do
if tc:IsReason(REASON_DESTROY) and not tc:IsReason(REASON_BATTLE) and tc:IsSetCard(0x45) then
local tlv=tc:GetLevel()
if tc:IsControler(0) then
if tlv>lv1 then lv1=tlv end
else
if tlv>lv2 then lv2=tlv end
end
end
tc=eg:GetNext()
end
if lv1>0 then Duel.RaiseSingleEvent(e:GetHandler(),94585852,e,0,0,0,lv1) end
if lv2>0 then Duel.RaiseSingleEvent(e:GetHandler(),94585852,e,0,1,1,lv2) end
end
function c94585852.filter(c,lv)
return c:GetLevel()<lv and c:IsSetCard(0x45) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c94585852.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c94585852.filter,tp,LOCATION_DECK,0,1,nil,ev) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c94585852.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c94585852.filter,tp,LOCATION_DECK,0,1,1,nil,ev)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--シャドウナイトデーモン
function c9603356.initial_effect(c)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c9603356.mtop)
c:RegisterEffect(e1)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c9603356.disop)
c:RegisterEffect(e2)
--damage reduce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetCondition(c9603356.rdcon)
e3:SetOperation(c9603356.rdop)
c:RegisterEffect(e3)
end
function c9603356.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.CheckLPCost(tp,900) then
Duel.PayLPCost(tp,900)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c9603356.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=3 then return end
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
function c9603356.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler()==Duel.GetAttacker()
end
function c9603356.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,Duel.GetBattleDamage(ep)/2)
end
......@@ -403,3 +403,4 @@
!counter 0x22 龙神指示物
!counter 0x23 海洋指示物
!counter 0x24 弦指示物
!counter 0x25 年代记指示物
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