Commit 3bdea07d authored by Argon's avatar Argon

custom counter

parent e8ce8c55
......@@ -269,10 +269,11 @@ struct processor {
uint8 attack_state_count[2];
uint8 phase_action;
uint32 hint_timing[2];
std::unordered_map<uint32, effect*> summon_counter;
std::unordered_map<uint32, effect*> spsummon_counter;
std::unordered_map<uint32, effect*> flipsummon_counter;
std::unordered_map<uint32, effect*> attack_counter;
std::unordered_map<uint32, std::pair<uint32, uint32> > summon_counter;
std::unordered_map<uint32, std::pair<uint32, uint32> > normalsummon_counter;
std::unordered_map<uint32, std::pair<uint32, uint32> > spsummon_counter;
std::unordered_map<uint32, std::pair<uint32, uint32> > flipsummon_counter;
std::unordered_map<uint32, std::pair<uint32, uint32> > attack_counter;
};
class field {
public:
......
......@@ -479,6 +479,8 @@ static const struct luaL_Reg duellib[] = {
{ "CheckChainUniqueness", scriptlib::duel_check_chain_uniqueness },
{ "GetActivityCount", scriptlib::duel_get_activity_count },
{ "CheckPhaseActivity", scriptlib::duel_check_phase_activity },
{ "AddCustomActivityCounter", scriptlib::duel_add_custom_activity_counter },
{ "GetCustomActivityCount", scriptlib::duel_get_custom_activity_count },
{ "VenomSwampCheck", scriptlib::duel_venom_swamp_check },
{ "SwapDeckAndGrave", scriptlib::duel_swap_deck_and_grave },
{ "MajesticCopy", scriptlib::duel_majestic_copy },
......
......@@ -3066,6 +3066,51 @@ int32 scriptlib::duel_check_phase_activity(lua_State *L) {
lua_pushboolean(L, pduel->game_field->core.phase_action);
return 1;
}
int32 scriptlib::duel_add_custom_activity_counter(lua_State *L) {
check_param_count(L, 3);
check_param(L, PARAM_TYPE_FUNCTION, 3);
int32 counter_id = lua_tointeger(L, 1);
int32 activity_type = lua_tointeger(L, 2);
int32 counter_filter = interpreter::get_function_handle(L, 3);
duel* pduel = interpreter::get_duel_info(L);
switch(activity_type) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
break;
}
return 0;
}
int32 scriptlib::duel_get_custom_activity_count(lua_State *L) {
check_param_count(L, 3);
int32 counter_id = lua_tointeger(L, 1);
int32 playerid = lua_tointeger(L, 2);
int32 activity_type = lua_tointeger(L, 3);
duel* pduel = interpreter::get_duel_info(L);
switch(activity_type) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
break;
}
return 0;
}
int32 scriptlib::duel_venom_swamp_check(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 2);
......
......@@ -2269,7 +2269,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
}
if(!result || (target->current.location == LOCATION_MZONE)
|| check_unique_onfield(target, playerid)
|| !is_player_can_spsummon(core.reason_effect, target->summon_info & 0xff000000, positions, target->summon_player, playerid, target)
|| !is_player_can_spsummon(core.reason_effect, target->summon_info & 0xff00ffff, positions, target->summon_player, playerid, target)
|| target->is_affected_by_effect(EFFECT_CANNOT_SPECIAL_SUMMON)
|| get_useable_count(playerid, LOCATION_MZONE, target->summon_player, LOCATION_REASON_TOFIELD) <= 0
|| (!nocheck && !(target->data.type & TYPE_MONSTER)))
......
......@@ -479,6 +479,8 @@ public:
static int32 duel_check_chain_uniqueness(lua_State *L);
static int32 duel_get_activity_count(lua_State *L);
static int32 duel_check_phase_activity(lua_State *L);
static int32 duel_add_custom_activity_counter(lua_State *L);
static int32 duel_get_custom_activity_count(lua_State *L);
//specific card functions
static int32 duel_venom_swamp_check(lua_State *L);
......
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