|
Post by Legend on Mar 18, 2018 4:10:29 GMT
Hey I am trying to simulate a card minion play for free right off the get go need some help as it isnt working - im guessing i am missing some sort of reference or something to actually summon it - no errors when i run but i expect a minion to just summon right away. thanks! daniel
var keeper = new Minion();
keeper.allowedAttacks = 1;
keeper.attack = 2;
keeper.hitPoints = keeper.maxHitPoints = 5;
keeper.name = "bill";
keeper.cost = 0;
keeper.id = "keeper1";
keeper.text = "test";
keeper.ownerIndex = p.index;
var summon = new SummonMinionAction(keeper);
container.AddReaction(summon);
var cardSystem = container.GetAspect<CardSystem>();
cardSystem.ChangeZone(summon.minion, Zones.Battlefield);
|
|
|
Post by Legend on Mar 18, 2018 4:16:34 GMT
forgot to mention i put that within the
foreach (Player p in match.players)
|
|
|
Post by Legend on Mar 18, 2018 18:16:48 GMT
o man i figured it out i think
added
if (card != null) to dismiss method
and changed it to this
var summon = new SummonMinionAction(keeper);
_container.Perform(summon);
container.AddReaction(summon);
|
|
|
Post by Admin on Mar 19, 2018 14:40:46 GMT
A few notes: 1.) "Add Reaction" only works while an action is already playing and even then should only be used at intended times such as during the various callbacks posted by the action system 2.) "Perform" is probably a better approach because it begins a new action. You don't need to use a second call of "AddReaction" with the same action that you used "Perform" with. 3.) If you want to start the game with a card already in play (such as a Hero card in Hearthstone), then you probably don't need to use the action system at all. Just create the card with the proper settings, zone, etc and make sure to account for it during setup of the game (such as for creating a proper view to represent it).
|
|
|
Post by legend on Mar 20, 2018 3:48:48 GMT
o i kind of thought that when i looked through the code some more later but i had already reverted my changes and just modified the heroes and multiplied by 3 - actually took some doing ...i got them created targetting victory stuff working just trying to figure out how to make them become untargetable and unusable except for certain cards ( like a revive or something). thanks for the help and tips as i will probably need those for my next installment which will be the secrets
|
|