Skip to content

Commit

Permalink
Merge pull request #52 from ArcaneAssemblers/willem/latest-cards
Browse files Browse the repository at this point in the history
Update card functionality to latest from table
  • Loading branch information
willemolding authored Jan 17, 2024
2 parents c4691fd + 2deeccd commit 9407ddc
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 130 deletions.
Binary file modified card-gen/src/card/__pycache__/card.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/card/__pycache__/card_builder.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/deck/__pycache__/deck.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/deck/__pycache__/deck_builder.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/gen/__pycache__/generator.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/layer/__pycache__/card_layer.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file modified card-gen/src/layer/__pycache__/image_card_layers.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/layer/__pycache__/text_card_layers.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/param/__pycache__/config_enums.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/param/__pycache__/input_parameters.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/provider/__pycache__/input_provider.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file modified card-gen/src/util/__pycache__/helpers.cpython-311.pyc
Binary file not shown.
Binary file modified card-gen/src/util/__pycache__/placement.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion cards.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"19","Gypsum Flower","cave","1",,,,,"2",,,,"-1",,,,,,,"A delicate curved and coiled crystal.","TRUE"
"20","Wolf Spider","cave_familiar","1",,,,,,,"1",,,,,,,,,"Once per turn you can send the Wolf Spider to collect 1 trinket from the Cave","FALSE"
"21","Bone","forest","1",,,,,"2","1",,"-2",,,,,,,,"A crunchy little rat bone","TRUE"
"22","Rat Heart","forest","1",,,,,"3","2",,"-3",,,,"-1",,,,"The still-beating heart of a rat","TRUE"
"22","Rat Heart","forest","1",,,,,"3","2",,"-3",,,,,,,,"The still-beating heart of a rat","TRUE"
"23","Quartz","forest","1",,,"2",,,"-3",,,,,,,,,,"A chunk of quartz. It feels stabilising in some way","TRUE"
"24","Pine Resin","forest","1",,,,,"-1","-2",,"1",,,,,,,,"Sticky sap from a pine tree","TRUE"
"25","Moss","forest","1",,,,,,"-2",,"-1",,,,,,,,"Soft green moss","TRUE"
Expand Down
4 changes: 2 additions & 2 deletions client/ren_client/generated/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,13 @@
"lightdark_delta": "",
"power_delta_fallback": "",
"chaos_delta_fallback": "",
"hotcold_delta_fallback": "-1",
"hotcold_delta_fallback": "",
"lightdark_delta_fallback": "",
"swaps_hotcold": "",
"swaps_lightdark": "",
"flavour": "The still-beating heart of a rat",
"consumable": "TRUE",
"description": "+3 POWER\n+2 CHAOS\n+3 COLD\nElse:\n +1 COLD\n"
"description": "+3 POWER\n+2 CHAOS\n+3 COLD\n"
},
{
"card_id": "23",
Expand Down
4 changes: 2 additions & 2 deletions client/src/generated/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,13 @@
"lightdark_delta": "",
"power_delta_fallback": "",
"chaos_delta_fallback": "",
"hotcold_delta_fallback": "-1",
"hotcold_delta_fallback": "",
"lightdark_delta_fallback": "",
"swaps_hotcold": "",
"swaps_lightdark": "",
"flavour": "The still-beating heart of a rat",
"consumable": "TRUE",
"description": "+3 POWER\n+2 CHAOS\n+3 COLD\nElse:\n +1 COLD\n"
"description": "+3 POWER\n+2 CHAOS\n+3 COLD\n"
},
{
"card_id": "23",
Expand Down
34 changes: 27 additions & 7 deletions contracts/src/cards/actions.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use spellcrafter::types::{Action, Region};
use spellcrafter::cards::properties::{
consumable, chaos_delta, power_delta, hotcold_delta, lightdark_delta, requires_cold_gt,
requires_hot_gt, requires_light_gt, requires_dark_gt, chaos_delta_fallback,
power_delta_fallback, hotcold_delta_fallback, lightdark_delta_fallback
power_delta_fallback, lightdark_delta_fallback, swaps_lightdark, swaps_hotcold,
};
use spellcrafter::cards::selection::random_card_from_region;
use spellcrafter::constants::{CHAOS_STAT, POWER_STAT, HOTCOLD_STAT, LIGHTDARK_STAT, BARRIERS_STAT, POLAR_STAT_MIDPOINT, TICKS, CHAOS_PER_TICK, ITEM_LIMIT, ITEMS_HELD};
Expand Down Expand Up @@ -82,6 +82,26 @@ fn make_primary_stat_changes(world: IWorldDispatcher, game_id: u128, card_id: u1
},
Option::None => {},
}
match swaps_hotcold::get(card_id) {
Option::Some(b) => {
let value = get!(world, (HOTCOLD_STAT, game_id), Valueingame).value;
set!(
world,
Valueingame { entity_id: HOTCOLD_STAT, game_id, value: 2*POLAR_STAT_MIDPOINT - value }
);
},
Option::None => {},
}
match swaps_lightdark::get(card_id) {
Option::Some(b) => {
let value = get!(world, (LIGHTDARK_STAT, game_id), Valueingame).value;
set!(
world,
Valueingame { entity_id: LIGHTDARK_STAT, game_id, value: 2*POLAR_STAT_MIDPOINT - value }
);
},
Option::None => {},
}
}

fn make_fallback_stat_changes(world: IWorldDispatcher, game_id: u128, card_id: u128) {
Expand All @@ -97,12 +117,12 @@ fn make_fallback_stat_changes(world: IWorldDispatcher, game_id: u128, card_id: u
},
Option::None => {},
}
match hotcold_delta_fallback::get(card_id) {
Option::Some(delta) => {
alter_stat(world, game_id, HOTCOLD_STAT, delta);
},
Option::None => {},
}
// match hotcold_delta_fallback::get(card_id) {
// Option::Some(delta) => {
// alter_stat(world, game_id, HOTCOLD_STAT, delta);
// },
// Option::None => {},
// }
match lightdark_delta_fallback::get(card_id) {
Option::Some(delta) => {
alter_stat(world, game_id, LIGHTDARK_STAT, delta);
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/cards/properties.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod hotcold_delta;
mod lightdark_delta;
mod power_delta_fallback;
mod chaos_delta_fallback;
mod hotcold_delta_fallback;
// mod hotcold_delta_fallback;
mod lightdark_delta_fallback;
mod swaps_hotcold;
mod swaps_lightdark;
Expand Down
115 changes: 0 additions & 115 deletions contracts/src/cards/properties/hotcold_delta_fallback.cairo

This file was deleted.

4 changes: 2 additions & 2 deletions contracts/src/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const FAMILIAR_LIMIT: u32 = 1;
const BARRIERS_LIMIT: u32 = 3;

// How many ticks each kind of action takes
const TICKS_PER_FORAGE: u32 = 3;
const TICKS_PER_FORAGE: u32 = 2;
const TICKS_PER_SUMMON: u32 = 5;
const TICKS_PER_SEND: u32 = 3;
const TICKS_PER_SEND: u32 = 2;
const CHAOS_PER_TICK: u32 = 1;

/// Valid IDs ///
Expand Down

0 comments on commit 9407ddc

Please sign in to comment.