Skip to content

Commit

Permalink
Fixed Human support. Tower Bosses will no longer be blocked from thei…
Browse files Browse the repository at this point in the history
…r signature moves.
  • Loading branch information
EternalWraith committed Feb 20, 2024
1 parent 9b28a32 commit 24776ba
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 18 deletions.
15 changes: 15 additions & 0 deletions palworld_pal_edit/EmptyObjectHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@
"type": "IntProperty"
}

EmptyHpObject = {
"struct_type": "FixedPoint64",
"struct_id": "00000000-0000-0000-0000-000000000000",
"id": None,
"value": {
"Value": {
"id": None,
"value": 0,
"type": "Int64Property"
}
},
"type": "StructProperty"
}


EmptyRarePalObject = {
"value": False,
"id": None,
Expand Down
31 changes: 21 additions & 10 deletions palworld_pal_edit/PalEdit.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def skip_encode(


class PalEditConfig:
version = "0.6.5"
version = "0.6.6"
ftsize = 18
font = "Arial"
badskill = "#DE3C3A"
Expand Down Expand Up @@ -485,25 +485,35 @@ def onselect(self, evt):
self.editindex = index

pal = self.palbox[self.players[self.current.get()]][index]
# palname.config(text=pal.GetName())


# All Entities
self.speciesvar.set(pal.GetCodeName())
self.speciesvar_name.set(pal.GetName())

self.storageId.config(text=f"StorageID: {pal.storageId}")
self.storageSlot.config(text=f"StorageSlot: {pal.storageSlot}")

self.portrait.config(image=pal.GetImage())

# palname.config(text=pal.GetName())

g = pal.GetGender()
self.palgender.config(text=g,
fg=PalInfo.PalGender.MALE.value if g == "Male ♂" else PalInfo.PalGender.FEMALE.value)

self.title.config(text=f"{pal.GetNickname()}")
self.level.config(text=f"Lv. {pal.GetLevel() if pal.GetLevel() > 0 else '?'}")

self.portrait.config(image=pal.GetImage())
calc = pal.CalculateIngameStats()
self.hthstatval.config(text=calc["HP"])
self.atkstatval.config(text=calc["ATK"])
self.defstatval.config(text=calc["DEF"])
if not pal.IsTower() and not pal.IsHuman():
calc = pal.CalculateIngameStats()
self.hthstatval.config(text=calc["HP"])
self.atkstatval.config(text=calc["ATK"])
self.defstatval.config(text=calc["DEF"])
else:
self.hthstatval.config(text="n/a")
self.atkstatval.config(text="n/a")
self.defstatval.config(text="n/a")

self.fruitOptions['values'] = [PalInfo.PalAttacks[aval] for aval in pal.GetAvailableSkills()]

Expand Down Expand Up @@ -666,7 +676,7 @@ def loadpal(self, paldata):
# print(f"{pl} - {plguid}")
# self.players[pl] = plguid
else:
self.unknown.append(i['key']['InstanceId']['value'])
self.unknown.append(str(e))
print(f"Error occured on {i['key']['InstanceId']['value']}: {e.__class__.__name__}: {str(e)}")
#traceback.print_exception(e)
print()
Expand All @@ -681,7 +691,7 @@ def loadpal(self, paldata):
logger.WriteLog(f"NOTE: Unknown list is a list of pals that could not be loaded")
logger.WriteLog(f"Unknown list contains {len(self.unknown)} entries")
for i in self.unknown:
logger.WriteLog(i)
logger.WriteLog(str(i))

logger.Space()
logger.WriteLog(f"{len(self.players)} players found:")
Expand Down Expand Up @@ -813,7 +823,8 @@ def generateguid(self):
print(newguid)

def handleMaxHealthUpdates(self, pal: PalEntity, changes: dict):
pal.UpdateMaxHP()
if not pal.IsTower() and not pal.IsHuman():
pal.UpdateMaxHP()

def OLD_handleMaxHealthUpdates(self, pal: PalEntity, changes: dict):
retval = pal.UpdateMaxHP(changes)
Expand Down
8 changes: 8 additions & 0 deletions palworld_pal_edit/PalInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,16 @@ def __init__(self, data):
self._equipMoves = self._obj["EquipWaza"]["value"]["values"]

self.CleanseAttacks()
if not "HP" in self._obj:
self._obj["HP"] = copy.deepcopy(EmptyHpObject)
self.UpdateMaxHP()

def IsHuman(self):
return self._type._human

def IsTower(self):
return self._type._tower

def SwapGender(self):
if self._obj['Gender']['value']['value'] == "EPalGenderType::Male":
self._obj['Gender']['value']['value'] = "EPalGenderType::Female"
Expand Down
8 changes: 4 additions & 4 deletions palworld_pal_edit/resources/data/attacks.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"Name": "Divine Disaster",
"Type": "Dark",
"Power": 160,
"Exclusive": ["BlackGriffon"]
"Exclusive": ["BlackGriffon", "GYM_BlackGriffon"]
},
{
"CodeName": "EPalWazaID::DragonBreath",
Expand Down Expand Up @@ -401,7 +401,7 @@
"Name": "Kerauno",
"Type": "Electric",
"Power": 100,
"Exclusive": ["ThunderDragonMan"]
"Exclusive": ["ThunderDragonMan", "GYM_ThunderDragonMan"]
},
{
"CodeName": "EPalWazaID::Unique_KingAlpaca_BodyPress",
Expand All @@ -421,7 +421,7 @@
"Name": "Lightning Claw",
"Type": "Electric",
"Power": 90,
"Exclusive": ["ElecPanda"]
"Exclusive": ["ElecPanda", "GYM_ElecPanda"]
},
{
"CodeName": "EPalWazaID::ThunderRain",
Expand Down Expand Up @@ -510,7 +510,7 @@
"Name": "Phoenix Flare",
"Type": "Fire",
"Power": 135,
"Exclusive": ["Horus"]
"Exclusive": ["Horus", "GYM_Horus"]
},
{
"CodeName": "EPalWazaID::ThunderFunnel",
Expand Down
8 changes: 4 additions & 4 deletions palworld_pal_edit/resources/data/attacks_zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"Name": "神圣灾祸[异构格里芬]",
"Type": "Dark",
"Power": 160,
"Exclusive": ["BlackGriffon"]
"Exclusive": ["BlackGriffon", "GYM_BlackGriffon"]
},
{
"CodeName": "EPalWazaID::DragonBreath",
Expand Down Expand Up @@ -401,7 +401,7 @@
"Name": "雷神之枪[波鲁杰克斯]",
"Type": "Electric",
"Power": 100,
"Exclusive": ["ThunderDragonMan"]
"Exclusive": ["ThunderDragonMan", "GYM_ThunderDragonMan"]
},
{
"CodeName": "EPalWazaID::Unique_KingAlpaca_BodyPress",
Expand All @@ -421,7 +421,7 @@
"Name": "霹雳连爪[暴电熊]",
"Type": "Electric",
"Power": 90,
"Exclusive": ["ElecPanda"]
"Exclusive": ["ElecPanda", "GYM_ElecPanda"]
},
{
"CodeName": "EPalWazaID::ThunderRain",
Expand Down Expand Up @@ -510,7 +510,7 @@
"Name": "凤凰翔波[荷鲁斯]",
"Type": "Fire",
"Power": 135,
"Exclusive": ["Horus"]
"Exclusive": ["Horus", "GYM_Horus"]
},
{
"CodeName": "EPalWazaID::ThunderFunnel",
Expand Down
Binary file added palworld_pal_edit/resources/pals/Human.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24776ba

Please sign in to comment.