feat: baka

This commit is contained in:
pwgen2155 2024-02-29 21:38:33 +11:00
parent 037045acd2
commit f49563217d
2 changed files with 32 additions and 29 deletions

View file

@ -2155,7 +2155,7 @@ class DawdleBot(abstract.AbstractBot):
ilvl = player.item_level(si.kind) + fudge
self.notice(player.nick,
f"The light of the gods shines down upon you! You have "
f"found the {C('item')}level {ilvl} {si.name}{C()}! {si.flavor}")
f"found the S Tier {C('item')}level {ilvl} {si.name}{C()}! {si.flavor}")
player.acquire_item(si.kind, ilvl, si.name)
self._db.write_players([player])
return
@ -2177,7 +2177,7 @@ class DawdleBot(abstract.AbstractBot):
self.notice(player.nick,
f"You found a {C('item')}level {level} {Item.DESC[slot]}{C()}. "
f"Your current {C('item', Item.DESC[slot])} is level {old_level}, "
f"so it seems Luck is against you. You toss the {C('item', Item.DESC[slot])}.")
f"it seems Luck is against you. You toss the shit {C('item', Item.DESC[slot])}.")
def pvp_battle(self, player: Player, opp: Optional[Player], flavor_start: str, flavor_win: str, flavor_loss: str) -> None:
@ -2208,14 +2208,17 @@ class DawdleBot(abstract.AbstractBot):
f"{duration(penalty)} is added to {C('name', opp.name)}'s clock.")
opp.nextlvl += penalty
self.chanmsg(f"{C('name', opp.name)} reaches next level in {duration(opp.nextlvl)}.")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"the baka")
elif player.level > 19 and rand.randomly('pvp_swap_item', 25):
slot = rand.choice('pvp_swap_itemtype', Item.SLOTS)
playeritem = player.item_level(slot)
oppitem = opp.item_level(slot)
if oppitem > playeritem:
self.logchanmsg([player, opp], f"In the fierce battle, {C('name', opp.name)} dropped their {C('item')}level "
f"{oppitem} {Item.DESC[slot]}{C()}! {C('name', player.name)} picks it up, tossing "
f"their old {C('item')}level {playeritem} {Item.DESC[slot]}{C()} to {C('name', opp.name)}.")
self.logchanmsg([player, opp], f"In the fierce battle for pantsu, {C('name', opp.name)} "
f"dropped their {C('item')}level {oppitem} {Item.DESC[slot]}{C()}! "
f"{C('name', player.name)} realising their luck, picks it up, tossing "
f"their old busted {C('item')}level {playeritem} {Item.DESC[slot]}{C()} to {C('name', opp.name)}.")
player.swap_items(opp, slot)
else:
# Losing
@ -2228,8 +2231,11 @@ class DawdleBot(abstract.AbstractBot):
self.chanmsg(f"{C('name', player.name)} reaches next level in {duration(player.nextlvl)}.")
if rand.randomly('pvp_find_item', {'g': 50, 'n': 67, 'e': 100}[player.alignment]):
self.logchanmsg([player], f"While recovering from battle, {C('name', player.name)} notices a glint "
f"in the mud. Upon investigation, they find an old lost item!")
self.logchanmsg([player], "While recovering from a strenuous battle of thumb wrestling "
f"{C('name', player.name)} notices something "
f"in the mud. Upon investigation, they find an old lost item!")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"the lucky baka")
self.find_item(player)
@ -2295,6 +2301,8 @@ class DawdleBot(abstract.AbstractBot):
elif slot == "boots":
msg = f"{C('name', player.name)} stepped in some hot lava!"
self.logchanmsg([player], msg + f" {C('name')}{player.name}'s{C()} {C('item', Item.DESC[slot])} loses 10% of its effectiveness.")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"baka")
player.items[slot].level = int(player.items[slot].level * 0.9)
return
@ -2339,6 +2347,8 @@ class DawdleBot(abstract.AbstractBot):
msg = f"A sorceror enchanted {C('name')}{player.name}'s{C()} {C('item', 'boots')} with Swiftness!"
self.logchanmsg([player], msg + f" {C('name')}{player.name}'s{C()} {C('item', Item.DESC[slot])} gains 10% effectiveness.")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"WTFBBQ")
player.items[slot].level = int(player.items[slot].level * 1.1)
return
@ -2375,13 +2385,18 @@ class DawdleBot(abstract.AbstractBot):
f"You made to steal {C('name', target.name)}'s {C('item', Item.DESC[slot])}, "
f"but realized it was lower level than your own. You creep "
f"back into the shadows.")
if rand.randomly('insult', 0, 2):
self.notice(player.nick, (f"you creep."))
else:
amount = int(player.nextlvl * rand.randint('evilness_penalty_pct', 1,6) / 100)
player.nextlvl += amount
self.logchanmsg([player], f"{C('name', player.name)} is forsaken by their evil god. {duration(amount)} is "
f"added to their clock.")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"YOUR INSOLENCE WILL NOT BE FORGOTTEN {C('name', player.name)}")
if player.nextlvl > 0:
self.chanmsg(f"{C('name', player.name)} reaches next level in {duration(player.nextlvl)}.")
self.chanmsg("weeb")
def goodness(self, op: List[Player]) -> None:
"""Bring two good players closer to their next level."""
@ -2448,12 +2463,15 @@ class DawdleBot(abstract.AbstractBot):
if (p.posx, p.posy) in combatants:
combatant = combatants[(p.posx, p.posy)]
if combatant.isadmin and rand.randomly('move_player_bow', 100):
self.chanmsg(f"{C('name', p.name)} encounters {C('name', combatant.name)} and bows humbly.")
self.chanmsg(f"{C('name', p.name)} encounters {C('name', combatant.name)} and bows humbly, knowing the end is neigh")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"Their heads hit as if a comedy routine is playing out before our eyes"
"Hot and flusted their cheeks turn red from embarressment")
elif rand.randomly('move_player_combat', len(op)):
self.pvp_battle(p, combatant,
'come upon',
'and taken them in combat',
'and been defeated in combat')
"come upon",
"and took them for all they were worth (in combat), which wasn't very much",
"and was defeated in combat, like a wet lily")
del combatants[(p.posx, p.posy)]
else:
combatants[(p.posx, p.posy)] = p
@ -2481,6 +2499,9 @@ class DawdleBot(abstract.AbstractBot):
self.chanmsg(f"{C('name', qp[0].name)}, {C('name', qp[1].name)}, {C('name', qp[2].name)}, and {C('name', qp[3].name)} have "
f"been chosen by the gods to {new_quest.text}. Quest to end in "
f"{duration(quest_time)}.")
if rand.randomly('insult', 0, 2):
self.chanmsg(f"or, like, whenever... what's even the point? They only walk from here to there, anyone could do that"
"I'm not like... going to join them or anything... not even if you asked")
log.info("Starting mode 1 quest with duration %s", duration(quest_time))
elif match[1] == '2':
new_quest.mode = 2

View file

@ -1,18 +0,0 @@
#!/bin/bash
#
DIR=./
mkdir -p "data"
cp setup/dawdle.conf "$DIR/data"
cp setup/events.txt "$DIR/data"
pushd "$DIR/site/"
SECRET_KEY="$(openssl rand -base64 45)"
sed -e "/^SECRET_KEY/ c \\SECRET_KEY = '${SECRET_KEY}'" \
-e "/^ALLOWED_HOSTS/ c \\ALLOWED_HOSTS = ['${HOST}']" \
-e "/^DEBUG/ c \\DEBUG = False" \
setup/project-settings.py \
>project/settings.py
./manage.py migrate --database=default
./manage.py migrate --database=game
./manage.py collectstatic --no-input
cd "$DIR"
"$DIR/dawdle.py" --setup "$DIR/data/dawdle.conf"