HurahItsHerald
Member Title : HeraldIsHereHoney Posts : 15 Join date : 2015-08-25
| Subject: Volcanoes and counters Tue Aug 25, 2015 5:33 pm | |
| [ Field Spell ] : Once per turn: You can remove 2 Volcano Counters from this card; activate 1 of these effects, and if you do, during your End Phase, place 2 Volcano Counters on this card. ● Choose 1 player; inflict 1000 damage to that player. ● Target 1 face-up monster on the field; it loses 1000 ATK & DEF. [script ]: - Code:
-
function c67810.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --reserved --damage local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(67810,0)) e3:SetCategory(CATEGORY_DAMAGE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1) e3:SetCost(c67810.fbcost) e3:SetTarget(c67810.fbtg) e3:SetOperation(c67810.fbop) c:RegisterEffect(e3) --atk & def down local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(67810,3)) e4:SetCategory(CATEGORY_DEFCHANGE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_FZONE) e4:SetCountLimit(1) e4:SetCost(c67810.fbcost) e4:SetTarget(c67810.fb2tg) e4:SetOperation(c67810.fb2op) c:RegisterEffect(e4) end function c67810.fbcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x781,2,REASON_COST) end e:GetHandler():RemoveCounter(tp,0x781,2,REASON_COST) end function c67810.fbtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local opt=Duel.SelectOption(tp,aux.Stringid(67810,1),aux.Stringid(67810,2)) local p=(opt==0 and tp or 1-tp) Duel.SetTargetPlayer(p) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,1000) end function c67810.fbop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end function c67810.fb2tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function c67810.fb2op(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(-1000) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENCE) tc:RegisterEffect(e2) end end almost complete but , how to add " and if you do, during your End Phase, place 2 Volcano Counters on this card. " ? i use this to test , adding volcano counters : [ Normal Spell ] : Target 1 "Volcano NAME HERE" Field Spell Card on the field; place 2 Volcano Counters on it. You can only activate 1 "Volcano Charger" per turn. [ script ] : - Code:
-
--Valcano Charger function c67820.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,67820+EFFECT_COUNT_CODE_OATH) e1:SetTarget(c67820.target) e1:SetOperation(c67820.activate) c:RegisterEffect(e1) end function c67820.filter(c) return c:IsFaceup() and c:GetCode(67810) or c:GetCode(67830) end function c67820.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and c67820.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c67820.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.SelectTarget(tp,c67820.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0x781) end function c67820.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:AddCounter(0x781,2) then end end [ ex-tra information ] strings.conf : !counter 0x781 Volcano Counter scripts text : (67810,0) "Choose 1 player; inflict 1000 damage to that player." (67810,1) "Inflict 1000 damage to yourself." (67810,1) "Inflict 1000 damage to your opponent." (67810,3) "Target 1 face-up monster on the field; it loses 1000 ATK & DEF." thank u |
|
TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Volcanoes and counters Sat Aug 29, 2015 1:52 am | |
| Man I've really not done scripting in like 2 months xD. Check lavalval chain for how to do those "choose 1" effects, I'm pretty sure what you have isn't fully correct for the countlimit. See how you have it, it seems like you can do both effects once per turn. You should check out wind up zenmaines for seeing how to register an effect using a flag, that is, if a condition is met, then the effect will trigger at the appropriate time. Although, you didn't write the add 2 counters as a trigger eff so it might not go how you intended if you do it that way (if you do though, try changing the zenmaines eff to continuous and not trigger) |
|