Skip to content

Commit

Permalink
revamp Magic Wand
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Aug 10, 2024
1 parent 57e3129 commit ce13001
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/cards.csv
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
7126|Pink Jelly|1|3|1|4|||jelly|
5127|Chaos Seed 2.0|1|3|2|1|||cseed2|
7127|Pandemonium 3.0|1|3|2|4|||pandemonium3|
5128|Magic Wand|1|0|3|4|3|7|0=shazam|ranged
7128|Magic Wand|1|0|3|3|3|7|0=shazam|ranged
5128|Magic Wand|1|0|3|3|2|7|1=shazam|psionic
7128|Magic Wand|1|0|3|2|2|7|1=shazam|psionic
5130|Shard of Serendipity|1|3|3|2|||serendipity|
7130|Shard of Serendipity|1|3|3|3|||serendipity|
5150|Entropy Pendulum|1|2|0|0|||pend|pillar+stackable+additive+charges=1
Expand Down
47 changes: 11 additions & 36 deletions src/rs/src/skill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ impl Skill {
Self::scatter => tgt!(or card play),
Self::scramble => Tgt::play,
Self::scramblespam => Tgt::play,
Self::shazam => Tgt::crea,
Self::shazam => tgt!(or card and own crea),
Self::shuffle3 => Tgt::crea,
Self::silence => tgt!(or crea play),
Self::silence => tgt!(or crea perm),
Expand Down Expand Up @@ -1743,41 +1743,16 @@ impl Skill {
}
}
Skill::shazam => {
let owner = ctx.get_owner(c);
let mut options = [etg::Chroma; 3];
let mut idx = 0;
if ctx.get_player(owner).quanta(etg::Life) > 1 {
options[idx as usize] = etg::Life;
idx += 1;
}
if ctx.get_player(owner).quanta(etg::Light) > 1 {
options[idx as usize] = etg::Light;
idx += 1;
}
if ctx.get_player(owner).quanta(etg::Air) > 1 {
options[idx as usize] = etg::Air;
idx += 1;
}
if idx != 0 {
let option = options[ctx.upto(idx) as usize];
ctx.spend(owner, option, 2);
match option {
etg::Life => {
let town = ctx.get_owner(t);
ctx.set(town, Stat::gpull, t);
ctx.transform(t, card::GuardianAngel);
}
etg::Light => {
ctx.set(t, Stat::atk, 3);
ctx.set(t, Stat::hp, 3);
}
etg::Air => {
ctx.transform(t, card::Wyrm);
ctx.set(t, Stat::atk, 2);
ctx.set(t, Stat::hp, 2);
}
_ => unsafe { core::hint::unreachable_unchecked() },
}
let code = ctx.get(t, Stat::card);
let uncode = card::AsUpped(code, false);
let element = ctx.get_card(code).element;
let newcard = if ctx.get_kind(t) == Kind::Spell {
ctx.random_card(false, |ctx, card| card.element == element && card.code != uncode)
} else {
ctx.random_card(false, |ctx, card| card.element == element && card.rarity == 1 && card.kind == Kind::Creature && card.code != uncode)
};
if let Some(newcard) = newcard {
ctx.transform(t, card::As(code, newcard.code));
}
}
Skill::fossilize => {
Expand Down
2 changes: 1 addition & 1 deletion src/rs/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ impl<'a> SkillThing<'a> {
} else {
"Add 3 random non-pillar cards to your hand. At least one will be 1:1"
}),
Skill::shazam => Cow::from("Randomly transform creature into rabbit for 2:8, bouquet for 2:5, or dove for 2:9"),
Skill::shazam => Cow::from("Transform creature you control into a random common creature of the same element, or transform target card into a random card of the same element"),
Skill::shtriga => Cow::from("Gain immaterial when your next turn starts"),
Skill::shuffle3 =>
Cow::from("Shuffle 3 copies of target creature into your deck & expend a charge. Destroyed when all charges expended"),
Expand Down

0 comments on commit ce13001

Please sign in to comment.