Commit 606754e4 authored by VanillaSalt's avatar VanillaSalt

fix

parent b620d17b
...@@ -914,6 +914,7 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -914,6 +914,7 @@ void card::reset(uint32 id, uint32 reset_type) {
attacked_cards.clear(); attacked_cards.clear();
announce_count = 0; announce_count = 0;
attacked_count = 0; attacked_count = 0;
attack_negated_count = 0;
attack_all_target = TRUE; attack_all_target = TRUE;
} }
if(id & 0x5fe0000) { if(id & 0x5fe0000) {
...@@ -1973,6 +1974,8 @@ int32 card::is_capable_attack() { ...@@ -1973,6 +1974,8 @@ int32 card::is_capable_attack() {
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_ATTACK_DISABLED)) if(is_affected_by_effect(EFFECT_ATTACK_DISABLED))
return FALSE; return FALSE;
if(pduel->game_field->is_player_affected_by_effect(pduel->game_field->infos.turn_player, EFFECT_SKIP_BP))
return FALSE;
return TRUE; return TRUE;
} }
int32 card::is_capable_attack_announce(uint8 playerid) { int32 card::is_capable_attack_announce(uint8 playerid) {
......
...@@ -92,6 +92,7 @@ public: ...@@ -92,6 +92,7 @@ public:
uint32 operation_param; uint32 operation_param;
uint8 announce_count; uint8 announce_count;
uint8 attacked_count; uint8 attacked_count;
uint8 attack_negated_count;
uint8 attack_all_target; uint8 attack_all_target;
uint16 cardid; uint16 cardid;
uint32 fieldid; uint32 fieldid;
......
...@@ -625,7 +625,7 @@ int32 scriptlib::card_get_attack_announced_count(lua_State *L) { ...@@ -625,7 +625,7 @@ int32 scriptlib::card_get_attack_announced_count(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->announce_count); lua_pushinteger(L, pcard->announce_count - pcard->attack_negated_count);
return 1; return 1;
} }
int32 scriptlib::card_is_direct_attacked(lua_State *L) { int32 scriptlib::card_is_direct_attacked(lua_State *L) {
......
...@@ -1946,6 +1946,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -1946,6 +1946,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
newchain.triggering_sequence = peffect->handler->current.sequence; newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_player = priority; newchain.triggering_player = priority;
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
core.delayed_quick_tmp.erase(peffect);
} }
} }
pr = effects.quick_o_effect.equal_range(evit->event_code); pr = effects.quick_o_effect.equal_range(evit->event_code);
...@@ -1961,6 +1962,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -1961,6 +1962,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
newchain.triggering_sequence = peffect->handler->current.sequence; newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_player = priority; newchain.triggering_player = priority;
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
core.delayed_quick_tmp.erase(peffect);
} }
} }
evit++; evit++;
...@@ -1972,7 +1974,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -1972,7 +1974,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
for(auto clit = core.new_ochain_h.begin(); clit != core.new_ochain_h.end(); ++clit) { for(auto clit = core.new_ochain_h.begin(); clit != core.new_ochain_h.end(); ++clit) {
peffect = clit->triggering_effect; peffect = clit->triggering_effect;
bool act = true; bool act = true;
if(clit->triggering_player == priority && !peffect->handler->is_status(STATUS_CHAINING) if(clit->triggering_player == priority && !peffect->handler->is_status(STATUS_CHAINING) && peffect->handler->is_has_relation(peffect)
&& peffect->is_chainable(priority) && peffect->is_activateable(priority, clit->evt, TRUE)) { && peffect->is_chainable(priority) && peffect->is_activateable(priority, clit->evt, TRUE)) {
for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) { for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) {
if(cait->triggering_player == priority) { if(cait->triggering_player == priority) {
...@@ -2830,6 +2832,10 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2830,6 +2832,10 @@ int32 field::process_battle_command(uint16 step) {
return FALSE; return FALSE;
} }
case 8: { case 8: {
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP)) {
core.units.begin()->step = 9;
return FALSE;
}
pduel->write_buffer8(MSG_HINT); pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT); pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(0); pduel->write_buffer8(0);
...@@ -2858,6 +2864,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2858,6 +2864,7 @@ int32 field::process_battle_command(uint16 step) {
atk_disabled = true; atk_disabled = true;
pduel->write_buffer8(MSG_ATTACK_DISABLED); pduel->write_buffer8(MSG_ATTACK_DISABLED);
core.attacker->set_status(STATUS_ATTACK_CANCELED, TRUE); core.attacker->set_status(STATUS_ATTACK_CANCELED, TRUE);
core.attacker->attack_negated_count++;
} }
effect* peffect; effect* peffect;
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))) {
...@@ -3763,6 +3770,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3763,6 +3770,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_DP)) { if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_DP)) {
core.units.begin()->step = 2; core.units.begin()->step = 2;
reset_phase(PHASE_DRAW); reset_phase(PHASE_DRAW);
...@@ -3805,6 +3813,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3805,6 +3813,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_SP)) { if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_SP)) {
reset_phase(PHASE_STANDBY); reset_phase(PHASE_STANDBY);
adjust_all(); adjust_all();
...@@ -3833,6 +3842,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3833,6 +3842,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
pduel->write_buffer8(MSG_NEW_PHASE); pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer8(infos.phase); pduel->write_buffer8(infos.phase);
add_process(PROCESSOR_IDLE_COMMAND, 0, 0, 0, 0, 0); add_process(PROCESSOR_IDLE_COMMAND, 0, 0, 0, 0, 0);
...@@ -3869,6 +3879,22 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3869,6 +3879,22 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
effect* peffect;
if(peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP)) {
if(is_player_affected_by_effect(infos.turn_player, EFFECT_BP_TWICE)) {
core.units.begin()->arg2 = 1;
core.units.begin()->step = 8;
} else
core.units.begin()->step = 14;
if(!peffect->value)
add_process(PROCESSOR_PHASE_EVENT, 0, 0, 0, PHASE_BATTLE, 0);
else {
reset_phase(PHASE_BATTLE);
adjust_all();
}
return FALSE;
}
add_process(PROCESSOR_BATTLE_COMMAND, 0, 0, 0, 0, 0); add_process(PROCESSOR_BATTLE_COMMAND, 0, 0, 0, 0, 0);
return FALSE; return FALSE;
} }
...@@ -3911,6 +3937,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3911,6 +3937,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
pduel->write_buffer8(MSG_NEW_PHASE); pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer8(infos.phase); pduel->write_buffer8(infos.phase);
add_process(PROCESSOR_IDLE_COMMAND, 0, 0, 0, 0, 0); add_process(PROCESSOR_IDLE_COMMAND, 0, 0, 0, 0, 0);
...@@ -3936,6 +3963,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3936,6 +3963,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
add_process(PROCESSOR_PHASE_EVENT, 0, 0, 0, PHASE_END, 0); add_process(PROCESSOR_PHASE_EVENT, 0, 0, 0, PHASE_END, 0);
return FALSE; return FALSE;
} }
...@@ -3949,6 +3977,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3949,6 +3977,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_fchain.clear(); core.new_fchain.clear();
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
core.units.begin()->step = -1; core.units.begin()->step = -1;
core.units.begin()->arg1 = 1 - core.units.begin()->arg1; core.units.begin()->arg1 = 1 - core.units.begin()->arg1;
return FALSE; return FALSE;
......
...@@ -24,7 +24,7 @@ function c22046459.initial_effect(c) ...@@ -24,7 +24,7 @@ function c22046459.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c22046459.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22046459.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() 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(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)
...@@ -36,11 +36,9 @@ function c22046459.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,11 +36,9 @@ function c22046459.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Equip(tp,e:GetHandler(),tc) Duel.Equip(tp,e:GetHandler(),tc)
end end
end end
function c22046459.condition(e)
function c22046459.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(0)~=Duel.GetLP(1) return Duel.GetLP(0)~=Duel.GetLP(1)
end end
function c22046459.value(e,c) function c22046459.value(e,c)
local p=e:GetHandler():GetControler() local p=e:GetHandler():GetControler()
if Duel.GetLP(p)<Duel.GetLP(1-p) then if Duel.GetLP(p)<Duel.GetLP(1-p) then
......
...@@ -32,18 +32,26 @@ function c23171610.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,18 +32,26 @@ function c23171610.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(tc:GetAttack()*2) e1:SetValue(tc:GetAttack()*2)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) tc:RegisterFlagEffect(23171610,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e2:SetCountLimit(1)
e2:SetOperation(c23171610.desop)
tc:RegisterEffect(e2)
tc=sg:GetNext() tc=sg:GetNext()
end end
sg:KeepAlive()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabelObject(sg)
e2:SetOperation(c23171610.desop)
Duel.RegisterEffect(e2,tp)
end
function c23171610.desfilter(c)
return c:GetFlagEffect(23171610)>0
end end
function c23171610.desop(e,tp,eg,ep,ev,re,r,rp) function c23171610.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) local g=e:GetLabelObject()
local dg=g:Filter(c23171610.desfilter,nil)
g:DeleteGroup()
Duel.Destroy(dg,REASON_EFFECT)
end end
...@@ -27,7 +27,7 @@ function c44663232.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,7 +27,7 @@ function c44663232.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1) e1:SetTargetRange(1,1)
e1:SetLabel(e:GetLabel()) e1:SetLabel(e:GetLabel()+1)
e1:SetReset(RESET_PHASE+PHASE_MAIN1+RESET_OPPO_TURN) e1:SetReset(RESET_PHASE+PHASE_MAIN1+RESET_OPPO_TURN)
e1:SetValue(c44663232.val) e1:SetValue(c44663232.val)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
......
...@@ -54,14 +54,11 @@ function c68540058.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,14 +54,11 @@ function c68540058.operation(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT) e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c68540058.eqlimit) e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000) e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
end end
function c68540058.eqlimit(e,c)
return c:GetControler()==e:GetOwnerPlayer()
end
function c68540058.atkup(e,tp,eg,ep,ev,re,r,rp) function c68540058.atkup(e,tp,eg,ep,ev,re,r,rp)
local eqc=e:GetHandler():GetEquipTarget() local eqc=e:GetHandler():GetEquipTarget()
local bc=eqc:GetBattleTarget() local bc=eqc:GetBattleTarget()
......
...@@ -25,6 +25,6 @@ function c92099232.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,6 +25,6 @@ function c92099232.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,92099232,0,0x11,0,0,2,RACE_FIEND,ATTRIBUTE_EARTH) then return end or not Duel.IsPlayerCanSpecialSummonMonster(tp,92099232,0,0x11,0,0,2,RACE_FIEND,ATTRIBUTE_EARTH) then return end
c:AddTrapMonsterAttribute(TYPE_NORMAL+TYPE_TUNER,ATTRIBUTE_EARTH,RACE_FIEND,2,0,0) c:AddTrapMonsterAttribute(TYPE_NORMAL+TYPE_TUNER,ATTRIBUTE_EARTH,RACE_FIEND,2,0,0)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_DEFENCE) Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock() c:TrapMonsterBlock()
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment