Commit 58385ed2 authored by VanillaSalt's avatar VanillaSalt

fix

parent ac298479
......@@ -1512,14 +1512,14 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset) {
}
if(peffect->is_available() && peffect->check_count_limit(playerid) && is_summonable(peffect)
&& pduel->game_field->is_player_can_spsummon(peffect, peffect->get_value(this), topos, playerid, toplayer, this))
peset->add_item(pr.first->second);
peset->add_item(peffect);
}
}
void card::filter_spsummon_procedure_g(uint8 playerid, effect_set* peset) {
auto pr = field_effect.equal_range(EFFECT_SPSUMMON_PROC_G);
for(; pr.first != pr.second; ++pr.first) {
effect* peffect = pr.first->second;
if(!peffect->is_available())
if(!peffect->is_available() || !peffect->check_count_limit(playerid))
continue;
effect* oreason = pduel->game_field->core.reason_effect;
uint8 op = pduel->game_field->core.reason_player;
......@@ -1529,7 +1529,7 @@ void card::filter_spsummon_procedure_g(uint8 playerid, effect_set* peset) {
pduel->lua->add_param(peffect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD);
if(pduel->lua->check_condition(peffect->condition, 2))
peset->add_item(pr.first->second);
peset->add_item(peffect);
pduel->game_field->restore_lp_cost();
pduel->game_field->core.reason_effect = oreason;
pduel->game_field->core.reason_player = op;
......
......@@ -61,7 +61,7 @@ int32 effect::is_available() {
if (type & EFFECT_TYPE_SINGLE) {
if (handler->current.controler == PLAYER_NONE)
return FALSE;
if((flag & EFFECT_FLAG_SINGLE_RANGE) && !(range & handler->current.location))
if((flag & EFFECT_FLAG_SINGLE_RANGE) && !in_range(handler->current.location, handler->current.sequence))
return FALSE;
if((flag & EFFECT_FLAG_SINGLE_RANGE) && (handler->current.location & LOCATION_ONFIELD)
&& (handler->is_position(POS_FACEDOWN) || !handler->is_status(STATUS_EFFECT_ENABLED)))
......@@ -97,7 +97,7 @@ int32 effect::is_available() {
return FALSE;
if(!(handler->get_status(STATUS_EFFECT_ENABLED)))
return FALSE;
if(!(range & handler->current.location))
if(!in_range(handler->current.location, handler->current.sequence))
return FALSE;
if((handler->current.location & LOCATION_ONFIELD) && !handler->is_position(POS_FACEUP))
return FALSE;
......@@ -201,7 +201,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if(((type & EFFECT_TYPE_FIELD) || ((type & EFFECT_TYPE_SINGLE) && (flag & EFFECT_FLAG_SINGLE_RANGE))) && (handler->current.location & LOCATION_ONFIELD)
&& (!handler->is_position(POS_FACEUP) || !handler->is_status(STATUS_EFFECT_ENABLED)))
return FALSE;
if((type & EFFECT_TYPE_SINGLE) && (flag & EFFECT_FLAG_SINGLE_RANGE) && !(handler->current.location & range))
if((type & EFFECT_TYPE_SINGLE) && (flag & EFFECT_FLAG_SINGLE_RANGE) && !in_range(handler->current.location, handler->current.sequence))
return FALSE;
if((flag & EFFECT_FLAG_OWNER_RELATE) && !(flag & EFFECT_FLAG_CANNOT_DISABLE) && owner->is_status(STATUS_DISABLED))
return FALSE;
......
......@@ -2128,6 +2128,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pduel->lua->add_param(core.units.begin()->ptarget, PARAM_TYPE_GROUP);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, peffect, 0, sumplayer, 0);
}
peffect->dec_count(sumplayer);
return FALSE;
}
case 21: {
......
......@@ -2547,6 +2547,8 @@ int32 field::process_idle_command(uint16 step) {
filter_field_effect(EFFECT_SPSUMMON_PROC, &eset);
for(int32 i = 0; i < eset.count; ++i) {
pcard = eset[i]->handler;
if(!eset[i]->check_count_limit(pcard->current.controler))
continue;
if(pcard->current.controler == infos.turn_player && pcard->is_special_summonable(infos.turn_player))
core.spsummonable_cards.push_back(pcard);
}
......@@ -2554,6 +2556,8 @@ int32 field::process_idle_command(uint16 step) {
filter_field_effect(EFFECT_SPSUMMON_PROC_G, &eset);
for(int32 i = 0; i < eset.count; ++i) {
pcard = eset[i]->handler;
if(!eset[i]->check_count_limit(pcard->current.controler))
continue;
if(pcard->current.controler != infos.turn_player)
continue;
effect* oreason = core.reason_effect;
......
......@@ -467,7 +467,6 @@ public:
static int32 duel_is_player_can_summon_count(lua_State *L);
static int32 duel_is_player_can_spsummon_count(lua_State *L);
static int32 duel_is_player_can_flipsummon_count(lua_State *L);
static int32 duel_is_player_can_release(lua_State *L);
static int32 duel_is_player_can_remove(lua_State *L);
static int32 duel_is_player_can_send_to_hand(lua_State *L);
......
......@@ -892,7 +892,8 @@ function Auxiliary.AddPendulumProcedure(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_SZONE)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,10000000)
e1:SetCondition(Auxiliary.PendCondition())
e1:SetOperation(Auxiliary.PendOperation())
e1:SetValue(SUMMON_TYPE_PENDULUM)
......@@ -907,7 +908,6 @@ function Auxiliary.PendCondition()
return function(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetFlagEffect(tp,10000000)~=0 then return false end
if c:GetSequence()~=6 then return false end
local rpz=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
if rpz==nil then return false end
......@@ -925,7 +925,6 @@ function Auxiliary.PendCondition()
end
function Auxiliary.PendOperation()
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
Duel.RegisterFlagEffect(tp,10000000,RESET_PHASE+PHASE_END,0,1)
local rpz=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
......
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