Commit 788fd110 authored by wind2009's avatar wind2009 Committed by GitHub

Merge pull request #17 from Fluorohydride/master

merge
parents 48059c37 9e2a7b45
...@@ -17,7 +17,10 @@ function s.filter(c,tp,ft) ...@@ -17,7 +17,10 @@ function s.filter(c,tp,ft)
local p=c:GetOwner() local p=c:GetOwner()
if p~=tp then ft=0 end if p~=tp then ft=0 end
local r=LOCATION_REASON_TOFIELD local r=LOCATION_REASON_TOFIELD
if not c:IsControler(p) then r=LOCATION_REASON_CONTROL end if not c:IsControler(p) then
if not c:IsAbleToChangeControler() then return false end
r=LOCATION_REASON_CONTROL
end
return Duel.GetLocationCount(p,LOCATION_SZONE,tp,r)>ft return Duel.GetLocationCount(p,LOCATION_SZONE,tp,r)>ft
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -20,7 +20,7 @@ function c44710391.initial_effect(c) ...@@ -20,7 +20,7 @@ function c44710391.initial_effect(c)
--double tribute --double tribute
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetCode(EFFECT_DOUBLE_TRIBUTE) e4:SetCode(EFFECT_DOUBLE_TRIBUTE)
e4:SetRange(LOCATION_FZONE) e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
......
...@@ -66,12 +66,12 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,12 +66,12 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) return not c:IsType(TYPE_TOKEN) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_FIRE)~=0 and not c:IsType(TYPE_TOKEN) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousAttributeOnField()&ATTRIBUTE_FIRE~=0
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end end
function s.tgfilter(c,e,tp) function s.tgfilter(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsPreviousControler(tp) return s.cfilter(c,tp) and c:IsCanBeEffectTarget(e)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler()) return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
......
...@@ -29,8 +29,6 @@ function c59019082.filter(c) ...@@ -29,8 +29,6 @@ function c59019082.filter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER) return c:IsLocation(LOCATION_GRAVE) and c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER)
end end
function c59019082.operation(e,tp,eg,ep,ev,re,r,rp) function c59019082.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.DiscardDeck(tp,2,REASON_EFFECT) Duel.DiscardDeck(tp,2,REASON_EFFECT)
local dg=Duel.GetOperatedGroup() local dg=Duel.GetOperatedGroup()
local d=dg:FilterCount(c59019082.filter,nil) local d=dg:FilterCount(c59019082.filter,nil)
......
...@@ -5,7 +5,7 @@ function c8129306.initial_effect(c) ...@@ -5,7 +5,7 @@ function c8129306.initial_effect(c)
e1:SetDescription(aux.Stringid(8129306,0)) e1:SetDescription(aux.Stringid(8129306,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE) e1:SetCode(EVENT_CUSTOM+8129306)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,8129306) e1:SetCountLimit(1,8129306)
...@@ -23,12 +23,32 @@ function c8129306.initial_effect(c) ...@@ -23,12 +23,32 @@ function c8129306.initial_effect(c)
e2:SetTarget(c8129306.lvtg) e2:SetTarget(c8129306.lvtg)
e2:SetOperation(c8129306.lvop) e2:SetOperation(c8129306.lvop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not c8129306.global_check then
c8129306.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_RELEASE)
ge2:SetCondition(c8129306.regcon)
ge2:SetOperation(c8129306.regop)
Duel.RegisterEffect(ge2,0)
end
end end
function c8129306.spfilter(c,tp) function c8129306.spfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end end
function c8129306.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(c8129306.spfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c8129306.spfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c8129306.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+8129306,re,r,rp,ep,e:GetLabel())
end
function c8129306.spcon(e,tp,eg,ep,ev,re,r,rp) function c8129306.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c8129306.spfilter,1,nil,tp) return ev==tp or ev==PLAYER_ALL
end end
function c8129306.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c8129306.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
......
...@@ -39,8 +39,12 @@ function c98095162.initial_effect(c) ...@@ -39,8 +39,12 @@ function c98095162.initial_effect(c)
e3:SetOperation(c98095162.thop) e3:SetOperation(c98095162.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c98095162.attfilter(c,att)
return c:GetLinkAttribute()&att==0
end
function c98095162.lcheck(g) function c98095162.lcheck(g)
return g:GetClassCount(Card.GetLinkAttribute)==1 and g:GetClassCount(Card.GetLinkRace)==g:GetCount() local tc=g:GetFirst()
return not g:IsExists(c98095162.attfilter,1,tc,tc:GetLinkAttribute()) and g:GetClassCount(Card.GetLinkRace)==#g
end end
function c98095162.tgcon(e,tp,eg,ep,ev,re,r,rp) function c98095162.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
......
...@@ -29,8 +29,7 @@ function c99861526.rdcon(e) ...@@ -29,8 +29,7 @@ function c99861526.rdcon(e)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end end
function c99861526.rval(e,damp) function c99861526.rval(e,damp)
local c=e:GetHandler() if damp==1-e:GetHandlerPlayer() then
if damp==1-e:GetHandlerPlayer() and not c:IsHasEffect(EFFECT_CHANGE_BATTLE_DAMAGE) then
return e:GetHandler():GetBaseAttack() return e:GetHandler():GetBaseAttack()
else return -1 end else return -1 end
end end
......
...@@ -732,8 +732,8 @@ OPCODE_ISTYPE =0x40000102 ...@@ -732,8 +732,8 @@ OPCODE_ISTYPE =0x40000102
OPCODE_ISRACE =0x40000103 OPCODE_ISRACE =0x40000103
OPCODE_ISATTRIBUTE =0x40000104 OPCODE_ISATTRIBUTE =0x40000104
-- --
DOUBLE_DAMAGE =0x80000000 DOUBLE_DAMAGE =-2147483648
HALF_DAMAGE =0x80000001 HALF_DAMAGE =-2147483647
--Hint Message --提示消息,显示在窗口的上面 --Hint Message --提示消息,显示在窗口的上面
HINTMSG_RELEASE =500 --请选择要解放的卡 HINTMSG_RELEASE =500 --请选择要解放的卡
HINTMSG_DISCARD =501 --请选择要丢弃的手牌 HINTMSG_DISCARD =501 --请选择要丢弃的手牌
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment