Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. --Aquarium Lightning
  2. function c13790591.initial_effect(c)
  3. c:SetUniqueOnField(1,0,13790591)
  4. local e1=Effect.CreateEffect(c)
  5. e1:SetType(EFFECT_TYPE_ACTIVATE)
  6. e1:SetCode(EVENT_FREE_CHAIN)
  7. c:RegisterEffect(e1)
  8. --atk
  9. local e2=Effect.CreateEffect(c)
  10. e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
  11. e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
  12. e2:SetRange(LOCATION_SZONE)
  13. e2:SetCondition(c13790591.atkcon)
  14. e2:SetOperation(c13790591.atkup)
  15. c:RegisterEffect(e2)
  16. local e3=Effect.CreateEffect(c)
  17. e3:SetDescription(aux.Stringid(56638325,1))
  18. e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  19. e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
  20. e3:SetCode(EVENT_TO_GRAVE)
  21. e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
  22. e3:SetCondition(c13790591.spcon)
  23. e3:SetTarget(c13790591.sptg)
  24. e3:SetOperation(c13790591.spop)
  25. c:RegisterEffect(e3)
  26.  
  27. end
  28. function c13790591.atkcon(e,tp,eg,ep,ev,re,r,rp)
  29. local a=Duel.GetAttacker()
  30. local d=Duel.GetAttackTarget()
  31. return not e:GetHandler():IsStatus(STATUS_CHAINING) and (d~=nil and a:GetControler()==tp and a:IsSetCard(0x1373) and a:IsRelateToBattle())
  32. or (d~=nil and d:GetControler()==tp and d:IsFaceup() and d:IsSetCard(0x1373) and d:IsRelateToBattle())
  33. end
  34. function c13790591.atkup(e,tp,eg,ep,ev,re,r,rp)
  35. local a=Duel.GetAttacker()
  36. local d=Duel.GetAttackTarget()
  37. if not a:IsRelateToBattle() or not d:IsRelateToBattle() then return end
  38. local e1=Effect.CreateEffect(e:GetHandler())
  39. e1:SetOwnerPlayer(tp)
  40. e1:SetType(EFFECT_TYPE_SINGLE)
  41. e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  42. e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
  43. if a:GetControler()==tp then
  44. e1:SetValue(a:GetAttack()*2)
  45. a:RegisterEffect(e1)
  46. else
  47. e1:SetValue(d:GetAttack()*2)
  48. d:RegisterEffect(e1)
  49. end
  50. local e1=Effect.CreateEffect(e:GetHandler())
  51. e1:SetOwnerPlayer(tp)
  52. e1:SetType(EFFECT_TYPE_SINGLE)
  53. e1:SetCode(EFFECT_SET_DEFENCE_FINAL)
  54. e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
  55. if a:GetControler()==tp then
  56. e1:SetValue(a:GetDefence()*2)
  57. a:RegisterEffect(e1)
  58. else
  59. e1:SetValue(d:GetDefence()*2)
  60. d:RegisterEffect(e1)
  61. end
  62. end
  63.  
  64.  
  65. function c13790591.spcon(e,tp,eg,ep,ev,re,r,rp)
  66. return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
  67. end
  68. function c13790591.spfilter(c,e,tp)
  69. return c:IsRace(RACE_AQUA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
  70. end
  71. function c13790591.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
  72. if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
  73. and Duel.IsExistingMatchingCard(c13790591.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
  74. Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
  75. end
  76. function c13790591.spop(e,tp,eg,ep,ev,re,r,rp)
  77. if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
  78. Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
  79. local g=Duel.SelectMatchingCard(tp,c13790591.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
  80. if g:GetCount()>0 then
  81. Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
  82. local e1=Effect.CreateEffect(e:GetHandler())
  83. e1:SetType(EFFECT_TYPE_FIELD)
  84. e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  85. e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  86. e1:SetTargetRange(1,0)
  87. e1:SetTarget(c13790591.splimit)
  88. e1:SetReset(RESET_PHASE+PHASE_END)
  89. Duel.RegisterEffect(e1,tp)
  90. end
  91. end
  92. function c13790591.splimit(e,c)
  93. return c:GetRace()~=RACE_AQUA
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement