Skip to content

Commit

Permalink
Bo Staff
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jul 6, 2024
1 parent 5f539dc commit 303a28f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cards.csv
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@
7827|Byakko|8|4|3|7|9|3|blocked=virtue|
5828|Dispersion|8|3|3|7|||dispersion|
7828|Dispersion|8|3|3|5|||dispersion|
5829|Bo Staff|8|0|3|3|5|5|1=protect|
7829|Bo Staff|8|0|3|3|5|5|1=protect|
5829|Bo Staff|8|0|3|3|5|5|1=protect+buff=buffdr+hit=boreset|
7829|Bo Staff|8|0|3|3|5|5|1=protect+buff=buffdr+hit=boreset|
5830|Shard of Divinity|8|3|3|3|||divinity|
7830|Shard of Divinity|8|3|3|2|||divinity|
5850|Light Pendulum|8|2|0|0|||pend|pillar+stackable+additive+charges=1
Expand Down
42 changes: 38 additions & 4 deletions src/rs/src/skill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,15 @@ pub enum Skill {
bolsterintodeck,
bonesharpen,
boneyard,
boreset,
bounce,
bow,
bravery,
brawl,
brew,
brokenmirror,
bubbleclear,
buffdr,
burrow,
burstout,
butterfly,
Expand Down Expand Up @@ -961,13 +963,15 @@ impl<'a> Display for SkillName<'a> {
Skill::bloodmoon => Ok(()),
Skill::bolsterintodeck => f.write_str("bolsterintodeck"),
Skill::boneyard => f.write_str("boneyard"),
Skill::boreset => Ok(()),
Skill::bounce => f.write_str("bounce"),
Skill::bow => f.write_str("bow"),
Skill::bravery => Ok(()),
Skill::brawl => f.write_str("brawl"),
Skill::brew => f.write_str("brew"),
Skill::brokenmirror => Ok(()),
Skill::bubbleclear => f.write_str("bubbleclear"),
Skill::buffdr => Ok(()),
Skill::burrow => f.write_str(if ctx.get(id, Flag::burrowed) { "unburrow" } else { "burrow" }),
Skill::butterfly => f.write_str("butterfly"),
Skill::catapult => f.write_str("catapult"),
Expand Down Expand Up @@ -1689,7 +1693,18 @@ impl Skill {
ctx.addCrea(foe, mirage);
}
Skill::grab2h => {}
Skill::protect => {}
Skill::protect => {
ctx.delay(c, 1);
let owner = ctx.get_owner(c);
let shield = ctx.get_player(owner).shield;
if shield == 0 {
let shield = ctx.new_thing(card::As(ctx.get(c, Stat::card), card::Shield), owner);
ctx.setShield(owner, shield);
} else {
ctx.incrStatus(shield, Stat::maxhp, 1);
ctx.incrStatus(shield, Stat::hp, 1);
}
}
Skill::fish => {
let owner = ctx.get_owner(c);
if !ctx.get_player(owner).hand_full() {
Expand Down Expand Up @@ -1982,6 +1997,18 @@ impl Skill {
ctx.addCrea(owner, skele);
}
}
Self::boreset => {
let owner = ctx.get_owner(c);
let shield = ctx.get_shield(owner);
if shield != 0 {
let shield = ctx.get_thing_mut(shield);
if let Some(swarm) = shield.status.get_mut(Stat::swarmhp) {
let swarm = core::mem::replace(swarm, 0);
let dr = shield.status.entry(Stat::hp).or_insert(0);
*dr = dr.saturating_sub(swarm);
}
}
}
Self::bounce => {
ctx.set(c, Stat::hp, ctx.get(c, Stat::maxhp));
ctx.rmskill(c, Event::Predeath, Skill::bounce);
Expand Down Expand Up @@ -3633,9 +3660,7 @@ impl Skill {
.get_player(owner)
.creatures
.into_iter()
.map(|cr| {
(cr != 0 && ctx.hasskill(cr, Event::Prespell, Skill::mirage)) as u32
})
.map(|cr| (cr != 0 && ctx.hasskill(cr, Event::Prespell, Skill::mirage)) as u32)
.sum::<u32>();
if totaldw > 0 && ctx.upto(totaldw) == 0 {
data.tgt = c;
Expand Down Expand Up @@ -5591,6 +5616,7 @@ impl Skill {
}
Self::accumulation
| Self::axe
| Self::buffdr
| Self::bow
| Self::countimmbur
| Self::dagger
Expand All @@ -5616,6 +5642,14 @@ impl Skill {
let mark = ctx.get_player(ctx.get_owner(c)).mark as i16;
(mark == etg::Fire || mark == etg::Time) as i16
}
Self::buffdr => {
let shield = ctx.get_player(ctx.get_owner(c)).shield as i16;
if shield == 0 {
0
} else {
ctx.get(shield, Stat::hp)
}
}
Self::bow => {
let mark = ctx.get_player(ctx.get_owner(c)).mark as i16;
(mark == etg::Air || ctx.cardset() == CardSet::Open && mark == etg::Light) as i16
Expand Down

0 comments on commit 303a28f

Please sign in to comment.