ID:1516851
 
Code:
obj
var/CardPosition = ""
var/Summoned = 0
var/mob/Owner
var/list/Options = list("Summon", "Set")
Cards
New(turf/t)
src.loc = t
return src
DblClick(usr.Hand)
if(!src.Owner)
src.Owner=usr
if(usr.Dueling == 0)
return
if(usr.currentphase == "Battle Phase")
return
else if(src.Owner==usr&&usr.Dueling == 1)
var/cardoptions = input(usr, "Select Option", "Select")as null | anything in src.Options
if(src in usr.Monsters_on_Field)
return
if(cardoptions == "Summon")
if(usr.Monsters_Played == 5) return
if(usr.Normal_Summoned == TRUE)
usr << "You cannot normal summon this turn"
return
if(usr.isturn == FALSE)
usr << "You cannot normal summon during your opponent's turn!"
return
if(src.Card != "Monster")
return
if(src.Level <= 4)
usr.Normal_Summoned = TRUE
src.Owner = usr
src.CardPosition = "Attack"
src.dir = usr.dir
usr.Hand.Remove(src)
usr.ShowCardsinHand()
var/list/l
if(src.Card=="Monster")
l = usr.field.monsterspaces
for(var/turf/t in l)
if(!(locate(/obj/Cards) in t))
src.loc = t
//usr.Monsters_on_Field += src
usr.Monsters_on_Field.Add(src)
usr.Monsters_Played ++
src.Summoned = 1
if(src.EffectCanActivate() == 1)
src.EffectActivate()
animate(src, alpha = 255, time = 10)

obj
Cards
Bladefly
EffectActivate()
for(var/obj/Cards/Card in src.Monsters_on_Field)
if(Card.Attribute == "WIND")
Card.ATK += 500
else if(Card.Attribute == "EARTH")
Card.ATK -= 500
if(Card.ATK < 0)
Card.ATK = 0

for(var/obj/Cards/Card in src.DuelTarget.Monsters_on_Field)
if(Card.Attribute == "WIND")
Card.ATK += 500
else if(Card.Attribute == "Earth")
Card.ATK -= 500
if(Card.ATK < 0)
Card.ATK = 0
EffectCanActivate()
if(src in usr.Monsters_on_Field)
return 1
else
return 0

obj
Cards
var
effecthappenedon = 0
ContinousEffect = 0
proc
EffectActivate()
..()
return 0
EffectCanActivate()
..()
return 0
CheckContinousEffect(var/obj/Cards/C)
//This is my problem here


Problem description:
Basically, what I'm trying to to is take Bladefly's Effect and make it continuous, or in simpler terms, I want it's effect to go off everytime a monster is summoned to the field. I have provided the summoning code and the effect of Bladefly. My problem lies in the "CheckContinuosEffect" proc. I don't know what to put and how to connect the two together. (Connecting the summoning proc, the checkcontinousproc() and the EffectActivate() proc)

What I would do, is explictly pass in the list of monsters and use that list to apply an effect.

EffectActivate(list/Friendly,list/NotFriendly)


Then at the end of playing the card, loop through all the cards and apply the effects placing this card in the friendly or NotFriendly respectively.
Add a new proc for all cards called something like "OnFieldForSummons()" and when ever a monster is summoned cycle through all the cards on the field and run their "OnFieldForSummons()" procs. Then under blade fly's OnFieldForSummons() add it's intended effect.

Also remove that stuff under DblClick to it's own proc for versatility later on.