Commit 3245c21b authored by VanillaSalt's avatar VanillaSalt

fix

parent de2ff509
...@@ -276,6 +276,7 @@ struct processor { ...@@ -276,6 +276,7 @@ struct processor {
uint8 attack_state_count[2]; uint8 attack_state_count[2];
uint8 battle_phase_count[2]; uint8 battle_phase_count[2];
uint8 phase_action; uint8 phase_action;
uint8 battle_phase_action;
uint32 hint_timing[2]; uint32 hint_timing[2];
uint8 current_player; uint8 current_player;
std::unordered_map<uint32, std::pair<uint32, uint32> > summon_counter; std::unordered_map<uint32, std::pair<uint32, uint32> > summon_counter;
......
...@@ -208,7 +208,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -208,7 +208,7 @@ static const struct luaL_Reg cardlib[] = {
{ "CheckUniqueOnField", scriptlib::card_check_unique_onfield }, { "CheckUniqueOnField", scriptlib::card_check_unique_onfield },
{ "ResetNegateEffect", scriptlib::card_reset_negate_effect }, { "ResetNegateEffect", scriptlib::card_reset_negate_effect },
{ "AssumeProperty", scriptlib::card_assume_prop }, { "AssumeProperty", scriptlib::card_assume_prop },
{ "SetSPSummonOnce", scriptlib::card_set_spsummon_once}, { "SetSPSummonOnce", scriptlib::card_set_spsummon_once },
{ NULL, NULL } { NULL, NULL }
}; };
......
...@@ -3138,7 +3138,7 @@ int32 scriptlib::duel_get_custom_activity_count(lua_State *L) { ...@@ -3138,7 +3138,7 @@ int32 scriptlib::duel_get_custom_activity_count(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
int32 val = 0; int32 val = 0;
switch(activity_type) { switch(activity_type) {
case 1:{ case 1: {
auto iter = pduel->game_field->core.summon_counter.find(counter_id); auto iter = pduel->game_field->core.summon_counter.find(counter_id);
if(iter != pduel->game_field->core.summon_counter.end()) if(iter != pduel->game_field->core.summon_counter.end())
val = iter->second.second; val = iter->second.second;
......
...@@ -2822,7 +2822,9 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2822,7 +2822,9 @@ int32 field::process_battle_command(uint16 step) {
core.attack_target = 0; core.attack_target = 0;
if((peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP))) { if((peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP))) {
core.units.begin()->step = 39; core.units.begin()->step = 39;
core.units.begin()->arg1 = 2; if(core.battle_phase_action)
core.units.begin()->arg1 = 2;
else core.units.begin()->arg1 = 3;
if(is_player_affected_by_effect(infos.turn_player, EFFECT_BP_TWICE)) if(is_player_affected_by_effect(infos.turn_player, EFFECT_BP_TWICE))
core.units.begin()->arg2 = 1; core.units.begin()->arg2 = 1;
else core.units.begin()->arg2 = 0; else core.units.begin()->arg2 = 0;
...@@ -2835,6 +2837,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2835,6 +2837,7 @@ int32 field::process_battle_command(uint16 step) {
} }
return FALSE; return FALSE;
} }
core.battle_phase_action = TRUE;
pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
...@@ -4172,6 +4175,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -4172,6 +4175,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
} }
infos.phase = PHASE_BATTLE; infos.phase = PHASE_BATTLE;
core.phase_action = FALSE; core.phase_action = FALSE;
core.battle_phase_action = FALSE;
core.battle_phase_count[infos.turn_player]++; core.battle_phase_count[infos.turn_player]++;
pduel->write_buffer8(MSG_NEW_PHASE); pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer8(infos.phase); pduel->write_buffer8(infos.phase);
...@@ -4740,7 +4744,7 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) { ...@@ -4740,7 +4744,7 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
++opit; ++opit;
check_card_counter(*opit, 3, 1 - sumplayer); check_card_counter(*opit, 3, 1 - sumplayer);
} else { } else {
uint32 sumplayer = cait.triggering_player; uint32 sumplayer = cait->triggering_player;
if(optarget.op_player == 1) if(optarget.op_player == 1)
sumplayer = 1 - sumplayer; sumplayer = 1 - sumplayer;
for(auto opit = optarget.op_cards->container.begin(); opit != optarget.op_cards->container.end(); ++opit) { for(auto opit = optarget.op_cards->container.begin(); opit != optarget.op_cards->container.end(); ++opit) {
......
...@@ -60,9 +60,6 @@ function c13959634.leaveop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,9 +60,6 @@ function c13959634.leaveop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end end
Duel.RegisterEffect(e1,effp) Duel.RegisterEffect(e1,effp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
Duel.RegisterEffect(e2,effp)
end end
function c13959634.skipcon(e) function c13959634.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
...@@ -42,9 +42,6 @@ function c2356994.skipop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,9 +42,6 @@ function c2356994.skipop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
end end
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
Duel.RegisterEffect(e2,tp)
end end
function c2356994.bpcon(e) function c2356994.bpcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
...@@ -74,21 +74,14 @@ function c29223325.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,21 +74,14 @@ function c29223325.desop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_SKIP_BP) e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1) e1:SetTargetRange(0,1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
if Duel.GetTurnPlayer()~=tp and ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then if Duel.GetTurnPlayer()~=tp and ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then
e1:SetLabel(Duel.GetTurnCount()) e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c29223325.skipcon) e1:SetCondition(c29223325.skipcon)
e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,2) e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,2)
e2:SetLabel(Duel.GetTurnCount())
e2:SetCondition(c29223325.skipcon)
e2:SetReset(RESET_PHASE+PHASE_MAIN2+RESET_OPPO_TURN,2)
else else
e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,1) e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,1)
e2:SetReset(RESET_PHASE+PHASE_MAIN2+RESET_OPPO_TURN,1)
end end
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
Duel.RegisterEffect(e2,tp)
end end
function c29223325.skipcon(e) function c29223325.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
...@@ -74,9 +74,6 @@ function c35842855.leaveop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,9 +74,6 @@ function c35842855.leaveop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end end
Duel.RegisterEffect(e1,effp) Duel.RegisterEffect(e1,effp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
Duel.RegisterEffect(e2,effp)
end end
function c35842855.skipcon(e) function c35842855.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
...@@ -64,9 +64,6 @@ function c53027855.leaveop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,9 +64,6 @@ function c53027855.leaveop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end end
Duel.RegisterEffect(e1,effp) Duel.RegisterEffect(e1,effp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
Duel.RegisterEffect(e2,effp)
end end
function c53027855.skipcon(e) function c53027855.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
...@@ -13,27 +13,19 @@ function c57069605.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -13,27 +13,19 @@ function c57069605.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)+2000<=Duel.GetLP(1-tp) return Duel.GetLP(tp)+2000<=Duel.GetLP(1-tp)
end end
function c57069605.activate(e,tp,eg,ep,ev,re,r,rp) function c57069605.activate(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
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_SKIP_BP) e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1) e1:SetTargetRange(0,1)
local e2=e1:Clone() if Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_BATTLE then
e2:SetCode(EFFECT_SKIP_M2)
if Duel.GetTurnPlayer()~=tp and ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then
e1:SetLabel(Duel.GetTurnCount()) e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c57069605.skipcon) e1:SetCondition(c57069605.skipcon)
e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,2) e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,2)
e2:SetLabel(Duel.GetTurnCount())
e2:SetCondition(c57069605.skipcon)
e2:SetReset(RESET_PHASE+PHASE_MAIN2+RESET_OPPO_TURN,2)
else else
e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,1) e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,1)
e2:SetReset(RESET_PHASE+PHASE_MAIN2+RESET_OPPO_TURN,1)
end end
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
Duel.RegisterEffect(e2,tp)
end end
function c57069605.skipcon(e) function c57069605.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
...@@ -69,9 +69,6 @@ function c61468779.leaveop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,9 +69,6 @@ function c61468779.leaveop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end end
Duel.RegisterEffect(e1,effp) Duel.RegisterEffect(e1,effp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
Duel.RegisterEffect(e2,effp)
end end
function c61468779.skipcon(e) function c61468779.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
......
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