#Just started working on a card game with

1 messages · Page 1 of 1 (latest)

nimble zenith
#

I guess one possible solution could be to have the card have a list of <Effect, int> tuples where the int is the value?

fiery laurel
#

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

nimble zenith
#

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?

fiery laurel
#

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

nimble zenith
#

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!

fiery laurel
#

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 🙂

nimble zenith
#

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.

fiery laurel