Skip to content

Commit

Permalink
"Shouldering a Destiny" fix
Browse files Browse the repository at this point in the history
Activating this card as a Continuous Spell should interact with other cards and effects as if you're activating a Continuous Spell normally (e.g. can chain "Magic Jammer" to it, cards will get Spell Counters from it, etc).
  • Loading branch information
pyrQ authored Feb 4, 2025
1 parent 5b17bbf commit 8bfd951
Showing 1 changed file with 58 additions and 46 deletions.
104 changes: 58 additions & 46 deletions skill/c300308012.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,86 @@
--Scripted by The Razgriz
local s,id=GetID()
function s.initial_effect(c)
--Activate
aux.AddSkillProcedure(c,1,true,s.flipcon,s.flipop)
end
s.listed_names={83965310}
function s.thfilter(c)
return c:IsCode(83965310) and c:IsAbleToHand()
end
s.listed_names={83965310} --"Destiny HERO - Plasma"
function s.flipcon(e)
local tp=e:GetHandlerPlayer()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
return aux.CanActivateSkill(tp) and Duel.GetFlagEffect(tp,id)==0 and ft>0
return aux.CanActivateSkill(tp) and not Duel.HasFlagEffect(tp,id)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function s.flipop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SKILL_FLIP,tp,id|1<<32)
Duel.Hint(HINT_CARD,tp,id)
Duel.RegisterFlagEffect(tp,id,0,0,0)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
-- Duel.Hint(HINT_SKILL_FLIP,tp,id|1<<32)
-- Duel.Hint(HINT_CARD,tp,id)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
Duel.Hint(HINT_SKILL_REMOVE,tp,c:GetOriginalCode())
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,nil)
if #g==0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
--You cannot draw cards during the Draw Phase while you control "Destiny HERO - Plasma"
Duel.RegisterFlagEffect(tp,id,0,0,0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_DRAW)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(1,0)
e1:SetCondition(aux.AND(s.plasmacon,s.drawcon))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--While you control "Destiny HERO - Plasma", you cannot draw during the Draw Phase
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(s.plasmacon)
e2:SetValue(0)
e2:SetCondition(aux.AND(s.plasmacon,s.drawcon))
c:RegisterEffect(e2)
--"Destiny HERO - Plasma" you control gains 100 ATK for each monster in both GYs
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
local e3=e2:Clone()
e3:SetCode(EFFECT_DRAW_COUNT)
e3:SetCondition(s.plasmacon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsCode,83965310))
e3:SetValue(function(e,c) return Duel.GetMatchingGroupCount(Card.IsMonster,0,LOCATION_GRAVE,LOCATION_GRAVE,nil)*100 end)
e3:SetValue(0)
c:RegisterEffect(e3)
--"Destiny HERO - Plasma" you control cannot be destroyed by opponent's card effects
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(aux.indoval)
--Each "Destiny HERO - Plasma" you control gains 100 ATK for each monster in the GYs, cannot be destroyed by your opponent's card effects, also can make a second attack during each Battle Phase
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(s.plasmacon)
e4:SetTarget(aux.TargetBoolFunction(Card.IsCode,83965310))
e4:SetValue(function(e,c) return Duel.GetMatchingGroupCount(Card.IsMonster,0,LOCATION_GRAVE,LOCATION_GRAVE,nil)*100 end)
c:RegisterEffect(e4)
--"Destiny HERO - Plasma" you control can make a second attack each Battle Phase
local e5=e3:Clone()
e5:SetCode(EFFECT_EXTRA_ATTACK)
e5:SetValue(1)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetTargetRange(LOCATION_ONFIELD,0)
e5:SetValue(aux.indoval)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_EXTRA_ATTACK)
e6:SetValue(1)
c:RegisterEffect(e6)
--Activate this Skill as a Continuous Spell
Duel.Activate(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
end
function s.thfilter(c)
return c:IsCode(83965310) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.plasmacon(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,83965310),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function s.drawcon(e)
return Duel.GetCurrentPhase()==PHASE_DRAW
function s.drawcon()
return Duel.IsPhase(PHASE_DRAW)
end

0 comments on commit 8bfd951

Please sign in to comment.