Commit 83cc3356 authored by VanillaSalt's avatar VanillaSalt

fix

parent f1542bbf
...@@ -11,6 +11,7 @@ ClientField::ClientField() { ...@@ -11,6 +11,7 @@ ClientField::ClientField() {
panel = 0; panel = 0;
hovered_card = 0; hovered_card = 0;
clicked_card = 0; clicked_card = 0;
highlighting_card = 0;
deck_act = false; deck_act = false;
grave_act = false; grave_act = false;
remove_act = false; remove_act = false;
...@@ -725,7 +726,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -725,7 +726,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r->X = 0.0f; r->X = 0.0f;
r->Z = 0.0f; r->Z = 0.0f;
if (pcard->position & POS_FACEDOWN) if (pcard->position & POS_FACEDOWN)
r->X = 3.1415926f; r->Y = 3.1415926f;
else r->Y = 0.0f; else r->Y = 0.0f;
} }
} else { } else {
...@@ -737,7 +738,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir ...@@ -737,7 +738,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r->Z = 3.1415926f / 2.0f; r->Z = 3.1415926f / 2.0f;
if (pcard->position & POS_FACEDOWN) if (pcard->position & POS_FACEDOWN)
r->Y = 3.1415926f + 0.001f; r->Y = 3.1415926f + 0.001f;
else r->Y = 0; else r->Y = 0.0f;
} else { } else {
r->X = 0.0f; r->X = 0.0f;
r->Z = 3.1415926f; r->Z = 3.1415926f;
......
...@@ -105,6 +105,7 @@ public: ...@@ -105,6 +105,7 @@ public:
ClientCard* hovered_card; ClientCard* hovered_card;
ClientCard* clicked_card; ClientCard* clicked_card;
ClientCard* command_card; ClientCard* command_card;
ClientCard* highlighting_card;
int list_command; int list_command;
wchar_t formatBuffer[2048]; wchar_t formatBuffer[2048];
......
...@@ -1060,6 +1060,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1060,6 +1060,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (pcard->code != code) if (pcard->code != code)
pcard->SetCode(code); pcard->SetCode(code);
BufferIO::ReadInt8(pbuf); BufferIO::ReadInt8(pbuf);
pcard->is_highlighting = true;
mainGame->dField.highlighting_card = pcard;
myswprintf(textBuffer, dataManager.GetSysString(200), dataManager.FormatLocation(l), dataManager.GetName(code)); myswprintf(textBuffer, dataManager.GetSysString(200), dataManager.FormatLocation(l), dataManager.GetName(code));
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, textBuffer);
...@@ -1070,6 +1072,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1070,6 +1072,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_SELECT_YESNO: { case MSG_SELECT_YESNO: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf); /*int selecting_player = */BufferIO::ReadInt8(pbuf);
int desc = BufferIO::ReadInt32(pbuf); int desc = BufferIO::ReadInt32(pbuf);
mainGame->dField.highlighting_card = 0;
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, (wchar_t*)dataManager.GetDesc(desc)); mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, (wchar_t*)dataManager.GetDesc(desc));
mainGame->PopupElement(mainGame->wQuery); mainGame->PopupElement(mainGame->wQuery);
......
...@@ -123,6 +123,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -123,6 +123,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
switch(mainGame->dInfo.curMsg) { switch(mainGame->dInfo.curMsg) {
case MSG_SELECT_YESNO: case MSG_SELECT_YESNO:
case MSG_SELECT_EFFECTYN: { case MSG_SELECT_EFFECTYN: {
if(highlighting_card)
highlighting_card->is_highlighting = false;
highlighting_card = 0;
DuelClient::SetResponseI(1); DuelClient::SetResponseI(1);
mainGame->HideElement(mainGame->wQuery, true); mainGame->HideElement(mainGame->wQuery, true);
break; break;
...@@ -145,6 +148,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -145,6 +148,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
switch(mainGame->dInfo.curMsg) { switch(mainGame->dInfo.curMsg) {
case MSG_SELECT_YESNO: case MSG_SELECT_YESNO:
case MSG_SELECT_EFFECTYN: { case MSG_SELECT_EFFECTYN: {
if(highlighting_card)
highlighting_card->is_highlighting = false;
highlighting_card = 0;
DuelClient::SetResponseI(0); DuelClient::SetResponseI(0);
mainGame->HideElement(mainGame->wQuery, true); mainGame->HideElement(mainGame->wQuery, true);
break; break;
...@@ -1189,6 +1195,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1189,6 +1195,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
case MSG_SELECT_YESNO: case MSG_SELECT_YESNO:
case MSG_SELECT_EFFECTYN: { case MSG_SELECT_EFFECTYN: {
if(highlighting_card)
highlighting_card->is_highlighting = false;
highlighting_card = 0;
DuelClient::SetResponseI(0); DuelClient::SetResponseI(0);
mainGame->HideElement(mainGame->wQuery, true); mainGame->HideElement(mainGame->wQuery, true);
break; break;
......
...@@ -1782,7 +1782,7 @@ int32 field::is_player_can_remove(uint8 playerid, card * pcard) { ...@@ -1782,7 +1782,7 @@ int32 field::is_player_can_remove(uint8 playerid, card * pcard) {
} }
int32 field::is_chain_negatable(uint8 chaincount, uint8 naga_check) { int32 field::is_chain_negatable(uint8 chaincount, uint8 naga_check) {
effect_set eset; effect_set eset;
if(chaincount < 0 && chaincount > core.current_chain.size()) if(chaincount < 0 || chaincount > core.current_chain.size())
return FALSE; return FALSE;
effect* peffect; effect* peffect;
if(chaincount == 0) if(chaincount == 0)
...@@ -1803,7 +1803,7 @@ int32 field::is_chain_negatable(uint8 chaincount, uint8 naga_check) { ...@@ -1803,7 +1803,7 @@ int32 field::is_chain_negatable(uint8 chaincount, uint8 naga_check) {
} }
int32 field::is_chain_disablable(uint8 chaincount, uint8 naga_check) { int32 field::is_chain_disablable(uint8 chaincount, uint8 naga_check) {
effect_set eset; effect_set eset;
if(chaincount < 0 && chaincount > core.current_chain.size()) if(chaincount < 0 || chaincount > core.current_chain.size())
return FALSE; return FALSE;
effect* peffect; effect* peffect;
if(chaincount == 0) if(chaincount == 0)
...@@ -1823,7 +1823,7 @@ int32 field::is_chain_disablable(uint8 chaincount, uint8 naga_check) { ...@@ -1823,7 +1823,7 @@ int32 field::is_chain_disablable(uint8 chaincount, uint8 naga_check) {
return TRUE; return TRUE;
} }
int32 field::check_chain_target(uint8 chaincount, card * pcard) { int32 field::check_chain_target(uint8 chaincount, card * pcard) {
if(chaincount < 0 && chaincount > core.current_chain.size()) if(chaincount < 0 || chaincount > core.current_chain.size())
return FALSE; return FALSE;
chain* pchain; chain* pchain;
if(chaincount == 0) if(chaincount == 0)
......
...@@ -14,19 +14,15 @@ function c1127737.initial_effect(c) ...@@ -14,19 +14,15 @@ function c1127737.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c1127737.damcon1) e2:SetCondition(c1127737.damcon1)
e2:SetTarget(c1127737.damtg1) e2:SetTarget(c1127737.damtg1)
e2:SetOperation(c1127737.damop) e2:SetOperation(c1127737.damop1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1127737,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCondition(c1127737.damcon2) e2:SetCondition(c1127737.damcon2)
e2:SetTarget(c1127737.damtg2) e2:SetOperation(c1127737.damop2)
e2:SetOperation(c1127737.damop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c1127737.damcon1(e,tp,eg,ep,ev,re,r,rp) function c1127737.damcon1(e,tp,eg,ep,ev,re,r,rp)
...@@ -36,7 +32,15 @@ function c1127737.damtg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,7 +32,15 @@ function c1127737.damtg1(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(eg:GetFirst():GetSummonPlayer()) Duel.SetTargetPlayer(eg:GetFirst():GetSummonPlayer())
Duel.SetTargetParam(500) Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,eg:GetFirst():GetSummonPlayer(),500)
end
function c1127737.damop1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if not Duel.IsPlayerAffectedByEffect(p,37511832) then
Duel.Damage(p,d,REASON_EFFECT)
end
end
end end
function c1127737.cfilter(c) function c1127737.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsType(TYPE_XYZ)
...@@ -44,17 +48,9 @@ end ...@@ -44,17 +48,9 @@ end
function c1127737.damcon2(e,tp,eg,ep,ev,re,r,rp) function c1127737.damcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c1127737.cfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c1127737.cfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,0,1,nil)
end end
function c1127737.damtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c1127737.damop2(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return true end local p=Duel.GetTurnPlayer()
Duel.SetTargetPlayer(Duel.GetTurnPlayer()) if not Duel.IsPlayerAffectedByEffect(p,37511832) then
Duel.SetTargetParam(500) Duel.Damage(p,500,REASON_EFFECT)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,Duel.GetTurnPlayer(),500)
end
function c1127737.damop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if not Duel.IsPlayerAffectedByEffect(p,37511832) then
Duel.Damage(p,d,REASON_EFFECT)
end
end end
end end
...@@ -37,9 +37,8 @@ end ...@@ -37,9 +37,8 @@ end
function c1644289.eqlimit(e,c) function c1644289.eqlimit(e,c)
return c:IsSetCard(0x30) return c:IsSetCard(0x30)
end end
function c1644289.tglimit(e,re) function c1644289.tglimit(e,re,rp)
local rc=re:GetOwner() return rp~=e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP+TYPE_MONSTER)
return e:GetHandler():GetControler()~=rc:GetControler() and rc:IsType(TYPE_TRAP+TYPE_MONSTER)
end end
function c1644289.filter(c) function c1644289.filter(c)
return c:IsFaceup() and c:IsSetCard(0x30) return c:IsFaceup() and c:IsSetCard(0x30)
......
...@@ -21,7 +21,6 @@ function c21702241.initial_effect(c) ...@@ -21,7 +21,6 @@ function c21702241.initial_effect(c)
e3:SetDescription(aux.Stringid(21702241,0)) e3:SetDescription(aux.Stringid(21702241,0))
e3:SetCategory(CATEGORY_DAMAGE) e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CONTROL_CHANGED) e3:SetCode(EVENT_CONTROL_CHANGED)
e3:SetCondition(c21702241.damcon) e3:SetCondition(c21702241.damcon)
...@@ -31,8 +30,7 @@ function c21702241.initial_effect(c) ...@@ -31,8 +30,7 @@ function c21702241.initial_effect(c)
end end
function c21702241.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c21702241.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
...@@ -47,7 +45,7 @@ function c21702241.damcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +45,7 @@ function c21702241.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler():GetEquipTarget()) return eg:IsContains(e:GetHandler():GetEquipTarget())
end end
function c21702241.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c21702241.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end
local ec=e:GetHandler():GetEquipTarget() local ec=e:GetHandler():GetEquipTarget()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,ec:GetControler(),ec:GetBaseAttack()) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,ec:GetControler(),ec:GetBaseAttack())
end end
......
...@@ -3,7 +3,6 @@ function c22047978.initial_effect(c) ...@@ -3,7 +3,6 @@ function c22047978.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c22047978.condition) e1:SetCondition(c22047978.condition)
...@@ -14,10 +13,9 @@ end ...@@ -14,10 +13,9 @@ end
function c22047978.condition(e,tp,eg,ep,ev,re,r,rp) function c22047978.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c22047978.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22047978.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker() local tg=Duel.GetAttacker()
if chkc then return chkc==tg end if chk==0 then return tg:IsOnField() and tg:IsDestructable() end
if chk==0 then return tg:IsOnField() and tg:IsDestructable() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg) Duel.SetTargetCard(tg)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0 then if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
...@@ -35,7 +33,10 @@ function c22047978.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,7 +33,10 @@ function c22047978.activate(e,tp,eg,ep,ev,re,r,rp)
local cg=g:Select(1-tp,1,1,nil) local cg=g:Select(1-tp,1,1,nil)
Duel.ConfirmCards(tp,cg) Duel.ConfirmCards(tp,cg)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
return if Duel.IsChainDisablable(0) then
Duel.NegateEffect(0)
return
end
end end
if Duel.Destroy(tc,REASON_EFFECT)>0 then if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1) Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
......
...@@ -21,7 +21,7 @@ function c22754505.cfilter(c) ...@@ -21,7 +21,7 @@ function c22754505.cfilter(c)
return c:IsFaceup() and c:IsCode(25247218) return c:IsFaceup() and c:IsCode(25247218)
end end
function c22754505.spcon(e,tp,eg,ep,ev,re,r,rp) function c22754505.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c22754505.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c22754505.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c22754505.filter(c,e,tp) function c22754505.filter(c,e,tp)
return c:IsCode(58843503) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(58843503) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -28,7 +28,7 @@ function c2316186.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,7 +28,7 @@ function c2316186.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct*600) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*600)
end end
function c2316186.operation(e,tp,eg,ep,ev,re,r,rp) function c2316186.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
......
...@@ -33,7 +33,7 @@ function c23232295.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,7 +33,7 @@ function c23232295.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabelObject(g:GetFirst()) e:SetLabelObject(g:GetFirst())
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local cg=g:Select(g,1,1,nil) local cg=g:Select(tp,1,1,nil)
e:SetLabelObject(cg:GetFirst()) e:SetLabelObject(cg:GetFirst())
end end
return true return true
......
...@@ -52,7 +52,7 @@ function c23454876.damtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,7 +52,7 @@ function c23454876.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
local dam=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)*400 local dam=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)*400
Duel.SetTargetParam(dam) Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end end
function c23454876.damop(e,tp,eg,ep,ev,re,r,rp) function c23454876.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
......
...@@ -18,7 +18,7 @@ function c23915499.spfilter(c,e,tp) ...@@ -18,7 +18,7 @@ function c23915499.spfilter(c,e,tp)
return c:IsCode(87526784) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(87526784) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c23915499.condition(e,tp,eg,ep,ev,re,r,rp) function c23915499.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c23915499.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c23915499.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c23915499.target(e,tp,eg,ep,ev,re,r,rp,chk) function c23915499.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -27,7 +27,7 @@ function c23915499.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -27,7 +27,7 @@ function c23915499.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c23915499.operation(e,tp,eg,ep,ev,re,r,rp,chk) function c23915499.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end 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 if not Duel.IsExistingMatchingCard(c23915499.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then return end
local tc=Duel.GetFirstMatchingCard(c23915499.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local tc=Duel.GetFirstMatchingCard(c23915499.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
...@@ -16,7 +16,7 @@ function c25866285.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -16,7 +16,7 @@ function c25866285.condition(e,tp,eg,ep,ev,re,r,rp)
return ec:IsFaceup() and ec:IsControler(tp) and ec:IsSetCard(0x2a) return ec:IsFaceup() and ec:IsControler(tp) and ec:IsSetCard(0x2a)
end end
function c25866285.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c25866285.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGrave() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function c25866285.operation(e,tp,eg,ep,ev,re,r,rp) function c25866285.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -36,7 +36,7 @@ function c29669359.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -36,7 +36,7 @@ function c29669359.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c29669359.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c29669359.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,g:GetFirst():GetTextAttack()) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetTextAttack())
end end
function c29669359.operation(e,tp,eg,ep,ev,re,r,rp) function c29669359.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -36,7 +36,7 @@ function c30757396.damtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,7 +36,7 @@ function c30757396.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct*300) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*300)
end end
function c30757396.damop(e,tp,eg,ep,ev,re,r,rp) function c30757396.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
...@@ -50,7 +50,7 @@ function c30757396.damtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -50,7 +50,7 @@ function c30757396.damtg2(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)
Duel.SetTargetParam(300) Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,300) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
end end
function c30757396.damop2(e,tp,eg,ep,ev,re,r,rp) function c30757396.damop2(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
...@@ -6,10 +6,14 @@ function c30915572.initial_effect(c) ...@@ -6,10 +6,14 @@ function c30915572.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE+CATEGORY_DECKDES) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCost(c30915572.spcost)
e1:SetTarget(c30915572.sptarget) e1:SetTarget(c30915572.sptarget)
e1:SetOperation(c30915572.spoperation) e1:SetOperation(c30915572.spoperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c30915572.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c30915572.sptarget(e,tp,eg,ep,ev,re,r,rp,chk) function c30915572.sptarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
......
...@@ -16,5 +16,5 @@ end ...@@ -16,5 +16,5 @@ end
function c31557782.spcon(e,c) function c31557782.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c31557782.filter,c:GetControler(),LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c31557782.filter,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end end
...@@ -17,6 +17,6 @@ end ...@@ -17,6 +17,6 @@ end
function c33655493.tg(e,c) function c33655493.tg(e,c)
return c:IsFaceup() and c:GetCode()~=33655493 return c:IsFaceup() and c:GetCode()~=33655493
end end
function c33655493.tglimit(e,re) function c33655493.tglimit(e,re,rp)
return not re:GetHandler():IsType(TYPE_MONSTER) return rp~=e:GetHandlerPlayer() and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end end
...@@ -20,6 +20,6 @@ function c34193084.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -20,6 +20,6 @@ function c34193084.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c34193084.spop(e,tp,eg,ep,ev,re,r,rp) function c34193084.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),1,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -31,7 +31,7 @@ function c39139935.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -31,7 +31,7 @@ function c39139935.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=g:GetFirst() local tc=g:GetFirst()
local atk=tc:GetAttack() local atk=tc:GetAttack()
local batk=tc:GetBaseAttack() local batk=tc:GetBaseAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,(batk>atk) and (batk-atk) or (atk-batk)) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,(batk>atk) and (batk-atk) or (atk-batk))
end end
function c39139935.operation(e,tp,eg,ep,ev,re,r,rp) function c39139935.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
function c43487744.initial_effect(c) function c43487744.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c43487744.condition) e1:SetCondition(c43487744.condition)
e1:SetTarget(c43487744.target)
e1:SetOperation(c43487744.activate) e1:SetOperation(c43487744.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c43487744.condition(e,tp,eg,ep,ev,re,r,rp) function c43487744.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(53129443) and Duel.IsChainDisablable(ev) return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(53129443)
end
function c43487744.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c43487744.activate(e,tp,eg,ep,ev,re,r,rp) function c43487744.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev) local e1=Effect.CreateEffect(e:GetHandler())
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil) e1:SetType(EFFECT_TYPE_FIELD)
Duel.Destroy(g,REASON_EFFECT) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(c43487744.indval)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(ev)
Duel.RegisterEffect(e1,tp)
end
function c43487744.indval(e,re,rp)
return Duel.GetCurrentChain()==e:GetLabel()
end end
...@@ -29,6 +29,7 @@ function c47596607.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -29,6 +29,7 @@ function c47596607.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c47596607.spop(e,tp,eg,ep,ev,re,r,rp) function c47596607.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
...@@ -21,12 +21,12 @@ function c48505422.initial_effect(c) ...@@ -21,12 +21,12 @@ function c48505422.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c48505422.spfilter(c) function c48505422.spfilter(c)
return c:IsFaceup() and c:GetCode()==74094021 return c:IsFaceup() and c:IsCode(74094021)
end end
function c48505422.spcon(e,c) function c48505422.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c48505422.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) Duel.IsExistingMatchingCard(c48505422.spfilter,c:GetControler(),LOCATION_ONFIELD,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():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
...@@ -35,7 +35,7 @@ function c48505422.filter(c) ...@@ -35,7 +35,7 @@ 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()
end end
function c48505422.rltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c48505422.rltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and c48505422.filter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c48505422.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c48505422.filter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c48505422.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c48505422.filter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c48505422.filter,tp,LOCATION_GRAVE,0,1,1,nil)
......
...@@ -18,7 +18,7 @@ function c50319138.spfilter(c,e,tp) ...@@ -18,7 +18,7 @@ function c50319138.spfilter(c,e,tp)
return c:IsCode(23915499) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(23915499) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c50319138.condition(e,tp,eg,ep,ev,re,r,rp) function c50319138.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50319138.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c50319138.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c50319138.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50319138.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -27,7 +27,7 @@ function c50319138.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -27,7 +27,7 @@ function c50319138.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c50319138.operation(e,tp,eg,ep,ev,re,r,rp,chk) function c50319138.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end 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 if not Duel.IsExistingMatchingCard(c50319138.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then return end
local tc=Duel.GetFirstMatchingCard(c50319138.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local tc=Duel.GetFirstMatchingCard(c50319138.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
...@@ -13,30 +13,19 @@ function c52875873.initial_effect(c) ...@@ -13,30 +13,19 @@ function c52875873.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c52875873.global_check then if not c52875873.global_check then
c52875873.global_check=true c52875873.global_check=true
c52875873[0]=true
c52875873[1]=true
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE) ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c52875873.checkop) ge1:SetOperation(c52875873.checkop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c52875873.clear)
Duel.RegisterEffect(ge2,0)
end end
end end
function c52875873.checkop(e,tp,eg,ep,ev,re,r,rp) function c52875873.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if tc:IsCode(70095154) then if tc:IsCode(70095154) then
c52875873[tc:GetControler()]=false Duel.RegisterFlagEffect(tc:GetControler(),52875873,RESET_PHASE+PHASE_END,0,1)
end end
end end
function c52875873.clear(e,tp,eg,ep,ev,re,r,rp)
c52875873[0]=true
c52875873[1]=true
end
function c52875873.cfilter(c) function c52875873.cfilter(c)
return c:IsFaceup() and c:IsCode(70095154) return c:IsFaceup() and c:IsCode(70095154)
end end
...@@ -44,7 +33,7 @@ function c52875873.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +33,7 @@ function c52875873.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c52875873.cfilter,tp,LOCATION_ONFIELD,0,1,nil) return Duel.IsExistingMatchingCard(c52875873.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c52875873.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c52875873.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c52875873[tp] end if chk==0 then return Duel.GetFlagEffect(tp,52875873)==0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
......
...@@ -18,7 +18,7 @@ function c5288597.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -18,7 +18,7 @@ function c5288597.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c5288597.cfilter(c,e,tp) function c5288597.cfilter(c,e,tp)
local lv=c:GetOriginalLevel() local lv=c:GetOriginalLevel()
return lv>0 and c:IsAbleToGraveAsCost() return lv>0 and c:IsFaceup() and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c5288597.spfilter,tp,LOCATION_DECK,0,1,nil,lv+1,c:GetOriginalRace(),c:GetOriginalAttribute(),e,tp) and Duel.IsExistingMatchingCard(c5288597.spfilter,tp,LOCATION_DECK,0,1,nil,lv+1,c:GetOriginalRace(),c:GetOriginalAttribute(),e,tp)
end end
function c5288597.spfilter(c,lv,rc,att,e,tp) function c5288597.spfilter(c,lv,rc,att,e,tp)
...@@ -35,16 +35,17 @@ function c5288597.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,16 +35,17 @@ function c5288597.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c5288597.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c5288597.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
c5288597[0]=tc:GetOriginalLevel()
c5288597[1]=tc:GetOriginalRace()
c5288597[2]=tc:GetOriginalAttribute()
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
e:SetLabelObject(tc)
tc:RegisterFlagEffect(5288597,RESET_EVENT+0x1fe0000+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c5288597.activate(e,tp,eg,ep,ev,re,r,rp) function c5288597.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=e:GetLabelObject()
if tc:GetFlagEffect(5288597)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c5288597.spfilter,tp,LOCATION_DECK,0,1,1,nil,c5288597[0]+1,c5288597[1],c5288597[2],e,tp) local g=Duel.SelectMatchingCard(tp,c5288597.spfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel()+1,tc:GetRace(),tc:GetAttribute(),e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -21,7 +21,7 @@ function c58843503.cfilter(c) ...@@ -21,7 +21,7 @@ function c58843503.cfilter(c)
return c:IsFaceup() and c:IsCode(25247218) return c:IsFaceup() and c:IsCode(25247218)
end end
function c58843503.spcon(e,tp,eg,ep,ev,re,r,rp) function c58843503.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c58843503.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c58843503.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c58843503.filter(c,e,tp) function c58843503.filter(c,e,tp)
return c:IsCode(22754505) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(22754505) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -3,7 +3,6 @@ function c60080151.initial_effect(c) ...@@ -3,7 +3,6 @@ function c60080151.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c60080151.condition) e1:SetCondition(c60080151.condition)
...@@ -14,13 +13,12 @@ end ...@@ -14,13 +13,12 @@ end
function c60080151.condition(e,tp,eg,ep,ev,re,r,rp) function c60080151.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c60080151.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c60080151.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker() local tg=Duel.GetAttacker()
if chkc then return chkc==tg end if chk==0 then return tg:IsOnField() and tg:IsAbleToRemove() end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) and tg:IsAbleToRemove() end
Duel.SetTargetCard(tg) Duel.SetTargetCard(tg)
local dam=tg:GetAttack() local dam=tg:GetAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0)
end end
function c60080151.activate(e,tp,eg,ep,ev,re,r,rp) function c60080151.activate(e,tp,eg,ep,ev,re,r,rp)
...@@ -29,13 +27,10 @@ function c60080151.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,13 +27,10 @@ function c60080151.activate(e,tp,eg,ep,ev,re,r,rp)
local dam=tc:GetAttack() local dam=tc:GetAttack()
if Duel.Damage(tp,dam,REASON_EFFECT)>0 and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then if Duel.Damage(tp,dam,REASON_EFFECT)>0 and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(60080151,0)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCondition(c60080151.spcon) e1:SetCondition(c60080151.spcon)
e1:SetTarget(c60080151.sptg)
e1:SetOperation(c60080151.spop) e1:SetOperation(c60080151.spop)
e1:SetLabelObject(tc) e1:SetLabelObject(tc)
e1:SetLabel(Duel.GetTurnCount()) e1:SetLabel(Duel.GetTurnCount())
...@@ -50,14 +45,6 @@ function c60080151.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,14 +45,6 @@ function c60080151.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()~=tp return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()~=tp
and tc:GetFlagEffect(60080151)~=0 and tc:GetReasonEffect():GetHandler()==e:GetHandler() and tc:GetFlagEffect(60080151)~=0 and tc:GetReasonEffect():GetHandler()==e:GetHandler()
end end
function c60080151.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(e:GetLabelObject())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetLabelObject(),1,0,0)
end
function c60080151.spop(e,tp,eg,ep,ev,re,r,rp) function c60080151.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() Duel.SpecialSummon(e:GetLabelObject(),0,tp,tp,false,false,POS_FACEUP)
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end end
...@@ -12,10 +12,10 @@ function c63391643.initial_effect(c) ...@@ -12,10 +12,10 @@ function c63391643.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c63391643.cfilter(c) function c63391643.cfilter(c)
return c:IsFaceup() and c:GetCode()==46986414 return c:IsFaceup() and c:IsCode(46986414)
end end
function c63391643.condition(e,tp,eg,ep,ev,re,r,rp) function c63391643.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c63391643.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c63391643.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c63391643.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c63391643.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end
......
...@@ -33,12 +33,12 @@ function c63883999.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,12 +33,12 @@ function c63883999.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c63883999.filter(c,e,tp) function c63883999.filter(c,e,tp)
local lv=c:GetLevel() local lv=c:GetLevel()
return lv>0 and c:IsSetCard(0x45) return lv>0 and c:IsFaceup() and c:IsSetCard(0x45)
and Duel.IsExistingMatchingCard(c63883999.rfilter,tp,LOCATION_MZONE,0,1,c) and Duel.IsExistingMatchingCard(c63883999.rfilter,tp,LOCATION_MZONE,0,1,c)
and Duel.IsExistingMatchingCard(c63883999.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,lv,e,tp) and Duel.IsExistingMatchingCard(c63883999.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,lv,e,tp)
end end
function c63883999.rfilter(c) function c63883999.rfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAbleToRemove() return c:IsFaceup() and c:IsRace(RACE_FIEND) and c:IsAbleToRemove()
end end
function c63883999.spfilter(c,lv,e,tp) function c63883999.spfilter(c,lv,e,tp)
return c:IsSetCard(0x45) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x45) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -16,9 +16,9 @@ end ...@@ -16,9 +16,9 @@ end
function c65396880.condition(e,tp,eg,ep,ev,re,r,rp) function c65396880.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
and Duel.IsExistingMatchingCard(c65396880.cfilter,tp,LOCATION_MZONE,0,1,nil,58538870) and Duel.IsExistingMatchingCard(c65396880.cfilter,tp,LOCATION_ONFIELD,0,1,nil,58538870)
and Duel.IsExistingMatchingCard(c65396880.cfilter,tp,LOCATION_MZONE,0,1,nil,12143771) and Duel.IsExistingMatchingCard(c65396880.cfilter,tp,LOCATION_ONFIELD,0,1,nil,12143771)
and Duel.IsExistingMatchingCard(c65396880.cfilter,tp,LOCATION_MZONE,0,1,nil,85936485) and Duel.IsExistingMatchingCard(c65396880.cfilter,tp,LOCATION_ONFIELD,0,1,nil,85936485)
end end
function c65396880.target(e,tp,eg,ep,ev,re,r,rp,chk) function c65396880.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) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil)
......
...@@ -63,7 +63,7 @@ function c66970002.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -63,7 +63,7 @@ function c66970002.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c66970002.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c66970002.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,g:GetFirst():GetAttack()) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack())
end end
function c66970002.desop(e,tp,eg,ep,ev,re,r,rp) function c66970002.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -14,7 +14,7 @@ function c68191243.cfilter(c) ...@@ -14,7 +14,7 @@ function c68191243.cfilter(c)
return c:IsFaceup() and c:IsCode(76922029) return c:IsFaceup() and c:IsCode(76922029)
end end
function c68191243.con(e,tp,eg,ep,ev,re,r,rp) function c68191243.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c68191243.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c68191243.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c68191243.filter(c,e,tp) function c68191243.filter(c,e,tp)
return c:IsSetCard(0x1a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x1a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -20,14 +20,20 @@ function c72575145.initial_effect(c) ...@@ -20,14 +20,20 @@ function c72575145.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT) e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetValue(1) e4:SetValue(c72575145.eqlimit)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c72575145.eqlimit(e,c)
return c:GetLevel()>0
end
function c72575145.filter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c72575145.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c72575145.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c72575145.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c72575145.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,c72575145.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end end
function c72575145.operation(e,tp,eg,ep,ev,re,r,rp) function c72575145.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -22,12 +22,12 @@ function c74094021.initial_effect(c) ...@@ -22,12 +22,12 @@ function c74094021.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c74094021.spfilter(c) function c74094021.spfilter(c)
return c:IsFaceup() and c:GetCode()==48505422 return c:IsFaceup() and c:IsCode(48505422)
end end
function c74094021.spcon(e,c) function c74094021.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c74094021.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) Duel.IsExistingMatchingCard(c74094021.spfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end end
function c74094021.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c74094021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x3d) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x3d) end
......
...@@ -51,7 +51,7 @@ function c75433814.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,7 +51,7 @@ function c75433814.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75433814.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c75433814.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c75433814.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c75433814.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,g:GetCount()*500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetCount()*500)
end end
function c75433814.desop(e,tp,eg,ep,ev,re,r,rp) function c75433814.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c75433814.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c75433814.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
......
...@@ -63,7 +63,7 @@ function c85121942.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -63,7 +63,7 @@ function c85121942.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c85121942.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c85121942.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,g:GetFirst():GetAttack()) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack())
end end
function c85121942.desop(e,tp,eg,ep,ev,re,r,rp) function c85121942.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -15,7 +15,7 @@ function c86821010.cfilter(c) ...@@ -15,7 +15,7 @@ function c86821010.cfilter(c)
return c:IsFaceup() and c:IsCode(2403771) return c:IsFaceup() and c:IsCode(2403771)
end end
function c86821010.condition(e,tp,eg,ep,ev,re,r,rp) function c86821010.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c86821010.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c86821010.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c86821010.filter(c) function c86821010.filter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToDeck() return c:IsType(TYPE_EQUIP) and c:IsAbleToDeck()
......
...@@ -16,14 +16,15 @@ function c86827882.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -16,14 +16,15 @@ function c86827882.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end end
function c86827882.filter(c) function c86827882.filter(c)
if c==Duel.GetAttacker() and Duel.GetAttackTarget()==nil then return false end
return c:IsFaceup() and (c:IsSetCard(0x42) or c:IsSetCard(0x4b)) return c:IsFaceup() and (c:IsSetCard(0x42) or c:IsSetCard(0x4b))
end end
function c86827882.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c86827882.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c86827882.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c86827882.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86827882.filter,tp,LOCATION_MZONE,0,1,nil) end local exc=nil
if Duel.GetCurrentPhase()==PHASE_DAMAGE and Duel.GetAttackTarget()==nil then exc=Duel.GetAttacker() end
if chk==0 then return Duel.IsExistingTarget(c86827882.filter,tp,LOCATION_MZONE,0,1,exc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c86827882.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c86827882.filter,tp,LOCATION_MZONE,0,1,1,exc)
end end
function c86827882.activate(e,tp,eg,ep,ev,re,r,rp) function c86827882.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -18,7 +18,7 @@ function c87526784.spfilter(c,e,tp) ...@@ -18,7 +18,7 @@ function c87526784.spfilter(c,e,tp)
return c:IsCode(50319138) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(50319138) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c87526784.condition(e,tp,eg,ep,ev,re,r,rp) function c87526784.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c87526784.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c87526784.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c87526784.target(e,tp,eg,ep,ev,re,r,rp,chk) function c87526784.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -27,7 +27,7 @@ function c87526784.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -27,7 +27,7 @@ function c87526784.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c87526784.operation(e,tp,eg,ep,ev,re,r,rp,chk) function c87526784.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end 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 if not Duel.IsExistingMatchingCard(c87526784.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then return end
local tc=Duel.GetFirstMatchingCard(c87526784.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local tc=Duel.GetFirstMatchingCard(c87526784.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
...@@ -25,14 +25,14 @@ function c87614611.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,14 +25,14 @@ function c87614611.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END,2) e2:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
e2:SetTargetRange(1,0) e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
......
...@@ -10,11 +10,11 @@ function c87621407.initial_effect(c) ...@@ -10,11 +10,11 @@ function c87621407.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c87621407.filter(c) function c87621407.filter(c)
return c:IsFaceup() and c:GetCode()==8715625 return c:IsFaceup() and c:IsCode(8715625)
end end
function c87621407.target(e,tp,eg,ep,ev,re,r,rp,chk) function c87621407.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(c87621407.filter,tp,LOCATION_MZONE,0,nil) local ct=Duel.GetMatchingGroupCount(c87621407.filter,tp,LOCATION_ONFIELD,0,nil)
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct+1) Duel.SetTargetParam(ct+1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct+1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct+1)
......
...@@ -14,7 +14,7 @@ function c90219263.cfilter(c) ...@@ -14,7 +14,7 @@ function c90219263.cfilter(c)
return c:IsFaceup() and c:IsCode(76812113) return c:IsFaceup() and c:IsCode(76812113)
end end
function c90219263.condition(e,tp,eg,ep,ev,re,r,rp) function c90219263.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c90219263.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(c90219263.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end end
function c90219263.filter(c,e,tp) function c90219263.filter(c,e,tp)
local code=c:GetCode() local code=c:GetCode()
......
...@@ -12,21 +12,47 @@ function c93211810.initial_effect(c) ...@@ -12,21 +12,47 @@ function c93211810.initial_effect(c)
e1:SetTarget(c93211810.target) e1:SetTarget(c93211810.target)
e1:SetOperation(c93211810.activate) e1:SetOperation(c93211810.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c93211810.global_check then
c93211810.global_check=true
c93211810[0]=0
c93211810[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c93211810.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c93211810.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c93211810.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(93211810)==0 then
c93211810[ep]=c93211810[ep]+1
tc:RegisterFlagEffect(93211810,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c93211810.clear(e,tp,eg,ep,ev,re,r,rp)
c93211810[0]=0
c93211810[1]=0
end end
function c93211810.condition(e,tp,eg,ep,ev,re,r,rp) function c93211810.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
end end
function c93211810.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c93211810.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.CheckAttackActivity(tp) end if chk==0 then return c93211810[tp]<2 end
end end
function c93211810.filter(c) function c93211810.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x101b) return c:IsFaceup() and c:IsSetCard(0x101b) and (c93211810[tp]==0 or c:GetFlagEffect(93211810)~=0)
end end
function c93211810.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c93211810.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c93211810.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c93211810.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c93211810.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c93211810.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c93211810.filter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectTarget(tp,c93211810.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
......
...@@ -17,7 +17,7 @@ function c93224848.filter(c) ...@@ -17,7 +17,7 @@ function c93224848.filter(c)
end end
function c93224848.condition(e,tp,eg,ep,ev,re,r,rp) function c93224848.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=2 return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=2
and Duel.IsExistingMatchingCard(c93224848.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c93224848.filter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c93224848.cfilter(c) function c93224848.cfilter(c)
return not c:IsAbleToGraveAsCost() return not c:IsAbleToGraveAsCost()
......
...@@ -27,10 +27,13 @@ function c96008713.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -27,10 +27,13 @@ function c96008713.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c96008713.activate(e,tp,eg,ep,ev,re,r,rp) function c96008713.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not Duel.GetControl(tc,tp,PHASE_BATTLE,1) then if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then if not Duel.GetControl(tc,tp,PHASE_BATTLE,1) then
Duel.Destroy(tc,REASON_EFFECT) if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
else
Duel.ChangeAttackTarget(tc)
end end
else Duel.ChangeAttackTarget(tc)
end end
end end
...@@ -25,14 +25,20 @@ function c98143165.initial_effect(c) ...@@ -25,14 +25,20 @@ function c98143165.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT) e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetValue(1) e4:SetValue(c98143165.eqlimit)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c98143165.eqlimit(e,c)
return c:GetLevel()>0
end
function c98143165.filter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c98143165.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98143165.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c98143165.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c98143165.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,c98143165.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end end
function c98143165.operation(e,tp,eg,ep,ev,re,r,rp) function c98143165.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -16,7 +16,7 @@ function c98299011.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -16,7 +16,7 @@ function c98299011.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rec=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)*300 local rec=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)*300
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec) Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,rec) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end end
function c98299011.activate(e,tp,eg,ep,ev,re,r,rp) function c98299011.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
......
...@@ -4,11 +4,11 @@ function c99177923.initial_effect(c) ...@@ -4,11 +4,11 @@ function c99177923.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99177923,0)) e1:SetDescription(aux.Stringid(99177923,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_MULTIACT_HAND)
e1:SetCode(EVENT_DRAW) e1:SetCode(EVENT_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(c99177923.spcon) e1:SetCondition(c99177923.spcon)
e1:SetCost(c99177923.spcost)
e1:SetTarget(c99177923.sptg) e1:SetTarget(c99177923.sptg)
e1:SetOperation(c99177923.spop) e1:SetOperation(c99177923.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -29,6 +29,9 @@ function c99177923.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,6 +29,9 @@ function c99177923.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
return ev==ct and eg:IsContains(c) return ev==ct and eg:IsContains(c)
end end
function c99177923.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c99177923.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c99177923.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
...@@ -18,7 +18,7 @@ function c99517131.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -18,7 +18,7 @@ function c99517131.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rec=Duel.GetMatchingGroupCount(c99517131.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)*400 local rec=Duel.GetMatchingGroupCount(c99517131.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)*400
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec) Duel.SetTargetParam(rec)
if rec>0 then Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,rec) end if rec>0 then Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec) end
end end
function c99517131.activate(e,tp,eg,ep,ev,re,r,rp) function c99517131.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
......
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