Rebalance most languages and revamp main game loop
This commit is contained in:
@@ -74,15 +74,15 @@ public class CardCatalogTests
|
||||
yield return new TestCaseData("shop_hs_dollar_bang", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Haskell|_maxAmount=5|_minAmount=5|_trueDamage=False;ShieldEffect|_amount=2", true, false, false,
|
||||
"stack: deal 5. gain 2 Shield.",
|
||||
"stack: deal 7. gain 4 Shield. [upgraded]").SetName("Catalog_preserves_shop_hs_dollar_bang");
|
||||
yield return new TestCaseData("lang_py_print", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Python|_maxAmount=3|_minAmount=3|_trueDamage=False", false, false, false,
|
||||
"queue: deal 3.",
|
||||
"queue: deal 5. [upgraded]").SetName("Catalog_preserves_lang_py_print");
|
||||
yield return new TestCaseData("lang_py_import_antigravity", "DrawEffect|_count=2", false, false, false,
|
||||
"queue: draw 2.",
|
||||
"queue: draw 4. [upgraded]").SetName("Catalog_preserves_lang_py_import_antigravity");
|
||||
yield return new TestCaseData("lang_py_for_loop", "DealDamageEffect|_allEnemies=True|_canCrit=True|_language=Python|_maxAmount=2|_minAmount=2|_trueDamage=False", false, true, false,
|
||||
"queue: deal 2 to all enemies.",
|
||||
"queue: deal 4 to all enemies. [upgraded]").SetName("Catalog_preserves_lang_py_for_loop");
|
||||
yield return new TestCaseData("lang_py_print", "PythonEffect|_amount=4|_operation=Print", true, false, false,
|
||||
"payload: deal 4 to a chosen enemy.",
|
||||
"payload: deal 6 to a chosen enemy. [upgraded]").SetName("Catalog_preserves_lang_py_print");
|
||||
yield return new TestCaseData("lang_py_import_antigravity", "PythonEffect|_amount=2|_operation=Draw", false, false, false,
|
||||
"preparation: immediately draw 2 (fixed).",
|
||||
"preparation: immediately draw 2 (fixed). [upgraded]").SetName("Catalog_preserves_lang_py_import_antigravity");
|
||||
yield return new TestCaseData("lang_py_for_loop", "PythonEffect|_amount=2|_operation=Loop", false, false, false,
|
||||
"modifier: gain 2 Shield. repeat the next payload once. unused repeat expires after next round.",
|
||||
"modifier: gain 4 Shield. repeat the next payload once. unused repeat expires after next round. [upgraded]").SetName("Catalog_preserves_lang_py_for_loop");
|
||||
yield return new TestCaseData("lang_js_console_log", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=JavaScript|_maxAmount=9|_minAmount=3|_trueDamage=False", true, false, true,
|
||||
"deal 3-9.",
|
||||
"deal 5-11. [upgraded]").SetName("Catalog_preserves_lang_js_console_log");
|
||||
@@ -92,51 +92,51 @@ public class CardCatalogTests
|
||||
yield return new TestCaseData("lang_rs_fn_main", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Rust|_maxAmount=6|_minAmount=6|_trueDamage=False", true, false, true,
|
||||
"deal 6. overkill becomes shield.",
|
||||
"deal 8. overkill becomes shield. [upgraded]").SetName("Catalog_preserves_lang_rs_fn_main");
|
||||
yield return new TestCaseData("lang_rs_unwrap", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Rust|_maxAmount=9|_minAmount=9|_trueDamage=False;DrawEffect|_count=1", true, false, true,
|
||||
"deal 9. overkill becomes shield. draw 1.",
|
||||
"deal 11. overkill becomes shield. draw 3. [upgraded]").SetName("Catalog_preserves_lang_rs_unwrap");
|
||||
yield return new TestCaseData("lang_rs_unwrap", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Rust|_maxAmount=5|_minAmount=5|_trueDamage=False;FixedDrawEffect|_count=1", true, false, true,
|
||||
"deal 5. overkill becomes shield. draw 1 (fixed).",
|
||||
"deal 7. overkill becomes shield. draw 1 (fixed). [upgraded]").SetName("Catalog_preserves_lang_rs_unwrap");
|
||||
yield return new TestCaseData("lang_rs_borrow", "ShieldEffect|_amount=5", false, false, false,
|
||||
"gain 5 shield.",
|
||||
"gain 7 shield. [upgraded]").SetName("Catalog_preserves_lang_rs_borrow");
|
||||
yield return new TestCaseData("lang_c_malloc", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=C|_maxAmount=12|_minAmount=12|_trueDamage=False", true, false, true,
|
||||
"deal 12. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card.",
|
||||
"deal 14. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. [upgraded]").SetName("Catalog_preserves_lang_c_malloc");
|
||||
yield return new TestCaseData("lang_c_printf", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=C|_maxAmount=7|_minAmount=7|_trueDamage=False;RepairCorruptedCardsEffect|_count=1", true, false, true,
|
||||
"deal 7. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. then repair up to 1 corrupted card in your active deck.",
|
||||
"deal 9. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. then repair up to 3 corrupted cards in your active deck. [upgraded]").SetName("Catalog_preserves_lang_c_printf");
|
||||
yield return new TestCaseData("lang_c_printf", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=C|_maxAmount=4|_minAmount=4|_trueDamage=False;RepairCorruptedCardsEffect|_count=1", true, false, true,
|
||||
"deal 4. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. then repair up to 1 corrupted card in your active deck.",
|
||||
"deal 6. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. then repair up to 3 corrupted cards in your active deck. [upgraded]").SetName("Catalog_preserves_lang_c_printf");
|
||||
yield return new TestCaseData("lang_c_pointer", "PreviousLanguageDamageEffect|_baseAmount=9|_language=C|_matchingAmount=15", true, false, true,
|
||||
"deal 9; 15 if the previous card was C. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card.",
|
||||
"deal 11; 17 if the previous card was C. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. [upgraded]").SetName("Catalog_preserves_lang_c_pointer");
|
||||
yield return new TestCaseData("lang_java_public_static_main", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Java|_maxAmount=7|_minAmount=7|_trueDamage=False", true, false, true,
|
||||
"uses 2 RAM. deal 7. overkill spills. JIT: Java cards cost 1 less this combat each time you play a Java card; discount decays by 1 after each wave.",
|
||||
"uses 2 RAM. deal 9. overkill spills. JIT: Java cards cost 1 less this combat each time you play a Java card; discount decays by 1 after each wave. [upgraded]").SetName("Catalog_preserves_lang_java_public_static_main");
|
||||
"uses 2 RAM. deal 7. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave.",
|
||||
"uses 2 RAM. deal 9. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave. [upgraded]").SetName("Catalog_preserves_lang_java_public_static_main");
|
||||
yield return new TestCaseData("lang_java_system_out_println", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Java|_maxAmount=5|_minAmount=5|_trueDamage=False", true, false, true,
|
||||
"uses 2 RAM. deal 5. overkill spills. JIT applies; discount decays by 1 after each wave.",
|
||||
"uses 2 RAM. deal 7. overkill spills. JIT applies; discount decays by 1 after each wave. [upgraded]").SetName("Catalog_preserves_lang_java_system_out_println");
|
||||
"uses 2 RAM. deal 5. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave.",
|
||||
"uses 2 RAM. deal 7. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave. [upgraded]").SetName("Catalog_preserves_lang_java_system_out_println");
|
||||
yield return new TestCaseData("lang_java_new_object", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Java|_maxAmount=3|_minAmount=3|_trueDamage=False", true, false, true,
|
||||
"uses 2 RAM. deal 3. overkill spills. JIT applies; discount decays by 1 after each wave.",
|
||||
"uses 2 RAM. deal 5. overkill spills. JIT applies; discount decays by 1 after each wave. [upgraded]").SetName("Catalog_preserves_lang_java_new_object");
|
||||
yield return new TestCaseData("ubuntu_ask_ubuntu", "AskUbuntuEffect", false, false, false,
|
||||
"queue: draw 2.",
|
||||
"queue: draw 4. [upgraded]").SetName("Catalog_preserves_ubuntu_ask_ubuntu");
|
||||
yield return new TestCaseData("ubuntu_unattended_upgrades", "ShieldEffect|_amount=4;ApplyStatusEffect|_duration=2|_skipNextTick=True|_stacks=4|_statusType=UnattendedUpgrades|_targetSelf=True", false, false, false,
|
||||
"queue: gain 4 shield now and next 2 turns.",
|
||||
"queue: gain 6 shield now and next 2 turns. [upgraded]").SetName("Catalog_preserves_ubuntu_unattended_upgrades");
|
||||
"uses 2 RAM. deal 3. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave.",
|
||||
"uses 2 RAM. deal 5. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave. [upgraded]").SetName("Catalog_preserves_lang_java_new_object");
|
||||
yield return new TestCaseData("ubuntu_ask_ubuntu", "PythonEffect|_amount=0|_operation=Inspect", false, false, false,
|
||||
"preparation: inspect the top 3 cards. take one; others keep their order.",
|
||||
"preparation: inspect the top 3 cards. take one; others keep their order. [upgraded]").SetName("Catalog_preserves_ubuntu_ask_ubuntu");
|
||||
yield return new TestCaseData("ubuntu_unattended_upgrades", "PythonEffect|_amount=3|_operation=Unattended", false, false, false,
|
||||
"automation: gain 3 Shield now and before the queue on each of the next 2 rounds. uses 1 of 2 script slots.",
|
||||
"automation: gain 5 Shield now and before the queue on each of the next 2 rounds. uses 1 of 2 script slots. [upgraded]").SetName("Catalog_preserves_ubuntu_unattended_upgrades");
|
||||
yield return new TestCaseData("mint_fix_broken", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=JavaScript|_maxAmount=8|_minAmount=8|_trueDamage=False;CleanseEffect|_harmfulOnly=True", true, false, true,
|
||||
"deal 8. cleanse harmful statuses.",
|
||||
"deal 10. cleanse harmful statuses. [upgraded]").SetName("Catalog_preserves_mint_fix_broken");
|
||||
yield return new TestCaseData("lang_js_typeof", "ChanceDamageEffect|_damageAmount=8|_language=JavaScript|_successPercent=75", true, false, true,
|
||||
"75%: deal 8. 25%: deal 0.",
|
||||
"75%: deal 10. 25%: deal 0. [upgraded]").SetName("Catalog_preserves_lang_js_typeof");
|
||||
yield return new TestCaseData("shop_py_list_append", "QueuedGrowthDamageEffect|_baseAmount=4|_language=Python", true, false, false,
|
||||
"queue: deal 4; +1 each time re-queued.",
|
||||
"queue: deal 8; +1 each time re-queued. [upgraded]").SetName("Catalog_preserves_shop_py_list_append");
|
||||
yield return new TestCaseData("shop_py_async_def", "DrawEffect|_count=2;NextTurnCycleEffect|_amount=1", false, false, false,
|
||||
"queue: draw 2. gain 1 cycle next turn.",
|
||||
"queue: draw 4. gain 3 cycle next turn. [upgraded]").SetName("Catalog_preserves_shop_py_async_def");
|
||||
yield return new TestCaseData("shop_py_zip", "QueueRepeatEffect|_count=2", false, false, false,
|
||||
"next 2 queued cards resolve twice.",
|
||||
"next 4 queued cards resolve twice. [upgraded]").SetName("Catalog_preserves_shop_py_zip");
|
||||
yield return new TestCaseData("lang_js_typeof", "ChanceDamageEffect|_damageAmount=14|_language=JavaScript|_successPercent=75", true, false, true,
|
||||
"75%: deal 14. 25%: deal 0.",
|
||||
"75%: deal 16. 25%: deal 0. [upgraded]").SetName("Catalog_preserves_lang_js_typeof");
|
||||
yield return new TestCaseData("shop_py_list_append", "PythonEffect|_amount=6|_operation=List", true, false, false,
|
||||
"payload: deal 6. +2 per subsequent hand play this wave; replays do not grow it.",
|
||||
"payload: deal 12. +2 per subsequent hand play this wave; replays do not grow it. [upgraded]").SetName("Catalog_preserves_shop_py_list_append");
|
||||
yield return new TestCaseData("shop_py_async_def", "PythonEffect|_amount=0|_operation=Async", false, false, false,
|
||||
"automation: draw 1 immediately on play (fixed). capture the next payload without modifiers; replay it before the queue on each of the next 2 rounds. uses 1 of 2 script slots.",
|
||||
"automation: draw 1 immediately on play (fixed). capture the next payload without modifiers; replay it before the queue on each of the next 2 rounds. uses 1 of 2 script slots. [upgraded]").SetName("Catalog_preserves_shop_py_async_def");
|
||||
yield return new TestCaseData("shop_py_zip", "PythonEffect|_amount=2|_operation=Zip", true, false, false,
|
||||
"modifier: deal 2. the next single-target damage payload hits all enemies. unused conversion expires after next round.",
|
||||
"modifier: deal 4. the next single-target damage payload hits all enemies. unused conversion expires after next round. [upgraded]").SetName("Catalog_preserves_shop_py_zip");
|
||||
yield return new TestCaseData("shop_js_math_random", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=JavaScript|_maxAmount=20|_minAmount=2|_trueDamage=False", true, false, true,
|
||||
"deal 2-20.",
|
||||
"deal 4-22. [upgraded]").SetName("Catalog_preserves_shop_js_math_random");
|
||||
@@ -152,24 +152,24 @@ public class CardCatalogTests
|
||||
yield return new TestCaseData("ubuntu_do_release_upgrade", "UpgradeHandCardsEffect|_maxCount=3|_minCount=1", false, false, false,
|
||||
"upgrade 1-3 random hand cards.",
|
||||
"upgrade 3-5 random hand cards. [upgraded]").SetName("Catalog_preserves_ubuntu_do_release_upgrade");
|
||||
yield return new TestCaseData("ubuntu_apt_install", "GenerateCardEffect|_language=Python|_rarity=Common", false, false, false,
|
||||
"queue: generate a random common Python card at 0c.",
|
||||
"queue: generate a random common Python card at 0c. [upgraded]").SetName("Catalog_preserves_ubuntu_apt_install");
|
||||
yield return new TestCaseData("ubuntu_apt_install", "PythonEffect|_amount=0|_operation=Install", false, false, false,
|
||||
"preparation: choose one of 3 Python cards. temporary copy costs 0 this turn and exhausts after play.",
|
||||
"preparation: choose one of 3 Python cards. temporary copy costs 0 this turn and exhausts after play. [upgraded]").SetName("Catalog_preserves_ubuntu_apt_install");
|
||||
yield return new TestCaseData("ubuntu_pro_trial", "NoOpCardEffect|_message=ubuntu pro trial is unplayable", false, false, false,
|
||||
"unplayable. exhausts at end of combat.",
|
||||
"unplayable. exhausts at end of combat. [upgraded]").SetName("Catalog_preserves_ubuntu_pro_trial");
|
||||
yield return new TestCaseData("mint_update_manager", "UpdateManagerEffect|_amount=5", false, false, false,
|
||||
"queue: deal 5 to all enemies. repeats at the end of your next turn.",
|
||||
"queue: deal 7 to all enemies. repeats at the end of your next turn. [upgraded]").SetName("Catalog_preserves_mint_update_manager");
|
||||
yield return new TestCaseData("mint_cinnamon", "ShieldEffect|_amount=3;DrawEffect|_count=1", false, false, false,
|
||||
"queue: gain 3 shield. draw 1.",
|
||||
"queue: gain 5 shield. draw 3. [upgraded]").SetName("Catalog_preserves_mint_cinnamon");
|
||||
yield return new TestCaseData("mint_update_manager", "PythonEffect|_amount=3|_operation=Update", false, true, false,
|
||||
"payload: deal 3 to all enemies; 5 if an automation ran earlier this phase.",
|
||||
"payload: deal 5 to all enemies; 7 if an automation ran earlier this phase. [upgraded]").SetName("Catalog_preserves_mint_update_manager");
|
||||
yield return new TestCaseData("mint_cinnamon", "PythonEffect|_amount=3|_operation=Cinnamon", false, false, false,
|
||||
"payload: gain 3 Shield; 5 if an earlier Python payload dealt damage this phase.",
|
||||
"payload: gain 5 Shield; 7 if an earlier Python payload dealt damage this phase. [upgraded]").SetName("Catalog_preserves_mint_cinnamon");
|
||||
yield return new TestCaseData("mint_nemo", "ConditionalShieldRepeatDamageEffect|_amount=6|_language=JavaScript", true, false, true,
|
||||
"deal 6. if you have shield, deal it again.",
|
||||
"deal 8. if you have shield, deal it again. [upgraded]").SetName("Catalog_preserves_mint_nemo");
|
||||
yield return new TestCaseData("mint_timeshift", "TimeshiftSnapshotEffect", false, false, false,
|
||||
"queue: record uptime now. at end of your next turn, restore to it if lower.",
|
||||
"queue: record uptime now. at end of your next turn, restore to it if lower. [upgraded]").SetName("Catalog_preserves_mint_timeshift");
|
||||
yield return new TestCaseData("mint_timeshift", "PythonEffect|_amount=0|_operation=Timeshift", false, false, false,
|
||||
"automation: save your Uptime when this resolves. after enemies act in each of the next 2 rounds, heal up to 6 Uptime, without exceeding the saved value. no healing this round or if defeated. healing does not scale with upgrades. uses 1 of 2 script slots until both rounds finish; ends when the wave ends.",
|
||||
"automation: save your Uptime when this resolves. after enemies act in each of the next 2 rounds, heal up to 6 Uptime, without exceeding the saved value. no healing this round or if defeated. healing does not scale with upgrades. uses 1 of 2 script slots until both rounds finish; ends when the wave ends. [upgraded]").SetName("Catalog_preserves_mint_timeshift");
|
||||
yield return new TestCaseData("fedora_dnf_autoremove", "DnfAutoremoveEffect|_cycleGain=1|_damageAmount=7", true, false, true,
|
||||
"deal 7. exhaust a junk/NOP/broken card from hand; if you do, gain 1 cycle. if not, do nothing.",
|
||||
"deal 9. exhaust a junk/NOP/broken card from hand; if you do, gain 3 cycle. if not, do nothing. [upgraded]").SetName("Catalog_preserves_fedora_dnf_autoremove");
|
||||
@@ -177,8 +177,8 @@ public class CardCatalogTests
|
||||
"deal 7. Java cards cost 1 less this turn.",
|
||||
"deal 9. Java cards cost 1 less this turn. [upgraded]").SetName("Catalog_preserves_fedora_first_to_package");
|
||||
yield return new TestCaseData("fedora_dnf_update", "DealDamageEffect|_allEnemies=False|_canCrit=True|_language=Java|_maxAmount=9|_minAmount=9|_trueDamage=False", true, false, true,
|
||||
"deal 9. overkill spills. costs 1 less per Java card played this combat.",
|
||||
"deal 11. overkill spills. costs 1 less per Java card played this combat. [upgraded]").SetName("Catalog_preserves_fedora_dnf_update");
|
||||
"deal 9. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave.",
|
||||
"deal 11. overkill spills. JIT: -1 Cycle per 2 Java plays, capped at -3; discount cools by 1 after each wave. [upgraded]").SetName("Catalog_preserves_fedora_dnf_update");
|
||||
yield return new TestCaseData("fedora_rawhide", "RawhideEffect", false, false, false,
|
||||
"draw 2. next card this turn gains bleeding edge.",
|
||||
"draw 4. next card this turn gains bleeding edge. [upgraded]").SetName("Catalog_preserves_fedora_rawhide");
|
||||
@@ -192,8 +192,8 @@ public class CardCatalogTests
|
||||
"fix a broken card and draw 1; if none, deal 6.",
|
||||
"fix a broken card and draw 3; if none, deal 8. [upgraded]").SetName("Catalog_preserves_arch_consult_wiki");
|
||||
yield return new TestCaseData("arch_makepkg", "BtwScaledDamageEffect|_baseAmount=7|_language=C|_perBtw=3", true, false, true,
|
||||
"deal 7 + btw x3; x4 at Arch v3+. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card.",
|
||||
"deal 9 + btw x3; x4 at Arch v3+. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. [upgraded]").SetName("Catalog_preserves_arch_makepkg");
|
||||
"deal 7 + btw x3. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card.",
|
||||
"deal 9 + btw x3. 50% of overkill spills per jump (rounded down). 25%: segfault, uptime -3 and corrupt a hand card. [upgraded]").SetName("Catalog_preserves_arch_makepkg");
|
||||
yield return new TestCaseData("arch_aur_helper", "RandomCommonLanguageCardEffect", false, false, false,
|
||||
"add a random C/Rust common card to hand; it costs 0 this turn.",
|
||||
"add a random C/Rust common card to hand; it costs 0 this turn. [upgraded]").SetName("Catalog_preserves_arch_aur_helper");
|
||||
@@ -345,6 +345,19 @@ public class CardCatalogTests
|
||||
}
|
||||
}
|
||||
|
||||
[TestCase("arch", 2, 3)]
|
||||
[TestCase("arch", 3, 4)]
|
||||
[TestCase("arch", 5, 4)]
|
||||
[TestCase("ubuntu", 5, 3)]
|
||||
public void MakepkgShowsOnlyTheActiveVersionMultiplier(string distro, int version, int multiplier)
|
||||
{
|
||||
var card = new CardInstance(Database.FindById("arch_makepkg"));
|
||||
card.ApplyMagnitudeUpgrade(2);
|
||||
string rules = CardEffectFactory.GetRulesText(card, distro, version);
|
||||
Assert.That(rules, Does.StartWith($"deal 9 + btw x{multiplier}."));
|
||||
Assert.That(rules, Does.Not.Contain("v3"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SerializedOverrideStillWinsAndUsesItsOwnDescription()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user