Commit ab3994a5 authored by argon.sun's avatar argon.sun

fix

parent ef5957dd
......@@ -2718,7 +2718,7 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
if(target->current.location & LOCATION_ONFIELD)
target->reset(RESET_LEAVE, RESET_EVENT);
}
if(!(location & LOCATION_ONFIELD))
if(!(target->current.location & LOCATION_ONFIELD))
target->relate_effect.clear();
} else {
if(target->turnid != infos.turn_id) {
......
......@@ -3248,11 +3248,11 @@ int32 field::process_battle_command(uint16 step) {
case 29: {
core.selfdes_disabled = FALSE;
group* des = core.units.begin()->ptarget;
if(!des || !des->container.size())
return FALSE;
for(auto cit = des->container.begin(); cit != des->container.end(); ++cit) {
(*cit)->set_status(STATUS_BATTLE_DESTROYED, TRUE);
(*cit)->filter_disable_related_cards();
if(des && des->container.size()) {
for(auto cit = des->container.begin(); cit != des->container.end(); ++cit) {
(*cit)->set_status(STATUS_BATTLE_DESTROYED, TRUE);
(*cit)->filter_disable_related_cards();
}
}
adjust_all();
return FALSE;
......@@ -3922,28 +3922,30 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
return FALSE;
}
case 1: {
effect* peffect = cait->triggering_effect;
if(cait->flag & CHAIN_DISABLE_ACTIVATE && is_chain_inactivatable(cait->chain_count)) {
remove_oath_effect(cait->triggering_effect);
if((cait->triggering_effect->flag & EFFECT_FLAG_COUNT_LIMIT) && (cait->triggering_effect->flag & EFFECT_FLAG_REPEAT))
cait->triggering_effect->reset_count += 0x100;
raise_event((card*)0, EVENT_CHAIN_INACTIVATED, cait->triggering_effect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
remove_oath_effect(peffect);
if((peffect->flag & EFFECT_FLAG_COUNT_LIMIT) && (peffect->flag & EFFECT_FLAG_REPEAT))
peffect->reset_count += 0x100;
raise_event((card*)0, EVENT_CHAIN_INACTIVATED, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
process_instant_event();
core.units.begin()->step = 9;
return FALSE;
}
oath_effects::iterator oeit;
for(oeit = effects.oath.begin(); oeit != effects.oath.end(); ++oeit)
if(oeit->second == cait->triggering_effect)
if(oeit->second == peffect)
oeit->second = 0;
break_effect();
core.chain_solving = TRUE;
if(cait->opinfos.count(0x200))
core.spsummon_state[cait->triggering_player] = TRUE;
if((cait->triggering_effect->type & EFFECT_TYPE_ACTIVATE) && cait->triggering_effect->handler->is_has_relation(cait->triggering_effect)) {
cait->triggering_effect->handler->enable_field_effect(TRUE);
if((peffect->type & EFFECT_TYPE_ACTIVATE) && peffect->handler->is_has_relation(peffect)) {
peffect->handler->set_status(STATUS_ACTIVATED, TRUE);
peffect->handler->enable_field_effect(TRUE);
adjust_instant();
}
raise_event((card*)0, EVENT_CHAIN_SOLVING, cait->triggering_effect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
raise_event((card*)0, EVENT_CHAIN_SOLVING, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
process_instant_event();
return FALSE;
}
......@@ -3972,8 +3974,6 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
}
case 3: {
effect* peffect = cait->triggering_effect;
if((peffect->type & EFFECT_TYPE_ACTIVATE) && (peffect->handler->current.location == LOCATION_SZONE))
peffect->handler->set_status(STATUS_ACTIVATED, TRUE);
peffect->operation = (ptr)core.units.begin()->peffect;
if(core.special_summoning.size())
special_summon_complete(peffect, cait->triggering_player);
......
......@@ -20,13 +20,16 @@ end
function c28553439.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28553439.rfilter(c)
return not c:IsImmuneToEffect(e)
end
function c28553439.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,c28553439.rfilter,1,nil,e)
and Duel.IsExistingMatchingCard(c28553439.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c28553439.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
local g=Duel.SelectReleaseGroup(tp,c28553439.rfilter,1,1,nil,e)
if g:GetCount()==0 or Duel.Release(g,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c28553439.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
......
......@@ -7,49 +7,56 @@ function c32835363.initial_effect(c)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32835363,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetOperation(c32835363.damcon)
e2:SetCondition(c32835363.regcon)
e2:SetOperation(c32835363.regop)
c:RegisterEffect(e2)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32835363,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(32835363)
e2:SetTarget(c32835363.damtg)
e2:SetOperation(c32835363.damop)
c:RegisterEffect(e2)
end
function c32835363.damcon(e,tp,eg,ep,ev,re,r,rp)
function c32835363.regcon(e,tp,eg,ep,ev,re,r,rp)
local d1=false
local d2=false
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsType(TYPE_MONSTER) and bit.band(tc:GetReason(),0x41)==0x41 then
if tc:GetOwner()==tp then d1=true
if tc:GetControler()==0 then d1=true
else d2=true end
end
tc=eg:GetNext()
end
local evt_p=PLAYER_NONE
if d1 and d2 then evt_p=PLAYER_ALL
elseif d1 then evt_p=tp
elseif d2 then evt_p=1-tp
else return end
elseif d1 then evt_p=0
elseif d2 then evt_p=1 end
e:SetLabel(evt_p)
return evt_p~=PLAYER_NONE
end
function c32835363.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseSingleEvent(e:GetHandler(),32835363,e,0,tp,e:GetLabel(),0)
end
function c32835363.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
local damp=e:GetLabel()
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,damp,800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,ep,800)
end
function c32835363.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local damp=e:GetLabel()
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if damp==PLAYER_ALL then
if ep==PLAYER_ALL then
Duel.Damage(tp,d,REASON_EFFECT)
Duel.Damage(1-tp,d,REASON_EFFECT)
else
Duel.Damage(damp,d,REASON_EFFECT)
Duel.Damage(ep,d,REASON_EFFECT)
end
end
......@@ -19,8 +19,8 @@ end
function c44790889.ntcon(e,c)
if c==nil then return true end
return c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_ONFIELD,0,nil)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_ONFIELD,nil)>0
end
function c44790889.atkcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,0,1,nil,TYPE_SPELL+TYPE_TRAP)
......
......@@ -40,13 +40,13 @@ function c54306223.acop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsCanAddCounter(0x9,1) and not tc:IsSetCard(0x50) then
if tc and tc:IsCanAddCounter(0x9,1) and not tc:IsSetCard(0x50) and not tc:IsCode(72677437) then
tc:AddCounter(0x9,1)
end
end
for i=0,4 do
local tc=Duel.GetFieldCard(1-tp,LOCATION_MZONE,i)
if tc and tc:IsCanAddCounter(0x9,1) and not tc:IsSetCard(0x50) then
if tc and tc:IsCanAddCounter(0x9,1) and not tc:IsSetCard(0x50) and not tc:IsCode(72677437) then
tc:AddCounter(0x9,1)
end
end
......
......@@ -5,6 +5,7 @@ function c89739383.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c89739383.cost)
e1:SetTarget(c89739383.target)
e1:SetOperation(c89739383.activate)
c:RegisterEffect(e1)
......
......@@ -38,7 +38,7 @@ function c89774530.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c89774530.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
function c89774530.xyzlimit(e,c)
......
......@@ -22,7 +22,7 @@ function c99173029.initial_effect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetOperation(c99173029.mtop)
......
......@@ -3,7 +3,7 @@
antialias = 2
nickname = Player
gamename = Game
lastdeck = sample
lastdeck = test
textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911
......
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