#Just started working on a card game with
1 messages · Page 1 of 1 (latest)
I guess one possible solution could be to have the card have a list of <Effect, int> tuples where the int is the value?
These are three different approaches. Either have a class that gets called, or scriptable object that is ONE set of data you cant alter when adding to a list, or make it a simple class that holds different types for example or values, soy ou can add them to a list of a script on your prefab
I am proposing three different solutions yes, not 100% happy with any of them (but after typing it out I'm leaning towards having both cards and effect be scriptable objects, and have the cards store a list of <Effect, value> pairs).
or make it a simple class that holds different types for example or values, soy ou can add them to a list of a script on your prefab
Not sure what you mean by this?
Something like a subclass sandbox?
Like public class Effect() which has like default virtual functions and you can override with subclasses or just alter the values in your card. But that way, you would never be able to reuse one effect. So I guess scriptableobject with pair might be the best shot
Orrr, use a database
I mean at some point, you will have to have a dataobject for dmg 5, dmg 7 and so on. either as SOs or in a database or a List
That's what I'm doing right now yes, with MonoBehaviors so they are reusable. But not loving this for a few reasons (mainly that cards have to be prefabs).
Yep, true. So a database has the same problems. And the more I think about it I realize I want to have the values stored in the cards. So will try out option #3 now.
Thanks for taking the time!
Yeah, if you do not want to reuse the effects anyway, just make your cards have a list of class effects that can do whatever you want to alter 🙂
You mean that effects would be scriptable objects right?
Or methods that get called by an event maybe? Come to think of it that might be better.
Yeah, you have a list of CardEvents and those can like DoDmg(float amount) or Heal or hold time orwhat not. And maybe more special functions that combine things or register the card in a list that adds up to a round based event , etc etc