Commit 62eea42c authored by Fluorohydride's avatar Fluorohydride

Merge pull request #370 from VanillaSalt/patch45

fix
parents a8d9b6c3 9475777c
......@@ -2677,7 +2677,7 @@ int32 field::process_battle_command(uint16 step) {
if(core.select_cards.size() == 1)
returns.bvalue[1] = 0;
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;
return FALSE;
}
......@@ -2689,7 +2689,7 @@ int32 field::process_battle_command(uint16 step) {
}
for(int32 i = 0; i < 5; ++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;
}
}
......@@ -2701,11 +2701,19 @@ int32 field::process_battle_command(uint16 step) {
if(core.select_cards.size() == 1)
returns.bvalue[1] = 0;
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;
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;
return FALSE;
}
......@@ -2715,7 +2723,7 @@ int32 field::process_battle_command(uint16 step) {
return FALSE;
} else {
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
core.units.begin()->step = -1;
}
......
......@@ -11,7 +11,7 @@ function c13166204.initial_effect(c)
c:RegisterEffect(e1)
end
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
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)
......
......@@ -4,7 +4,8 @@ function c31557782.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
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:SetCondition(c31557782.spcon)
c:RegisterEffect(e1)
......
......@@ -24,7 +24,7 @@ function c38525760.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCost(c38525760.thcon)
e3:SetCondition(c38525760.thcon)
e3:SetTarget(c38525760.thtg)
e3:SetOperation(c38525760.thop)
c:RegisterEffect(e3)
......
......@@ -65,10 +65,11 @@ function c41181774.sdcon(e)
or Duel.IsExistingMatchingCard(c41181774.exfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetFieldID())
end
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
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct==0 then return end
if ct>3 then ct=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
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)
......@@ -76,8 +77,9 @@ end
function c41181774.hdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not g then return end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local ct=sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==0 then return end
local dg=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,ct)
local dt=Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
......@@ -89,7 +91,7 @@ function c41181774.hdop(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(dt*1000)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
......@@ -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 c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
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
function c51402908.spcon(e,tp,eg,ep,ev,re,r,rp)
......
--Red Dragon Ninja
function c58165765.initial_effect(c)
--destroy
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58165765,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
......@@ -28,13 +28,14 @@ function c58165765.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c58165765.filter(c)
return c:IsFacedown() and c:IsDestructable()
return c:IsFacedown() and c:IsAbleToDeck()
end
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 chk==0 then return Duel.IsExistingTarget(c58165765.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
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()))
end
function c58165765.limit(c)
......
......@@ -16,7 +16,7 @@ function c58471134.initial_effect(c)
c:RegisterEffect(e2)
end
function c58471134.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable()
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c58471134.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
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)
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
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
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
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