Commit 9475777c authored by VanillaSalt's avatar VanillaSalt

fix

parent c4f0dbe9
...@@ -2677,7 +2677,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2677,7 +2677,7 @@ int32 field::process_battle_command(uint16 step) {
if(core.select_cards.size() == 1) if(core.select_cards.size() == 1)
returns.bvalue[1] = 0; returns.bvalue[1] = 0;
else else
add_process(MSG_SELECT_CARD, 0, 0, 0, 1 - infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001); add_process(PROCESSOR_SELECT_CARD, 0, 0, 0, 1 - infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001);
core.units.begin()->step = 5; core.units.begin()->step = 5;
return FALSE; return FALSE;
} }
...@@ -2689,7 +2689,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2689,7 +2689,7 @@ int32 field::process_battle_command(uint16 step) {
} }
for(int32 i = 0; i < 5; ++i) { for(int32 i = 0; i < 5; ++i) {
if(player[1 - infos.turn_player].list_mzone[i]) { if(player[1 - infos.turn_player].list_mzone[i]) {
add_process(MSG_SELECT_YESNO, 0, 0, 0, infos.turn_player, 31); add_process(PROCESSOR_SELECT_YESNO, 0, 0, 0, infos.turn_player, 31);
return FALSE; return FALSE;
} }
} }
...@@ -2701,11 +2701,19 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2701,11 +2701,19 @@ int32 field::process_battle_command(uint16 step) {
if(core.select_cards.size() == 1) if(core.select_cards.size() == 1)
returns.bvalue[1] = 0; returns.bvalue[1] = 0;
else else
add_process(MSG_SELECT_CARD, 0, 0, 0, 1 - infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001); add_process(PROCESSOR_SELECT_CARD, 0, 0, 0, 1 - infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001);
core.units.begin()->step = 5; core.units.begin()->step = 5;
return FALSE; return FALSE;
} }
add_process(MSG_SELECT_CARD, 0, 0, 0, infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001); if(core.select_cards.size() == 0) {
if(!core.attack_cancelable) {
core.attacker->announce_count++;
core.attacker->announced_cards[0] = 0;
}
core.units.begin()->step = -1;
return FALSE;
}
add_process(PROCESSOR_SELECT_CARD, 0, 0, 0, infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001);
core.units.begin()->step = 5; core.units.begin()->step = 5;
return FALSE; return FALSE;
} }
...@@ -2715,7 +2723,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2715,7 +2723,7 @@ int32 field::process_battle_command(uint16 step) {
return FALSE; return FALSE;
} else { } else {
if(core.select_cards.size()) if(core.select_cards.size())
add_process(MSG_SELECT_CARD, 0, 0, 0, infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001); add_process(PROCESSOR_SELECT_CARD, 0, 0, 0, infos.turn_player + (core.attack_cancelable ? 0x20000 : 0), 0x10001);
else else
core.units.begin()->step = -1; core.units.begin()->step = -1;
} }
......
...@@ -11,7 +11,7 @@ function c13166204.initial_effect(c) ...@@ -11,7 +11,7 @@ function c13166204.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c13166204.filter(c,tp) function c13166204.filter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x54) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x54)
end end
function c13166204.condition(e,tp,eg,ep,ev,re,r,rp) function c13166204.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c13166204.filter,1,nil,tp) return rp~=tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c13166204.filter,1,nil,tp)
......
...@@ -4,7 +4,8 @@ function c31557782.initial_effect(c) ...@@ -4,7 +4,8 @@ function c31557782.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,0)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31557782.spcon) e1:SetCondition(c31557782.spcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
......
...@@ -24,7 +24,7 @@ function c38525760.initial_effect(c) ...@@ -24,7 +24,7 @@ function c38525760.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCost(c38525760.thcon) e3:SetCondition(c38525760.thcon)
e3:SetTarget(c38525760.thtg) e3:SetTarget(c38525760.thtg)
e3:SetOperation(c38525760.thop) e3:SetOperation(c38525760.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
......
...@@ -65,10 +65,11 @@ function c41181774.sdcon(e) ...@@ -65,10 +65,11 @@ function c41181774.sdcon(e)
or Duel.IsExistingMatchingCard(c41181774.exfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetFieldID()) or Duel.IsExistingMatchingCard(c41181774.exfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetFieldID())
end end
function c41181774.hdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c41181774.hdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsAbleToDeck() end if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsAbleToDeck() end
if chk==0 then return true end if chk==0 then return true end
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct==0 then return end if ct==0 then return end
if ct>3 then ct=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,0,1,ct,e:GetHandler()) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,0,1,ct,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
...@@ -76,8 +77,9 @@ end ...@@ -76,8 +77,9 @@ end
function c41181774.hdop(e,tp,eg,ep,ev,re,r,rp) function c41181774.hdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not g then return end if not g then return end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) local sg=g:Filter(Card.IsRelateToEffect,nil,e)
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local ct=sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==0 then return end if ct==0 then return end
local dg=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,ct) local dg=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,ct)
local dt=Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD) local dt=Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
...@@ -89,7 +91,7 @@ function c41181774.hdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -89,7 +91,7 @@ function c41181774.hdop(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(dt*1000) e1:SetValue(dt*1000)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
...@@ -33,7 +33,7 @@ function c51402908.spr(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,7 +33,7 @@ function c51402908.spr(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_DAMAGE then pos=c:GetBattlePosition() end if Duel.GetCurrentPhase()==PHASE_DAMAGE then pos=c:GetBattlePosition() end
if c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) if c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
and bit.band(pos,POS_FACEUP)~=0 then and bit.band(pos,POS_FACEUP)~=0 then
c:RegisterFlagEffect(51402908,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,0,1) c:RegisterFlagEffect(51402908,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,2)
end end
end end
function c51402908.spcon(e,tp,eg,ep,ev,re,r,rp) function c51402908.spcon(e,tp,eg,ep,ev,re,r,rp)
......
--Red Dragon Ninja --Red Dragon Ninja
function c58165765.initial_effect(c) function c58165765.initial_effect(c)
--destroy --todeck
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58165765,0)) e1:SetDescription(aux.Stringid(58165765,0))
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
...@@ -28,13 +28,14 @@ function c58165765.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,13 +28,14 @@ function c58165765.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c58165765.filter(c) function c58165765.filter(c)
return c:IsFacedown() and c:IsDestructable() return c:IsFacedown() and c:IsAbleToDeck()
end end
function c58165765.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c58165765.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c58165765.filter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c58165765.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c58165765.filter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(c58165765.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c58165765.filter,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c58165765.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetChainLimit(c58165765.limit(g:GetFirst())) Duel.SetChainLimit(c58165765.limit(g:GetFirst()))
end end
function c58165765.limit(c) function c58165765.limit(c)
......
...@@ -16,7 +16,7 @@ function c58471134.initial_effect(c) ...@@ -16,7 +16,7 @@ function c58471134.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c58471134.cfilter(c) function c58471134.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end end
function c58471134.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c58471134.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,58471134)==0 if chk==0 then return Duel.GetFlagEffect(tp,58471134)==0
......
...@@ -60,10 +60,10 @@ function c62953041.spreg(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,10 +60,10 @@ function c62953041.spreg(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,0x41)~=0x41 or not c:IsPreviousPosition(POS_FACEUP) then return end if bit.band(r,0x41)~=0x41 or not c:IsPreviousPosition(POS_FACEUP) then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount()) e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2) c:RegisterFlagEffect(62953041,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else else
e:SetLabel(0) e:SetLabel(0)
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1) c:RegisterFlagEffect(62953041,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end end
end end
function c62953041.spcon(e,tp,eg,ep,ev,re,r,rp) function c62953041.spcon(e,tp,eg,ep,ev,re,r,rp)
......
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