albibong 1.0.5__py3-none-any.whl → 1.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,7 +71,7 @@ class Character:
71
71
  self.fame_gained += fame
72
72
  event = {
73
73
  "type": "update_fame",
74
- "payload": {"username": self.username, "fame_gained": fame},
74
+ "payload": {"username": self.username, "fame_gained": self.fame_gained},
75
75
  }
76
76
  send_event(event)
77
77
 
@@ -80,7 +80,10 @@ class Character:
80
80
  self.re_spec_gained += re_spec
81
81
  event = {
82
82
  "type": "update_re_spec",
83
- "payload": {"username": self.username, "re_spec_gained": re_spec},
83
+ "payload": {
84
+ "username": self.username,
85
+ "re_spec_gained": self.re_spec_gained,
86
+ },
84
87
  }
85
88
  send_event(event)
86
89
 
@@ -91,7 +94,10 @@ class Character:
91
94
  self.silver_gained += silver
92
95
  event = {
93
96
  "type": "update_silver",
94
- "payload": {"username": self.username, "silver_gained": silver},
97
+ "payload": {
98
+ "username": self.username,
99
+ "silver_gained": self.silver_gained,
100
+ },
95
101
  }
96
102
  send_event(event)
97
103
  else:
@@ -7,10 +7,16 @@ from albibong.threads.websocket_server import send_event
7
7
 
8
8
 
9
9
  def handle_operation_join(world_data: WorldData, parameters):
10
+ # update relative id if character has initialized before
11
+ if world_data.me.username != "not initialized":
12
+ WorldDataUtils.convert_id_to_name(
13
+ world_data,
14
+ old_id=world_data.me.id,
15
+ new_id=parameters[0],
16
+ char=world_data.me,
17
+ )
18
+
10
19
  # set my character
11
- WorldDataUtils.convert_id_to_name(
12
- world_data, old_id=world_data.me.id, new_id=parameters[0], char=world_data.me
13
- )
14
20
  world_data.me.uuid = Utils.convert_int_arr_to_uuid(parameters[1])
15
21
  world_data.me.username = parameters[2]
16
22
  world_data.me.guild = parameters[57] if 57 in parameters else ""
@@ -30,7 +36,7 @@ def handle_operation_join(world_data: WorldData, parameters):
30
36
  # set map my character is currently in
31
37
  if parameters[8][0] == "@":
32
38
  area = parameters[8].split("@")
33
- if area[1] == "RANDOMDUNGEON":
39
+ if area[1] == "RANDOMDUNGEON" or area[1] == "MISTS":
34
40
  check_map = Location.get_location_from_code(area[1])
35
41
  WorldDataUtils.start_current_dungeon(
36
42
  world_data, type=check_map.type, name=check_map.name
@@ -52,10 +52,20 @@ class WorldDataUtils:
52
52
  def set_dungeon_status(
53
53
  world_data: WorldData, check_map: Location, map_type_splitted: set
54
54
  ):
55
- if "EXPEDITION" in map_type_splitted or "DUNGEON" in map_type_splitted:
55
+ if "EXPEDITION" in map_type_splitted:
56
56
  WorldDataUtils.start_current_dungeon(
57
57
  world_data, type=check_map.type, name=check_map.name
58
58
  )
59
+ elif "DUNGEON" in map_type_splitted:
60
+ WorldDataUtils.start_current_dungeon(
61
+ world_data,
62
+ type=check_map.type,
63
+ name=(
64
+ f"{check_map.name} at {world_data.current_map.name}"
65
+ if world_data.current_map
66
+ else check_map.name
67
+ ),
68
+ )
59
69
  elif (
60
70
  "EXPEDITION" not in map_type_splitted or "DUNGEON" not in map_type_splitted
61
71
  ):
@@ -13,34 +13,6 @@ class Location:
13
13
  self.name = name
14
14
  self.type = type
15
15
 
16
- def is_black_zone(self):
17
- if self.type == "OPENPVP_BLACK":
18
- return True
19
- elif self.type == "DUNGEON_BLACK":
20
- return True
21
- elif self.type == "PASSAGE_BLACK":
22
- return True
23
- elif self.type == "TUNNEL":
24
- return True
25
- else:
26
- return False
27
-
28
- def is_red_zone(self):
29
- if self.type == "OPENPVP_RED":
30
- return True
31
- elif self.type == "DUNGEON_RED":
32
- return True
33
- elif self.type == "PASSAGE_RED":
34
- return True
35
- else:
36
- return False
37
-
38
- def is_safe_zone(self):
39
- if self.is_black_zone() == False and self.is_red_zone() == False:
40
- return True
41
- else:
42
- return False
43
-
44
16
  @classmethod
45
17
  def get_location_from_code(cls, code: str):
46
18
  location = map_data[code]
@@ -0,0 +1 @@
1
+ *{box-sizing:border-box}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}p{margin:0}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}#root,body{margin:auto;display:flex;flex-direction:column;justify-content:start;align-items:center;min-width:320px;min-height:100vh;color:#fff;width:100%}h1{font-size:2em;line-height:1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}._dmgBar_uvx94_1{background:linear-gradient(135deg,#ff6486,#6486ff);height:6px;border-radius:8px;margin-bottom:2px}._healBar_uvx94_8{background:linear-gradient(135deg,#64ffde,#64ff90);height:2px;border-radius:4px}._dpsContainer_uvx94_14{display:flex;flex-direction:column;justify-content:flex-start;width:100%;gap:4px;box-sizing:content-box;padding:16px}._dpsRow_uvx94_24{display:flex;flex-direction:row;justify-content:space-between;align-items:center}._dpsNumber_uvx94_31{width:128px;text-align:right}._dpsButton_uvx94_36{display:flex;flex-grow:1;gap:1rem}._hidden_uvx94_42{display:none}._player_uvx94_46{flex-grow:1}._checkboxColor_uvx94_50{accent-color:#64d3ff}._dungeonContainer_3nxyx_1{border-radius:1rem;width:100%;padding:2rem;display:flex;flex-direction:column;gap:1rem}._tag_3nxyx_12{background-color:#64d3ff;padding:0 1rem;border-radius:1rem;color:#0f3c4e;font-weight:700}._stickToTop_3nxyx_20{z-index:10;position:sticky;top:64px;left:0;width:100%;padding:24px 0}._container_pkz1i_1{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;gap:1.5rem}._snackbar_pkz1i_10{position:fixed;right:64px}._stats_pkz1i_15{display:flex;flex-direction:row;align-items:center;gap:.5rem}._options_pkz1i_22{display:flex;flex-direction:row;align-items:center;gap:2rem}._row_pkz1i_29{display:flex;width:100%;justify-content:space-between}._hidden_pkz1i_35{display:none}