Skip to content

Commit

Permalink
fix maul attack spam, fix maul block, narrow haunt to only apply when…
Browse files Browse the repository at this point in the history
… mutual
  • Loading branch information
serprex committed Jul 7, 2024
1 parent 78658a8 commit c5c763f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/rs/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
17 changes: 8 additions & 9 deletions src/rs/src/skill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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
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 @@ -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 =>
Expand Down

0 comments on commit c5c763f

Please sign in to comment.