Commit 265b6baa authored by VanillaSalt's avatar VanillaSalt

fix

parent bfd953f4
...@@ -5045,7 +5045,7 @@ int32 field::adjust_step(uint16 step) { ...@@ -5045,7 +5045,7 @@ int32 field::adjust_step(uint16 step) {
} }
case 8: { case 8: {
if(core.selfdes_disabled) { if(core.selfdes_disabled) {
core.units.begin()->step = 9; core.units.begin()->step = 10;
return FALSE; return FALSE;
} }
//self destroy //self destroy
...@@ -5081,6 +5081,39 @@ int32 field::adjust_step(uint16 step) { ...@@ -5081,6 +5081,39 @@ int32 field::adjust_step(uint16 step) {
return FALSE; return FALSE;
} }
case 9: { case 9: {
if(returns.ivalue[0] > 0)
core.re_adjust = TRUE;
//self tograve
uint8 tp = infos.turn_player;
effect* peffect;
card_set tograve_set;
for(uint8 p = 0; p < 2; ++p) {
for(uint8 i = 0; i < 5; ++i) {
card* pcard = player[tp].list_mzone[i];
if(pcard && pcard->is_position(POS_FACEUP) && (peffect = pcard->is_affected_by_effect(EFFECT_SELF_TOGRAVE))) {
tograve_set.insert(pcard);
pcard->current.reason_effect = peffect;
pcard->current.reason_player = peffect->get_handler_player();
}
}
for(uint8 i = 0; i < 8; ++i) {
card* pcard = player[tp].list_szone[i];
if(pcard && pcard->is_position(POS_FACEUP) && (peffect = pcard->is_affected_by_effect(EFFECT_SELF_TOGRAVE))) {
tograve_set.insert(pcard);
pcard->current.reason_effect = peffect;
pcard->current.reason_player = peffect->get_handler_player();
}
}
tp = 1 - tp;
}
if(tograve_set.size()) {
send_to(&tograve_set, 0, REASON_RULE, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
} else {
returns.ivalue[0] = 0;
}
return FALSE;
}
case 10: {
if(returns.ivalue[0] > 0) if(returns.ivalue[0] > 0)
core.re_adjust = TRUE; core.re_adjust = TRUE;
//equip check //equip check
...@@ -5101,7 +5134,7 @@ int32 field::adjust_step(uint16 step) { ...@@ -5101,7 +5134,7 @@ int32 field::adjust_step(uint16 step) {
} }
return FALSE; return FALSE;
} }
case 10: { case 11: {
//position //position
uint32 tp = infos.turn_player, pos; uint32 tp = infos.turn_player, pos;
card* pcard; card* pcard;
...@@ -5139,7 +5172,7 @@ int32 field::adjust_step(uint16 step) { ...@@ -5139,7 +5172,7 @@ int32 field::adjust_step(uint16 step) {
} }
return FALSE; return FALSE;
} }
case 11: { case 12: {
//shuffle check //shuffle check
for(uint32 i = 0; i < player[0].list_hand.size(); ++i) { for(uint32 i = 0; i < player[0].list_hand.size(); ++i) {
card* pcard = player[0].list_hand[i]; card* pcard = player[0].list_hand[i];
...@@ -5161,7 +5194,7 @@ int32 field::adjust_step(uint16 step) { ...@@ -5161,7 +5194,7 @@ int32 field::adjust_step(uint16 step) {
shuffle(1 - infos.turn_player, LOCATION_HAND); shuffle(1 - infos.turn_player, LOCATION_HAND);
return FALSE; return FALSE;
} }
case 12: { case 13: {
//reverse_deck && remove brainwashing //reverse_deck && remove brainwashing
effect_set eset; effect_set eset;
uint32 res = 0; uint32 res = 0;
...@@ -5218,19 +5251,19 @@ int32 field::adjust_step(uint16 step) { ...@@ -5218,19 +5251,19 @@ int32 field::adjust_step(uint16 step) {
} }
return FALSE; return FALSE;
} }
case 13: { case 14: {
//attack cancel //attack cancel
card* attacker = core.attacker; card* attacker = core.attacker;
if(attacker && attacker->is_affected_by_effect(EFFECT_CANNOT_ATTACK)) if(attacker && attacker->is_affected_by_effect(EFFECT_CANNOT_ATTACK))
attacker->set_status(STATUS_ATTACK_CANCELED, TRUE); attacker->set_status(STATUS_ATTACK_CANCELED, TRUE);
return FALSE; return FALSE;
} }
case 14: { case 15: {
raise_event((card*)0, EVENT_ADJUST, 0, 0, PLAYER_NONE, PLAYER_NONE, 0); raise_event((card*)0, EVENT_ADJUST, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
process_instant_event(); process_instant_event();
return FALSE; return FALSE;
} }
case 15: { case 16: {
if(core.re_adjust) { if(core.re_adjust) {
core.units.begin()->step = -1; core.units.begin()->step = -1;
return FALSE; return FALSE;
......
...@@ -32,11 +32,11 @@ function c20426907.initial_effect(c) ...@@ -32,11 +32,11 @@ function c20426907.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--tograve --tograve
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EVENT_ADJUST) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
e5:SetCode(EFFECT_SELF_TOGRAVE)
e5:SetCondition(c20426907.sdcon) e5:SetCondition(c20426907.sdcon)
e5:SetOperation(c20426907.sdop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c20426907.filter(c) function c20426907.filter(c)
...@@ -84,7 +84,7 @@ function c20426907.distg3(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -84,7 +84,7 @@ function c20426907.distg3(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end end
function c20426907.disop(e,tp,eg,ep,ev,re,r,rp) function c20426907.disop(e,tp,eg,ep,ev,re,r,rp)
if c20426907.sdcon(e,tp,eg,ep,ev,re,r,rp) then return end if c20426907.sdcon(e) then return end
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -116,9 +116,6 @@ end ...@@ -116,9 +116,6 @@ end
function c20426907.sdfilter(c) function c20426907.sdfilter(c)
return c:IsFaceup() and c:IsSetCard(0xaa) and not c:IsCode(20426907) return c:IsFaceup() and c:IsSetCard(0xaa) and not c:IsCode(20426907)
end end
function c20426907.sdcon(e,tp,eg,ep,ev,re,r,rp) function c20426907.sdcon(e)
return not Duel.IsExistingMatchingCard(c20426907.sdfilter,tp,LOCATION_ONFIELD,0,1,nil) return not Duel.IsExistingMatchingCard(c20426907.sdfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c20426907.sdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end end
...@@ -44,7 +44,7 @@ function c49919798.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,7 @@ function c49919798.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c49919798.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c49919798.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(49919798)==0 end if chk==0 then return e:GetHandler():GetFlagEffect(49919798)==0 end
e:GetHandler():RegisterFlagEffect(49919798,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(49919798,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
......
...@@ -22,11 +22,11 @@ function c94432298.initial_effect(c) ...@@ -22,11 +22,11 @@ function c94432298.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tograve --tograve
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_ADJUST) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_SELF_TOGRAVE)
e3:SetCondition(c94432298.sdcon) e3:SetCondition(c94432298.sdcon)
e3:SetOperation(c94432298.sdop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c94432298.tgtg1(e,tp,eg,ep,ev,re,r,rp,chk) function c94432298.tgtg1(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -56,7 +56,7 @@ function c94432298.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -56,7 +56,7 @@ function c94432298.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function c94432298.tgop(e,tp,eg,ep,ev,re,r,rp) function c94432298.tgop(e,tp,eg,ep,ev,re,r,rp)
if c94432298.sdcon(e,tp,eg,ep,ev,re,r,rp) then return end if c94432298.sdcon(e) then return end
if e:GetHandler():GetFlagEffect(94432298)==0 then return end if e:GetHandler():GetFlagEffect(94432298)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c94432298.filter,tp,LOCATION_DECK,0,1,2,nil) local g=Duel.SelectMatchingCard(tp,c94432298.filter,tp,LOCATION_DECK,0,1,2,nil)
...@@ -67,9 +67,6 @@ end ...@@ -67,9 +67,6 @@ end
function c94432298.sdfilter(c) function c94432298.sdfilter(c)
return c:IsFacedown() or not c:IsSetCard(0xbb) return c:IsFacedown() or not c:IsSetCard(0xbb)
end end
function c94432298.sdcon(e,tp,eg,ep,ev,re,r,rp) function c94432298.sdcon(e)
return Duel.IsExistingMatchingCard(c94432298.sdfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c94432298.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c94432298.sdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end end
...@@ -380,6 +380,7 @@ EFFECT_UPDATE_RSCALE =136 --改变右刻度 ...@@ -380,6 +380,7 @@ EFFECT_UPDATE_RSCALE =136 --改变右刻度
EFFECT_CHANGE_RSCALE =137 --设置右刻度 EFFECT_CHANGE_RSCALE =137 --设置右刻度
EFFECT_SET_POSITION =140 --改变表示形式 EFFECT_SET_POSITION =140 --改变表示形式
EFFECT_SELF_DESTROY =141 --自灭(罪系列等) EFFECT_SELF_DESTROY =141 --自灭(罪系列等)
EFFECT_SELF_TOGRAVE =142 --
EFFECT_DOUBLE_TRIBUTE =150 --可以作为2个祭品 EFFECT_DOUBLE_TRIBUTE =150 --可以作为2个祭品
EFFECT_DECREASE_TRIBUTE =151 --减少祭品 EFFECT_DECREASE_TRIBUTE =151 --减少祭品
EFFECT_DECREASE_TRIBUTE_SET =152 --减少放置怪兽的祭品 EFFECT_DECREASE_TRIBUTE_SET =152 --减少放置怪兽的祭品
......
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