Commit 9cd08a80 authored by argon.sun's avatar argon.sun

new scripts

parent 0b4feb07
......@@ -421,7 +421,7 @@ public:
int32 summon(uint16 step, uint8 sumplayer, card* target, effect* proc, uint8 ignore_count);
int32 flip_summon(uint16 step, uint8 sumplayer, card* target);
int32 mset(uint16 step, uint8 setplayer, card* ptarget, effect* proc, uint8 ignore_count);
int32 sset(uint16 step, uint8 setplayer, card* ptarget);
int32 sset(uint16 step, uint8 setplayer, uint8 toplayer, card* ptarget);
int32 special_summon_rule(uint16 step, uint8 sumplayer, card* target);
int32 special_summon_step(uint16 step, group* targets, card* target);
int32 special_summon(uint16 step, effect* reason_effect, uint8 reason_player, group* targets);
......
......@@ -276,9 +276,14 @@ int32 scriptlib::duel_sets(lua_State *L) {
uint32 playerid = lua_tointeger(L, 1);
if(playerid != 0 && playerid != 1)
return 0;
uint32 toplayer = playerid;
if(lua_gettop(L) > 2)
toplayer = lua_tointeger(L, 3);
if(toplayer != 0 && toplayer != 1)
toplayer = playerid;
card* pcard = *(card**)lua_touserdata(L, 2);
duel * pduel = pcard->pduel;
pduel->game_field->add_process(PROCESSOR_SSET, 0, 0, (group*)pcard, playerid, 0);
pduel->game_field->add_process(PROCESSOR_SSET, 0, 0, (group*)pcard, playerid, toplayer);
return lua_yield(L, 0);
}
int32 scriptlib::duel_create_token(lua_State *L) {
......
......@@ -1447,10 +1447,10 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
}
return TRUE;
}
int32 field::sset(uint16 step, uint8 setplayer, card * target) {
int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
switch(step) {
case 0: {
if(!(target->data.type & TYPE_FIELD) && get_useable_count(setplayer, LOCATION_SZONE) == 0)
if(!(target->data.type & TYPE_FIELD) && get_useable_count(toplayer, LOCATION_SZONE) == 0)
return TRUE;
if(target->data.type & TYPE_MONSTER && !target->is_affected_by_effect(EFFECT_MONSTER_SSET))
return TRUE;
......@@ -1476,7 +1476,7 @@ int32 field::sset(uint16 step, uint8 setplayer, card * target) {
}
case 1: {
target->enable_field_effect(FALSE);
move_to_field(target, setplayer, setplayer, LOCATION_SZONE, POS_FACEDOWN);
move_to_field(target, setplayer, toplayer, LOCATION_SZONE, POS_FACEDOWN);
return FALSE;
}
case 2: {
......
......@@ -382,7 +382,7 @@ int32 field::process() {
return pduel->bufferlen;
}
case PROCESSOR_SSET: {
if (sset(it->step, it->arg1, (card*)(it->ptarget)))
if (sset(it->step, it->arg1, it->arg2, (card*)(it->ptarget)))
core.units.pop_front();
else
core.units.begin()->step++;
......@@ -2285,7 +2285,7 @@ int32 field::process_idle_command(uint16 step) {
}
case 9: {
card* target = core.ssetable_cards[returns.ivalue[0] >> 16];
add_process(PROCESSOR_SSET, 0, 0, (group*)target, target->current.controler, 0);
add_process(PROCESSOR_SSET, 0, 0, (group*)target, target->current.controler, target->current.controler);
core.units.begin()->step = -1;
return FALSE;
}
......
--ウイングトータス
function c10132124.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10132124,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(c10132124.spcon)
e1:SetTarget(c10132124.sptg)
e1:SetOperation(c10132124.spop)
c:RegisterEffect(e1)
end
function c10132124.spfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousControler()==tp and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA)
end
function c10132124.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10132124.spfilter,1,nil,tp)
end
function c10132124.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and 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 c10132124.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--フライファング
function c11954712.initial_effect(c)
--reg
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetOperation(c11954712.regop)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
end
function c11954712.regop(e,tp,eg,ep,ev,re,r,rp)
--remove
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11954712,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c11954712.rmtg)
e1:SetOperation(c11954712.rmop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
e:GetHandler():RegisterEffect(e1)
end
function c11954712.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c11954712.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(c)
e1:SetOperation(c11954712.retop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c11954712.retop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.ReturnToField(e:GetLabelObject())
end
end
--バグマンY
function c23915499.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23915499,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c23915499.condition)
e1:SetTarget(c23915499.target)
e1:SetOperation(c23915499.operation)
c:RegisterEffect(e1)
end
function c23915499.cfilter(c)
return c:IsFaceup() and c:IsCode(50319138)
end
function c23915499.spfilter(c,e,tp)
return c:IsCode(87526784) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23915499.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c23915499.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c23915499.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c23915499.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c23915499.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not Duel.IsExistingMatchingCard(c23915499.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end
local tc=Duel.GetFirstMatchingCard(c23915499.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ドリル·バーニカル
function c24137081.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetOperation(c24137081.atkop)
c:RegisterEffect(e2)
end
function c24137081.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetAttackTarget()==nil then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--龍炎剣の使い手
function c34160055.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34160055,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c34160055.target)
e1:SetOperation(c34160055.operation)
c:RegisterEffect(e1)
end
function c34160055.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return tc:IsControler(tp) and not tc:IsCode(34160055) end
tc:CreateEffectRelation(e)
end
function c34160055.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
e2:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
end
--スペースタイムポリス
function c47126872.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47126872,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c47126872.rmtg)
e1:SetOperation(c47126872.rmop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47126872,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c47126872.setcon)
e2:SetTarget(c47126872.settg)
e2:SetOperation(c47126872.setop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c47126872.filter(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function c47126872.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c47126872.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c47126872.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c47126872.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
e:SetLabelObject(tc)
tc:RegisterFlagEffect(47126872,RESET_EVENT+0x1fe0000,0,1)
end
end
end
function c47126872.setcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetLabelObject()
return tc and tc:GetFlagEffect(47126872)~=0
end
function c47126872.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject():GetLabelObject()
if tc:IsType(TYPE_MONSTER) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
else
e:SetCategory(0)
end
end
function c47126872.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetLabelObject()
if tc:GetFlagEffect(47126872)==0 then return end
tc:ResetFlagEffect(47126872)
if tc:IsType(TYPE_MONSTER) then
Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENCE)
else
Duel.SSet(tp,tc,1-tp)
end
end
--スカイオニヒトクイエイ
function c47349310.initial_effect(c)
--reg
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetOperation(c47349310.regop)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e2)
end
function c47349310.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetAttackTarget() then return end
--remove
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(47349310,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c47349310.rmtg)
e1:SetOperation(c47349310.rmop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
e:GetHandler():RegisterEffect(e1)
end
function c47349310.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c47349310.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(c)
e1:SetOperation(c47349310.retop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c47349310.retop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.ReturnToField(e:GetLabelObject())
end
end
......@@ -41,13 +41,13 @@ function c49514333.repfilter(c)
end
function c49514333.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local count=eg:FilterCount(c49514333.repfilter,nil)
local count=eg:FilterCount(c49514333.repfilter,e:GetHandler())
return count>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=count
end
if Duel.SelectYesNo(tp,aux.Stringid(49514333,0)) then
local container=e:GetLabelObject():GetLabelObject()
container:Clear()
local g=eg:Filter(c49514333.repfilter,nil)
local g=eg:Filter(c49514333.repfilter,e:GetHandler())
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
......
--バグマンZ
function c50319138.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50319138,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c50319138.condition)
e1:SetTarget(c50319138.target)
e1:SetOperation(c50319138.operation)
c:RegisterEffect(e1)
end
function c50319138.cfilter(c)
return c:IsFaceup() and c:IsCode(87526784)
end
function c50319138.spfilter(c,e,tp)
return c:IsCode(23915499) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50319138.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50319138.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c50319138.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c50319138.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c50319138.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not Duel.IsExistingMatchingCard(c50319138.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end
local tc=Duel.GetFirstMatchingCard(c50319138.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ジョーズマン
function c50532786.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--tribute limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRIBUTE_LIMIT)
e2:SetValue(c50532786.tlimit)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c50532786.atkup)
c:RegisterEffect(e3)
end
function c50532786.tlimit(e,c)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
function c50532786.atkfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c50532786.atkup(e,c)
return Duel.GetMatchingGroupCount(c50532786.atkfilter,c:GetControler(),LOCATION_MZONE,0,c)*300
end
......@@ -20,7 +20,7 @@ function c50712728.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,700)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c50712728.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
--ビッグ·ジョーズ
function c51254277.initial_effect(c)
--reg
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetOperation(c51254277.regop)
c:RegisterEffect(e1)
end
function c51254277.regop(e,tp,eg,ep,ev,re,r,rp)
--remove
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(51254277,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c51254277.rmtg)
e1:SetOperation(c51254277.rmop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
e:GetHandler():RegisterEffect(e1)
end
function c51254277.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c51254277.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Remove(c,POS_FACEUP,REASON_EFFECT)
end
end
......@@ -6,7 +6,7 @@ function c68124775.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68124775,0))
e1:SetCategory(CATEGORY_REMOVEE)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
......
--レアル·クルセイダー
function c70832512.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70832512,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCost(c70832512.cost)
e1:SetTarget(c70832512.target)
e1:SetOperation(c70832512.operation)
c:RegisterEffect(e1)
end
function c70832512.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c70832512.dfilter(c,e)
return c:IsFaceup() and c:IsLevelAbove(5) and (not e or c:IsRelateToEffect(e))
end
function c70832512.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not eg:IsExists(c70832512.dfilter,1,nil) then return false end
if e:GetHandler():IsStatus(STATUS_CHAINING) then return false end
e:GetHandler():SetStatus(STATUS_CHAINING,true)
return true
end
Duel.SetTargetCard(eg)
end
function c70832512.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c70832512.dfilter,nil,e)
if g:GetCount()~=0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--地獄の傀儡魔人
function c71564150.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c71564150.cost)
e1:SetTarget(c71564150.target)
e1:SetOperation(c71564150.operation)
c:RegisterEffect(e1)
end
function c71564150.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c71564150.filter(c)
return c:IsFaceup() and c:IsLevelBelow(3) and c:IsControlerCanBeChanged()
end
function c71564150.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c71564150.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c71564150.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,c71564150.filter,tp,0,LOCATION_MZONE,ft,ft,nil)
local tc=g:GetFirst()
while tc do
if Duel.GetControl(tc,tp,PHASE_END,1) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASEABLE_SUM)
e1:SetReset(RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASEABLE_NONSUM)
e2:SetReset(RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetReset(RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e4:SetReset(RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END)
e4:SetValue(1)
tc:RegisterEffect(e4)
end
tc=g:GetNext()
end
end
--ギアギアーノ
function c71786742.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c71786742.cost)
e1:SetTarget(c71786742.target)
e1:SetOperation(c71786742.activate)
c:RegisterEffect(e1)
end
function c71786742.cost(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 c71786742.filter(c,e,tp)
return c:GetLevel()==4 and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71786742.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71786742.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c71786742.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c71786742.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c71786742.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
--タイム·エスケーパー
function c73625877.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73625877,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c73625877.rmcost)
e1:SetTarget(c73625877.rmtg)
e1:SetOperation(c73625877.rmop)
c:RegisterEffect(e1)
end
function c73625877.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c73625877.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsAbleToRemove()
end
function c73625877.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c73625877.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c73625877.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c73625877.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c73625877.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(c73625877.retop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c73625877.retop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.ReturnToField(e:GetLabelObject())
end
end
--ポケ·ドラ
function c8175346.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8175346,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c8175346.target)
e1:SetOperation(c8175346.operation)
c:RegisterEffect(e1)
end
function c8175346.filter(c)
return c:IsCode(8175346) and c:IsAbleToHand()
end
function c8175346.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c8175346.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c8175346.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstMatchingCard(c8175346.filter,tp,LOCATION_DECK,0,nil)
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--スピアフィッシュソルジャー
function c84569017.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c84569017.atkup)
c:RegisterEffect(e1)
end
function c84569017.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_AQUA+RACE_SEASERPENT)
end
function c84569017.atkup(e,c)
return Duel.GetMatchingGroupCount(c84569017.atkfilter,c:GetControler(),LOCATION_REMOVED,0,nil)*100
end
--エアジャチ
function c84747429.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84747429,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c84747429.descost)
e1:SetTarget(c84747429.destg)
e1:SetOperation(c84747429.desop)
c:RegisterEffect(e1)
end
function c84747429.cfilter(c)
return c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToRemoveAsCost()
end
function c84747429.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84747429.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c84747429.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c84747429.filter(c)
return c:IsFaceup() and c:IsDestructable()
end
function c84747429.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c84747429.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c84747429.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c84747429.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c84747429.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(c)
e1:SetOperation(c84747429.retop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c84747429.retop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.ReturnToField(e:GetLabelObject())
end
end
--スーパーバグマン
function c86804246.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENCE,0)
e1:SetCondition(c86804246.spcon)
e1:SetOperation(c86804246.spop)
c:RegisterEffect(e1)
--swap ad
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SWAP_AD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c86804246.adfilter)
c:RegisterEffect(e2)
--only 1 can exists
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
e3:SetCondition(c86804246.excon)
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(c86804246.splimit)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SELF_DESTROY)
e5:SetCondition(c86804246.descon)
c:RegisterEffect(e5)
end
function c86804246.spfilter(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost()
end
function c86804246.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(c86804246.exfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(c86804246.spfilter,tp,LOCATION_GRAVE,0,1,nil,87526784)
and Duel.IsExistingMatchingCard(c86804246.spfilter,tp,LOCATION_GRAVE,0,1,nil,23915499)
and Duel.IsExistingMatchingCard(c86804246.spfilter,tp,LOCATION_GRAVE,0,1,nil,50319138)
end
function c86804246.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c86804246.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,87526784)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c86804246.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,23915499)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=Duel.SelectMatchingCard(tp,c86804246.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,50319138)
g1:Merge(g2)
g1:Merge(g3)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c86804246.adfilter(e,c)
return c:IsPosition(POS_FACEUP_ATTACK)
end
function c86804246.exfilter(c,fid)
return c:IsFaceup() and c:GetCode()==86804246 and (fid==nil or c:GetFieldID()<fid)
end
function c86804246.excon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c86804246.exfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c86804246.splimit(e,se,sp,st,spos,tgp)
if bit.band(spos,POS_FACEDOWN)~=0 then return true end
return not Duel.IsExistingMatchingCard(c86804246.exfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c86804246.descon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c86804246.exfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,c:GetFieldID())
end
--バグマンX
function c87526784.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87526784,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c87526784.condition)
e1:SetTarget(c87526784.target)
e1:SetOperation(c87526784.operation)
c:RegisterEffect(e1)
end
function c87526784.cfilter(c)
return c:IsFaceup() and c:IsCode(23915499)
end
function c87526784.spfilter(c,e,tp)
return c:IsCode(50319138) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c87526784.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c87526784.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c87526784.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c87526784.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c87526784.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not Duel.IsExistingMatchingCard(c87526784.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end
local tc=Duel.GetFirstMatchingCard(c87526784.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -7,22 +7,19 @@ function c90810762.initial_effect(c)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DAMAGE)
e2:SetCondition(c90810762.atkcon)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetOperation(c90810762.atkop)
c:RegisterEffect(e2)
end
function c90810762.atkcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()==nil
end
function c90810762.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetAttackTarget()==nil then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--スカル·クラーケン
function c98649372.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98649372,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c98649372.destg)
e1:SetOperation(c98649372.desop)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98649372,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetOperation(c98649372.posop)
c:RegisterEffect(e2)
end
function c98649372.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsDestructable()
end
function c98649372.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c98649372.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c98649372.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c98649372.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c98649372.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c98649372.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
--アチャチャアーチャー
function c98865920.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98865920,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c98865920.target)
e1:SetOperation(c98865920.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c98865920.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c98865920.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
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