Grant winners 10 points on royal rumble wins

This commit is contained in:
hgw 2023-10-10 11:05:33 +00:00
parent b71a7e04d9
commit f52cbc8646
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4

View File

@ -140,6 +140,13 @@ impl HallOfFame {
}; };
*winner += 3; *winner += 3;
} }
pub fn add_rumble_champion(&mut self, nick: &str) {
let winner = match self.entry(nick.to_owned()) {
std::collections::hash_map::Entry::Occupied(o) => o.into_mut(),
std::collections::hash_map::Entry::Vacant(v) => v.insert(0),
};
*winner += 10;
}
pub fn add_fucking_looser(&mut self, nick: &str) { pub fn add_fucking_looser(&mut self, nick: &str) {
let fucking_looser = match self.entry(nick.to_owned()) { let fucking_looser = match self.entry(nick.to_owned()) {
std::collections::hash_map::Entry::Occupied(o) => o.into_mut(), std::collections::hash_map::Entry::Occupied(o) => o.into_mut(),
@ -330,6 +337,9 @@ fn fight(
if fight.kind == FightKind::DeathMatch { if fight.kind == FightKind::DeathMatch {
hall_of_fame.add_winner(&winners[0].nick); hall_of_fame.add_winner(&winners[0].nick);
} }
if fight.kind == FightKind::RoyalRumble {
hall_of_fame.add_rumble_champion(&winners[0].nick);
}
} else { } else {
ctx.privmsg( ctx.privmsg(
&fight.channel, &fight.channel,
@ -354,6 +364,9 @@ fn fight(
if fight.kind == FightKind::DeathMatch { if fight.kind == FightKind::DeathMatch {
hall_of_fame.add_winner(&w.nick); hall_of_fame.add_winner(&w.nick);
} }
if fight.kind == FightKind::RoyalRumble {
hall_of_fame.add_rumble_champion(&w.nick);
}
} }
} }