Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add start card rule affecting all heroes. #106

Merged
merged 4 commits into from
Feb 6, 2022
Merged

Conversation

orendain
Copy link
Owner

@orendain orendain commented Feb 5, 2022

Resolves #80 .

Note: Haven't gotten around to testing this. Feels like it should work, but can't confirm.

@jimconner In case you happen to want to play with this, feel free to merge if it checks out. Else, I can try to test in the next couple of days.

@orendain orendain added type: feature New feature, enhancement or request area: houserules/essentials The collection of default rules and rulesets for HouseRules labels Feb 5, 2022
@orendain orendain self-assigned this Feb 5, 2022
@orendain orendain marked this pull request as ready for review February 6, 2022 13:56
Copy link
Collaborator

@jimconner jimconner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the following ruleset.

var guardianCards = new List<Rules.StartCardsModifiedRule.CardConfig>()
                {
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Whirlwind, IsReplenishable = true },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Zap, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.CoinFlip, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Freeze, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Fireball, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.ReplenishArmor, IsReplenishable = true },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Heal, IsReplenishable = false },
                };
            var hunterCards = new List<Rules.StartCardsModifiedRule.CardConfig>()
                {
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.PiercingSpear, IsReplenishable = true },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Zap, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Speed, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.HunterArrow, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Fireball, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Heal, IsReplenishable = false },
                };
            var sorcererCards = new List<Rules.StartCardsModifiedRule.CardConfig>()
                {
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Whirlwind, IsReplenishable = true },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Zap, IsReplenishable = true },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Fireball, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Fireball, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Fireball, IsReplenishable = false },
                    new Rules.StartCardsModifiedRule.CardConfig() { Card = AbilityKey.Heal, IsReplenishable = false },
                };

            var startCardRules = new List<Rule>
            {
                new Rules.StartCardsModifiedRule(new Dictionary<DataKeys.BoardPieceId, List<Rules.StartCardsModifiedRule.CardConfig>>()
            {
                { BoardPieceId.HeroGuardian, guardianCards },
                { BoardPieceId.HeroHunter, hunterCards },
                { BoardPieceId.HeroSorcerer, sorcererCards },
            }),
            };

            var startCardRuleset = Ruleset.NewInstance("StartCardRuleset", "New starting hands for Guardian, Hunter and Sorcerer", startCardRules);
            registrar.Register(startCardRuleset);

Changes are not having any effect at the moment. I'll see if I can work out why.

Copy link
Collaborator

@jimconner jimconner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the issue that was stopping this working and have pushed another commit with the fix.

Should all be good to merge now.

@jimconner jimconner merged commit e2d529d into main Feb 6, 2022
@jimconner jimconner deleted the eo/start-card-rule branch February 6, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: houserules/essentials The collection of default rules and rulesets for HouseRules type: feature New feature, enhancement or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rule to set start cards.
3 participants