|
Post by Legend on Mar 29, 2018 1:44:48 GMT
So i am looking and trying to figure out how to make the buff system.
So what i am thinking is kind of the same thing as the DestructatbleSystem instead use a buff system for the amount of Attack Armor and Health and im thinking can just use a - amounts as a debuff system
thoughts?
|
|
|
Post by Legend on Apr 3, 2018 21:11:38 GMT
think what i am going to do is this: - make it similiar to the performdamageaction instead it will be a onperformbuffaction i might have a debuff one as well or i may just use a negative instead on cards in the info section we shall see there - might look better if i add separate debuff action
anywho so itll be pretty much the same as the below but the object will be different (IE combatant for attack - health armor (if applicable) to Iarmored that kind of thing
no sure what to do with the filter attack targets
your prototype is a bit different then your tutorial version
- anyways hope this works and if anyone has any suggestions - im all ears!
void OnPerformDamageAction(object sender, object args) { var action = args as DamageAction; foreach (IDestructable target in action.targets) { target.hitPoints -= action.amount; if (target.hitPoints < 0) target.hitPoints = 0; } }
void OnFilterAttackTargets(object sender, object args) { var candidates = args as List<Card>; for (int i = candidates.Count - 1; i >= 0; --i) { var destructable = candidates as IDestructable; if (destructable == null) candidates.RemoveAt(i); } }
|
|
|
Post by Admin on Apr 4, 2018 20:46:36 GMT
I think that would work. One thing to keep in mind is that you may want to differentiate between a card's base stats and its buff or debuff alteration so that it can be reverted (via other cards) if necessary. So for example, I may have a buff that adds health, and then I have that object store the amount it added so that if it is removed it will remove the same amount it added.
|
|
|
Post by Legend on Apr 5, 2018 14:10:24 GMT
ya im not quite sure how to do that - would i instantiate a separate object for each buff so that it can be interacted with by the player ? meaning i would need to display the buff on the screen as well - unless i chose a system in which the buff debuffs taken off were auto targetted either manual or FIFO/LIFO or something? that adds another complexity to the targetting system cause now the spell can target buffs and debuffs
|
|
|
Post by Legend on Apr 5, 2018 20:31:20 GMT
k so what i am doing
creating a
public class IBuffable { int BonusAttack { get; set; } int BonusArmor { get; set; } int BonusHealth { get; set; } }
then ill attach that to the minions and hero
that should take care of the total bonus stuff i think
then ill have a list on that hero / minions each of buffs and one of debuffs that buff card and debuff card will be a Card type as well as itself when a card is cast i will somehow add that card to the buff list of that targeted w/e then i have to create a method of summing that totalbonus from the list of buffs and minusing the total debuffs of each stat
buff class inherits Card and has public int duration; public int amount; public string stat;
ill add a string in the json for the stat to boost or something
does that sound about right?
|
|
|
Post by Legend on Apr 6, 2018 17:20:24 GMT
k so buff : CArd
public int duration; public int amount; public string stat;
which ienchantable has list <Buff> Buffs;
which Hero inherits Ienchantable
so far i have that and now i have to figure out how to implement the boosting process with the system you designed.
|
|
|
Post by Legend on Apr 6, 2018 18:14:55 GMT
so I create a buffsystem which will i think take your onperformchangeturn and onprepare play card using the similiar login to the minion except what i would do is not summon a minioon or anything but i need to somehow get the target information from when the card is played to attach that Blessing card to the blessing list of that target (minion or hero)...i am not entirely sure how the targetting works - how would i be able to pass the Buff to the target's list or even all the target's list - i am thinking its similiar to the way you deal damage to single or all of the targets - going to the damagesystem it is.
|
|
|
Post by Legend on Apr 7, 2018 3:53:15 GMT
I am missing how to make sure the action system is taken into consideration - this is a doozy of an issue - damage action wont work because its more of a one off case - and the ability is close but doesnt have a duration one as well - i can probably add one but that still doesnt really help because i still need a hwhole new system for targeting and removing the buff - so i have to figure out how to make sure i do this correctly through that appropriate gameaction container system you made.
|
|
|
Post by Legend on Apr 8, 2018 23:16:20 GMT
getting there - made it an ability and it creates a buff which adds to the list of the target...almost there - just gotta figure out why i am getting some object reference note set to an instance errors
|
|
|
Post by Admin on Apr 9, 2018 14:41:52 GMT
Just came back from a nice vacation. Sounds like you are learning a lot and are making progress, so that's good. I can confirm that the approach you should take is to create a new system for this - all features should exist in their own system. This is an architectural practice where everything should have a single responsibility. I might approach this challenge by making an aspect of a card rather than making a subclass of a card. You can still check things like whether the card conforms to a type of interface to know if a certain type of buff is relevant or not. Their should be a new action to apply the aspect to a card, and the buff system would observe the action to "apply" it. In Hearthstone, buffs and debuffs are applied and are displayed as parts of the card. You dont target individual buffs to modify, so if you were to say, '"silence" the card, then all buffs would be removed.
Good luck!
|
|
|
Post by Legend on Apr 13, 2018 19:50:52 GMT
glad that your vacay was nice! - i think thats what i did - basically created a new action in the system added the buff to the list of buffs and refresh the stats all within the onperformbuffaction
it works anyways! now on to making it look a little better as far as the click system goes
-clicking should bring the card up and enlarge - upon click off should shrink the card back to the hand -click and hold on card should make the card small and depending on card highlight if valid target -select a hero will bring up a larger - perhaps even look like a card version of the hero - in which it ill show its stats and buffs - same thing with a minion
|
|
|
Post by Admin on Apr 16, 2018 16:55:26 GMT
Sounds cool - good luck on your improvements
|
|