Skip to content

Commit 17f3e2a

Browse files
committed
v1.0.22
1 parent 429834c commit 17f3e2a

30 files changed

+1966
-926
lines changed

Cargo.lock

+334-428
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rebels"
3-
version = "1.0.21"
3+
version = "1.0.22"
44
edition = "2021"
55
authors = ["Alessandro Ricottone <[email protected]>"]
66
license = "GPL-3.0-or-later"
@@ -9,7 +9,7 @@ readme = "README.md"
99
homepage = "https://github.com/ricott1/rebels-in-the-sky"
1010
repository = "https://github.com/ricott1/rebels-in-the-sky"
1111
keywords = ["cli", "pirates", "rebels", "game"]
12-
categories = ["games", "terminal"]
12+
categories = ["games"]
1313

1414
[profile.release]
1515
strip = true
@@ -40,15 +40,16 @@ imageproc = "0.25.0"
4040
include_dir = "0.7.4"
4141
itertools = "0.13.0"
4242
libp2p = { version = "0.54.1", features = [
43+
"dns",
44+
"gossipsub",
45+
"macros",
46+
"mdns",
4347
"noise",
4448
"ping",
49+
"serde",
4550
"tcp",
4651
"tokio",
4752
"yamux",
48-
"gossipsub",
49-
"mdns",
50-
"macros",
51-
"serde",
5253
] }
5354
log = "0.4.22"
5455
log4rs = { version = "1.3.0", features = ["file_appender", "pattern_encoder"] }
@@ -61,7 +62,7 @@ rodio = "0.20.1"
6162
russh = "0.46.0"
6263
russh-keys = "0.46.0"
6364
serde = { version = "1.0.215", features = ["derive", "default"] }
64-
serde_json = "1.0.132"
65+
serde_json = "1.0.133"
6566
serde_repr = "0.1.19"
6667
sha2 = "0.10.8"
6768
stream-download = { version = "0.12.0", features = ["reqwest-rustls"] }

src/game_engine/brawl.rs

+129-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::world::{
88
player::Trait,
99
skill::GameSkill,
1010
};
11-
use rand::Rng;
11+
use rand::{seq::SliceRandom, Rng};
1212
use rand_chacha::ChaCha8Rng;
1313
use std::collections::HashMap;
1414

@@ -91,55 +91,163 @@ impl EngineAction for Brawl {
9191

9292
if attacker.has_hook() {
9393
defender_update.extra_tiredness += TirednessCost::CRITICAL;
94-
format!(
95-
"A brawl between {} and {}! {} seems to have gotten the upper hand.",
96-
defender.info.shortened_name(),
97-
attacker.info.shortened_name(),
98-
attacker.info.shortened_name()
99-
)
100-
} else {
101-
defender_update.extra_tiredness += TirednessCost::SEVERE;
10294
format!(
10395
"A brawl between {} and {}! {} got {} good with the hook! That'll be an ugly scar.",
10496
defender.info.shortened_name(), attacker.info.shortened_name(), attacker.info.shortened_name(), defender.info.pronouns.as_object()
10597
)
98+
} else {
99+
defender_update.extra_tiredness += TirednessCost::SEVERE;
100+
101+
[
102+
format!(
103+
"A brawl between {} and {}! {} seems to have gotten the upper hand.",
104+
attacker.info.shortened_name(),
105+
defender.info.shortened_name(),
106+
attacker.info.shortened_name()
107+
),
108+
format!(
109+
"An intense clash between {} and {} ends with {} coming out on top!",
110+
attacker.info.shortened_name(),
111+
defender.info.shortened_name(),
112+
attacker.info.shortened_name()
113+
),
114+
format!(
115+
"A fierce fight between {} and {} concludes with {} gaining the upper hand!",
116+
attacker.info.shortened_name(),
117+
defender.info.shortened_name(),
118+
attacker.info.shortened_name()
119+
),
120+
format!(
121+
"{} and {} engage in a heated scuffle, but {} emerges the winner.",
122+
attacker.info.shortened_name(),
123+
defender.info.shortened_name(),
124+
attacker.info.shortened_name()
125+
),
126+
format!(
127+
"It's {} versus {} in a wild brawl! {} prevails in the end.",
128+
attacker.info.shortened_name(),
129+
defender.info.shortened_name(),
130+
attacker.info.shortened_name()
131+
),
132+
format!(
133+
"{} and {} come to blows during the game. {} manages to give the best shots.",
134+
attacker.info.shortened_name(),
135+
defender.info.shortened_name(),
136+
attacker.info.shortened_name()
137+
),
138+
format!(
139+
"The battle between {} and {} wraps up with {} as the victor.",
140+
attacker.info.shortened_name(),
141+
defender.info.shortened_name(),
142+
attacker.info.shortened_name()
143+
),
144+
]
145+
.choose(rng)
146+
.expect("There should be an option")
147+
.clone()
106148
}
107149
}
108150
x if x == 0 => {
109151
attacker_update.extra_tiredness += TirednessCost::HIGH;
110152
defender_update.extra_tiredness += TirednessCost::HIGH;
111153
defender_update.extra_morale += MoraleModifier::SMALL_MALUS;
112154
attacker_update.extra_morale += MoraleModifier::SMALL_MALUS;
113-
match rng.gen_range(0..=1) {
114-
0 => format!(
155+
156+
[
157+
format!(
115158
"A brawl between {} and {}! They both got some damage.",
116159
attacker.info.shortened_name(),
117160
defender.info.shortened_name()
118161
),
119-
_ => format!(
162+
format!(
120163
"A brawl between {} and {}! An even match.",
121164
defender.info.shortened_name(),
122165
attacker.info.shortened_name()
123166
),
124-
}
167+
format!(
168+
"A fierce clash! {} and {} trade powerful blows.",
169+
attacker.info.shortened_name(),
170+
defender.info.shortened_name()
171+
),
172+
format!(
173+
"{} and {} collide in an intense struggle! Neither backs down.",
174+
attacker.info.shortened_name(),
175+
defender.info.shortened_name()
176+
),
177+
format!(
178+
"{} strikes first, but {} quickly counters! An even fight.",
179+
attacker.info.shortened_name(),
180+
defender.info.shortened_name()
181+
),
182+
format!(
183+
"{} tries to outmaneuver {}, but the fight remains deadlocked.",
184+
attacker.info.shortened_name(),
185+
defender.info.shortened_name()
186+
),
187+
]
188+
.choose(rng)
189+
.expect("There should be one choice")
190+
.clone()
125191
}
126192
_ => {
127193
defender_update.extra_morale += MoraleModifier::SEVERE_BONUS;
128194
attacker_update.extra_morale += MoraleModifier::SEVERE_MALUS;
129195
if defender.has_hook() {
130196
attacker_update.extra_tiredness += TirednessCost::CRITICAL;
131-
format!(
132-
"A brawl between {} and {}! {} seems to have gotten the upper hand.",
133-
attacker.info.shortened_name(),
134-
defender.info.shortened_name(),
135-
defender.info.shortened_name()
136-
)
137-
} else {
138-
attacker_update.extra_tiredness += TirednessCost::SEVERE;
139197
format!(
140198
"A brawl between {} and {}! {} got {} good with the hook! That'll be an ugly scar.",
141199
attacker.info.shortened_name(), defender.info.shortened_name(), defender.info.shortened_name(), attacker.info.pronouns.as_object()
142200
)
201+
} else {
202+
attacker_update.extra_tiredness += TirednessCost::SEVERE;
203+
204+
[
205+
format!(
206+
"A brawl between {} and {}! {} seems to have gotten the upper hand.",
207+
attacker.info.shortened_name(),
208+
defender.info.shortened_name(),
209+
defender.info.shortened_name()
210+
),
211+
format!(
212+
"An intense clash between {} and {} ends with {} coming out on top!",
213+
attacker.info.shortened_name(),
214+
defender.info.shortened_name(),
215+
defender.info.shortened_name()
216+
),
217+
format!(
218+
"A fierce fight between {} and {} concludes with {} gaining the upper hand!",
219+
attacker.info.shortened_name(),
220+
defender.info.shortened_name(),
221+
defender.info.shortened_name()
222+
),
223+
format!(
224+
"{} and {} engage in a heated scuffle, but {} emerges the winner.",
225+
attacker.info.shortened_name(),
226+
defender.info.shortened_name(),
227+
defender.info.shortened_name()
228+
),
229+
format!(
230+
"It's {} versus {} in a wild brawl! {} prevails in the end.",
231+
attacker.info.shortened_name(),
232+
defender.info.shortened_name(),
233+
defender.info.shortened_name()
234+
),
235+
format!(
236+
"{} and {} come to blows during the game. {} manages to give the best shots.",
237+
attacker.info.shortened_name(),
238+
defender.info.shortened_name(),
239+
defender.info.shortened_name()
240+
),
241+
format!(
242+
"The battle between {} and {} wraps up with {} as the victor.",
243+
attacker.info.shortened_name(),
244+
defender.info.shortened_name(),
245+
defender.info.shortened_name()
246+
),
247+
]
248+
.choose(rng)
249+
.expect("There should be an option")
250+
.clone()
143251
}
144252
}
145253
};

0 commit comments

Comments
 (0)