fixed a bug with nunchucks not saving weapon speed. Updated libstormgames.
This commit is contained in:
Submodule libstormgames updated: 8cca66d44e...acb899e6eb
@@ -101,6 +101,7 @@ class SaveManager:
|
|||||||
"range": weapon.range,
|
"range": weapon.range,
|
||||||
"attackSound": weapon.attackSound,
|
"attackSound": weapon.attackSound,
|
||||||
"hitSound": weapon.hitSound,
|
"hitSound": weapon.hitSound,
|
||||||
|
"cooldown": weapon.cooldown,
|
||||||
"attackDuration": weapon.attackDuration,
|
"attackDuration": weapon.attackDuration,
|
||||||
"speedBonus": getattr(weapon, "speedBonus", 1.0),
|
"speedBonus": getattr(weapon, "speedBonus", 1.0),
|
||||||
"jumpDurationBonus": getattr(weapon, "jumpDurationBonus", 1.0),
|
"jumpDurationBonus": getattr(weapon, "jumpDurationBonus", 1.0),
|
||||||
@@ -117,18 +118,24 @@ class SaveManager:
|
|||||||
# Handle backward compatibility for old saves
|
# Handle backward compatibility for old saves
|
||||||
speedBonus = data.get("speedBonus", 1.0)
|
speedBonus = data.get("speedBonus", 1.0)
|
||||||
jumpDurationBonus = data.get("jumpDurationBonus", 1.0)
|
jumpDurationBonus = data.get("jumpDurationBonus", 1.0)
|
||||||
|
cooldown = data.get("cooldown", 500) # Default cooldown for old saves
|
||||||
|
|
||||||
# For old saves, restore proper bonuses for specific weapons
|
# For old saves, restore proper bonuses and cooldowns for specific weapons
|
||||||
if data["name"] == "witch_broom" and speedBonus == 1.0:
|
if data["name"] == "witch_broom" and speedBonus == 1.0:
|
||||||
speedBonus = 1.17
|
speedBonus = 1.17
|
||||||
jumpDurationBonus = 1.25
|
jumpDurationBonus = 1.25
|
||||||
|
|
||||||
|
# Restore proper cooldown for nunchucks in old saves
|
||||||
|
if data["name"] == "nunchucks" and cooldown == 500:
|
||||||
|
cooldown = 250
|
||||||
|
|
||||||
weapon = Weapon(
|
weapon = Weapon(
|
||||||
name=data["name"],
|
name=data["name"],
|
||||||
damage=data["damage"],
|
damage=data["damage"],
|
||||||
range=data["range"],
|
range=data["range"],
|
||||||
attackSound=data["attackSound"],
|
attackSound=data["attackSound"],
|
||||||
hitSound=data["hitSound"],
|
hitSound=data["hitSound"],
|
||||||
|
cooldown=cooldown,
|
||||||
attackDuration=data["attackDuration"],
|
attackDuration=data["attackDuration"],
|
||||||
speedBonus=speedBonus,
|
speedBonus=speedBonus,
|
||||||
jumpDurationBonus=jumpDurationBonus,
|
jumpDurationBonus=jumpDurationBonus,
|
||||||
|
Reference in New Issue
Block a user