Skip to content

Commit c008410

Browse files
committed
Soften Rustler nerf, nerf Snowflake, fix Tidal to remove neuro/afla
1 parent aed6ae5 commit c008410

3 files changed

Lines changed: 46 additions & 23 deletions

File tree

src/rs/src/game.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl Status {
402402
}
403403
}
404404

405-
pub fn entry(&mut self, stat: Stat) -> StatusEntry {
405+
pub fn entry<'a>(&'a mut self, stat: Stat) -> StatusEntry<'a> {
406406
match self.0.binary_search_by_key(&stat, |kv| kv.0) {
407407
Err(idx) => StatusEntry::Vacant(StatusVacant { status: self, idx, stat }),
408408
Ok(idx) => StatusEntry::Occupied(StatusOccupied { status: self, idx }),
@@ -1022,7 +1022,7 @@ impl Game {
10221022

10231023
pub fn getIndex(&self, id: i16) -> i32 {
10241024
if !self.has_id(id) {
1025-
return -1
1025+
return -1;
10261026
}
10271027
let owner = self.get_owner(id);
10281028
match self.get_kind(id) {
@@ -1400,7 +1400,7 @@ impl Game {
14001400
self.cards.random_card(&self.rng, upped, |c| ffilt(self, c))
14011401
}
14021402

1403-
pub fn skill_text(&self, id: i16, ev: Event) -> Option<SkillsName> {
1403+
pub fn skill_text<'a>(&'a self, id: i16, ev: Event) -> Option<SkillsName<'a>> {
14041404
if let Some(sk) = self.get_thing(id).skill.get(ev) {
14051405
if !sk.is_empty() {
14061406
return Some(SkillsName { ctx: self, sk, id });

src/rs/src/skill.rs

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,15 +2073,17 @@ impl Skill {
20732073
}
20742074
Self::coldsnap => {
20752075
let charges = ctx.get_mut(c, Stat::charges);
2076-
let count = (core::mem::replace(charges, 0) + 1) as u32;
2077-
let owner = ctx.get_owner(t);
2078-
if !ctx.sanctified(owner) {
2079-
ctx.remove(t);
2080-
let decklen = ctx.get_player(owner).deck.len() as u32;
2081-
for n in 1..=count {
2082-
let idx = ctx.upto(decklen + n) as usize;
2083-
let inst = if n == count { t } else { ctx.cloneinst(t) };
2084-
ctx.get_player_mut(owner).deck_mut().insert(idx, inst);
2076+
let count = core::mem::replace(charges, 0);
2077+
if count > 0 {
2078+
let owner = ctx.get_owner(t);
2079+
if !ctx.sanctified(owner) {
2080+
ctx.remove(t);
2081+
let decklen = ctx.get_player(owner).deck.len() as u32;
2082+
for n in 0..count {
2083+
let idx = ctx.upto(decklen + n as u32) as usize;
2084+
let inst = if n == 0 { t } else { ctx.cloneinst(t) };
2085+
ctx.get_player_mut(owner).deck_mut().insert(idx, inst);
2086+
}
20852087
}
20862088
}
20872089
}
@@ -4099,7 +4101,7 @@ impl Skill {
40994101
Self::photosynthesis => {
41004102
ctx.fx(c, Fx::Quanta(2, etg::Life as i8));
41014103
ctx.spend(ctx.get_owner(c), etg::Life, -2);
4102-
if ctx.get(c, Stat::poison) <= 0
4104+
if !ctx.get(c, Flag::neuro)
41034105
&& ctx.get(c, Stat::cast) > if ctx.get(c, Stat::castele) == etg::Chroma { 1 } else { 0 }
41044106
{
41054107
ctx.set(c, Stat::casts, 1);
@@ -4900,10 +4902,29 @@ impl Skill {
49004902
Self::tidalhealing => {
49014903
for cr in ctx.get_player(ctx.get_owner(c)).creatures {
49024904
if cr != 0 {
4903-
ctx.set(cr, Stat::poison, 0);
4904-
ctx.set(cr, Stat::frozen, 0);
4905-
if ctx.get(cr, Flag::aquatic) && !ctx.hasskill(cr, Event::Hit, Skill::regen) {
4906-
ctx.addskills(cr, Event::Hit, &[Skill::regen]);
4905+
let thing = ctx.get_thing_mut(cr);
4906+
if let Some(val) = thing.status.get_mut(Stat::poison) {
4907+
*val = 0
4908+
}
4909+
if let Some(val) = thing.status.get_mut(Stat::frozen) {
4910+
*val = 0
4911+
}
4912+
thing.flag.0 &= !(Flag::aflatoxin | Flag::neuro);
4913+
if thing.flag.get(Flag::aquatic) {
4914+
match thing.skill.entry(Event::Hit) {
4915+
SkillsEntry::Vacant(hole) => {
4916+
hole.insert(Cow::from(&[Skill::regen]));
4917+
}
4918+
SkillsEntry::Occupied(spot) => {
4919+
for (k, v) in spot.skills.iter_mut() {
4920+
if k == Event::Hit {
4921+
if v.iter().all(|sk| !matches!(sk, Skill::regen)) {
4922+
v.to_mut().push(Skill::regen)
4923+
}
4924+
}
4925+
}
4926+
}
4927+
}
49074928
}
49084929
}
49094930
}

src/rs/src/text.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ impl<'a> SkillThing<'a> {
213213
Skill::bloodmoon => Cow::from(
214214
"Aquatic creatures gain \"Gain 1:8 when it attacks.\"\nGolems gain \"Damage dealt by this card also reduces the defender's maxHP.\"\nNocturnal creatures gain \"Heal yourself equal to the damage dealt by this card.\"",
215215
),
216-
Skill::bolsterintodeck => Cow::from("Add 3 exact copies of target creature or weapon on top of your deck"),
216+
Skill::bolsterintodeck => {
217+
Cow::from("Add 3 exact copies of target creature or weapon on top of your deck")
218+
}
217219
Skill::bonesharpen => Cow::from(
218220
"Replace your own target creature's skills with \"0: Combine with target creature, giving strength, HP, & poison counters\"\nIf not poisoned & target is skeleton, reactivated",
219221
),
@@ -286,7 +288,7 @@ impl<'a> SkillThing<'a> {
286288
),
287289
Skill::cold => Cow::from("\u{2153} chance to freeze non-ranged attackers for 3 turns"),
288290
Skill::coldsnap => Cow::from(
289-
"Shuffle target card into owner's deck. Expend charges to shuffle that many more copies",
291+
"Expend charges to shuffle as many copies of target card into its owner's deck. Ineffective without charges",
290292
),
291293
Skill::corpseexplosion => Cow::from(if self.upped() {
292294
"Sacrifice one of your creatures to deal 1 spell damage to all enemy creatures. Increase damage by 1 for every 5HP of the sacrifice. Poisonous or poisoned sacrifices inflict 1 poison. Also affect opponent"
@@ -761,9 +763,9 @@ impl<'a> SkillThing<'a> {
761763
} else {
762764
"When this creature dies, transform it into an Ash"
763765
}),
764-
Skill::photosynthesis => {
765-
Cow::from("Gain 2:5. Unless poisoned or cost was 0 or 1:0, caster reactivated")
766-
}
766+
Skill::photosynthesis => Cow::from(
767+
"Gain 2:5. Unless afflicted with neurotoxin or cost was 0 or 1:0, caster reactivated",
768+
),
767769
Skill::pillar => Cow::from(format!(
768770
"Gain {}:{} every turn",
769771
if self.card().element == 0 { '3' } else { '1' },
@@ -917,7 +919,7 @@ impl<'a> SkillThing<'a> {
917919
"Target cannot gain quanta until their turn ends. Their deck is protected until start of their next turn.\nSilence all your opponent's creatures & heal all your creatures by 8",
918920
),
919921
Skill::sabbath if ev == Event::Mulligan => Cow::from(
920-
"When this card is mulliganed, opponent cannot gain quanta until their first turn ends.",
922+
"When this card is mulliganed, opponent cannot gain quanta until their first turn ends",
921923
),
922924
Skill::sadism => Cow::from("Whenever any creatures are damaged, heal yourself an equal amount"),
923925
Skill::salvage => Cow::from(if self.set() == CardSet::Open {

0 commit comments

Comments
 (0)