Skip to content

Commit 9e0095e

Browse files
committed
Move tornado shatter logic to avoid shuffling shattered permanent
Skeletons cannot be haunted
1 parent 67f5d02 commit 9e0095e

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

src/rs/server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ lto = "thin"
1616
[dependencies]
1717
base64 = { version = "0.22", default-features = false, features = ["alloc"] }
1818
bb8-postgres = { version = "0.8", features = ["with-serde_json-1"] }
19-
brotli = { version = "6", default-features = false, features = ["std"] }
19+
brotli = { version = "7", default-features = false, features = ["std"] }
2020
etg = { version = "0.1", default-features = false, path = "../" }
2121
futures = { version = "0.3", default-features = false, features = ["alloc"] }
2222
fxhash = "0.2"

src/rs/server/src/users.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ impl Users {
416416
self.0.retain(|_, (ref gc, ref sockid, _)| {
417417
NonZeroUsize::new(sockid.load(Ordering::Acquire))
418418
.map(|id| rsocks.contains_key(&id))
419-
.unwrap_or(false) || gc.swap(false, Ordering::AcqRel)
419+
.unwrap_or(false)
420+
|| gc.swap(false, Ordering::AcqRel)
420421
});
421422
}
422423
}

src/rs/src/skill.rs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ impl Skill {
14931493
}
14941494
}
14951495
Self::guard => Tgt::crea,
1496-
Self::haunt => Tgt::crea,
1496+
Self::haunt => tgt!(and crea not skele),
14971497
Self::heal => tgt!(or crea play),
14981498
Self::holylight => tgt!(or crea play),
14991499
Self::icebolt => tgt!(or crea play),
@@ -3167,7 +3167,13 @@ impl Skill {
31673167
}
31683168
for &(k, v) in tstatus.iter() {
31693169
match k {
3170-
Stat::hp | Stat::maxhp | Stat::atk | Stat::card | Stat::costele | Stat::shardgolem | Stat::swarmhp => (),
3170+
Stat::hp
3171+
| Stat::maxhp
3172+
| Stat::atk
3173+
| Stat::card
3174+
| Stat::costele
3175+
| Stat::shardgolem
3176+
| Stat::swarmhp => (),
31713177
Stat::castele | Stat::cast => {
31723178
if setcast {
31733179
ctx.set(equip, k, v)
@@ -4845,6 +4851,22 @@ impl Skill {
48454851
let owner = ctx.get_owner(c);
48464852
let foe = ctx.get_foe(owner);
48474853
let upped = card::Upped(ctx.get(c, Stat::card));
4854+
let mut perms = Vec::with_capacity(18);
4855+
for i in 0..2 {
4856+
let plpl = ctx.get_player(if i == 0 { owner } else { foe });
4857+
perms.clear();
4858+
perms.extend(
4859+
once(plpl.weapon)
4860+
.chain(once(plpl.shield))
4861+
.chain(plpl.permanents.into_iter())
4862+
.filter(|&pr| pr != 0 && ctx.material(pr, None)),
4863+
);
4864+
for id in perms.iter().cloned() {
4865+
if ctx.get(id, Stat::frozen) > 0 {
4866+
ctx.shatter(id);
4867+
}
4868+
}
4869+
}
48484870
for i in 0..3 {
48494871
let pl = if i == 2 {
48504872
if upped {
@@ -4855,19 +4877,14 @@ impl Skill {
48554877
} else {
48564878
foe
48574879
};
4858-
let mut perms = Vec::with_capacity(18);
48594880
let plpl = ctx.get_player(pl);
4881+
perms.clear();
48604882
perms.extend(
48614883
once(plpl.weapon)
48624884
.chain(once(plpl.shield))
48634885
.chain(plpl.permanents.into_iter())
48644886
.filter(|&pr| pr != 0 && ctx.material(pr, None)),
48654887
);
4866-
for id in perms.iter().cloned() {
4867-
if ctx.get(id, Stat::frozen) > 0 {
4868-
ctx.shatter(id);
4869-
}
4870-
}
48714888
if let Some(&pr) = ctx.choose(&perms) {
48724889
ctx.fx(pr, Fx::Shuffled);
48734890
let newowner = if ctx.next32() & 1 == 0 { pl } else { ctx.get_foe(pl) };

0 commit comments

Comments
 (0)