Skip to content

Update cards that set original ATK/DEF #1155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions official/c15066114.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--Segmental Dragon
local s,id=GetID()
function s.initial_effect(c)
--summon & set with no tribute
--You can Normal Summon/Set this card without Tributing
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE)
Expand All @@ -14,7 +14,7 @@ function s.initial_effect(c)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--destroy
--Destroy all monsters in the Main Monster Zones with ATK less than or equal to the ATK this card had on the field
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
Expand All @@ -33,13 +33,12 @@ function s.ntcon(e,c,minc)
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function s.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--ATK and DEF become halved
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_DISABLE)
e1:SetReset(RESET_EVENT|(RESETS_STANDARD&~RESET_TOFIELD)|RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
Expand All @@ -50,22 +49,22 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function s.desfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:GetSequence()<5
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsInMainMZone()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local atk=c:GetAttack()
if Duel.Destroy(c,REASON_EFFECT)~=0 then
if Duel.Destroy(c,REASON_EFFECT)>0 then
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,atk)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
21 changes: 12 additions & 9 deletions official/c15629801.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
--Battle Waltz
local s,id=GetID()
function s.initial_effect(c)
--Activate
--Special Summon 1 "Waltz Token"
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
Expand All @@ -29,17 +30,18 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e)
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e)
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,tc:GetAttack(),tc:GetDefense(),tc:GetLevel(),tc:GetRace(),tc:GetAttribute()) then
local token=Duel.CreateToken(tp,id+1)
local e1=Effect.CreateEffect(e:GetHandler())
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(tc:GetAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TOFIELD)
token:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(tc:GetDefense())
token:RegisterEffect(e2)
local e3=e1:Clone()
Expand All @@ -55,15 +57,16 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e5:SetValue(tc:GetAttribute())
token:RegisterEffect(e5)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e6=Effect.CreateEffect(e:GetHandler())
--Neither player takes any battle damage from attacks involving it
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e6:SetValue(1)
e6:SetReset(RESET_EVENT+RESETS_STANDARD)
e6:SetReset(RESET_EVENT|RESETS_STANDARD)
token:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
token:RegisterEffect(e7)
end
Duel.SpecialSummonComplete()
end
end
27 changes: 12 additions & 15 deletions official/c1828513.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,44 @@
--Shadow of the Six Samurai - Shien
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,0x3d),4,2)
c:EnableReviveLimit()
--attack up
--Xyz Summon procedure: 2 Level 4 "Six Samurai" monsters
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_SIX_SAMURAI),4,2)
--Make the original ATK of a "Six Samurai" monster become 2000
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCost(s.cost)
e1:SetCost(aux.dxmcostgen(1,1,nil))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT)
end
s.listed_series={0x3d}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
s.listed_series={SET_SIX_SAMURAI}
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0x3d) and c:GetAttack()<2000
return c:IsFaceup() and c:IsSetCard(SET_SIX_SAMURAI) and c:GetAttack()<2000
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g:GetFirst(),1,tp,math.abs(2000-g:GetFirst():GetAttack()))
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and s.filter(tc) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end
end
24 changes: 12 additions & 12 deletions official/c19636995.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
--急き兎馬
--Red Hared Hasty Horse
--Scripted by edo9300

local s,id=GetID()
function s.initial_effect(c)
--Special summon itself from hand
Expand All @@ -21,6 +20,7 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_MOVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
Expand All @@ -29,17 +29,17 @@ function s.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(s.dattg)
e3:SetOperation(s.datop)
c:RegisterEffect(e3)
end
function s.hspval(e,c)
local tp=c:GetControler()
local zone=0x1f
local zone=ZONES_MMZ
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do
for tc in lg:Iter() do
zone=zone&(~tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
end
return 0,zone
Expand All @@ -48,9 +48,8 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp)
return #(e:GetHandler():GetColumnGroup()&eg)>0
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 end
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Expand All @@ -59,25 +58,26 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
end
function s.dattg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,e:GetHandler():GetAttack()/2)
end
function s.datop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local base_atk=c:GetBaseAttack()
--Halve its original ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(c:GetBaseAttack()/2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e1:SetValue(base_atk/2)
e1:SetReset(RESETS_STANDARD_PHASE_END|RESET_DISABLE)
c:RegisterEffect(e1)
--Can attack directly
local e2=Effect.CreateEffect(c)
e2:SetDescription(3205)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e2)
end
end
6 changes: 2 additions & 4 deletions official/c22996376.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ function s.otop(g,e,tp,eg,ep,ev,re,r,rp,c,minc,zone,relzone,exeff)
--Change original ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE&~RESET_TOFIELD)
c:RegisterEffect(e1)
Expand All @@ -37,11 +35,11 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return ct>0 and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,tp,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e):Match(Card.IsRace,nil,RACE_BEAST)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
11 changes: 6 additions & 5 deletions official/c23898021.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--atk
--Its original ATK becomes 1000
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.regop)
c:RegisterEffect(e1)
--search
--Reveal 3 Normal Traps from your Deck and your opponent randomly chooses 1 for you to Set on your field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
Expand All @@ -27,7 +28,7 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Expand All @@ -36,7 +37,7 @@ function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST)
end
function s.thfilter(c)
return c:GetType()==TYPE_TRAP and c:IsSSetable()
return c:IsNormalTrap() and c:IsSSetable()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Expand All @@ -53,4 +54,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tg=sg:Select(1-tp,1,1,nil)
Duel.SSet(tp,tg:GetFirst(),tp,false)
end
end
end
Loading
Loading