From c5c763f02f5a9d4a75d8e434380ce19dec88ab22 Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Sun, 7 Jul 2024 16:59:16 +0000 Subject: [PATCH] fix maul attack spam, fix maul block, narrow haunt to only apply when mutual --- src/rs/src/game.rs | 2 +- src/rs/src/skill.rs | 17 ++++++++--------- src/rs/src/text.rs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/rs/src/game.rs b/src/rs/src/game.rs index 50f6579e..6c2242ed 100644 --- a/src/rs/src/game.rs +++ b/src/rs/src/game.rs @@ -2180,7 +2180,7 @@ impl Game { pub fn trigger_data(&mut self, k: Event, c: i16, t: i16, data: &mut ProcData) { if let Some(ss) = self.get_thing(c).skill.get(k) { - for &s in ss.clone().iter() { + for s in ss.clone().into_iter() { s.proc(self, c, t, data); } } diff --git a/src/rs/src/skill.rs b/src/rs/src/skill.rs index dadd8ff9..604d17da 100644 --- a/src/rs/src/skill.rs +++ b/src/rs/src/skill.rs @@ -1348,6 +1348,7 @@ impl Skill { | Self::deepdiveproc2 | Self::dshieldoff | Self::elf | Self::firebrand + | Self::hauntatk(..) | Self::haunthp(..) | Self::martyr | Self::mummy | Self::obsession | Self::predatoroff @@ -1681,6 +1682,9 @@ impl Skill { Skill::haunt => { let owner = ctx.get_owner(c); let skele = ctx.new_thing(card::As(ctx.get(c, Stat::card), card::Skeleton), owner); + ctx.set(skele, Stat::hp, 0); + ctx.set(skele, Stat::maxhp, 0); + ctx.set(skele, Stat::atk, 0); ctx.addCrea(owner, skele); if ctx.getIndex(skele) != -1 { ctx.get_thing_mut(skele) @@ -1714,7 +1718,7 @@ impl Skill { Skill::grab2h => { if ctx.get_kind(t) == Kind::Spell { ctx.die(t); - ctx.queue_attack(c, ctx.get_foe(ctx.get_owner(c))); + ctx.dmg(ctx.get_foe(ctx.get_owner(c)), ctx.trueatk(c)); } else { ctx.unsummon(t); } @@ -3616,12 +3620,7 @@ impl Skill { } } Self::maul => { - let owner = ctx.get_owner(c); - if ctx.get_player(owner).shield == 0 { - if c != t && ctx.get_kind(c) == ctx.get_kind(t) && ctx.getIndex(c) == ctx.getIndex(t) { - data.flags |= ProcData::stasis; - } - } else if c == t { + if ctx.get_player(ctx.get_owner(c)).shield != 0 && ctx.get_kind(c) == ctx.get_kind(t) && ctx.getIndex(c) == ctx.getIndex(t) { data.flags |= ProcData::stasis; } } @@ -5739,14 +5738,14 @@ impl Skill { (mark == etg::Gravity || mark == etg::Earth) as i16 } Skill::haunthp(o) => { - if ctx.getIndex(o) != -1 { + if ctx.getIndex(o) != -1 && ctx.hasskill(o, Event::Hp, Skill::haunthp(c)) { ctx.get(o, Stat::hp) } else { 0 } } Skill::hauntatk(o) => { - if ctx.getIndex(o) != -1 { + if ctx.getIndex(o) != -1 && ctx.hasskill(o, Event::Buff, Skill::hauntatk(c)) { ctx.get(o, Stat::atk) } else { 0 diff --git a/src/rs/src/text.rs b/src/rs/src/text.rs index e50227c2..1f138c0c 100644 --- a/src/rs/src/text.rs +++ b/src/rs/src/text.rs @@ -391,7 +391,7 @@ impl<'a> SkillThing<'a> { Skill::gaintimecharge => Cow::from("Gain one stack for every card you draw. Does not gain a stack from your draw at the start of your turn"), Skill::gas => Cow::from("Summon an Unstable Gas"), - Skill::grab2h => Cow::from("Return your target shield to hand, or discard a card in order to attack. While shield equipped does not attack, but blocks opposing card instead."), + Skill::grab2h => Cow::from("Return your target shield to hand, or discard a card in order to deal damage to opponent equivalent to this card's attack power. While shield equipped does not attack, but blocks opposing card instead."), Skill::grave => Cow::from("When another creature dies, unburrow & transform this creature into a fresh copy of the dying creature. This creature retains nocturnal"), Skill::give =>