@@ -197,6 +197,8 @@ class RuleSet(abc.Serializable):
197197 The percentage of rent prices relative to the regular price.
198198 house_auction_durations: :class:`int`
199199 The duration of house auctions.
200+ shared_xp_bonus: :class:`bool`
201+ Whether there is a bonus for sharing experience or not.
200202 """
201203
202204 __slots__ = (
@@ -211,6 +213,7 @@ class RuleSet(abc.Serializable):
211213 "loot_probability" ,
212214 "rent_percentage" ,
213215 "house_auction_durations" ,
216+ "shared_xp_bonus" ,
214217 )
215218
216219 def __init__ (self , ** kwargs ):
@@ -225,6 +228,7 @@ def __init__(self, **kwargs):
225228 self .loot_probability = kwargs .get ("loot_probability" )
226229 self .rent_percentage = kwargs .get ("rent_percentage" )
227230 self .house_auction_durations = kwargs .get ("house_auction_durations" )
231+ self .shared_xp_bonus = kwargs .get ("shared_xp_bonus" )
228232
229233 def __repr__ (self ):
230234 attributes = ""
@@ -253,24 +257,36 @@ class ScoreSet(abc.Serializable):
253257
254258 Attributes
255259 ----------
260+ creature_kills: :class:`dict`
261+ Points received for participating in creature kills.
256262 level_gain_loss: :class:`int`
257263 The points gained for leveling up or lost for losing a level.
264+ skill_gain_loss: :class:`int`
265+ The points gained for leveling up or lost for losing a skill level.
258266 charm_point_multiplier: :class:`int`
259267 The multiplier for every charm point.
260268 character_death: :class:`int`
261269 The points lost for dying.
270+ area_discovery: :class:`int`
271+ Points that will be added to the score for discovering an area entirely.
262272 """
263273
264274 __slots__ = (
275+ "creature_kills" ,
265276 "level_gain_loss" ,
277+ "skill_gain_loss" ,
266278 "charm_point_multiplier" ,
267279 "character_death" ,
280+ "area_discovery" ,
268281 )
269282
270283 def __init__ (self , ** kwargs ):
284+ self .creature_kills = kwargs .get ("creature_kills" , {})
271285 self .level_gain_loss = kwargs .get ("level_gain_loss" , 0 )
286+ self .skill_gain_loss = kwargs .get ("skill_gain_loss" , 0 )
272287 self .charm_point_multiplier = kwargs .get ("charm_point_multiplier" , 0 )
273288 self .character_death = kwargs .get ("character_death" , 0 )
289+ self .area_discovery = kwargs .get ("area_discovery" , 0 )
274290
275291 def __repr__ (self ):
276292 attributes = ""
@@ -453,7 +469,7 @@ def _parse_tournament_rules(self, table):
453469 The table containing the tournament rule set.
454470 """
455471 rows = table .find_all ('tr' )
456- bool_fields = ("playtime_reduced_only_in_combat" ,)
472+ bool_fields = ("playtime_reduced_only_in_combat" , "shared_xp_bonus" )
457473 float_fields = (
458474 "death_penalty_modifier" ,
459475 "xp_multiplier" ,
@@ -486,15 +502,22 @@ def _parse_tournament_scores(self, table):
486502 table: :class:`bs4.BeautifulSoup`
487503 The parsed table containing the tournament score set.
488504 """
505+ creatures = {}
489506 rows = table .find_all ('tr' )
490507 rules = {}
491508 for row in rows [1 :]:
492509 cols_raw = row .find_all ('td' )
493510 cols = [ele .text .strip () for ele in cols_raw ]
494511 field , value , * _ = cols
512+ icon = cols_raw [2 ].find ("span" )
495513 field = field .replace ("\xa0 " , "_" ).replace (" " , "_" ).replace (":" , "" ).replace ("/" , "_" ).lower ()
496514 value = re .sub (r'[^-0-9]' , '' , value .replace ("+/-" , "" ))
497- rules [field ] = parse_integer (value )
515+ if not icon :
516+ creatures [field .replace ("_" , " " )] = int (value )
517+ else :
518+ rules [field ] = parse_integer (value )
519+ if "creature_kills" in rules :
520+ rules ["creature_kills" ] = creatures
498521 self .score_set = ScoreSet (** rules )
499522
500523 def _parse_tournament_rewards (self , table ):
@@ -583,7 +606,7 @@ def _parse_archive_list(self, archive_table):
583606
584607 Parameters
585608 ----------
586- archive_table: :class:`bs4.BeautifulSoup `
609+ archive_table: :class:`bs4.Tag `
587610 The parsed element containing the table.
588611 """
589612 _ , * options = archive_table .find_all ("option" )
0 commit comments