Commit df7420a2 authored by Uytrewq's avatar Uytrewq Committed by GitHub

fix 隠し砦 ストロング・ホールド, 地縛死霊ゾーマ(#2411)

parent f520ccdf
--隠し砦 ストロング・ホールド --隠し砦 ストロング・ホールド
--Coded by Lee
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,79791878) aux.AddCodeList(c,79791878)
...@@ -17,6 +16,7 @@ function s.initial_effect(c) ...@@ -17,6 +16,7 @@ function s.initial_effect(c)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.atkcon)
e2:SetValue(s.atkval) e2:SetValue(s.atkval)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--destroy --destroy
...@@ -38,14 +38,16 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,14 +38,16 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,0,2000,4,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,0,2000,4,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP) c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
end end
function s.atkfilter(c) function s.atkfilter(c)
return (c:IsCode(79791878) or (aux.IsCodeListed(c,79791878) and c:IsLocation(LOCATION_MZONE))) and c:IsFaceup() return (c:IsCode(79791878) or (aux.IsCodeListed(c,79791878) and c:IsLocation(LOCATION_MZONE))) and c:IsFaceup()
end end
function s.atkcon(e)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function s.atkval(e,c) function s.atkval(e,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return Duel.GetMatchingGroupCount(s.atkfilter,tp,LOCATION_ONFIELD,0,nil)*1000 return Duel.GetMatchingGroupCount(s.atkfilter,tp,LOCATION_ONFIELD,0,nil)*1000
...@@ -55,16 +57,17 @@ function s.filter(c) ...@@ -55,16 +57,17 @@ function s.filter(c)
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil) return Duel.GetAttacker():IsControler(1-tp) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
and e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker() local tg=Duel.GetAttacker()
if chk==0 then return tg:IsOnField() end if chk==0 then return tg:IsOnField() end
Duel.SetTargetCard(tg) Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -11,7 +11,7 @@ function s.initial_effect(c) ...@@ -11,7 +11,7 @@ function s.initial_effect(c)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--damage --damage
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
...@@ -22,7 +22,7 @@ function s.initial_effect(c) ...@@ -22,7 +22,7 @@ function s.initial_effect(c)
e2:SetCondition(s.damcon) e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg) e2:SetTarget(s.damtg)
e2:SetOperation(s.damop) e2:SetOperation(s.damop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
...@@ -31,8 +31,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,8 +31,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,1800,500,4,RACE_ZOMBIE,ATTRIBUTE_DARK) then return end
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,1800,500,4,RACE_ZOMBIE,ATTRIBUTE_DARK) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP) c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
--must attack --must attack
...@@ -53,7 +52,8 @@ function s.atklimit(e,c) ...@@ -53,7 +52,8 @@ function s.atklimit(e,c)
end end
function s.damcon(e,tp,eg,ep,ev,re,r,rp) function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF and c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp) and c==Duel.GetAttackTarget() and ((Duel.GetAttacker():IsControler(1-tp) and c:IsLocation(LOCATION_ONFIELD)) or Duel.GetAttacker():IsPreviousControler(1-tp)) return c:GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF and c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp)
and c==Duel.GetAttackTarget() and ((Duel.GetAttacker():IsControler(1-tp) and c:IsOnField()) or Duel.GetAttacker():IsPreviousControler(1-tp))
end end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -73,4 +73,4 @@ end ...@@ -73,4 +73,4 @@ end
function s.damop(e,tp,eg,ep,ev,re,r,rp) function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
\ No newline at end of file
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