Skip to content

Commit

Permalink
fix(cards): + Keep in Mind +
Browse files Browse the repository at this point in the history
Fixes #319
  • Loading branch information
db0 committed May 2, 2022
1 parent addd39f commit 8e56cf5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .gut_editor_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"hide_orphans": false,
"ignore_pause": true,
"include_subdirs": false,
"inner_class": "TestQuicken",
"inner_class": "TestKeepInMindPlus",
"junit_xml_file": "",
"junit_xml_timestamp": false,
"log_level": 3,
"opacity": 68,
"post_run_script": "",
"pre_run_script": "",
"prefix": "test_",
"selected": "test_effects_versatile.gd",
"selected": "test_Vindictive.gd",
"should_exit": false,
"should_exit_on_success": false,
"should_maximize": true,
Expand All @@ -33,7 +33,7 @@
"tests": [

],
"unit_test_name": "test_super_negative_quicken_and_intents",
"unit_test_name": "test_card_results",
"gut_on_top": true,
"panel_options": {
"font_name": "CourierPrime",
Expand Down
1 change: 1 addition & 0 deletions src/dreamscape/cards/sets/SetScripts_Vindictive.gd
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const KeepInMind = {
},
"sort_by": "random",
"src_container": "hand",
"up_to": true,
},
{
"name": "move_card_to_container",
Expand Down
30 changes: 30 additions & 0 deletions tests/integration/cards/test_Vindictive.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,36 @@ class TestKeepInMind:
found_frozen += 1
assert_eq(found_frozen, 2, "One random card got frozen tag")

class TestKeepInMindPlus:
extends "res://tests/HUT_Ordeal_CardTestClass.gd"
func _init() -> void:
testing_card_name = "+ Keep in Mind +"
globals.test_flags["test_initial_hand"] = true
globals.test_flags["no_refill"] = false
expected_amount_keys = [
"beneficial_integer",
]
test_card_names = [
]

func test_card_results():
var hcards = hand.get_all_cards()
var other_cards := []
for iter in hand.get_card_count():
if hcards[iter].canonical_name != testing_card_name:
other_cards.append(hcards[iter])
if iter < 5:
hcards[iter].modify_property("Tags", Terms.GENERIC_TAGS.frozen.name)
var sceng = execute_with_yield(card)
if sceng is GDScriptFunctionState:
sceng = yield(sceng, "completed")
var found_frozen := 0
for sel_card in other_cards:
if sel_card.properties.Tags.has(Terms.GENERIC_TAGS.frozen.name):
found_frozen += 1
assert_eq(found_frozen, 5, "All random cards got frozen tag")
assert_eq(card.get_parent(), forgotten, "Card Played")

class TestAngerMemento:
extends "res://tests/HUT_Ordeal_CardTestClass.gd"
var effect: String = Terms.ACTIVE_EFFECTS.burn.name
Expand Down

0 comments on commit 8e56cf5

Please sign in to comment.