--Akil, Pharaohnic Alchemist local id,cod=23251034,c23251034 function cod.initial_effect(c) --Normal Summon local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LIMIT_SUMMON_PROC) e1:SetCondition(cod.ttcon) e1:SetOperation(cod.ttop) e1:SetValue(SUMMON_TYPE_ADVANCE) c:RegisterEffect(e1) --Cannot Set local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_LIMIT_SET_PROC) e2:SetCondition(cod.setcon) c:RegisterEffect(e2) --SP Summon Rule local e3=Effect.CreateEffect(c) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e3) --ATK/DEF local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_SET_BASE_ATTACK) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetValue(cod.val) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_SET_BASE_DEFENSE) c:RegisterEffect(e5) --Activate local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e6:SetCode(EVENT_CHAINING) e6:SetRange(LOCATION_MZONE) e6:SetOperation(aux.chainreg) c:RegisterEffect(e6) local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(id,0)) e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e7:SetCode(EVENT_CHAIN_SOLVING) e7:SetRange(LOCATION_MZONE) -- e7:SetCountLimit(1) e7:SetCondition(cod.effcon) e7:SetTarget(cod.efftg) e7:SetOperation(cod.effop) c:RegisterEffect(e7) end function cod.setcon(e,c,minc) if not c then return true end return false end function cod.ttcon(e,c,minc) if c==nil then return true end return minc<=3 and Duel.CheckTribute(c,3) end function cod.ttop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.SelectTribute(tp,c,3,3) c:SetMaterial(g) Duel.Release(g,REASON_SUMMON+REASON_MATERIAL) end function cod.vfilter(c) return c:IsSetCard(0xd3e) and c:IsType(TYPE_MONSTER) end function cod.val(e,c) return Duel.GetMatchingGroup(cod.vfilter,c:GetControler(),LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)*400 end function cod.effcon(e,tp,eg,ep,ev,re,r,rp) return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0xd3e) end function cod.efftg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) local op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) e:SetLabel(op) if op==0 then e:SetCategory(CATEGORY_RECOVER) Duel.SetTargetPlayer(tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500) else e:SetCategory(CATEGORY_DAMAGE) Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end end function cod.effop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if e:GetLabel()==0 then Duel.Recover(p,d,REASON_EFFECT) else Duel.Damage(p,d,REASON_EFFECT) end end