Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VanillaSalt committed Mar 26, 2015
1 parent eca48f9 commit 5b0719c
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ocgcore/operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3649,7 +3649,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
flips.insert(pcard);
}
if(enable) {
if(!reason_effect || !(reason_effect->type & 0x7f0))
if(!reason_effect || !(reason_effect->type & 0x7f0) || pcard->current.location != LOCATION_MZONE)
pcard->enable_field_effect(TRUE);
else
core.delayed_enable_set.insert(pcard);
Expand Down
1 change: 1 addition & 0 deletions ocgcore/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ int32 field::process() {
case PROCESSOR_ANNOUNCE_NUMBER: {
if(announce_number(it->step, it->arg1)) {
pduel->lua->add_param(core.select_options[returns.ivalue[0]], PARAM_TYPE_INT);
pduel->lua->add_param(returns.ivalue[0], PARAM_TYPE_INT);
core.units.pop_front();
} else {
it->step++;
Expand Down
3 changes: 2 additions & 1 deletion script/c13647631.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end
function c13647631.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local atk=c:GetBaseAttack()
local def=c:GetBaseDefence()
local e1=Effect.CreateEffect(c)
Expand All @@ -55,6 +55,7 @@ function c13647631.spop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_SET_BASE_DEFENCE)
e2:SetValue(def/2)
c:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
function c13647631.descon(e,tp,eg,ep,ev,re,r,rp)
Expand Down
3 changes: 1 addition & 2 deletions script/c21105106.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ function c21105106.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c21105106.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0
and Duel.GetActivityCount(tp,ACTIVITY_FLIPSUMMON)==0
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0
and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==1 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
Expand Down
18 changes: 12 additions & 6 deletions script/c22404675.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ function c22404675.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c22404675.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,22404676,0,0x4011,800,1000,1,RACE_THUNDER,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,22404676)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE)
if c:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(c,REASON_EFFECT)
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,22404676,0,0x4011,800,1000,1,RACE_THUNDER,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,22404676)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE)
end
Duel.SpecialSummonComplete()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
Expand Down
2 changes: 1 addition & 1 deletion script/c23516703.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function c23516703.initial_effect(c)
local et=Effect.CreateEffect(c)
et:SetType(EFFECT_TYPE_FIELD)
et:SetCode(EFFECT_LEFT_SPSUMMON_COUNT)
et:SetRange(LOCATION_MZONE)
et:SetRange(LOCATION_SZONE)
et:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
et:SetTargetRange(1,1)
et:SetValue(c23516703.countval)
Expand Down
17 changes: 16 additions & 1 deletion script/c24348804.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ function c24348804.initial_effect(c)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c24348804.distg)
c:RegisterEffect(e3)
if not c24348804.global_check then
c24348804.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c24348804.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c24348804.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
tc:RegisterFlagEffect(24348804,RESET_EVENT+0x1ec0000+RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
function c24348804.cfilter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
Expand Down Expand Up @@ -65,5 +80,5 @@ function c24348804.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c24348804.distg(e,c)
return c:IsStatus(STATUS_SUMMON_TURN) and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
return c:GetFlagEffect(24348804)~=0
end
3 changes: 2 additions & 1 deletion script/c39454112.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ function c39454112.diceop(e,tp,eg,ep,ev,re,r,rp)
local ac=1
local ct=bit.band(ev,0xff)+bit.rshift(ev,16)
if ct>1 then
local val
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(39454112,1))
ac=Duel.AnnounceNumber(tp,table.unpack(dc,1,ct))
val,ac=Duel.AnnounceNumber(tp,table.unpack(dc,1,ct))
end
if dc[ac]==1 or dc[ac]==3 or dc[ac]==5 then dc[ac]=6
else dc[ac]=1 end
Expand Down
21 changes: 20 additions & 1 deletion script/c60621361.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,28 @@ function c60621361.initial_effect(c)
e4:SetCondition(c60621361.descon)
e4:SetOperation(c60621361.desop)
c:RegisterEffect(e4)
if not c60621361.global_check then
c60621361.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c60621361.spcheckop)
Duel.RegisterEffect(ge1,0)
end
end
function c60621361.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60621361,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60621361,RESET_PHASE+PHASE_END,0,1) end
end
function c60621361.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetActivityCount(1-tp,ACTIVITY_SPSUMMON)~=0
return Duel.GetFlagEffect(1-tp,60621361)~=0
end
function c60621361.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
Expand Down
5 changes: 0 additions & 5 deletions script/c71422989.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ function c71422989.activate(e,tp,eg,ep,ev,re,r,rp)
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
elseif Duel.IsPlayerCanSpecialSummon(tp) then
local cg1=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_MZONE,0)
Duel.ConfirmCards(1-tp,cg1)
local cg2=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
Duel.ConfirmCards(1-tp,cg2)
end
end
end

0 comments on commit 5b0719c

Please sign in to comment.