Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
PhoenixFire6934 committed Jan 15, 2021
1 parent 64bc213 commit c4a6dd9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions Logic/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Players:
gems = settings['Gems']
gold = settings['Gold']
tickets = settings['Tickets']
theme_id = 41000000 + settings['ThemeID']
tokens = 0


Expand Down
11 changes: 5 additions & 6 deletions Logic/Shop.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,21 @@ class Shop:

offers = [

# Star Shop
{
'ID': 14, # Big Box
'ID': 6,
'OfferTitle': 'SPECIAL OFFER',
'Cost': 0,
'Cost': 20,
'Multiplier': 1,
'SkinID': 0,
'ShopType': 3,
'ShopType': 0,
'ShopDisplay': 0,
'Timer': 99999
},

{
'ID': 10, # Mega Box
'ID': 10,
'OfferTitle': 'SPECIAL OFFER',
'Cost': 0,
'Cost': 1500,
'Multiplier': 1,
'SkinID': 0,
'ShopType': 3,
Expand Down
15 changes: 15 additions & 0 deletions Packets/Commands/Client/Buy_Offer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from Packets.Commands.Server.Buy_Brawl_Box_Callback import BuyBrawlBoxCallback
from Packets.Messages.Server.Out_Of_Sync_Message import OutOfSyncMessage
from Database.DataBase import DataBase
from Logic.Shop import Shop

from Utils.Reader import BSMessageReader
Expand All @@ -20,6 +21,18 @@ def decode(self):

def process(self):
id = Shop.offers[self.offer_index]['ID']
type = Shop.offers[self.offer_index]['ShopType']
cost = Shop.offers[self.offer_index]['Cost']

def res(type):
if type == 0 or type == 2:
newGems = self.player.gems - cost
self.player.gems = newGems
DataBase.replaceValue(self, 'gems', newGems)
elif type == 3:
newStarPoints = self.player.star_points - cost
self.player.star_points = newStarPoints
DataBase.replaceValue(self, 'starpoints', newStarPoints)

if id in [0, 6, 10, 14]:

Expand All @@ -32,6 +45,8 @@ def process(self):
elif id == 10:
self.player.box_id = 3

res(type)

BuyBrawlBoxCallback(self.client, self.player).send()

else:
Expand Down
8 changes: 3 additions & 5 deletions Packets/Messages/Server/Home/Own_Home_Data_Message.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def encode(self):

self.writeVint(500) # Starting Level (exp points)

self.writeScId(28, self.player.profile_icon) # Player Icon ID
self.writeScId(28, self.player.profile_icon) # Player Icon ID
self.writeScId(43, self.player.name_color) # Player Name Color ID

self.writeVint(0) # array
Expand Down Expand Up @@ -223,11 +223,9 @@ def encode(self):

self.writeVint(0) # array

self.writeVint(2) # Menu Theme
self.writeInt(1)
self.writeInt(41000011) # Theme ID
self.writeInt(30)
self.writeVint(1) # Menu Theme
self.writeInt(1)
self.writeInt(self.player.theme_id)

self.writeVint(0) # array

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Gems": 99999, "Gold": 99999, "Tickets": 99999, "Starpoints": 99999, "BrawlBoxTokens": 5000, "BigBoxTokens": 5000, "Trophies": 5000, "BrawlerTrophies": 500, "BrawlerTrophiesForRank": 500, "BrawlerPowerLevel": 8, "BrawlerUpgradePoints": 0, "ShowPacketsInLog": false, "Maintenance": false, "MaintenanceTime": 3600, "Patch": false, "PatchUrl": "http://192.168.0.103:8080/", "UpdateUrl": "https://github.com/PhoenixFire6879/Classic-Brawl"}
{"Gems": 99999, "Gold": 99999, "Tickets": 99999, "Starpoints": 99999, "BrawlBoxTokens": 5000, "BigBoxTokens": 5000, "Trophies": 5000, "BrawlerTrophies": 500, "BrawlerTrophiesForRank": 500, "BrawlerPowerLevel": 8, "BrawlerUpgradePoints": 0, "ThemeID": 11, "ShowPacketsInLog": false, "Maintenance": false, "MaintenanceTime": 3600, "Patch": false, "PatchUrl": "http://192.168.0.103:8080/", "UpdateUrl": "https://github.com/PhoenixFire6879/Classic-Brawl"}

0 comments on commit c4a6dd9

Please sign in to comment.