Commit 22b2334e authored by VanillaSalt's avatar VanillaSalt

fix

parent a3d6af60
......@@ -425,6 +425,7 @@ public:
int32 process_idle_command(uint16 step);
int32 process_battle_command(uint16 step);
int32 process_damage_step(uint16 step);
void field::calculate_battle_damage(effect** pdamchange, card** preason_card, uint8 *battle_destroyed);
int32 process_turn(uint16 step, uint8 turn_player);
int32 add_chain(uint16 step);
......
This diff is collapsed.
......@@ -55,7 +55,8 @@ end
function c12644061.damcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
return ep==tp and ((a:IsControler(tp) and a:IsSetCard(0x1034)) or (at and at:IsControler(tp) and at:IsSetCard(0x1034)))
return Duel.GetBattleDamage(tp)>0
and ((a:IsControler(tp) and a:IsSetCard(0x1034)) or (at and at:IsControler(tp) and at:IsSetCard(0x1034)))
end
function c12644061.dfilter(c)
return c:IsSetCard(0x1034) and c:IsAbleToGraveAsCost()
......@@ -74,7 +75,8 @@ function c12644061.damop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetRange(LOCATION_FZONE)
e1:SetOperation(c12644061.dop)
c:RegisterEffect(e1,tp)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
end
function c12644061.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,0)
......
......@@ -51,12 +51,11 @@ function c14001430.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return bit.band(r,REASON_EFFECT)~=0 and re and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsSetCard(0x71) and eg:IsExists(c14001430.repfilter,1,nil,tp) end
if Duel.SelectYesNo(tp,aux.Stringid(14001430,0)) then
local ct=eg:FilterCount(c14001430.repfilter,nil,tp)
local g=eg:Filter(c14001430.repfilter,nil,tp)
local ct=g:GetCount()
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
g=eg:FilterSelect(tp,c14001430.repfilter,1,ct,nil,tp)
else
g=eg:Filter(c14001430.repfilter,nil,tp)
g=g:Select(tp,1,ct,nil)
end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -9,7 +9,7 @@ function c16674846.initial_effect(c)
c:RegisterEffect(e1)
end
function c16674846.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
return Duel.GetTurnPlayer()~=tp and Duel.GetBattleDamage(tp)>0
end
function c16674846.filter(c)
return c:IsDefenceBelow(1500) and c:IsType(TYPE_TUNER) and c:IsRace(RACE_WARRIOR)
......@@ -20,6 +20,7 @@ function c16674846.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c16674846.damop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
local g=Duel.GetMatchingGroup(c16674846.filter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(16674846,0)) then
......
......@@ -21,15 +21,13 @@ end
function c23171610.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23171610.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c23171610.filter,tp,LOCATION_MZONE,0,nil)
g:KeepAlive()
e:SetLabelObject(g)
Duel.SetTargetCard(g)
end
function c23171610.filter2(c,e,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_MACHINE) and not c:IsImmuneToEffect(e)
function c23171610.filter2(c,e)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
end
function c23171610.activate(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(c23171610.filter2,nil,e,tp)
local sg=Duel.GetMatchingGroup(c23171610.filter2,tp,LOCATION_MZONE,0,nil,e)
local c=e:GetHandler()
local fid=c:GetFieldID()
local tc=sg:GetFirst()
......
......@@ -10,7 +10,7 @@ function c24268052.initial_effect(c)
c:RegisterEffect(e1)
end
function c24268052.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
return Duel.GetTurnPlayer()~=tp and Duel.GetBattleDamage(tp)>0
end
function c24268052.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......@@ -21,6 +21,7 @@ function c24268052.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c24268052.damop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
......
......@@ -11,22 +11,7 @@ function c29389368.initial_effect(c)
c:RegisterEffect(e1)
end
function c29389368.condition(e,tp,eg,ep,ev,re,r,rp)
local ar=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
local v1=0
if ar:IsPosition(POS_DEFENCE) and ar:IsHasEffect(EFFECT_DEFENCE_ATTACK) then v1=ar:GetDefence()
else v1=ar:GetAttack() end
if at then
if at:IsPosition(POS_ATTACK) then
return v1-at:GetAttack()>=2000
elseif ar:IsHasEffect(EFFECT_PIERCE)
return v1-at:GetDefence()>=2000
else
return false
end
else
return v1>=2000
end
return Duel.GetBattleDamage(tp)>=2000
end
function c29389368.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -12,7 +12,7 @@ function c40640057.initial_effect(c)
c:RegisterEffect(e1)
end
function c40640057.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
return Duel.GetTurnPlayer()~=tp and Duel.GetBattleDamage(tp)>0
end
function c40640057.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
......@@ -23,6 +23,7 @@ function c40640057.op(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c40640057.damop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c40640057.damop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,7 +14,7 @@ function c47432275.initial_effect(c)
c:RegisterEffect(e1)
end
function c47432275.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==e:GetHandler()
return Duel.GetAttackTarget()==e:GetHandler() and Duel.GetBattleDamage(tp)>0
end
function c47432275.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -29,6 +29,7 @@ function c47432275.op(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c47432275.damop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
......
......@@ -53,7 +53,7 @@ function c48868994.filter(c)
return c:IsFaceup() and c:IsAttackPos() and c:IsAbleToChangeControler()
end
function c48868994.tgd(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c48868994.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c48868994.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c48868994.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
......
......@@ -27,7 +27,7 @@ function c60953118.initial_effect(c)
c:RegisterEffect(e4)
end
function c60953118.damcon(e,tp,eg,ep,ev,re,r,rp)
return true
return Duel.GetBattleDamage(tp)>0
end
function c60953118.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......@@ -38,6 +38,7 @@ function c60953118.damop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c60953118.dop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c60953118.dop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -17,7 +17,8 @@ end
function c83682725.dfilter(c,lv)
return (c:IsFacedown() or c:IsLevelBelow(lv-1)) and c:IsAbleToHand()
end
function c83682725.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c83682725.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c83682725.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c83682725.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c83682725.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
......
......@@ -15,7 +15,7 @@ function c99733359.initial_effect(c)
c:RegisterEffect(e1)
end
function c99733359.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
return Duel.GetTurnPlayer()~=tp and Duel.GetBattleDamage(tp)>0
end
function c99733359.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
......@@ -40,6 +40,7 @@ function c99733359.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e2:SetOperation(c99733359.damop)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e2,tp)
end
end
......
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