Commit 0296c72e authored by argon.sun's avatar argon.sun

new scripts

parent 2541f026
......@@ -2528,21 +2528,27 @@ bool Game::SolveMessage(void* pd, char* msg, int len) {
mainGame->showcard = 0;
return true;
}
case MSG_CARD_SELECTED:
case MSG_CARD_SELECTED: {
return true;
}
case MSG_RANDOM_SELECTED: {
int player = NetManager::ReadInt8(pbuf);
int count = NetManager::ReadInt8(pbuf);
ClientCard* pcard;
ClientCard* pcards[10];
for (int i = 0; i < count; ++i) {
int c = mainGame->LocalPlayer(NetManager::ReadInt8(pbuf));
int l = NetManager::ReadInt8(pbuf);
int s = NetManager::ReadInt8(pbuf);
int ss = NetManager::ReadInt8(pbuf);
if ((l & 0x80) > 0)
pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss];
pcards[i] = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss];
else
pcard = mainGame->dField.GetCard(c, l, s);
pcards[i] = mainGame->dField.GetCard(c, l, s);
pcards[i]->is_highlighting = true;
}
mainGame->WaitFrameSignal(30);
for(int i = 0; i < count; ++i)
pcards[i]->is_highlighting = false;
return true;
}
case MSG_BECOME_TARGET: {
......
......@@ -69,12 +69,12 @@ function c21790410.tgfilter(c)
end
function c21790410.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsFaceup()
and Duel.IsExistingTarget(c21790410.tgfilter,tp,LOCATION_DECK,0,1,nil) end
and Duel.IsExistingMatchingCard(c21790410.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c21790410.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c21790410.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c21790410.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
--ブラック·ブルドラゴ
--メンタルオーバー·デーモン
function c24221808.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),aux.NonTuner(Card.IsRace,RACE_PSYCHO),2)
......@@ -10,7 +10,7 @@ function c24221808.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
--e1:SetCountLimit(1)
e1:SetCountLimit(1)
e1:SetTarget(c24221808.rmtg)
e1:SetOperation(c24221808.rmop)
c:RegisterEffect(e1)
......@@ -35,7 +35,7 @@ end
function c24221808.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c24221808.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24221808.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.SelectTarget(tp,c24221808.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
......@@ -44,26 +44,32 @@ function c24221808.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
local sg=e:GetLabelObject()
if c:GetFlagEffect(24221808)==0 then
sg:Clear()
c:RegisterFlagEffect(24221808,RESET_EVENT+0x1680000,0,1)
end
if c:IsRelateToEffect(e) then
local sg=e:GetLabelObject()
if c:GetFlagEffect(24221808)==0 then
sg:Clear()
c:RegisterFlagEffect(24221808,RESET_EVENT+0x1680000,0,1)
end
sg:AddCard(tc)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
end
end
end
function c96029574.spcon(e,tp,eg,ep,ev,re,r,rp)
function c24221808.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():GetFlagEffect(24221808)~=0
end
function c96029574.spfilter(c,e,tp)
function c24221808.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c96029574.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c24221808.spfilter(c,rc,e,tp)
return c:IsRelateToCard(rc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96029574.spop(e,tp,eg,ep,ev,re,r,rp)
function c24221808.spop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:FilterSelect(tp,c24221808.spfilter,ft,ft,nil,e:GetHandler(),e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--旋風のボルテクス
function c25373678.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_WINDBEAST),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(25373678,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c25373678.condition)
e1:SetTarget(c25373678.target)
e1:SetOperation(c25373678.operation)
c:RegisterEffect(e1)
end
function c25373678.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c25373678.filter(c,e,tp)
return c:IsLavelBelow(4) and c:IsRace(RACE_WINDBEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c25373678.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c25373678.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c25373678.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c25373678.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--エンシェント·ホーリー·ワイバーン
function c25958491.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c25958491.synfilter,aux.NonTuner(nil),1)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--Atk update
local e1=Effect.CreateEffect(c)
......@@ -23,9 +23,6 @@ function c25958491.initial_effect(c)
e2:SetOperation(c25958491.sumop)
c:RegisterEffect(e2)
end
function c25958491.synfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c25958491.atkval(e,c)
local cont=c:GetControler()
return Duel.GetLP(cont)-Duel.GetLP(1-cont)
......
......@@ -53,5 +53,5 @@ function c29343734.atkfilter(c,att)
return c:IsFaceup() and c:IsAttribute(att)
end
function c29343734.val(e,c)
return Duel.GetMatchingGroupCount(c29343734.atkfilter,tp,0,LOCATION_MZONE,nil,c:GetAttribute())*300
return Duel.GetMatchingGroupCount(c29343734.atkfilter,c:GetControler(),0,LOCATION_MZONE,nil,c:GetAttribute())*300
end
--漆黒のズムウォルト
function c31919988.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsRace,RACE_INSECT),1)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--atk change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31919988,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c31919988.atcon)
e2:SetTarget(c31919988.attg)
e2:SetOperation(c31919988.atop)
c:RegisterEffect(e2)
--battle destroying
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(31919988,1))
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(c31919988.ddcon)
e3:SetTarget(c31919988.ddtg)
e3:SetOperation(c31919988.ddop)
c:RegisterEffect(e3)
end
function c31919988.atcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsFaceup() and tc:GetAttack()>e:GetHandler():GetAttack()
end
function c31919988.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():GetBattleTarget():CreateEffectRelation(e)
end
function c31919988.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() or tc:IsFacedown() or not tc:IsRelateToEffect(e)
or tc:GetAttack()<=c:GetAttack() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(c:GetAttack())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
end
function c31919988.ddcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
end
function c31919988.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c31919988.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
end
--デーモン·カオス·キング
function c36407615.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--atk/def swap
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(36407615,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetTarget(c36407615.attg)
e1:SetOperation(c36407615.atop)
c:RegisterEffect(e1)
end
function c36407615.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c36407615.atop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local atk=tc:GetAttack()
local def=tc:GetDefence()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(def)
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_SET_DEFENCE_FINAL)
e2:SetValue(atk)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--カタパルト·ウォリアー
function c37474917.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37474917,0))
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c37474917.cost)
e1:SetTarget(c37474917.target)
e1:SetOperation(c37474917.operation)
c:RegisterEffect(e1)
end
function c37474917.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x43) end
local sg=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x43)
local atk=sg:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.Release(sg,REASON_COST)
end
function c37474917.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetLabel())
end
function c37474917.operation(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 c43366227.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43366227,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_EQUIP)
e1:SetTarget(c43366227.damcon)
e1:SetTarget(c43366227.damtg)
e1:SetOperation(c43366227.damop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(43366227,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c43366227.tgtg)
e2:SetOperation(c43366227.tgop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(43366227,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c43366227.descon)
e3:SetTarget(c43366227.destg)
e3:SetOperation(c43366227.desop)
c:RegisterEffect(e3)
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)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c43366227.damop(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 c43366227.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetEquipTarget()==e:GetHandler() end
if chk==0 then return e:GetHandler():GetEquipCount()~=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=e:GetHandler():GetEquipGroup():Select(tp,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c43366227.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c43366227.cfilter(c,ec,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
and c:IsHasCardTarget(ec) and c:GetPreviousEquipTarget()==ec
end
function c43366227.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c43366227.cfilter,1,nil,e:GetHandler(),tp)
end
function c43366227.desfilter(c)
return c:IsFaceup() and c:IsDestructable()
end
function c43366227.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c43366227.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c43366227.desfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c43366227.spfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c43366227.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ダーク·フラット·トップ
function c67904682.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsRace,RACE_MACHINE),1)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67904682,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c67904682.sptg1)
e1:SetOperation(c67904682.spop1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67904682,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c67904682.spcon2)
e2:SetTarget(c67904682.sptg2)
e2:SetOperation(c67904682.spop2)
c:RegisterEffect(e2)
end
function c67904682.spfilter1(c,e,tp)
return (c:IsSetCard(0x63) or c:IsCode(16898077)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c67904682.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c67904682.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c67904682.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c67904682.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c67904682.spop1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
function c67904682.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c67904682.spfilter2(c,e,tp)
return c:IsLevelBelow(5) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c67904682.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c67904682.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c67904682.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c67904682.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
......@@ -69,12 +69,12 @@ function c68184115.spfilter(c,e,tp)
end
function c68184115.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsFaceup()
and Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingTarget(c68184115.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
and Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingMatchingCard(c68184115.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c68184115.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c68184115.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c68184115.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
--サイコ·デビル
function c7582066.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_PSYCHO),1)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7582066,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c7582066.atkcon)
e1:SetOperation(c7582066.atkop)
c:RegisterEffect(e1)
end
function c7582066.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0
end
function c7582066.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() or Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0 then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1,nil)
local tc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local op=Duel.SelectOption(tp,70,71,72)
Duel.ConfirmCards(tp,tc)
Duel.ShuffleHand(1-tp)
if (op==0 and tc:IsType(TYPE_MONSTER)) or (op==1 and tc:IsType(TYPE_SPELL)) or (op==2 and tc:IsType(TYPE_TRAP)) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment