Add XP loss for missing ducks
- Players now lose 1 XP when missing a duck - Updated miss message to show XP loss - XP cannot go below 0
This commit is contained in:
@@ -7,11 +7,11 @@
|
|||||||
"duck_flies_away": "The duck flies away. ·°'`'°-.,¸¸.·°'`",
|
"duck_flies_away": "The duck flies away. ·°'`'°-.,¸¸.·°'`",
|
||||||
"fast_duck_flies_away": "The fast duck quickly flies away! ·°'`'°-.,¸¸.·°'`",
|
"fast_duck_flies_away": "The fast duck quickly flies away! ·°'`'°-.,¸¸.·°'`",
|
||||||
"golden_duck_flies_away": "The {gold}golden duck{reset} flies away majestically. ·°'`'°-.,¸¸.·°'`",
|
"golden_duck_flies_away": "The {gold}golden duck{reset} flies away majestically. ·°'`'°-.,¸¸.·°'`",
|
||||||
"bang_hit": "{nick} > {red}*BANG*{reset} You shot the duck! [+{xp_gained} xp] [Total ducks: {ducks_shot}]",
|
"bang_hit": "{nick} > {red}*BANG*{reset} You shot the duck! \\_X< *KWAK* {green}[+{xp_gained} xp]{reset} [Total ducks: {ducks_shot}]",
|
||||||
"bang_hit_golden": "{nick} > {red}*BANG*{reset} You shot a {gold}GOLDEN DUCK!{reset} [{hp_remaining} HP remaining] [+{xp_gained} xp]",
|
"bang_hit_golden": "{nick} > {red}*BANG*{reset} You shot a {gold}GOLDEN DUCK!{reset} [{hp_remaining} HP remaining] {green}[+{xp_gained} xp]{reset} [Total ducks: {ducks_shot}]",
|
||||||
"bang_hit_golden_killed": "{nick} > {red}*BANG*{reset} You killed the GOLDEN DUCK! [+{xp_gained} xp] [Total ducks: {ducks_shot}]",
|
"bang_hit_golden_killed": "{nick} > {red}*BANG*{reset} You killed the GOLDEN DUCK! [+{xp_gained} xp] [Total ducks: {ducks_shot}]",
|
||||||
"bang_hit_fast": "{nick} > {red}*BANG*{reset} You shot a FAST DUCK! [+{xp_gained} xp] [Total ducks: {ducks_shot}]",
|
"bang_hit_fast": "{nick} > {red}*BANG*{reset} You shot a FAST DUCK! {green}[+{xp_gained} xp]{reset} [Total ducks: {ducks_shot}]",
|
||||||
"bang_miss": "{nick} > {red}*BANG*{reset} You missed the duck!",
|
"bang_miss": "{nick} > {red}*BANG*{reset} You missed the duck! {red}[-1 XP]{reset}",
|
||||||
"bang_friendly_fire_penalty": "{nick} > {red}*BANG*{reset} You missed and hit {victim}! {red}[GUN CONFISCATED]{reset} [LOST {xp_lost} XP]",
|
"bang_friendly_fire_penalty": "{nick} > {red}*BANG*{reset} You missed and hit {victim}! {red}[GUN CONFISCATED]{reset} [LOST {xp_lost} XP]",
|
||||||
"bang_friendly_fire_insured": "{nick} > *BANG* You missed and hit {victim}! {green}[INSURANCE PROTECTED - No penalties]{reset}",
|
"bang_friendly_fire_insured": "{nick} > *BANG* You missed and hit {victim}! {green}[INSURANCE PROTECTED - No penalties]{reset}",
|
||||||
"bang_no_duck": "{nick} > *BANG* What did you shoot at? There is no duck in the area... {red}[GUN CONFISCATED]{reset}",
|
"bang_no_duck": "{nick} > *BANG* What did you shoot at? There is no duck in the area... {red}[GUN CONFISCATED]{reset}",
|
||||||
|
|||||||
@@ -311,6 +311,10 @@ class DuckGame:
|
|||||||
else:
|
else:
|
||||||
# Miss! Duck stays in the channel
|
# Miss! Duck stays in the channel
|
||||||
player['shots_missed'] = player.get('shots_missed', 0) + 1 # Track missed shots
|
player['shots_missed'] = player.get('shots_missed', 0) + 1 # Track missed shots
|
||||||
|
|
||||||
|
# Lose 1 XP for missing
|
||||||
|
player['xp'] = max(0, player.get('xp', 0) - 1)
|
||||||
|
|
||||||
accuracy_loss = self.bot.get_config('gameplay.accuracy_loss_on_miss', 2)
|
accuracy_loss = self.bot.get_config('gameplay.accuracy_loss_on_miss', 2)
|
||||||
min_accuracy = self.bot.get_config('gameplay.min_accuracy', 10)
|
min_accuracy = self.bot.get_config('gameplay.min_accuracy', 10)
|
||||||
player['accuracy'] = max(player.get('accuracy', self.bot.get_config('player_defaults.accuracy', 75)) - accuracy_loss, min_accuracy)
|
player['accuracy'] = max(player.get('accuracy', self.bot.get_config('player_defaults.accuracy', 75)) - accuracy_loss, min_accuracy)
|
||||||
@@ -390,7 +394,7 @@ class DuckGame:
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Check befriend success rate from config and level modifiers
|
# Check befriend success rate from config and level modifiers
|
||||||
base_rate = self.bot.get_config('befriend_success_rate', 75)
|
base_rate = self.bot.get_config('gameplay.befriend_success_rate', 75)
|
||||||
try:
|
try:
|
||||||
if base_rate is not None:
|
if base_rate is not None:
|
||||||
base_rate = float(base_rate)
|
base_rate = float(base_rate)
|
||||||
@@ -408,7 +412,7 @@ class DuckGame:
|
|||||||
duck = self.ducks[channel].pop(0)
|
duck = self.ducks[channel].pop(0)
|
||||||
|
|
||||||
# Lower XP gain than shooting
|
# Lower XP gain than shooting
|
||||||
xp_gained = self.bot.get_config('befriend_duck_xp', 5)
|
xp_gained = self.bot.get_config('gameplay.befriend_xp', 5)
|
||||||
old_level = self.bot.levels.calculate_player_level(player)
|
old_level = self.bot.levels.calculate_player_level(player)
|
||||||
player['xp'] = player.get('xp', 0) + xp_gained
|
player['xp'] = player.get('xp', 0) + xp_gained
|
||||||
player['ducks_befriended'] = player.get('ducks_befriended', 0) + 1
|
player['ducks_befriended'] = player.get('ducks_befriended', 0) + 1
|
||||||
|
|||||||
Reference in New Issue
Block a user