@@ -197,6 +197,8 @@ class RuleSet(abc.Serializable):
197
197
The percentage of rent prices relative to the regular price.
198
198
house_auction_durations: :class:`int`
199
199
The duration of house auctions.
200
+ shared_xp_bonus: :class:`bool`
201
+ Whether there is a bonus for sharing experience or not.
200
202
"""
201
203
202
204
__slots__ = (
@@ -211,6 +213,7 @@ class RuleSet(abc.Serializable):
211
213
"loot_probability" ,
212
214
"rent_percentage" ,
213
215
"house_auction_durations" ,
216
+ "shared_xp_bonus" ,
214
217
)
215
218
216
219
def __init__ (self , ** kwargs ):
@@ -225,6 +228,7 @@ def __init__(self, **kwargs):
225
228
self .loot_probability = kwargs .get ("loot_probability" )
226
229
self .rent_percentage = kwargs .get ("rent_percentage" )
227
230
self .house_auction_durations = kwargs .get ("house_auction_durations" )
231
+ self .shared_xp_bonus = kwargs .get ("shared_xp_bonus" )
228
232
229
233
def __repr__ (self ):
230
234
attributes = ""
@@ -253,24 +257,36 @@ class ScoreSet(abc.Serializable):
253
257
254
258
Attributes
255
259
----------
260
+ creature_kills: :class:`dict`
261
+ Points received for participating in creature kills.
256
262
level_gain_loss: :class:`int`
257
263
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.
258
266
charm_point_multiplier: :class:`int`
259
267
The multiplier for every charm point.
260
268
character_death: :class:`int`
261
269
The points lost for dying.
270
+ area_discovery: :class:`int`
271
+ Points that will be added to the score for discovering an area entirely.
262
272
"""
263
273
264
274
__slots__ = (
275
+ "creature_kills" ,
265
276
"level_gain_loss" ,
277
+ "skill_gain_loss" ,
266
278
"charm_point_multiplier" ,
267
279
"character_death" ,
280
+ "area_discovery" ,
268
281
)
269
282
270
283
def __init__ (self , ** kwargs ):
284
+ self .creature_kills = kwargs .get ("creature_kills" , {})
271
285
self .level_gain_loss = kwargs .get ("level_gain_loss" , 0 )
286
+ self .skill_gain_loss = kwargs .get ("skill_gain_loss" , 0 )
272
287
self .charm_point_multiplier = kwargs .get ("charm_point_multiplier" , 0 )
273
288
self .character_death = kwargs .get ("character_death" , 0 )
289
+ self .area_discovery = kwargs .get ("area_discovery" , 0 )
274
290
275
291
def __repr__ (self ):
276
292
attributes = ""
@@ -453,7 +469,7 @@ def _parse_tournament_rules(self, table):
453
469
The table containing the tournament rule set.
454
470
"""
455
471
rows = table .find_all ('tr' )
456
- bool_fields = ("playtime_reduced_only_in_combat" ,)
472
+ bool_fields = ("playtime_reduced_only_in_combat" , "shared_xp_bonus" )
457
473
float_fields = (
458
474
"death_penalty_modifier" ,
459
475
"xp_multiplier" ,
@@ -486,15 +502,22 @@ def _parse_tournament_scores(self, table):
486
502
table: :class:`bs4.BeautifulSoup`
487
503
The parsed table containing the tournament score set.
488
504
"""
505
+ creatures = {}
489
506
rows = table .find_all ('tr' )
490
507
rules = {}
491
508
for row in rows [1 :]:
492
509
cols_raw = row .find_all ('td' )
493
510
cols = [ele .text .strip () for ele in cols_raw ]
494
511
field , value , * _ = cols
512
+ icon = cols_raw [2 ].find ("span" )
495
513
field = field .replace ("\xa0 " , "_" ).replace (" " , "_" ).replace (":" , "" ).replace ("/" , "_" ).lower ()
496
514
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
498
521
self .score_set = ScoreSet (** rules )
499
522
500
523
def _parse_tournament_rewards (self , table ):
@@ -583,7 +606,7 @@ def _parse_archive_list(self, archive_table):
583
606
584
607
Parameters
585
608
----------
586
- archive_table: :class:`bs4.BeautifulSoup `
609
+ archive_table: :class:`bs4.Tag `
587
610
The parsed element containing the table.
588
611
"""
589
612
_ , * options = archive_table .find_all ("option" )
0 commit comments