Commit e09dd463 authored by DailyShana's avatar DailyShana Committed by GitHub

update solve continuous (#180)

* update solve continuous
* tweak
parent 8a97fed9
...@@ -193,6 +193,10 @@ struct processor { ...@@ -193,6 +193,10 @@ struct processor {
chain_array select_chains; chain_array select_chains;
chain_array current_chain; chain_array current_chain;
chain_list continuous_chain; chain_list continuous_chain;
chain_list solving_continuous;
chain_list sub_solving_continuous;
chain_list delayed_continuous_tp;
chain_list delayed_continuous_ntp;
chain_list desrep_chain; chain_list desrep_chain;
chain_list new_fchain; chain_list new_fchain;
chain_list new_fchain_s; chain_list new_fchain_s;
...@@ -231,10 +235,6 @@ struct processor { ...@@ -231,10 +235,6 @@ struct processor {
effect_set_v extram_effects; effect_set_v extram_effects;
effect_set_v extras_effects; effect_set_v extras_effects;
std::set<effect*> reseted_effects; std::set<effect*> reseted_effects;
std::list<effect*> delayed_tp;
std::list<effect*> delayed_ntp;
event_list delayed_tev;
event_list delayed_ntev;
std::unordered_map<card*, uint32> readjust_map; std::unordered_map<card*, uint32> readjust_map;
std::unordered_set<card*> unique_cards[2]; std::unordered_set<card*> unique_cards[2];
std::unordered_map<uint32, uint32> effect_count_code; std::unordered_map<uint32, uint32> effect_count_code;
...@@ -488,7 +488,7 @@ public: ...@@ -488,7 +488,7 @@ public:
int32 process_quick_effect(int16 step, int32 skip_freechain, uint8 priority); int32 process_quick_effect(int16 step, int32 skip_freechain, uint8 priority);
int32 process_instant_event(); int32 process_instant_event();
int32 process_single_event(); int32 process_single_event();
int32 process_single_event(effect* peffect, const tevent& e, effect_vector& tp, effect_vector& ntp, event_list& tev, event_list& ntev); int32 process_single_event(effect* peffect, const tevent& e, chain_list& tp, chain_list& ntp);
int32 process_idle_command(uint16 step); int32 process_idle_command(uint16 step);
int32 process_battle_command(uint16 step); int32 process_battle_command(uint16 step);
int32 process_damage_step(uint16 step, uint32 new_attack); int32 process_damage_step(uint16 step, uint32 new_attack);
...@@ -496,7 +496,8 @@ public: ...@@ -496,7 +496,8 @@ public:
int32 process_turn(uint16 step, uint8 turn_player); int32 process_turn(uint16 step, uint8 turn_player);
int32 add_chain(uint16 step); int32 add_chain(uint16 step);
int32 solve_continuous(uint16 step, effect* peffect, uint8 triggering_player); void solve_continuous(uint8 playerid, effect* peffect, const tevent& e);
int32 solve_continuous(uint16 step);
int32 solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2); int32 solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2);
int32 break_effect(); int32 break_effect();
void adjust_instant(); void adjust_instant();
......
...@@ -657,8 +657,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) { ...@@ -657,8 +657,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) {
e.reason = 0; e.reason = 0;
e.reason_effect = core.reason_effect; e.reason_effect = core.reason_effect;
e.reason_player = playerid; e.reason_player = playerid;
core.sub_solving_event.push_back(e); solve_continuous(playerid, peffect, e);
add_process(PROCESSOR_SOLVE_CONTINUOUS, 0, peffect, 0, playerid, 0);
return TRUE; return TRUE;
} }
} }
...@@ -714,8 +713,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay ...@@ -714,8 +713,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay
e.reason = reason; e.reason = reason;
e.reason_effect = core.reason_effect; e.reason_effect = core.reason_effect;
e.reason_player = rplayer; e.reason_player = rplayer;
core.sub_solving_event.push_back(e); solve_continuous(rplayer, peffect, e);
add_process(PROCESSOR_SOLVE_CONTINUOUS, 0, peffect, 0, rplayer, 0);
core.units.begin()->step = 3; core.units.begin()->step = 3;
return FALSE; return FALSE;
} }
...@@ -791,8 +789,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8 ...@@ -791,8 +789,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
e.reason = reason; e.reason = reason;
e.reason_effect = core.reason_effect; e.reason_effect = core.reason_effect;
e.reason_player = rplayer; e.reason_player = rplayer;
core.sub_solving_event.push_back(e); solve_continuous(rplayer, peffect, e);
add_process(PROCESSOR_SOLVE_CONTINUOUS, 0, peffect, 0, rplayer, 0);
core.units.begin()->step = 3; core.units.begin()->step = 3;
return FALSE; return FALSE;
} }
...@@ -5952,8 +5949,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player, ...@@ -5952,8 +5949,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
process_instant_event(); process_instant_event();
return FALSE; return FALSE;
} else { } else {
core.sub_solving_event.push_back(e); solve_continuous(peffect->get_handler_player(), peffect, e);
add_process(PROCESSOR_SOLVE_CONTINUOUS, 0, peffect, 0, peffect->get_handler_player(), 0);
return TRUE; return TRUE;
} }
} }
...@@ -6006,8 +6002,7 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player, ...@@ -6006,8 +6002,7 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player,
process_instant_event(); process_instant_event();
return FALSE; return FALSE;
} else { } else {
core.sub_solving_event.push_back(e); solve_continuous(peffect->get_handler_player(), peffect, e);
add_process(PROCESSOR_SOLVE_CONTINUOUS, 0, peffect, 0, peffect->get_handler_player(), 0);
return TRUE; return TRUE;
} }
} }
......
This diff is collapsed.
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