Skip to content

Commit

Permalink
Buff patch
Browse files Browse the repository at this point in the history
sopa: raise cost by 1
arctic squid: freeze lasts 2/3 instead of 3/4
flooding: change active to resummon
freeze: freezes for 4/5 turns
siren: change stats to 3|4 / 4|5
ouija: add active spawning ouija on opponent's field costing 2 life
tunneling: active is free
unstable gas: reduce cost by 1, deal 5 damage to opponent when discarded
sadism: add active mend costing 2 light
stasis: sanctify player when drawn
gnome rider: cost 1 chroma
plate armor: increase hp by 7/13
fallen elf: change stats to 3|3
virus: can't target players, on death poisons opponent for 1
elf/druid: change stats to 3|4
firefly: cost 2/2
mutants: fix typo causing poisonfoe mutants to spawn as poison mutants
hatch: never hatch to same creature using hatch (so fate egg won't become fate egg)
jetstream: can target non-airborne creatures, making them airborne
corpse explosion: apply damage/poison to both creatures & opponent
martyr: healing martyr heals owner
sabbath: silence all of target player's creatures
clockwork golem: buff hp by restored power when using wind
  • Loading branch information
Philip Dubé committed Aug 24, 2023
1 parent 6980eb8 commit 6d78103
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 197 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/cargo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/setup-node@v3
with:
node-version: 17
- run: cargo test --manifest-path=./src/rs/Cargo.toml
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --manifest-path=./src/rs/Cargo.toml
28 changes: 14 additions & 14 deletions src/Cards.json

Large diffs are not rendered by default.

33 changes: 12 additions & 21 deletions src/rs/src/aieval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,9 @@ fn eval_skill(
ctx.get(weapon, Stat::cost) as f32
}
}
Skill::disfield | Skill::v_disfield => {
(3 + quantamap.get(ctx.get_owner(c), etg::Chroma) as i32) as f32
}
Skill::disshield | Skill::v_disshield => {
(2 + quantamap.get(ctx.get_owner(c), etg::Entropy) as i32) as f32
}
Skill::dive | Skill::v_dive => {
Skill::disfield => (3 + quantamap.get(ctx.get_owner(c), etg::Chroma) as i32) as f32,
Skill::disshield => (2 + quantamap.get(ctx.get_owner(c), etg::Entropy) as i32) as f32,
Skill::dive => {
if ctx.get_kind(c) == Kind::Spell {
ctx.get_card(ctx.get(c, Stat::card)).attack as f32
} else {
Expand Down Expand Up @@ -370,13 +366,8 @@ fn eval_skill(
Skill::forceplay => 2.0,
Skill::fractal => (20 - ctx.get_player(ctx.get_owner(c)).hand_len()) as f32 / 4.0,
Skill::freedom => 4.0,
Skill::freeze | Skill::v_freeze | Skill::freezeperm => {
if card::Upped(ctx.get(c, Stat::card)) {
3.0
} else {
3.5
}
}
Skill::freeze(x) | Skill::v_freeze(x) => x as f32,
Skill::freezeperm => 4.0,
Skill::fungusrebirth => 1.0,
Skill::gas | Skill::v_gas => 5.0,
Skill::give => 1.0,
Expand Down Expand Up @@ -452,7 +443,7 @@ fn eval_skill(
Skill::locket => 1.0,
Skill::loot => 2.0,
Skill::luciferin | Skill::v_luciferin => 3.0,
Skill::lycanthropy | Skill::v_lycanthropy => 4.0,
Skill::lycanthropy => 4.0,
Skill::mend => 3.0,
Skill::metamorph => 2.0,
Skill::midas => 6.0,
Expand Down Expand Up @@ -669,7 +660,7 @@ fn eval_skill(
}
}
Skill::absorber => 5.0,
Skill::blockwithcharge | Skill::v_blockwithcharge => {
Skill::blockwithcharge => {
ctx.get(c, Stat::charges) as f32
/ (1 + ctx.count_creatures(ctx.get_foe(ctx.get_owner(c))) * 2) as f32
}
Expand Down Expand Up @@ -1180,17 +1171,17 @@ pub fn eval(ctx: &Game) -> f32 {
if shield != 0 {
for &fsh in ctx.getSkill(shield, Event::Shield) {
match fsh {
Skill::blockwithcharge | Skill::v_blockwithcharge => {
Skill::blockwithcharge => {
wall.shield = Some(WallShield::Chargeblock(ctx.get(shield, Stat::charges)));
}
Skill::disshield | Skill::v_disshield => {
if fsh == Skill::disshield || !ctx.get(pl, Flag::sanctuary) {
Skill::disshield => {
if ctx.cardset() == CardSet::Open || !ctx.get(pl, Flag::sanctuary) {
wall.shield =
Some(WallShield::Disentro(player.quanta(etg::Entropy) as i32));
}
}
Skill::disfield | Skill::v_disfield => {
if fsh == Skill::disfield || !ctx.get(pl, Flag::sanctuary) {
Skill::disfield => {
if ctx.cardset() == CardSet::Open || !ctx.get(pl, Flag::sanctuary) {
wall.shield = Some(WallShield::Dischroma(
player.quanta.iter().map(|&q| q as i32).sum::<i32>(),
));
Expand Down
13 changes: 11 additions & 2 deletions src/rs/src/deckgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ use crate::skill::{Event, Skill};

#[cfg(target_arch = "wasm32")]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
pub fn deckgen_duo(e1: i8, e2: i8, uprate: f64, markpower: i32, maxrarity: i32, seed: i32) -> Vec<u16> {
pub fn deckgen_duo(
e1: i8,
e2: i8,
uprate: f64,
markpower: i32,
maxrarity: i32,
seed: i32,
) -> Vec<u16> {
let mut rng = Pcg32::seed_from_u64(seed as u64);
let mut build = Builder::new(e2 as i32, uprate, markpower, &mut rng);
for j in 0..=1 {
Expand Down Expand Up @@ -99,7 +106,9 @@ pub fn deckgen_ai4(e1: i8, e2: i8, seed: i32) -> Vec<u16> {
let mut deck = Vec::with_capacity(65);
for i in 0..24 {
let upped = rng.gen_bool(0.3);
deck.push(etg::PillarList[if i < 4 { 0 } else { e1 as usize }] - if upped { 2000 } else { 4000 });
deck.push(
etg::PillarList[if i < 4 { 0 } else { e1 as usize }] - if upped { 2000 } else { 4000 },
);
}
for i in 0..40 {
let upped = rng.gen_bool(0.3);
Expand Down
12 changes: 5 additions & 7 deletions src/rs/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ impl Game {
id,
&[
Skill::hatch,
Skill::freeze,
Skill::freeze(4),
Skill::burrow,
Skill::destroy,
Skill::steal,
Expand All @@ -1383,7 +1383,7 @@ impl Game {
Skill::mutation,
Skill::growth(2, 2),
Skill::growth(2, 0),
Skill::poison(1),
Skill::poisonfoe(1),
Skill::deja,
Skill::endow,
Skill::guard,
Expand All @@ -1397,14 +1397,14 @@ impl Game {
id,
&[
Skill::v_hatch,
Skill::v_freeze,
Skill::v_freeze(3),
Skill::v_burrow,
Skill::destroy,
Skill::v_steal,
Skill::v_dive,
Skill::dive,
Skill::mend,
Skill::paradox,
Skill::v_lycanthropy,
Skill::lycanthropy,
Skill::poison(1),
Skill::gpull,
Skill::devour,
Expand Down Expand Up @@ -1904,7 +1904,6 @@ impl Game {
}

pub fn addCreaCore(&mut self, id: i32, crea: i32, fromhand: bool) {
debug_assert!(id < crea);
let pl = self.get_player_mut(id);
for cr in Rc::make_mut(&mut pl.creatures).iter_mut() {
if *cr == 0 {
Expand All @@ -1920,7 +1919,6 @@ impl Game {
}

fn addPermCore(&mut self, id: i32, perm: i32, fromhand: bool) {
debug_assert!(id < perm);
if self.get(perm, Flag::additive) {
let code = card::AsShiny(self.get(perm, Stat::card), false);
for &pr in self.get_player(id).permanents.clone().iter() {
Expand Down
4 changes: 1 addition & 3 deletions src/rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ mod test {
let un = set.get(card::AsUpped(card.code as i32, false));
let up = set.get(card::AsUpped(card.code as i32, true));
if card.kind == Kind::Spell {
assert_eq!(card.skill.len(), 1);
assert!(card.skill[0].0 == Event::Cast);
assert_eq!(card.skill[0].1.len(), 1);
assert!(card.skill.iter().any(|&(k, v)| k == Event::Cast));
}
}
}
Expand Down
Loading

0 comments on commit 6d78103

Please sign in to comment.