Skip to content

Commit 8acc1dd

Browse files
authored
Update "Pheromone Wasp"
- Should Special Summon the monster if battle damage was inflicted (confirmed with Memory Crusher FAQ) - General script overhaul
1 parent 5af8204 commit 8acc1dd

1 file changed

Lines changed: 35 additions & 36 deletions

File tree

unofficial/c511000889.lua

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
1+
--フェロモンワスプ
12
--Pheromone Wasp
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--sp summon
5-
local e2=Effect.CreateEffect(c)
6-
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
7-
e2:SetCode(EVENT_DAMAGE_STEP_END)
8-
e2:SetCondition(s.condition)
9-
e2:SetOperation(s.operation)
10-
c:RegisterEffect(e2)
11-
end
12-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
13-
return Duel.GetAttackTarget()==nil and Duel.GetAttacker()==e:GetHandler()
14-
end
15-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
16-
local e1=Effect.CreateEffect(e:GetHandler())
5+
--If this card inflicts Battle Damage to your opponent by a direct attack, you can Special Summon 1 Level 4 or lower Insect-Type monster from your Deck at the end of the Battle Phase.
6+
local e1=Effect.CreateEffect(c)
177
e1:SetDescription(aux.Stringid(id,0))
188
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
19-
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
20-
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
9+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
10+
e1:SetCode(EVENT_BATTLE_DAMAGE)
2111
e1:SetRange(LOCATION_MZONE)
22-
e1:SetCountLimit(1)
23-
e1:SetTarget(s.sptg)
24-
e1:SetOperation(s.spop)
25-
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
26-
e:GetHandler():RegisterEffect(e1)
12+
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp and Duel.GetAttackTarget()==nil end)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.operation)
15+
c:RegisterEffect(e1)
16+
end
17+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
18+
if chk==0 then return true end
19+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
2720
end
28-
function s.filter(c,e,tp)
21+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
22+
local e2=Effect.CreateEffect(e:GetHandler())
23+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
24+
e2:SetCode(EVENT_PHASE|PHASE_BATTLE)
25+
e2:SetCountLimit(1)
26+
e2:SetCondition(s.spcon)
27+
e2:SetOperation(s.spop)
28+
e2:SetReset(RESET_PHASE|PHASE_BATTLE)
29+
Duel.RegisterEffect(e2,tp)
30+
end
31+
function s.spfilter(c,e,tp)
2932
return c:IsLevelBelow(4) and c:IsRace(RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
3033
end
31-
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
32-
if chk==0 then return true end
33-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
34+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
35+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
3436
end
3537
function s.spop(e,tp,eg,ep,ev,re,r,rp)
38+
Duel.Hint(HINT_CARD,0,id)
39+
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
40+
if ft==0 then return end
41+
local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
42+
if #sg==0 then return end
3643
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
37-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
38-
if #g>0 then
39-
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
40-
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
41-
else
42-
Duel.Destroy(g,REASON_EFFECT)
43-
end
44-
else
45-
local cg=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
46-
Duel.ConfirmCards(1-tp,cg)
47-
Duel.ShuffleDeck(tp)
44+
sg=sg:Select(tp,1,1,nil)
45+
if #sg>0 then
46+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
4847
end
49-
end
48+
end

0 commit comments

Comments
 (0)