Grant winners 10 points on royal rumble wins
This commit is contained in:
parent
b71a7e04d9
commit
f52cbc8646
13
src/main.rs
13
src/main.rs
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user