Commit 30674f14 authored by DailyShana's avatar DailyShana

add attack_announce_count for scripts

parent 5a280b99
......@@ -1965,6 +1965,7 @@ void card::reset(uint32 id, uint32 reset_type) {
indestructable_effects.clear();
announced_cards.clear();
attacked_cards.clear();
attack_announce_count = 0;
announce_count = 0;
attacked_count = 0;
attack_all_target = TRUE;
......
......@@ -142,6 +142,7 @@ public:
uint32 position_param;
uint32 spsummon_param;
uint32 to_field_param;
uint8 attack_announce_count;
uint8 direct_attackable;
uint8 announce_count;
uint8 attacked_count;
......
......@@ -1318,7 +1318,7 @@ int32 scriptlib::card_get_attack_announced_count(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->announce_count);
lua_pushinteger(L, pcard->attack_announce_count);
return 1;
}
int32 scriptlib::card_is_direct_attacked(lua_State *L) {
......
......@@ -1422,6 +1422,7 @@ int32 scriptlib::duel_change_attacker(lua_State *L) {
attacker->attack_controler = attacker->current.controler;
pduel->game_field->core.pre_field[0] = attacker->fieldid_r;
if(!ignore_count) {
attacker->attack_announce_count++;
if(pduel->game_field->infos.phase == PHASE_DAMAGE) {
attacker->attacked_count++;
attacker->attacked_cards.addcard(attack_target);
......
......@@ -3057,6 +3057,7 @@ int32 field::process_battle_command(uint16 step) {
}
core.attack_state_count[infos.turn_player]++;
check_card_counter(core.attacker, 5, infos.turn_player);
core.attacker->attack_announce_count++;
}
if(core.units.begin()->arg3) {
core.attacker->announce_count++;
......@@ -3913,6 +3914,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
pcard->set_status(STATUS_SET_TURN, FALSE);
pcard->set_status(STATUS_FORM_CHANGED, FALSE);
pcard->indestructable_effects.clear();
pcard->attack_announce_count = 0;
pcard->announce_count = 0;
pcard->attacked_count = 0;
pcard->announced_cards.clear();
......@@ -4123,6 +4125,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
card* pcard = *cit;
if(!pcard)
continue;
pcard->attack_announce_count = 0;
pcard->announce_count = 0;
pcard->attacked_count = 0;
pcard->announced_cards.clear();
......
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