Skip to content

Commit fa3e8e6

Browse files
committed
added Freshberry Collaboration
1 parent 6ed9d6e commit fa3e8e6

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

rush/c160218071.lua

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
--ベリーフレッシュ・コラボレーション
2+
--Freshberry Collaboration
3+
--scripted by YoshiDuels
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--change position
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_POSITION)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetCountLimit(1)
13+
e1:SetCondition(function(e)return e:GetHandler():IsStatus(STATUS_SUMMON_TURN)end)
14+
e1:SetCost(s.cost)
15+
e1:SetTarget(s.target)
16+
e1:SetOperation(s.operation)
17+
c:RegisterEffect(e1)
18+
end
19+
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
20+
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD|LOCATION_HAND,0,1,e:GetHandler()) end
21+
end
22+
function s.posfilter(c)
23+
return c:IsAttackPos() and c:IsCanChangePositionRush()
24+
end
25+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
26+
if chk==0 then return Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,0,1,nil) end
27+
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
28+
end
29+
function s.desfilter(c)
30+
return c:IsFaceup() and c:IsLevelBelow(10) and not c:IsType(TYPE_MAXIMUM)
31+
end
32+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
33+
local c=e:GetHandler()
34+
--Requirement
35+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
36+
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD|LOCATION_HAND,0,1,1,c):GetFirst()
37+
if Duel.SendtoGrave(tc,REASON_COST)==0 then return end
38+
--Effect
39+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
40+
local g2=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
41+
Duel.HintSelection(g2)
42+
Duel.ChangePosition(g2,POS_FACEUP_DEFENSE)
43+
local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil)
44+
if #g>0 and tc:IsMonster() and tc:IsRace(RACE_AQUA) and tc:IsAttribute(ATTRIBUTE_WATER) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
45+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
46+
local sg=g:Select(tp,1,1,nil)
47+
if #sg==0 then return end
48+
Duel.HintSelection(sg)
49+
Duel.BreakEffect()
50+
Duel.Destroy(sg,REASON_EFFECT)
51+
end
52+
--Prevent non-Aqua from attacking
53+
local e2=Effect.CreateEffect(e:GetHandler())
54+
e2:SetType(EFFECT_TYPE_FIELD)
55+
e2:SetCode(EFFECT_CANNOT_ATTACK)
56+
e2:SetProperty(EFFECT_FLAG_OATH)
57+
e2:SetTargetRange(LOCATION_MZONE,0)
58+
e2:SetTarget(s.ftarget)
59+
e2:SetReset(RESET_PHASE|PHASE_END)
60+
Duel.RegisterEffect(e2,tp)
61+
end
62+
function s.ftarget(e,c)
63+
return not c:IsRace(RACE_AQUA)
64+
end

0 commit comments

Comments
 (0)