Commit 8f361df9 authored by argon.sun's avatar argon.sun

fix&gaov-2

parent 1390116e
...@@ -51,7 +51,7 @@ bool Game::Initialize() { ...@@ -51,7 +51,7 @@ bool Game::Initialize() {
numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16); numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16);
adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 12); adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 12);
lpcFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 48); lpcFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 48);
guiFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, 14); guiFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, 12);
textFont = guiFont; textFont = guiFont;
smgr = device->getSceneManager(); smgr = device->getSceneManager();
device->setWindowCaption(L"[---]"); device->setWindowCaption(L"[---]");
......
...@@ -23,8 +23,9 @@ class group; ...@@ -23,8 +23,9 @@ class group;
class effect; class effect;
struct tevent { struct tevent {
card* trigger_card;
uint32 event_code; uint32 event_code;
void* event_cards; group* event_cards;
uint32 event_value; uint32 event_value;
uint8 event_player; uint8 event_player;
effect* reason_effect; effect* reason_effect;
...@@ -357,7 +358,7 @@ public: ...@@ -357,7 +358,7 @@ public:
int32 execute_target(uint16 step, effect* peffect, uint8 triggering_player); int32 execute_target(uint16 step, effect* peffect, uint8 triggering_player);
void raise_event(card* event_card, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value); void raise_event(card* event_card, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value);
void raise_event(card_set* event_cards, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value); void raise_event(card_set* event_cards, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value);
void raise_single_event(card* event_card, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value ); void raise_single_event(card* trigger_card, card_set* event_cards, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value );
int32 check_event(uint32 code, tevent* pe = 0); int32 check_event(uint32 code, tevent* pe = 0);
int32 check_hint_timing(effect* peffect); int32 check_hint_timing(effect* peffect);
int32 process_phase_event(int16 step, int32 phase_event); int32 process_phase_event(int16 step, int32 phase_event);
......
...@@ -699,7 +699,7 @@ int32 scriptlib::duel_raise_single_event(lua_State *L) { ...@@ -699,7 +699,7 @@ int32 scriptlib::duel_raise_single_event(lua_State *L) {
uint32 ep = lua_tointeger(L, 6); uint32 ep = lua_tointeger(L, 6);
uint32 ev = lua_tointeger(L, 7); uint32 ev = lua_tointeger(L, 7);
duel* pduel = pcard->pduel; duel* pduel = pcard->pduel;
pduel->game_field->raise_single_event(pcard, code, peffect, r, rp, ep, ev); pduel->game_field->raise_single_event(pcard, 0, code, peffect, r, rp, ep, ev);
pduel->game_field->process_single_event(); pduel->game_field->process_single_event();
return lua_yield(L, 0); return lua_yield(L, 0);
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -16,14 +16,12 @@ function c13293158.initial_effect(c) ...@@ -16,14 +16,12 @@ function c13293158.initial_effect(c)
e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetOperation(c13293158.atkop) e2:SetOperation(c13293158.atkop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--damage --destroy
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13293158,0)) e3:SetDescription(aux.Stringid(13293158,0))
e3:SetCategory(CATEGORY_DAMAGE) e3:SetCategory(CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c13293158.condition)
e3:SetTarget(c13293158.target) e3:SetTarget(c13293158.target)
e3:SetOperation(c13293158.activate) e3:SetOperation(c13293158.activate)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -46,9 +44,6 @@ end ...@@ -46,9 +44,6 @@ end
function c13293158.aclimit(e,re,tp) function c13293158.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end end
function c13293158.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c13293158.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c13293158.filter(c) function c13293158.filter(c)
return c:IsFacedown() and c:IsDestructable() return c:IsFacedown() and c:IsDestructable()
end end
......
...@@ -47,6 +47,7 @@ function c21790410.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,6 +47,7 @@ function c21790410.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc then if tc then
if not Duel.Equip(tp,tc,c,true) then return end if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
...@@ -55,7 +56,7 @@ function c21790410.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +56,7 @@ function c21790410.eqop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c21790410.eqlimit(e,c) function c21790410.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled() return e:GetOwner()==c
end end
function c21790410.cfilter(c,ec,tp) function c21790410.cfilter(c,ec,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
......
...@@ -21,9 +21,8 @@ function c21977828.initial_effect(c) ...@@ -21,9 +21,8 @@ function c21977828.initial_effect(c)
e3:SetDescription(aux.Stringid(21977828,1)) e3:SetDescription(aux.Stringid(21977828,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c21977828.spcon) e3:SetCondition(c21977828.spcon)
e3:SetTarget(c21977828.sptg) e3:SetTarget(c21977828.sptg)
e3:SetOperation(c21977828.spop) e3:SetOperation(c21977828.spop)
......
--甲虫装機 グルフ
function c2461031.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(2461031,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c2461031.eqtg)
e1:SetOperation(c2461031.eqop)
c:RegisterEffect(e1)
--equip effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetValue(100)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(2)
c:RegisterEffect(e4)
--lvup
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(2461031,1))
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCost(c2461031.lvcost)
e5:SetTarget(c2461031.lvtg)
e5:SetOperation(c2461031.lvop)
c:RegisterEffect(e5)
end
function c2461031.filter(c)
return c:IsSetCard(0x56) and c:IsType(TYPE_MONSTER) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c2461031.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c2461031.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c2461031.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c2461031.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c2461031.eqlimit)
tc:RegisterEffect(e1)
end
end
function c2461031.eqlimit(e,c)
return e:GetOwner()==c
end
function c2461031.lvcost(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 c2461031.lvfilter(c)
return c:IsFaceup() and not c:IsType(TYPE_XYZ)
end
function c2461031.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c2461031.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c2461031.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c2461031.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c2461031.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local opt=Duel.SelectOption(tp,aux.Stringid(2461031,2),aux.Stringid(2461031,3))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(opt+1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
--甲虫装機の手甲
function c259314.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c259314.condition)
e1:SetTarget(c259314.target)
e1:SetOperation(c259314.operation)
c:RegisterEffect(e1)
end
function c259314.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c259314.filter(c)
return c:IsFaceup() and c:IsSetCard(0x56)
end
function c259314.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c259314.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c259314.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c259314.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c259314.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_DEFENCE)
e1:SetValue(1000)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c259314.eqlimit)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetValue(c259314.efilter)
c:RegisterEffect(e3,true)
end
end
function c259314.eqlimit(e,c)
return c:IsSetCard(0x56)
end
function c259314.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
--甲虫装機 エクサスタッグ
function c26211048.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,c26211048.xyzfilter,2)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26211048,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c26211048.eqcost)
e1:SetTarget(c26211048.eqtg)
e1:SetOperation(c26211048.eqop)
c:RegisterEffect(e1)
end
function c26211048.xyzfilter(c)
return c:IsRace(RACE_INSECT) and c:GetLevel()==5
end
function c26211048.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c26211048.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsType(TYPE_MONSTER) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,nil,TYPE_MONSTER) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil,TYPE_MONSTER)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
end
function c26211048.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or c:IsFacedown() or not c:IsRelateToEffect(e) then
if tc:IsLocation(LOCATION_MZONE) then Duel.SendtoGrave(tc,REASON_EFFECT) end
return
end
Duel.Equip(tp,tc,c,false)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c44505297.eqlimit)
tc:RegisterEffect(e1)
if tc:IsFaceup() then
local atk=tc:GetTextAttack()/2
if atk<0 then atk=0 end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(atk)
tc:RegisterEffect(e2)
local def=tc:GetTextDefence()/2
if def<0 then def=0 end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetValue(def)
tc:RegisterEffect(e3)
end
end
function c44505297.eqlimit(e,c)
return e:GetOwner()==c
end
--ライトレイ ディアボロス
function c30126992.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)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c30126992.spcon)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(30126992,0))
e3:SetCategory(CATEGORY_TODECK)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c30126992.tdcost)
e3:SetTarget(c30126992.tdtg)
e3:SetOperation(c30126992.tdop)
c:RegisterEffect(e3)
end
function c30126992.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT)
local ct=g:GetClassCount(Card.GetCode)
return ct>4
end
function c30126992.cfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemove()
end
function c30126992.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30126992.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c30126992.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c30126992.filter(c)
return c:IsFacedown() and c:IsAbleToDeck()
end
function c30126992.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c30126992.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c30126992.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c30126992.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c30126992.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.ConfirmCards(tp,tc)
local opt=Duel.SelectOption(tp,aux.Stringid(30126992,1),aux.Stringid(30126992,2))
Duel.SendtoDeck(tc,nil,opt,REASON_EFFECT)
end
end
...@@ -43,7 +43,8 @@ function c36099620.acop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,8 @@ function c36099620.acop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c36099620.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) function c36099620.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetCounter(0x5)>=2 end if chk==0 then return not e:GetHandler():IsReason(REASON_RULE)
and e:GetHandler():GetCounter(0x5)>=2 end
return true return true
end end
function c36099620.desrepop(e,tp,eg,ep,ev,re,r,rp) function c36099620.desrepop(e,tp,eg,ep,ev,re,r,rp)
......
--甲虫装機 ウィーグ
function c38450736.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(38450736,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c38450736.eqtg)
e1:SetOperation(c38450736.eqop)
c:RegisterEffect(e1)
--equip effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetValue(1000)
c:RegisterEffect(e3)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(38450736,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c38450736.atkcon)
e3:SetTarget(c38450736.atktg)
e3:SetOperation(c38450736.atkop)
c:RegisterEffect(e3)
end
function c38450736.filter(c)
return c:IsSetCard(0x56) and c:IsType(TYPE_MONSTER) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c38450736.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c38450736.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c38450736.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c38450736.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c38450736.eqlimit)
tc:RegisterEffect(e1)
end
end
function c38450736.eqlimit(e,c)
return e:GetOwner()==c
end
function c38450736.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
e:SetLabelObject(ec)
return c:IsPreviousLocation(LOCATION_SZONE) and not c:IsReason(REASON_LOST_TARGET)
end
function c38450736.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ec=e:GetLabelObject()
ec:CreateEffectRelation(e)
end
function c38450736.atkop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject()
if ec:IsLocation(LOCATION_MZONE) and ec:IsFaceup() and ec:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
ec:RegisterEffect(e1)
end
end
--ライトレイ ダイダロス
function c38737148.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)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c38737148.spcon)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(38737148,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c38737148.destg)
e3:SetOperation(c38737148.desop)
c:RegisterEffect(e3)
end
function c38737148.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_GRAVE,0,4,nil,ATTRIBUTE_LIGHT)
end
function c38737148.desfilter(c)
return c:IsDestructable() and c:GetSequence()==5
and Duel.IsExistingTarget(Card.IsDestructable,0,LOCATION_ONFIELD,LOCATION_ONFIELD,2,c)
end
function c38737148.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c38737148.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c38737148.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,g1:GetFirst())
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0)
end
function c38737148.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
...@@ -44,7 +44,7 @@ end ...@@ -44,7 +44,7 @@ end
function c39910367.op(e,tp,eg,ep,ev,re,r,rp) function c39910367.op(e,tp,eg,ep,ev,re,r,rp)
local te=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT) local te=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
local c=te:GetHandler() local c=te:GetHandler()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) and c~=e:GetHandler() then if te:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) and c:GetSequence()~=5 then
e:GetHandler():AddCounter(0x3001,1) e:GetHandler():AddCounter(0x3001,1)
end end
end end
...@@ -55,7 +55,8 @@ function c39910367.rop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,8 @@ function c39910367.rop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(ep,0x3001,ev,REASON_EFFECT) e:GetHandler():RemoveCounter(ep,0x3001,ev,REASON_EFFECT)
end end
function c39910367.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) function c39910367.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetCounter(0x3001)>0 end if chk==0 then return not e:GetHandler():IsReason(REASON_RULE)
and e:GetHandler():GetCounter(0x3001)>0 end
return Duel.SelectYesNo(tp,aux.Stringid(39910367,1)) return Duel.SelectYesNo(tp,aux.Stringid(39910367,1))
end end
function c39910367.desrepop(e,tp,eg,ep,ev,re,r,rp) function c39910367.desrepop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -4,17 +4,12 @@ function c423705.initial_effect(c) ...@@ -4,17 +4,12 @@ function c423705.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(423705,0)) e1:SetDescription(aux.Stringid(423705,0))
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_EQUIP) e1:SetCode(EVENT_EQUIP)
e1:SetTarget(c423705.descon)
e1:SetTarget(c423705.destg) e1:SetTarget(c423705.destg)
e1:SetOperation(c423705.desop) e1:SetOperation(c423705.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c423705.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():GetEquipTarget()==e:GetHandler()
end
function c423705.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c423705.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
eg:GetFirst():CreateEffectRelation(e) eg:GetFirst():CreateEffectRelation(e)
......
...@@ -8,11 +8,9 @@ function c43366227.initial_effect(c) ...@@ -8,11 +8,9 @@ function c43366227.initial_effect(c)
e1:SetDescription(aux.Stringid(43366227,0)) e1:SetDescription(aux.Stringid(43366227,0))
e1:SetCategory(CATEGORY_DAMAGE) e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCode(EVENT_EQUIP) e1:SetCode(EVENT_EQUIP)
e1:SetTarget(c43366227.damcon)
e1:SetTarget(c43366227.damtg) e1:SetTarget(c43366227.damtg)
e1:SetOperation(c43366227.damop) e1:SetOperation(c43366227.damop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -40,9 +38,6 @@ function c43366227.initial_effect(c) ...@@ -40,9 +38,6 @@ function c43366227.initial_effect(c)
e3:SetOperation(c43366227.desop) e3:SetOperation(c43366227.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c43366227.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():GetEquipTarget()==e:GetHandler()
end
function c43366227.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c43366227.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
......
...@@ -7,6 +7,7 @@ function c44505297.initial_effect(c) ...@@ -7,6 +7,7 @@ function c44505297.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(44505297,0)) e1:SetDescription(aux.Stringid(44505297,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP) e1:SetCategory(CATEGORY_EQUIP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c44505297.eqcon) e1:SetTarget(c44505297.eqcon)
...@@ -34,7 +35,8 @@ function c44505297.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,7 +35,8 @@ function c44505297.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,TYPE_MONSTER) end and Duel.IsExistingTarget(Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,TYPE_MONSTER) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,TYPE_MONSTER) local g=Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,TYPE_MONSTER)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end end
function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp) function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -43,26 +45,31 @@ function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,26 +45,31 @@ function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp)
or not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end or not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
Duel.Equip(tp,tc,c,false) Duel.Equip(tp,tc,c,false)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c44505297.eqlimit) e1:SetValue(c44505297.eqlimit)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local atk=tc:GetTextAttack()/2
if atk<0 then atk=0 end
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP) e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000) e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(tc:GetTextAttack()/2) e2:SetValue(atk)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
local def=tc:GetTextDefence()/2
if def<0 then def=0 end
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP) e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_DEFENCE) e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetReset(RESET_EVENT+0x1fe0000) e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetValue(tc:GetTextDefence()/2) e3:SetValue(def)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
function c44505297.eqlimit(e,c) function c44505297.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled() return e:GetOwner()==c
end end
function c44505297.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c44505297.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
--ライトレイ ギア・フリード
function c4722253.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)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c4722253.spcon)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(4722253,0))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCode(EVENT_CHAINING)
e3:SetCondition(c4722253.negcon)
e3:SetCost(c4722253.negcost)
e3:SetTarget(c4722253.negtg)
e3:SetOperation(c4722253.negop)
c:RegisterEffect(e3)
end
function c4722253.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT)
local ct=g:GetClassCount(Card.GetCode)
return ct>4
end
function c4722253.cfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_WARRIOR)
end
function c4722253.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainInactivatable(ev)
and not Duel.IsExistingMatchingCard(c4722253.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c4722253.cfilter2(c)
return c:IsRace(RACE_WARRIOR) and c:IsAbleToRemove()
end
function c4722253.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4722253.cfilter2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c4722253.cfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c4722253.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c4722253.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
...@@ -29,7 +29,7 @@ function c48505422.spcon(e,c) ...@@ -29,7 +29,7 @@ function c48505422.spcon(e,c)
Duel.IsExistingMatchingCard(c48505422.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) Duel.IsExistingMatchingCard(c48505422.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function c48505422.rlcon(e,tp,eg,ep,ev,re,r,rp) function c48505422.rlcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsOnField() return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function c48505422.filter(c) function c48505422.filter(c)
return c:IsSetCard(0x3d) and c:GetCode()~=48505422 and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x3d) and c:GetCode()~=48505422 and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......
--ファイナル・インゼクション
function c51549976.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c51549976.cost)
e1:SetTarget(c51549976.target)
e1:SetOperation(c51549976.activate)
c:RegisterEffect(e1)
end
function c51549976.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x56) and c:IsAbleToGraveAsCost()
end
function c51549976.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c51549976.cfilter,tp,LOCATION_ONFIELD,0,5,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c51549976.cfilter,tp,LOCATION_ONFIELD,0,5,5,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c51549976.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c51549976.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
if Duel.Destroy(g,REASON_EFFECT)==0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetCondition(c51549976.actcon)
e1:SetValue(c51549976.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c51549976.actcon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE and ph<=PHASE_DAMAGE_CAL
end
function c51549976.aclimit(e,re,tp)
return re:GetHandler():IsType(TYPE_MONSTER) and re:GetHandler():IsLocation(LOCATION_HAND+LOCATION_GRAVE)
end
...@@ -39,7 +39,7 @@ function c525110.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,7 +39,7 @@ function c525110.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
t1:RegisterEffect(e1) t1:RegisterEffect(e1)
if t2 then if t2 then
Duel.SpecialSummonStep(t2,0,tp,tp,false,false,POS_FACEUP) end Duel.SpecialSummonStep(t2,0,tp,tp,false,false,POS_FACEUP)
local e2=e1:Clone() local e2=e1:Clone()
t2:RegisterEffect(e2) t2:RegisterEffect(e2)
end end
......
--No.25 重装光学撮影機フォーカス・フォース
function c64554883.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,6),2)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(64554883,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c64554883.cost)
e1:SetTarget(c64554883.target)
e1:SetOperation(c64554883.operation)
c:RegisterEffect(e1)
end
function c64554883.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c64554883.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c64554883.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c64554883.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c64554883.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c64554883.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c64554883.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
tc:RegisterEffect(e2)
end
end
--甲虫装機 ギガグリオル
function c65844845.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65844845,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c65844845.eqcost)
e1:SetTarget(c65844845.eqtg)
e1:SetOperation(c65844845.eqop)
c:RegisterEffect(e1)
--equip effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(2000)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
end
function c65844845.cfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAbleToRemoveAsCost()
end
function c65844845.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65844845.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c65844845.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c65844845.filter(c)
return c:IsFaceup() and c:IsSetCard(0x56)
end
function c65844845.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c65844845.filter(chkc) end
if chk==0 then return Duel.GetFlagEffect(tp,65844845)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c65844845.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c65844845.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.RegisterFlagEffect(tp,65844845,RESET_PHASE+PHASE_END,0,1)
end
function c65844845.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c65844845.eqlimit)
c:RegisterEffect(e1)
end
function c65844845.eqlimit(e,c)
return c:IsSetCard(0x56)
end
--甲虫装機 リュシオル
function c66066482.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66066482,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c66066482.eqtg)
e1:SetOperation(c66066482.eqop)
c:RegisterEffect(e1)
--equip effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(100)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_DEFENCE)
e4:SetValue(100)
c:RegisterEffect(e4)
--confirm
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(66066482,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_EQUIP)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c66066482.cfcon)
e3:SetTarget(c66066482.cftg)
e3:SetOperation(c66066482.cfop)
c:RegisterEffect(e3)
end
function c66066482.filter(c)
return c:IsSetCard(0x56) and c:IsType(TYPE_MONSTER) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c66066482.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c66066482.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c66066482.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c66066482.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c66066482.eqlimit)
tc:RegisterEffect(e1)
end
end
function c66066482.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function c66066482.cfcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsSetCard(0x56)
end
function c66066482.cftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
end
function c66066482.cfop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
end
end
--ドラゴン・ウィッチ-ドラゴンの守護者-
function c67511500.initial_effect(c)
--cannot be battle target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_DRAGON))
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetTarget(c67511500.desreptg)
c:RegisterEffect(e2)
end
function c67511500.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_HAND,0,1,nil,RACE_DRAGON) end
if Duel.SelectYesNo(tp,aux.Stringid(67511500,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsRace,tp,LOCATION_HAND,0,1,1,nil,RACE_DRAGON)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
...@@ -47,6 +47,7 @@ function c68184115.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,6 +47,7 @@ function c68184115.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc then if tc then
if not Duel.Equip(tp,tc,c,true) then return end if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
...@@ -55,7 +56,7 @@ function c68184115.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +56,7 @@ function c68184115.eqop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c68184115.eqlimit(e,c) function c68184115.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled() return e:GetOwner()==c
end end
function c68184115.cfilter(c,ec,tp) function c68184115.cfilter(c,ec,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
......
...@@ -56,6 +56,7 @@ function c69207766.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,6 +56,7 @@ function c69207766.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc then if tc then
if not Duel.Equip(tp,tc,c,true) then return end if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
...@@ -64,7 +65,7 @@ function c69207766.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,7 +65,7 @@ function c69207766.eqop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c69207766.eqlimit(e,c) function c69207766.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled() return e:GetOwner()==c
end end
function c69207766.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c69207766.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
--ゼクト・コンバージョン
function c74854609.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c74854609.condition)
e1:SetTarget(c74854609.target)
e1:SetOperation(c74854609.operation)
c:RegisterEffect(e1)
end
function c74854609.condition(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d:IsFaceup() and d:IsSetCard(0x56) and a:IsControler(1-tp)
end
function c74854609.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local a=Duel.GetAttacker()
if chkc then return a==chkc end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and a:IsOnField() and a:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(a)
end
function c74854609.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c74854609.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=Duel.GetAttackTarget()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED)
and ec:IsLocation(LOCATION_MZONE) and ec:IsFaceup() then
Duel.Equip(tp,ec,tc)
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c74854609.eqlimit)
e1:SetLabelObject(tc)
ec:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_CONTROL)
e2:SetValue(tp)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetCondition(c74854609.con)
e2:SetLabelObject(ec)
tc:RegisterEffect(e2)
end
end
function c74854609.con(e)
local c=e:GetLabelObject()
local h=e:GetHandler()
return c:IsHasCardTarget(h)
end
--甲虫装機の魔弓 ゼクトアロー
function c87047074.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(c87047074.target)
e1:SetOperation(c87047074.operation)
c:RegisterEffect(e1)
--Atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
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(c87047074.eqlimit)
c:RegisterEffect(e3)
--chain limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(c87047074.chcon)
e4:SetOperation(c87047074.chop)
c:RegisterEffect(e4)
end
function c87047074.eqlimit(e,c)
return c:IsSetCard(0x56)
end
function c87047074.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x56)
end
function c87047074.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c87047074.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c87047074.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c87047074.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c87047074.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c87047074.chcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler()==e:GetHandler():GetEquipTarget()
end
function c87047074.chop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimit(c87047074.chlimit)
end
function c87047074.chlimit(e,ep,tp)
return ep==tp
end
...@@ -13,7 +13,7 @@ function c88095331.initial_effect(c) ...@@ -13,7 +13,7 @@ function c88095331.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c88095331.condition(e,tp,eg,ep,ev,re,r,rp) function c88095331.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsOnField() return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function c88095331.filter(c,e,tp) function c88095331.filter(c,e,tp)
return c:IsSetCard(0x604e) and c:IsCanBeSpecialSummoned(e,155,tp,false,false) return c:IsSetCard(0x604e) and c:IsCanBeSpecialSummoned(e,155,tp,false,false)
......
--竜魔人 クィーンドラグーン
function c90726340.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTarget(c90726340.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(90726340,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c90726340.spcost)
e2:SetTarget(c90726340.sptg)
e2:SetOperation(c90726340.spop)
c:RegisterEffect(e2)
end
function c90726340.indtg(e,c)
return c:IsRace(RACE_DRAGON) and c:GetCode()~=90726340
end
function c90726340.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c90726340.spfilter(c,e,tp)
return c:IsLevelAbove(5) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c90726340.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c90726340.spfilter(c,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c90726340.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c90726340.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c90726340.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3,true)
Duel.SpecialSummonComplete()
end
end
--ライトレイ ソーサラー
function c91349449.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)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c91349449.spcon)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(91349449,0))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c91349449.rmcost)
e3:SetTarget(c91349449.rmtg)
e3:SetOperation(c91349449.rmop)
c:RegisterEffect(e3)
end
function c91349449.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_REMOVED,0,3,nil,ATTRIBUTE_LIGHT)
end
function c91349449.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1,true)
end
function c91349449.filter1(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function c91349449.filter2(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function c91349449.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c91349449.filter1,tp,LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingTarget(c91349449.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,c91349449.filter1,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,1,0,0)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,c91349449.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g2,1,0,0)
end
function c91349449.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc1=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
if tc1:IsRelateToEffect(e) and Duel.SendtoDeck(tc1,nil,2,REASON_EFFECT)~=0 then
if tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
Duel.Remove(tc2,POS_FACEUP,REASON_EFFECT)
end
end
end
...@@ -21,9 +21,8 @@ function c94573223.initial_effect(c) ...@@ -21,9 +21,8 @@ function c94573223.initial_effect(c)
e3:SetDescription(aux.Stringid(94573223,1)) e3:SetDescription(aux.Stringid(94573223,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c94573223.spcon) e3:SetCondition(c94573223.spcon)
e3:SetTarget(c94573223.sptg) e3:SetTarget(c94573223.sptg)
e3:SetOperation(c94573223.spop) e3:SetOperation(c94573223.spop)
......
...@@ -52,6 +52,7 @@ function c95395761.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,6 +52,7 @@ function c95395761.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc then if tc then
if not Duel.Equip(tp,tc,c,true) then return end if not Duel.Equip(tp,tc,c,true) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
...@@ -60,7 +61,7 @@ function c95395761.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +61,7 @@ function c95395761.eqop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c95395761.eqlimit(e,c) function c95395761.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled() return e:GetOwner()==c
end end
function c95395761.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function c95395761.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
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