Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
30a19ca
move the create_event function to the items file
benny-dreamly Jan 6, 2026
d83657d
Revert "move the create_event function to the items file"
benny-dreamly Jan 6, 2026
57b5ca0
pass the world, player and options instead of getting them
benny-dreamly Jan 6, 2026
aaf7a41
start making a completion condition function
benny-dreamly Jan 6, 2026
05a7168
use the local goal variable
benny-dreamly Jan 6, 2026
3024298
call the new function
benny-dreamly Jan 6, 2026
c44a509
make a local variable for the goal value and reference it
benny-dreamly Jan 6, 2026
f0a92ea
make variables for the pack options
benny-dreamly Jan 6, 2026
6b045c8
more optimizing
benny-dreamly Jan 6, 2026
14b2e52
more optimizing again
benny-dreamly Jan 6, 2026
16bad25
move skill rules into new function
benny-dreamly Jan 6, 2026
908ce2c
move aspiration rules into new function
benny-dreamly Jan 6, 2026
e813dc7
cool aspiration function thing
benny-dreamly Jan 6, 2026
f1fa2f1
move the lookup stuff down
benny-dreamly Jan 6, 2026
452bbd9
note down what i'm thinking
benny-dreamly Jan 6, 2026
4f8144d
new structure for career logic
benny-dreamly Jan 6, 2026
4a48a54
use the new structure
benny-dreamly Jan 6, 2026
3fb5ece
make the set rules function leaner
benny-dreamly Jan 6, 2026
99f3afc
okay this should be good now
benny-dreamly Jan 6, 2026
d3ae8a9
move the completion condition call over
benny-dreamly Jan 6, 2026
cb6c2c0
oops that was broken at runtime
benny-dreamly Jan 6, 2026
fa3e777
move the helper functions down in order to make it easier to edit them
benny-dreamly Jan 6, 2026
d6cf72e
remove the old import
benny-dreamly Jan 6, 2026
d6fd1eb
rename the import
benny-dreamly Jan 6, 2026
620b265
let's not override the location constructor
benny-dreamly Jan 6, 2026
5b22429
add an event location creator method
benny-dreamly Jan 6, 2026
7d0db30
start working on events
benny-dreamly Jan 6, 2026
b54b840
okay i think this is the first event
benny-dreamly Jan 6, 2026
c9f8c14
move the import
benny-dreamly Jan 6, 2026
af0a1ed
change it back?
benny-dreamly Jan 6, 2026
af431c1
change it back?
benny-dreamly Jan 6, 2026
ceb584d
another one
benny-dreamly Jan 6, 2026
4306120
oooooooops
benny-dreamly Jan 6, 2026
26a0bfb
okay well that was a fucking shitshow
benny-dreamly Jan 6, 2026
55ae9a9
okay we're fully migrated to events for the goal now
benny-dreamly Jan 6, 2026
dcce519
fix the c&p mistake
benny-dreamly Jan 6, 2026
c44aa8d
remove old code
benny-dreamly Jan 6, 2026
ab74d9a
new line for EOF
benny-dreamly Jan 6, 2026
eaf003b
use a lookup table
benny-dreamly Jan 6, 2026
05187cf
remove extra comma
benny-dreamly Jan 6, 2026
79b5223
fix the lookup table
benny-dreamly Jan 6, 2026
52f164d
fuck i fell in the trap again
benny-dreamly Jan 6, 2026
b3741f3
remove old code again
benny-dreamly Jan 6, 2026
5986e93
remove unused imports
benny-dreamly Jan 6, 2026
233e200
whitespace stuff
benny-dreamly Jan 6, 2026
c1e2c60
type the lookup table & remove trailing comma
benny-dreamly Jan 6, 2026
a557aac
typing
benny-dreamly Jan 6, 2026
c462db2
add eije's test thingy
benny-dreamly Jan 6, 2026
ce58185
unused import (again)
benny-dreamly Jan 7, 2026
7012b74
fix some small things
benny-dreamly Jan 7, 2026
61ae538
another typing thing
benny-dreamly Jan 7, 2026
4157996
fix pep8
benny-dreamly Jan 7, 2026
8c88da1
some small tweaks (other than that should be good)
benny-dreamly Jan 7, 2026
b57fc7b
oops extra space :D
benny-dreamly Jan 7, 2026
86b1832
fix the extra space and make a new error type
benny-dreamly Jan 7, 2026
534f139
fixywixy
benny-dreamly Jan 7, 2026
5215c27
fix some formatting
benny-dreamly Jan 7, 2026
a423640
fix a pep8
benny-dreamly Jan 7, 2026
1a95683
i think this is actually better
benny-dreamly Jan 7, 2026
fabfd74
stop shadowing the thing
benny-dreamly Jan 7, 2026
ef0feb4
actually make the thing optional and use it in the event thing
benny-dreamly Jan 7, 2026
db70ed8
add create location helper
benny-dreamly Jan 7, 2026
4c24303
refactor to use the new location helper
benny-dreamly Jan 7, 2026
ad5b093
use the right Mapping
benny-dreamly Jan 7, 2026
9f3f7a5
line length
benny-dreamly Jan 7, 2026
e58e6de
okay that went horribly wrong
benny-dreamly Jan 7, 2026
60d9bb7
remove the comment (i misinterpreted)
benny-dreamly Jan 7, 2026
9668878
update the version (i can't believe i forgot)
benny-dreamly Jan 7, 2026
0da7c4e
remove unused import
benny-dreamly Jan 7, 2026
8f91f09
fix the length of the line here
benny-dreamly Jan 7, 2026
e1ec54a
Update .github/workflows/test.yml
benny-dreamly Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test apworld
on:
push:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: Eijebong/ap-actions/ap-tests@main
with:
apworld-path: worlds/sims4
ap-version: latest
python-version: '3.12'
17 changes: 13 additions & 4 deletions worlds/sims4/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .Names import SkillNames, JunkNames, UsefulNames
from .Names.DLC import ExpansionNames, GamePackNames, StuffNames


class ItemDict(TypedDict):
classification: ItemClassification
count: int
Expand All @@ -24,21 +25,29 @@ class Sims4Item(Item):

skills_table: dict[int, ItemDict] = {}


class SkillConfigError(ValueError):
"""Raised when skill configuration is invalid."""


def add_skill(skill_name: str, expansion: str, max_level: int) -> int:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if max_level < 2:
raise SkillConfigError(f"max_level must be at least 2, got {max_level}")
if skills_table:
skill_id = max(skills_table.keys()) + 1
else:
skill_id = 0x7334001

skills_table[skill_id] = {
"name": f"{skill_name}",
"name": skill_name,
"classification": ItemClassification.progression,
"count": max_level - 2,
"tech_type": "Skill",
"expansion": expansion
}
return skill_id
Comment thread
coderabbitai[bot] marked this conversation as resolved.


add_skill(SkillNames.base_skill_comedy, ExpansionNames.base, 10)
add_skill(SkillNames.base_skill_guitar, ExpansionNames.base, 10)
add_skill(SkillNames.base_skill_logic, ExpansionNames.base, 10)
Expand Down Expand Up @@ -80,7 +89,7 @@ def add_skill(skill_name: str, expansion: str, max_level: int) -> int:
add_skill(SkillNames.du_robotics_skill, ExpansionNames.discover_university, 10)
add_skill(SkillNames.el_fabrication_skill, ExpansionNames.eco_lifestyle, 10)
add_skill(SkillNames.el_juicefizzing_skill, ExpansionNames.eco_lifestyle, 5)
add_skill(SkillNames.nk_knitting_skill, StuffNames.nifty_knitting, 10)
add_skill(SkillNames.nk_knitting_skill, StuffNames.nifty_knitting, 10)
add_skill(SkillNames.sy_rock_climbing_skill, ExpansionNames.snowy_escape, 10)
add_skill(SkillNames.sy_skiing_skill, ExpansionNames.snowy_escape, 10)
add_skill(SkillNames.sy_snowboarding_skill, ExpansionNames.snowy_escape, 10)
Expand All @@ -97,7 +106,7 @@ def add_skill(skill_name: str, expansion: str, max_level: int) -> int:
add_skill(SkillNames.ebn_apothecary_skill, ExpansionNames.enchanted_by_nature, 10)
add_skill(SkillNames.ebn_natural_living_skill, ExpansionNames.enchanted_by_nature, 10)

useful_table = {
useful_table: dict[int, ItemDict] = {
0x733400FF: {'classification': ItemClassification.useful,
'count': 4,
'name': UsefulNames.skill_gain_boost,
Expand All @@ -106,7 +115,7 @@ def add_skill(skill_name: str, expansion: str, max_level: int) -> int:

}

junk_table = {
junk_table: dict[int, ItemDict] = {
0x73340FFF: {'classification': ItemClassification.filler,
'count': 0,
'name': JunkNames.twothousand_simoleons,
Expand Down
20 changes: 9 additions & 11 deletions worlds/sims4/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
class Sims4Location(Location):
game: str = "The Sims 4"

def __init__(self, player: int, name: str, address: Optional[int], parent):
super().__init__(player, name, address, parent)
self.event = not address


class Sims4LocationDict(TypedDict, total=False):
name: str
Expand All @@ -27,6 +23,7 @@ class Sims4LocationData(NamedTuple):

skill_locations_table: dict[int, Sims4LocationDict] = {}


def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:
if skill_locations_table:
start_id = max(skill_locations_table.keys())
Expand All @@ -42,6 +39,7 @@ def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:
}
return skill_id


add_skill_location(SkillNames.base_skill_comedy, ExpansionNames.base, 10)
add_skill_location(SkillNames.base_skill_guitar, ExpansionNames.base, 10)
add_skill_location(SkillNames.base_skill_logic, ExpansionNames.base, 10)
Expand Down Expand Up @@ -83,7 +81,7 @@ def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:
add_skill_location(SkillNames.du_robotics_skill, ExpansionNames.discover_university, 10)
add_skill_location(SkillNames.el_fabrication_skill, ExpansionNames.eco_lifestyle, 10)
add_skill_location(SkillNames.el_juicefizzing_skill, ExpansionNames.eco_lifestyle, 5)
add_skill_location(SkillNames.nk_knitting_skill, StuffNames.nifty_knitting, 10)
add_skill_location(SkillNames.nk_knitting_skill, StuffNames.nifty_knitting, 10)
add_skill_location(SkillNames.sy_rock_climbing_skill, ExpansionNames.snowy_escape, 10)
add_skill_location(SkillNames.sy_skiing_skill, ExpansionNames.snowy_escape, 10)
add_skill_location(SkillNames.sy_snowboarding_skill, ExpansionNames.snowy_escape, 10)
Expand All @@ -97,13 +95,13 @@ def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:
add_skill_location(SkillNames.lnd_thanatology_skill, ExpansionNames.life_and_death, 5)
add_skill_location(SkillNames.bnh_pottery_skill, ExpansionNames.business_and_hobbies, 10)
add_skill_location(SkillNames.bnh_tattooing_skill, ExpansionNames.business_and_hobbies, 10)
add_skill_location(SkillNames.ebn_apothecary_skill, ExpansionNames.enchanted_by_nature , 10)
add_skill_location(SkillNames.ebn_natural_living_skill, ExpansionNames.enchanted_by_nature , 10)
add_skill_location(SkillNames.ebn_apothecary_skill, ExpansionNames.enchanted_by_nature, 10)
add_skill_location(SkillNames.ebn_natural_living_skill, ExpansionNames.enchanted_by_nature, 10)

del add_skill_location


careers_locations_table = {
careers_locations_table: dict[int, Sims4LocationDict] = {

0x73342001: {"name": f"{CareerNames.base_career_athlete_2}",
"category": "Athlete",
Expand Down Expand Up @@ -568,7 +566,7 @@ def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:

}

ptj_locations_table = {
ptj_locations_table: dict[int, Sims4LocationDict] = {

0x733420A2: {"name": f"{CareerNames.base_ptj_babysitter_2}",
"category": "Babysitter",
Expand Down Expand Up @@ -606,7 +604,7 @@ def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:
"expansion": "base"},
}

aspiration_locations_table = {
aspiration_locations_table: dict[int, Sims4LocationDict] = {
0x73343000: {"name": f"{AspirationNames.base_aspiration_basic_trainer}",
"category": "Aspirations",
"expansion": "base"},
Expand Down Expand Up @@ -882,7 +880,7 @@ def add_skill_location(skill_name: str, expansion: str, max_level: int) -> int:
"expansion": "base"},
}

location_table = {
location_table: dict[int, Sims4LocationDict] = {
**skill_locations_table,
**careers_locations_table,
**aspiration_locations_table,
Expand Down
36 changes: 36 additions & 0 deletions worlds/sims4/Names/EventNames.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
bodybuilder = "Completed Bodybuilder Aspiration"
bodybuilder_item = "Completed Bodybuilder"
painter_extraordinaire = "Completed Painter Extraordinaire Aspiration"
painter_extraordinaire_item = "Completed Painter Extraordinaire"
bestselling_author = "Completed Bestselling Author Aspiration"
bestselling_author_item = "Completed Bestselling Author"
musical_genius = "Completed Musical Genius Aspiration"
musical_genius_item = "Completed Musical Genius"
chief_of_mischief = "Completed Chief of Mischief Aspiration"
chief_of_mischief_item = "Completed Chief of Mischief"
public_enemy = "Completed Public Enemy Aspiration"
public_enemy_item = "Completed Public Enemy"
master_chef = "Completed Master Chef Aspiration"
master_chef_item = "Completed Master Chef"
master_mixologist = "Completed Master Mixologist Aspiration"
master_mixologist_item = "Completed Master Mixologist"
renaissance_sim = "Completed Renaissance Sim Aspiration"
renaissance_sim_item = "Completed Renaissance Sim"
nerd_brain = "Completed Nerd Brain Aspiration"
nerd_brain_item = "Completed Nerd Brain"
computer_whiz = "Completed Computer Whiz Aspiration"
computer_whiz_item = "Completed Computer Whiz"
serial_romantic = "Completed Serial Romantic Aspiration"
serial_romantic_item = "Completed Serial Romantic"
freelance_botanist = "Completed Freelance Botanist Aspiration"
freelance_botanist_item = "Completed Freelance Botanist"
the_curator = "Completed The Curator Aspiration"
the_curator_item = "Completed The Curator"
angling_ace = "Completed Angling Ace Aspiration"
angling_ace_item = "Completed Angling Ace"
joke_star = "Completed Joke Star Aspiration"
joke_star_item = "Completed Joke Star"
friend_of_the_world = "Completed Friend of the World Aspiration"
friend_of_the_world_item = "Completed Friend of the World"
neighborly_advisor = "Completed Neighborly Advisor Aspiration"
neighborly_advisor_item = "Completed Neighborly Advisor"
Loading
Loading