├── strings ├── ww │ └── en │ │ ├── haircolor.txt │ │ ├── personalities.txt │ │ ├── hairstyle.txt │ │ ├── facetype.txt │ │ └── villager.txt ├── nl │ └── en │ │ ├── eyecolor.txt │ │ ├── personalities.txt │ │ ├── haircolor.txt │ │ ├── badges.txt │ │ ├── facetype.txt │ │ └── hairstyle.txt └── wa │ └── en │ ├── eyecolor.txt │ ├── personalities.txt │ ├── haircolor.txt │ ├── badges.txt │ ├── facetype.txt │ └── hairstyle.txt ├── Contributors.md ├── source ├── house │ ├── HouseNL.cpp │ ├── HouseWA.cpp │ └── HouseWW.cpp ├── acre │ ├── AcreWW.cpp │ ├── AcreNL.cpp │ └── AcreWA.cpp ├── shop │ ├── ShopNL.cpp │ ├── ShopWA.cpp │ └── ShopWW.cpp ├── hhd │ └── SavHHD.cpp ├── island │ ├── IslandWA.cpp │ └── IslandNL.cpp ├── itemUtils │ ├── itemUtils.cpp │ ├── ItemWhiteListNL.cpp │ ├── ItemWhiteListWW.cpp │ └── ItemWhiteListWA.cpp ├── sav │ ├── SavNL.cpp │ └── SavWA.cpp ├── coreUtils │ └── saveUtils.cpp ├── pattern │ ├── PatternImageNL.cpp │ └── PatternImageWW.cpp └── villager │ ├── VillagerNL.cpp │ └── VillagerWA.cpp ├── include ├── itemUtils │ ├── itemUtils.hpp │ ├── ItemWhiteListWW.hpp │ ├── ItemWhiteList.hpp │ ├── ItemWhiteListNL.hpp │ ├── ItemWhiteListWA.hpp │ ├── itemKindWA.hpp │ └── itemKindNL.hpp ├── coreUtils │ ├── stringDB.hpp │ ├── saveUtils.hpp │ ├── checksum.hpp │ ├── stringUtils.hpp │ └── encryptedInt32.hpp ├── shop │ ├── Shop.hpp │ ├── ShopWA.hpp │ ├── ShopNL.hpp │ └── ShopWW.hpp ├── acre │ ├── AcreNL.hpp │ ├── AcreWA.hpp │ ├── AcreWW.hpp │ └── Acre.hpp ├── island │ ├── Island.hpp │ ├── IslandNL.hpp │ └── IslandWA.hpp ├── types.hpp ├── pattern │ ├── PatternImage.hpp │ ├── PatternImageNL.hpp │ ├── PatternImageWW.hpp │ ├── PatternNL.hpp │ ├── PatternWA.hpp │ ├── Pattern.hpp │ └── PatternWW.hpp ├── house │ ├── House.hpp │ ├── HouseNL.hpp │ ├── HouseWA.hpp │ └── HouseWW.hpp ├── item │ ├── ItemNL.hpp │ ├── ItemWA.hpp │ ├── ItemWW.hpp │ └── Item.hpp ├── town │ ├── Town.hpp │ ├── TownWW.hpp │ ├── TownNL.hpp │ └── TownWA.hpp ├── sav │ ├── SavNL.hpp │ ├── SavWA.hpp │ ├── SavWW.hpp │ └── Sav.hpp ├── villager │ ├── Villager.hpp │ ├── VillagerWA.hpp │ ├── VillagerNL.hpp │ └── VillagerWW.hpp ├── hhd │ ├── SavHHD.hpp │ ├── PlayerHHD.hpp │ └── PatternHHD.hpp ├── letter │ ├── LetterNL.hpp │ ├── LetterWA.hpp │ ├── Letter.hpp │ └── LetterWW.hpp └── player │ └── Player.hpp ├── README.md └── core-features.md /strings/ww/en/haircolor.txt: -------------------------------------------------------------------------------- 1 | Dark Brown 2 | Light Brown 3 | Orange 4 | Blue 5 | Yellow 6 | Green 7 | Pink 8 | White -------------------------------------------------------------------------------- /strings/ww/en/personalities.txt: -------------------------------------------------------------------------------- 1 | Lazy ♂ 2 | Jock ♂ 3 | Cranky ♂ 4 | Normal ♀ 5 | Peppy ♀ 6 | Snooty ♀ 7 | Not Set -------------------------------------------------------------------------------- /strings/nl/en/eyecolor.txt: -------------------------------------------------------------------------------- 1 | Black 2 | Brown 3 | Green 4 | Gray 5 | Blue 6 | Light Blue 7 | Light Blue 8 | Light Blue -------------------------------------------------------------------------------- /strings/wa/en/eyecolor.txt: -------------------------------------------------------------------------------- 1 | Black 2 | Brown 3 | Green 4 | Gray 5 | Blue 6 | Light Blue 7 | Light Blue 8 | Light Blue -------------------------------------------------------------------------------- /strings/nl/en/personalities.txt: -------------------------------------------------------------------------------- 1 | Lazy ♂ 2 | Jock ♂ 3 | Cranky ♂ 4 | Smug ♂ 5 | Normal ♀ 6 | Peppy ♀ 7 | Snooty ♀ 8 | Uchi ♀ 9 | Not Set -------------------------------------------------------------------------------- /strings/wa/en/personalities.txt: -------------------------------------------------------------------------------- 1 | Lazy ♂ 2 | Jock ♂ 3 | Cranky ♂ 4 | Smug ♂ 5 | Normal ♀ 6 | Peppy ♀ 7 | Snooty ♀ 8 | Uchi ♀ 9 | Not Set -------------------------------------------------------------------------------- /strings/nl/en/haircolor.txt: -------------------------------------------------------------------------------- 1 | Dark Brown 2 | Light Brown 3 | Orange 4 | Light Blue 5 | Gold 6 | Light Green 7 | Pink 8 | White 9 | Black 10 | Auburn 11 | Red 12 | Dark Blue 13 | Blonde 14 | Dark Green 15 | Light Purple 16 | Ash Brown -------------------------------------------------------------------------------- /strings/wa/en/haircolor.txt: -------------------------------------------------------------------------------- 1 | Dark Brown 2 | Light Brown 3 | Orange 4 | Light Blue 5 | Gold 6 | Light Green 7 | Pink 8 | White 9 | Black 10 | Auburn 11 | Red 12 | Dark Blue 13 | Blonde 14 | Dark Green 15 | Light Purple 16 | Ash Brown -------------------------------------------------------------------------------- /strings/nl/en/badges.txt: -------------------------------------------------------------------------------- 1 | Angler 2 | Bug Catcher 3 | Diver 4 | Fish 5 | Insect 6 | Seafood 7 | Balloon 8 | Traveler 9 | Host 10 | Gardener 11 | Bell Saver 12 | Turnip Trader 13 | Medalist 14 | StreetPass 15 | Weed 16 | Shopper 17 | Letter 18 | Refurbishing 19 | Catalog Maniac 20 | K.K. Slider 21 | Happy Homer 22 | Villager 23 | Samaritan 24 | Dreamer -------------------------------------------------------------------------------- /strings/nl/en/facetype.txt: -------------------------------------------------------------------------------- 1 | Male #1 2 | Male #2 3 | Male #3 4 | Male #4 5 | Male #5 6 | Male #6 7 | Male #7 8 | Male #8 9 | Male #9 10 | Male #10 11 | Male #11 12 | Male #12 13 | Female #1 14 | Female #2 15 | Female #3 16 | Female #4 17 | Female #5 18 | Female #6 19 | Female #7 20 | Female #8 21 | Female #9 22 | Female #10 23 | Female #11 24 | Female #12 -------------------------------------------------------------------------------- /strings/wa/en/badges.txt: -------------------------------------------------------------------------------- 1 | Angler 2 | Bug Catcher 3 | Diver 4 | Fish 5 | Insect 6 | Seafood 7 | Balloon 8 | Traveler 9 | Host 10 | Gardener 11 | Bell Saver 12 | Turnip Trader 13 | Medalist 14 | StreetPass 15 | Weed 16 | Shopper 17 | Letter 18 | Refurbishing 19 | Catalog Maniac 20 | K.K. Slider 21 | Happy Homer 22 | Villager 23 | Samaritan 24 | Dreamer -------------------------------------------------------------------------------- /strings/wa/en/facetype.txt: -------------------------------------------------------------------------------- 1 | Male #1 2 | Male #2 3 | Male #3 4 | Male #4 5 | Male #5 6 | Male #6 7 | Male #7 8 | Male #8 9 | Male #9 10 | Male #10 11 | Male #11 12 | Male #12 13 | Female #1 14 | Female #2 15 | Female #3 16 | Female #4 17 | Female #5 18 | Female #6 19 | Female #7 20 | Female #8 21 | Female #9 22 | Female #10 23 | Female #11 24 | Female #12 -------------------------------------------------------------------------------- /strings/ww/en/hairstyle.txt: -------------------------------------------------------------------------------- 1 | Male #1 - Buzz Cut 2 | Male #2 - Front Cowlick 3 | Male #3 - Long Bangs w/ Left Part 4 | Male #4 - Spiked Up 5 | Male #5 - Middle Part 6 | Male #6 - Inward Spikes 7 | Male #7 - Bowl Cut 8 | Male #8 - Round w/ Spiked Bangs 9 | Female #1 - Rightward Bangs w/ Side Curls 10 | Female #2 - Mop Top w/ Rightward Bangs 11 | Female #3 - Pigtails 12 | Female #4 - Tritails (Three Braids) 13 | Female #5 - Ponytail 14 | Female #6 - Bun 15 | Female #7 - Shortcut 16 | Female #8 - Curly -------------------------------------------------------------------------------- /Contributors.md: -------------------------------------------------------------------------------- 1 | # LeafEdit-Core Contributors 2 | 3 | ## All Contributors 4 | - [Cuyler](https://github.com/Cuyler36) 5 | - [Pk11](https://github.com/Epicpkmn11) 6 | - [piepie62](https://github.com/piepie62) 7 | - [RedShyGuy](https://github.com/RedShyGuy) 8 | - [Slattz](https://github.com/Slattz) 9 | - [SuperSaiyajinStackZ](https://github.com/SuperSaiyajinStackZ) 10 | 11 | ### if you helped on the core and you think i forgot to mention you, please let SuperSaiyajinStackZ know, so SuperSaiyajinStackZ can add you. -------------------------------------------------------------------------------- /strings/nl/en/hairstyle.txt: -------------------------------------------------------------------------------- 1 | Male #1 2 | Male #2 3 | Male #3 4 | Male #4 5 | Male #5 6 | Male #6 7 | Male #7 8 | Male #8 9 | Male #9 10 | Male #10 11 | Male #11 12 | Male #12 13 | Male #13 14 | Male #14 15 | Male #15 16 | Male #16 17 | Male #17 - Bed Head 18 | Female #1 19 | Female #2 20 | Female #3 21 | Female #4 22 | Female #5 23 | Female #6 24 | Female #7 25 | Female #8 26 | Female #9 27 | Female #10 28 | Female #11 29 | Female #12 30 | Female #13 31 | Female #14 32 | Female #15 33 | Female #16 34 | Female #17 - Bed Head -------------------------------------------------------------------------------- /strings/wa/en/hairstyle.txt: -------------------------------------------------------------------------------- 1 | Male #1 2 | Male #2 3 | Male #3 4 | Male #4 5 | Male #5 6 | Male #6 7 | Male #7 8 | Male #8 9 | Male #9 10 | Male #10 11 | Male #11 12 | Male #12 13 | Male #13 14 | Male #14 15 | Male #15 16 | Male #16 17 | Male #17 - Bed Head 18 | Female #1 19 | Female #2 20 | Female #3 21 | Female #4 22 | Female #5 23 | Female #6 24 | Female #7 25 | Female #8 26 | Female #9 27 | Female #10 28 | Female #11 29 | Female #12 30 | Female #13 31 | Female #14 32 | Female #15 33 | Female #16 34 | Female #17 - Bed Head -------------------------------------------------------------------------------- /strings/ww/en/facetype.txt: -------------------------------------------------------------------------------- 1 | Male #1 - Brown Eyes w/ Lashes 2 | Male #2 - Black Eyes w/ Brows 3 | Male #3 - Blue Eyes w/ Eyelids 4 | Male #4 - Green Eyes w/ Small Pupils & Brows 5 | Male #5 - Brown Eyes 6 | Male #6 - Arched Black Eyes 7 | Male #7 - Blue Eyes w/ Rosey Cheeks 8 | Male #8 - Blue Eyes w/ Small Pupils 9 | Female #1 - Black Squinted Eyes w/ Lash 10 | Female #2 - Black Oval Eyes w/ Lash 11 | Female #3 - Blue Eyes w/ Rosey Cheeks 12 | Female #4 - Blue Eyes w/ Eyelids 13 | Female #5 - Green Oval Eyes w/ Lashes 14 | Female #6 - Brown Arched Eyes w/ Lash 15 | Female #7 - Blue Eyes 16 | Female #8 - Green Circle Eyes w/ Lashes -------------------------------------------------------------------------------- /source/house/HouseNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "HouseNL.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | Return a room. 32 | 33 | int room: The room. 34 | */ 35 | std::unique_ptr HouseNL::room(u8 room) const { return nullptr; }; -------------------------------------------------------------------------------- /source/house/HouseWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "HouseWA.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | Return a room. 32 | 33 | int room: The room. 34 | */ 35 | std::unique_ptr HouseWA::room(u8 room) const { return nullptr; }; -------------------------------------------------------------------------------- /source/house/HouseWW.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "HouseWW.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | Return a room. 32 | 33 | int room: The room. 34 | */ 35 | std::unique_ptr HouseWW::room(u8 room) const { return nullptr; }; -------------------------------------------------------------------------------- /source/acre/AcreWW.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "AcreWW.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | Get and Set for the Acre ID. 32 | */ 33 | u8 AcreWW::id() const { return this->acrePointer()[0]; }; 34 | void AcreWW::id(u8 v) { SaveUtils::Write(this->acrePointer(), 0x0, v); }; -------------------------------------------------------------------------------- /source/acre/AcreNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "AcreNL.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | 155 & 165 are part of Welcome Amiibo. 32 | Acre ID. 33 | */ 34 | 35 | /* 36 | Get and Set for the Acre ID. 37 | */ 38 | u8 AcreNL::id() const { return this->acrePointer()[0]; }; 39 | void AcreNL::id(u8 v) { SaveUtils::Write(this->acrePointer(), 0x0, v); }; -------------------------------------------------------------------------------- /source/acre/AcreWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "AcreWA.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | 155 & 165 are part of Welcome Amiibo. 32 | Acre ID. 33 | */ 34 | 35 | /* 36 | Get and Set for the Acre ID. 37 | */ 38 | u8 AcreWA::id() const { return this->acrePointer()[0]; }; 39 | void AcreWA::id(u8 v) { SaveUtils::Write(this->acrePointer(), 0x0, v); }; -------------------------------------------------------------------------------- /source/shop/ShopNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "saveUtils.hpp" 28 | #include "ShopNL.hpp" 29 | 30 | /* 31 | Return the able sister pattern. 32 | 33 | u8 pattern: Pattern Index. 34 | */ 35 | std::unique_ptr ShopNL::ableSisterPattern(u8 pattern) const { 36 | if (pattern > 7) return nullptr; 37 | 38 | return std::make_unique(this->ShopData, 0x5C934 + pattern * 0x870); 39 | } -------------------------------------------------------------------------------- /source/shop/ShopWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "saveUtils.hpp" 28 | #include "ShopWA.hpp" 29 | 30 | /* 31 | Return the able sister pattern. 32 | 33 | u8 pattern: Pattern Index. 34 | */ 35 | std::unique_ptr ShopWA::ableSisterPattern(u8 pattern) const { 36 | if (pattern > 7) return nullptr; 37 | 38 | return std::make_unique(this->ShopData, 0x62338 + pattern * 0x870); 39 | } -------------------------------------------------------------------------------- /source/hhd/SavHHD.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "checksum.hpp" 28 | #include "SavHHD.hpp" 29 | 30 | /* 31 | Return a player. 32 | */ 33 | std::unique_ptr SavHHD::playerhhd() const { return std::make_unique(this->SaveData); }; 34 | 35 | /* 36 | Last call before writing to file. Update Checksum. 37 | */ 38 | void SavHHD::Finish(void) { Checksum::FixHHDChecksum(this->savePointer()); }; -------------------------------------------------------------------------------- /include/itemUtils/itemUtils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEMUTILS_HPP 28 | #define _LEAFEDIT_CORE_ITEMUTILS_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | #include 33 | 34 | namespace ItemUtils { 35 | /* Read Database. */ 36 | void LoadDatabase(SaveType save); 37 | 38 | /* Get an Item's name. */ 39 | std::string getName(u16 ID); 40 | std::string getWWName(u8 category, u8 index); 41 | }; 42 | 43 | #endif -------------------------------------------------------------------------------- /include/coreUtils/stringDB.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_STRING_DB_HPP 28 | #define _LEAFEDIT_CORE_STRING_DB_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | #include 33 | 34 | namespace StringDB { 35 | void LoadItemDatabase(SaveType save); 36 | void LoadVillagerDatabase(SaveType save); 37 | std::vector> searchTuple(std::string searchResult, std::vector searchCategory, std::vector> &searchType, bool compare = false); 38 | }; 39 | 40 | #endif -------------------------------------------------------------------------------- /include/shop/Shop.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SHOP_HPP 28 | #define _LEAFEDIT_CORE_SHOP_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | 33 | class Shop { 34 | protected: 35 | std::shared_ptr ShopData; 36 | u32 Offset; 37 | public: 38 | virtual ~Shop() { }; 39 | Shop(std::shared_ptr data, u32 offset) : ShopData(data), Offset(offset) { }; 40 | Shop(const Shop& shop) = delete; 41 | Shop& operator=(const Shop& shop) = delete; 42 | 43 | virtual std::unique_ptr ableSisterPattern(u8 pattern) const = 0; 44 | }; 45 | 46 | #endif -------------------------------------------------------------------------------- /source/island/IslandWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "IslandWA.hpp" 28 | 29 | /* 30 | Return an Island Acre. 31 | 32 | u8 Acre: The Acre index. 33 | */ 34 | std::unique_ptr IslandWA::acre(u8 Acre) const { 35 | if (Acre > 15) return nullptr; 36 | 37 | return std::make_unique(this->IslandData, 0x06FEB8 + Acre * 2); 38 | } 39 | 40 | /* 41 | Return an Island Map item. 42 | 43 | u16 index: The map index. 44 | */ 45 | std::unique_ptr IslandWA::item(u16 index) const { 46 | if (index > 1023) return nullptr; 47 | 48 | return std::make_unique(this->IslandData, 0x06FED8 + index * 4); 49 | } -------------------------------------------------------------------------------- /source/island/IslandNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "IslandNL.hpp" 28 | 29 | /* 30 | Return an Island Acre. 31 | 32 | u8 Acre: The Acre index. 33 | */ 34 | std::unique_ptr IslandNL::acre(u8 Acre) const { 35 | if (Acre > 15) return nullptr; 36 | 37 | return std::make_unique(this->IslandData, 0x80 + 0x06a408 + Acre * 2); 38 | } 39 | 40 | /* 41 | Return an Island Map item. 42 | 43 | u16 index: The map index. 44 | */ 45 | std::unique_ptr IslandNL::item(u16 index) const { 46 | if (index > 1023) return nullptr; 47 | 48 | return std::make_unique(this->IslandData, 0x80 + 0x06a428 + index * 4); 49 | } -------------------------------------------------------------------------------- /include/acre/AcreNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ACRE_NL_HPP 28 | #define _LEAFEDIT_CORE_ACRE_NL_HPP 29 | 30 | #include "Acre.hpp" 31 | #include 32 | 33 | class AcreNL : public Acre { 34 | protected: 35 | std::shared_ptr AcreData; 36 | u32 Offset; 37 | public: 38 | virtual ~AcreNL() { }; 39 | AcreNL(std::shared_ptr acreData, u32 offset) : 40 | Acre(acreData, offset), AcreData(acreData), Offset(offset) { }; 41 | 42 | u32 maxAcre() const { return 204; }; 43 | 44 | u8 id() const override; 45 | void id(u8 v) override; 46 | private: 47 | u8 *acrePointer() const { return this->AcreData.get() + this->Offset; }; 48 | }; 49 | 50 | #endif -------------------------------------------------------------------------------- /include/acre/AcreWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ACRE_WA_HPP 28 | #define _LEAFEDIT_CORE_ACRE_WA_HPP 29 | 30 | #include "Acre.hpp" 31 | #include 32 | 33 | class AcreWA : public Acre { 34 | protected: 35 | std::shared_ptr AcreData; 36 | u32 Offset; 37 | public: 38 | virtual ~AcreWA() { }; 39 | AcreWA(std::shared_ptr acreData, u32 offset) : 40 | Acre(acreData, offset), AcreData(acreData), Offset(offset) { }; 41 | 42 | u32 maxAcre() const { return 206; }; 43 | 44 | u8 id() const override; 45 | void id(u8 v) override; 46 | private: 47 | u8 *acrePointer() const { return this->AcreData.get() + this->Offset; }; 48 | }; 49 | 50 | #endif -------------------------------------------------------------------------------- /include/acre/AcreWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ACRE_WW_HPP 28 | #define _LEAFEDIT_CORE_ACRE_WW_HPP 29 | 30 | #include "Acre.hpp" 31 | #include 32 | 33 | class AcreWW : public Acre { 34 | protected: 35 | std::shared_ptr AcreData; 36 | u32 Offset; 37 | public: 38 | virtual ~AcreWW() { }; 39 | AcreWW(std::shared_ptr acreData, u32 offset) : 40 | Acre(acreData, offset), AcreData(acreData), Offset(offset) { }; 41 | 42 | u32 maxAcre() const { return 131; }; 43 | 44 | u8 id() const override; 45 | void id(u8 v) override; 46 | private: 47 | u8 *acrePointer() const { return this->AcreData.get() + this->Offset; }; 48 | }; 49 | 50 | #endif -------------------------------------------------------------------------------- /include/shop/ShopWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SHOP_WA_HPP 28 | #define _LEAFEDIT_CORE_SHOP_WA_HPP 29 | 30 | #include "PatternWA.hpp" 31 | #include "Shop.hpp" 32 | #include 33 | 34 | class ShopWA : public Shop { 35 | protected: 36 | std::shared_ptr ShopData; 37 | u32 Offset; 38 | public: 39 | virtual ~ShopWA() { }; 40 | ShopWA(std::shared_ptr shopData, u32 offset) : 41 | Shop(shopData, offset), ShopData(shopData), Offset(offset) { }; 42 | 43 | std::unique_ptr ableSisterPattern(u8 pattern) const override; 44 | private: 45 | u8* shopPointer() const { return this->ShopData.get() + this->Offset; }; 46 | }; 47 | 48 | #endif -------------------------------------------------------------------------------- /include/acre/Acre.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ACRE_HPP 28 | #define _LEAFEDIT_CORE_ACRE_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | 33 | #define WWACRE_SIZE 1 34 | #define NLACRE_SIZE 2 35 | 36 | class Acre { 37 | protected: 38 | std::shared_ptr AcreData; 39 | u32 Offset; 40 | public: 41 | virtual ~Acre() { }; 42 | Acre(std::shared_ptr data, u32 offset) : 43 | AcreData(data), Offset(offset) { }; 44 | 45 | Acre(const Acre& acre) = delete; 46 | Acre& operator=(const Acre& acre) = delete; 47 | 48 | virtual u32 maxAcre() const = 0; 49 | 50 | virtual u8 id() const = 0; 51 | virtual void id(u8 v) = 0; 52 | }; 53 | 54 | #endif -------------------------------------------------------------------------------- /include/shop/ShopNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SHOP_NL_HPP 28 | #define _LEAFEDIT_CORE_SHOP_NL_HPP 29 | 30 | #include "PatternNL.hpp" 31 | #include "Shop.hpp" 32 | #include 33 | #include 34 | 35 | class ShopNL : public Shop { 36 | protected: 37 | std::shared_ptr ShopData; 38 | u32 Offset; 39 | public: 40 | virtual ~ShopNL() { }; 41 | ShopNL(std::shared_ptr shopData, u32 offset) : 42 | Shop(shopData, offset), ShopData(shopData), Offset(offset) { }; 43 | 44 | std::unique_ptr ableSisterPattern(u8 pattern) const override; 45 | private: 46 | u8 *shopPointer() const { return this->ShopData.get() + this->Offset; }; 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /include/island/Island.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ISLAND_HPP 28 | #define _LEAFEDIT_CORE_ISLAND_HPP 29 | 30 | #include "Acre.hpp" 31 | #include "Item.hpp" 32 | #include "types.hpp" 33 | #include 34 | #include 35 | 36 | class Island { 37 | protected: 38 | std::shared_ptr IslandData; 39 | public: 40 | virtual ~Island() { }; 41 | Island(std::shared_ptr islandData) : 42 | IslandData(islandData) { }; 43 | Island(const Island& island) = delete; 44 | Island& operator=(const Island& island) = delete; 45 | 46 | virtual std::unique_ptr acre(u8 Acre) const = 0; 47 | 48 | virtual std::unique_ptr item(u16 index) const = 0; 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /include/shop/ShopWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SHOP_WW_HPP 28 | #define _LEAFEDIT_CORE_SHOP_WW_HPP 29 | 30 | #include "PatternWW.hpp" 31 | #include "Shop.hpp" 32 | #include 33 | 34 | class ShopWW : public Shop { 35 | protected: 36 | std::shared_ptr ShopData; 37 | u32 Offset; 38 | WWRegion SaveRegion; 39 | public: 40 | virtual ~ShopWW() { }; 41 | ShopWW(std::shared_ptr shopData, u32 offset, WWRegion rg) : 42 | Shop(shopData, offset), ShopData(shopData), Offset(offset), SaveRegion(rg) { }; 43 | 44 | std::unique_ptr ableSisterPattern(u8 pattern) const override; 45 | private: 46 | u8 *shopPointer() const { return this->ShopData.get() + this->Offset; }; 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /include/island/IslandNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ISLAND_NL_HPP 28 | #define _LEAFEDIT_CORE_ISLAND_NL_HPP 29 | 30 | #include "AcreNL.hpp" 31 | #include "Island.hpp" 32 | #include "ItemNL.hpp" 33 | #include "types.hpp" 34 | #include 35 | 36 | class IslandNL : public Island { 37 | protected: 38 | std::shared_ptr IslandData; 39 | public: 40 | virtual ~IslandNL() { }; 41 | IslandNL(std::shared_ptr islandData) : 42 | Island(islandData), IslandData(islandData) { }; 43 | 44 | std::unique_ptr acre(u8 Acre) const override; 45 | 46 | std::unique_ptr item(u16 index) const override; 47 | private: 48 | u8 *islandPointer() const { return this->IslandData.get(); }; 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /include/island/IslandWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ISLAND_WA_HPP 28 | #define _LEAFEDIT_CORE_ISLAND_WA_HPP 29 | 30 | #include "AcreWA.hpp" 31 | #include "Island.hpp" 32 | #include "ItemWA.hpp" 33 | #include "types.hpp" 34 | #include 35 | 36 | class IslandWA : public Island { 37 | protected: 38 | std::shared_ptr IslandData; 39 | public: 40 | virtual ~IslandWA() { }; 41 | IslandWA(std::shared_ptr islandData) : 42 | Island(islandData), IslandData(islandData) { }; 43 | 44 | std::unique_ptr acre(u8 Acre) const override; 45 | 46 | std::unique_ptr item(u16 index) const override; 47 | private: 48 | u8 *islandPointer() const { return this->IslandData.get(); }; 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /include/types.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_TYPES_HPP 28 | #define _LEAFEDIT_CORE_TYPES_HPP 29 | 30 | #include 31 | 32 | typedef uint8_t u8; 33 | typedef uint16_t u16; 34 | typedef uint32_t u32; 35 | typedef uint64_t u64; 36 | 37 | typedef int8_t s8; 38 | typedef int16_t s16; 39 | typedef int32_t s32; 40 | typedef int64_t s64; 41 | 42 | struct Byte { 43 | u8 Nibble1: 4; // 0 - 3. 44 | u8 Nibble2: 4; // 4 - 7. 45 | }; 46 | 47 | /* 48 | SaveTypes. 49 | */ 50 | enum class SaveType : u8 { 51 | WW, 52 | NL, 53 | WA, 54 | HHD, 55 | UNUSED 56 | }; 57 | 58 | /* 59 | Save Regions. (Mainly for AC:WW) 60 | */ 61 | enum class WWRegion : u8 { 62 | EUR, 63 | USA, 64 | JPN, 65 | KOR 66 | }; 67 | 68 | #endif -------------------------------------------------------------------------------- /include/itemUtils/ItemWhiteListWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_WW_HPP 28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_WW_HPP 29 | 30 | #include "ItemWhiteList.hpp" 31 | #include "types.hpp" 32 | 33 | class ItemWhiteListWW : public ItemWhiteList { 34 | public: 35 | bool validHat(u16 itemID) const override; 36 | bool validAccessoires(u16 itemID) const override; 37 | bool validShirt(u16 itemID) const override; 38 | bool validPants(u16 itemID) const override; 39 | bool validSocks(u16 itemID) const override; 40 | bool validShoes(u16 itemID) const override; 41 | bool validTools(u16 itemID) const override; 42 | bool validMusic(u16 itemID) const override; 43 | bool validItem(u16 itemID) const override; 44 | 45 | std::unique_ptr GetItemKind() const override { return nullptr; }; 46 | }; 47 | 48 | #endif -------------------------------------------------------------------------------- /include/pattern/PatternImage.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_IMAGE_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_IMAGE_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | 33 | /* 34 | Pixel struct. 35 | */ 36 | struct pixel { 37 | u8 left: 4; // 0000. 38 | u8 right: 4; // 1111. 39 | }; 40 | 41 | class PatternImage { 42 | public: 43 | virtual ~PatternImage() { }; 44 | PatternImage() { }; 45 | 46 | virtual bool isValid() const = 0; 47 | 48 | virtual u8 getPaletteColor(u8 plt) const = 0; 49 | 50 | virtual u8 getWWPaletteIndex() const = 0; 51 | 52 | virtual void setPaletteColor(u8 index, u8 color) = 0; 53 | 54 | virtual pixel getPixel(u16 pixel) const = 0; 55 | 56 | virtual void setPixel(u16 index, u8 color) = 0; 57 | 58 | virtual void setPixel(u8 x, u8 y, u8 color) = 0; 59 | }; 60 | 61 | #endif -------------------------------------------------------------------------------- /source/shop/ShopWW.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "saveUtils.hpp" 28 | #include "ShopWW.hpp" 29 | 30 | /* 31 | Return the able sister pattern. 32 | 33 | u8 pattern: Pattern Index. 34 | */ 35 | std::unique_ptr ShopWW::ableSisterPattern(u8 pattern) const { 36 | if (pattern > 7) return nullptr; 37 | 38 | switch(this->SaveRegion) { 39 | case WWRegion::EUR: 40 | case WWRegion::USA: 41 | return std::make_unique(this->ShopData, this->Offset + 0xFAFC + pattern * 0x228, this->SaveRegion); 42 | 43 | case WWRegion::JPN: 44 | return std::make_unique(this->ShopData, this->Offset + 0xDAF8 + pattern * 0x220, this->SaveRegion); 45 | 46 | case WWRegion::KOR: 47 | return std::make_unique(this->ShopData, this->Offset + 0x10AD0 + pattern * 0x234, this->SaveRegion); 48 | } 49 | 50 | return nullptr; 51 | } -------------------------------------------------------------------------------- /include/itemUtils/ItemWhiteList.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_HPP 28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_HPP 29 | 30 | #include "itemKind.hpp" 31 | #include "types.hpp" 32 | #include 33 | 34 | class ItemWhiteList { 35 | public: 36 | virtual bool validHat(u16 itemID) const = 0; 37 | virtual bool validAccessoires(u16 itemID) const = 0; 38 | virtual bool validShirt(u16 itemID) const = 0; 39 | virtual bool validPants(u16 itemID) const = 0; 40 | virtual bool validSocks(u16 itemID) const = 0; 41 | virtual bool validShoes(u16 itemID) const = 0; 42 | virtual bool validTools(u16 itemID) const = 0; 43 | virtual bool validMusic(u16 itemID) const = 0; 44 | virtual bool validItem(u16 itemID) const = 0; 45 | 46 | virtual std::unique_ptr GetItemKind() const = 0; // Return the itemKind. 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /include/itemUtils/ItemWhiteListNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_NL_HPP 28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_NL_HPP 29 | 30 | #include "itemKindNL.hpp" 31 | #include "ItemWhiteList.hpp" 32 | #include "types.hpp" 33 | 34 | class ItemWhiteListNL : public ItemWhiteList { 35 | public: 36 | bool validHat(u16 itemID) const override; 37 | bool validAccessoires(u16 itemID) const override; 38 | bool validShirt(u16 itemID) const override; 39 | bool validPants(u16 itemID) const override; 40 | bool validSocks(u16 itemID) const override; 41 | bool validShoes(u16 itemID) const override; 42 | bool validTools(u16 itemID) const override; 43 | bool validMusic(u16 itemID) const override; 44 | bool validItem(u16 itemID) const override; 45 | 46 | std::unique_ptr GetItemKind() const override { return std::make_unique(); }; 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /include/itemUtils/ItemWhiteListWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_WA_HPP 28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_WA_HPP 29 | 30 | #include "itemKindWA.hpp" 31 | #include "ItemWhiteList.hpp" 32 | #include "types.hpp" 33 | 34 | class ItemWhiteListWA : public ItemWhiteList { 35 | public: 36 | bool validHat(u16 itemID) const override; 37 | bool validAccessoires(u16 itemID) const override; 38 | bool validShirt(u16 itemID) const override; 39 | bool validPants(u16 itemID) const override; 40 | bool validSocks(u16 itemID) const override; 41 | bool validShoes(u16 itemID) const override; 42 | bool validTools(u16 itemID) const override; 43 | bool validMusic(u16 itemID) const override; 44 | bool validItem(u16 itemID) const override; 45 | 46 | std::unique_ptr GetItemKind() const override { return std::make_unique(); }; 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /include/coreUtils/saveUtils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SAVEUTILS_HPP 28 | #define _LEAFEDIT_CORE_SAVEUTILS_HPP 29 | 30 | #include "Sav.hpp" 31 | #include "types.hpp" 32 | #include 33 | 34 | inline std::unique_ptr save; 35 | 36 | namespace SaveUtils { 37 | /* Read. */ 38 | template 39 | T Read(u8 *Buffer, u32 offset) { return *(T *)(Buffer + offset); }; 40 | 41 | /* Get and set a bit. */ 42 | bool GetBit(const u8 *data, u32 offset, u8 bitIndex); 43 | void SetBit(u8 *data, u32 offset, u8 bitIndex, bool bit); 44 | 45 | /* Write. */ 46 | template 47 | void Write(u8 *Buffer, u32 offset, T data, const bool saveWrite = true) { 48 | *reinterpret_cast(Buffer + offset) = data; 49 | 50 | if (saveWrite) { 51 | if (save) save->setChangesMade(true); 52 | } 53 | }; 54 | 55 | void WriteNibble(u8 *Buffer, u32 offset, bool first, u8 data, const bool SaveWrite = true); 56 | }; 57 | 58 | #endif -------------------------------------------------------------------------------- /include/house/House.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_HOUSE_HPP 28 | #define _LEAFEDIT_CORE_HOUSE_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | 33 | class Room { 34 | protected: 35 | std::shared_ptr RoomData; 36 | u32 Offset; 37 | public: 38 | virtual ~Room() { }; 39 | Room(std::shared_ptr data, u32 offset) : 40 | RoomData(data), Offset(offset) { }; 41 | Room(const Room& room) = delete; 42 | Room& operator=(const Room& room) = delete; 43 | 44 | virtual u32 debts() const = 0; 45 | virtual void debts(u32 v) = 0; 46 | }; 47 | 48 | class House { 49 | protected: 50 | std::shared_ptr HouseData; 51 | u32 Offset; 52 | public: 53 | virtual ~House() { }; 54 | House(std::shared_ptr data, u32 offset) : 55 | HouseData(data), Offset(offset) { }; 56 | House(const House& house) = delete; 57 | House& operator=(const House& house) = delete; 58 | 59 | virtual std::unique_ptr room(u8 room) const = 0; 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /include/house/HouseNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_HOUSE_NL_HPP 28 | #define _LEAFEDIT_CORE_HOUSE_NL_HPP 29 | 30 | #include "House.hpp" 31 | #include 32 | 33 | class RoomNL : public Room { 34 | protected: 35 | std::shared_ptr RoomData; 36 | u32 Offset; 37 | public: 38 | virtual ~RoomNL() { }; 39 | RoomNL(std::shared_ptr roomData, u32 offset) : 40 | Room(roomData, offset), RoomData(roomData), Offset(offset) { }; 41 | private: 42 | u8 *roomPointer() const { return this->RoomData.get() + this->Offset; }; 43 | }; 44 | 45 | class HouseNL : public House { 46 | protected: 47 | std::shared_ptr HouseData; 48 | u32 Offset; 49 | public: 50 | virtual ~HouseNL() { }; 51 | HouseNL(std::shared_ptr houseData, u32 offset) : 52 | House(houseData, offset), HouseData(houseData), Offset(offset) { }; 53 | 54 | std::unique_ptr room(u8 room) const override; 55 | private: 56 | u8 *housePointer() const { return this->HouseData.get() + this->Offset; }; 57 | }; 58 | 59 | #endif -------------------------------------------------------------------------------- /include/house/HouseWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_HOUSE_WA_HPP 28 | #define _LEAFEDIT_CORE_HOUSE_WA_HPP 29 | 30 | #include "House.hpp" 31 | #include 32 | 33 | class RoomWA : public Room { 34 | protected: 35 | std::shared_ptr RoomData; 36 | u32 Offset; 37 | public: 38 | virtual ~RoomWA() { }; 39 | RoomWA(std::shared_ptr roomData, u32 offset) : 40 | Room(roomData, offset), RoomData(roomData), Offset(offset) { }; 41 | private: 42 | u8 *roomPointer() const { return this->RoomData.get() + this->Offset; }; 43 | }; 44 | 45 | class HouseWA : public House { 46 | protected: 47 | std::shared_ptr HouseData; 48 | u32 Offset; 49 | public: 50 | virtual ~HouseWA() { }; 51 | HouseWA(std::shared_ptr houseData, u32 offset) : 52 | House(houseData, offset), HouseData(houseData), Offset(offset) { }; 53 | 54 | std::unique_ptr room(u8 room) const override; 55 | private: 56 | u8 *housePointer() const { return this->HouseData.get() + this->Offset; }; 57 | }; 58 | 59 | #endif -------------------------------------------------------------------------------- /include/item/ItemNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_NL_HPP 28 | #define _LEAFEDIT_CORE_ITEM_NL_HPP 29 | 30 | #include "Item.hpp" 31 | #include 32 | 33 | class ItemNL : public Item { 34 | protected: 35 | std::shared_ptr ItemData; 36 | u32 Offset; 37 | public: 38 | virtual ~ItemNL() { }; 39 | ItemNL(std::shared_ptr itemData, u32 offset) : 40 | Item(itemData, offset), ItemData(itemData), Offset(offset) { }; 41 | 42 | u32 maxItems() const override { return 0; }; 43 | 44 | u16 id() const override; 45 | void id(u16 v) override; 46 | 47 | u16 flags() const override; 48 | void flags(u16 v) override; 49 | 50 | u8 flag1() const override; 51 | void flag1(u8 v) override; 52 | 53 | u8 flag2() const override; 54 | void flag2(u8 v) override; 55 | 56 | std::string name() const override; 57 | 58 | ItemType itemtype() const override; 59 | 60 | FurnitureDirection rotation() const override; 61 | void rotation(FurnitureDirection Direction) override; 62 | private: 63 | u8 *itemPointer() const { return this->ItemData.get() + this->Offset; }; 64 | }; 65 | 66 | #endif -------------------------------------------------------------------------------- /include/item/ItemWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_WA_HPP 28 | #define _LEAFEDIT_CORE_ITEM_WA_HPP 29 | 30 | #include "Item.hpp" 31 | #include 32 | 33 | class ItemWA : public Item { 34 | protected: 35 | std::shared_ptr ItemData; 36 | u32 Offset; 37 | public: 38 | virtual ~ItemWA() { }; 39 | ItemWA(std::shared_ptr itemData, u32 offset) : 40 | Item(itemData, offset), ItemData(itemData), Offset(offset) { }; 41 | 42 | u32 maxItems() const override { return 0; }; 43 | 44 | u16 id() const override; 45 | void id(u16 v) override; 46 | 47 | u16 flags() const override; 48 | void flags(u16 v) override; 49 | 50 | u8 flag1() const override; 51 | void flag1(u8 v) override; 52 | 53 | u8 flag2() const override; 54 | void flag2(u8 v) override; 55 | 56 | std::string name() const override; 57 | 58 | ItemType itemtype() const override; 59 | 60 | FurnitureDirection rotation() const override; 61 | void rotation(FurnitureDirection Direction) override; 62 | private: 63 | u8 *itemPointer() const { return this->ItemData.get() + this->Offset; }; 64 | }; 65 | 66 | #endif -------------------------------------------------------------------------------- /include/item/ItemWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_WW_HPP 28 | #define _LEAFEDIT_CORE_ITEM_WW_HPP 29 | 30 | #include "Item.hpp" 31 | #include 32 | 33 | class ItemWW : public Item { 34 | protected: 35 | std::shared_ptr ItemData; 36 | u32 Offset; 37 | public: 38 | virtual ~ItemWW() { }; 39 | ItemWW(std::shared_ptr itemData, u32 offset) : 40 | Item(itemData, offset), ItemData(itemData), Offset(offset) { }; 41 | 42 | u32 maxItems() const override { return 0; }; 43 | 44 | u16 id() const override; 45 | void id(u16 v) override; 46 | 47 | u16 flags() const override; 48 | void flags(u16 v) override; 49 | 50 | u8 flag1() const override; 51 | void flag1(u8 v) override; 52 | 53 | u8 flag2() const override; 54 | void flag2(u8 v) override; 55 | 56 | std::string name() const override; 57 | 58 | ItemType itemtype() const override; 59 | 60 | FurnitureDirection rotation() const override; 61 | void rotation(FurnitureDirection Direction) override; 62 | private: 63 | u8 *itemPointer() const { return this->ItemData.get() + this->Offset; }; 64 | }; 65 | 66 | #endif -------------------------------------------------------------------------------- /include/coreUtils/checksum.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_CHECKSUM_HPP 28 | #define _LEAFEDIT_CORE_CHECKSUM_HPP 29 | 30 | #include "types.hpp" 31 | 32 | enum class ChecksumType : u8 { 33 | CRC_REFLECTED, // Most common in AC:NL checksums. 34 | CRC_NORMAL 35 | }; 36 | 37 | namespace Checksum { 38 | /* 39 | New Leaf + Welcome amiibo stuff. 40 | */ 41 | u32 CalculateCRC32Reflected(u8 *buf, u32 size); 42 | u32 CalculateCRC32Normal(u8 *buf, u32 size); 43 | bool VerifyCRC32(u32 crc, u8 *buf, u32 startOffset, u32 size, ChecksumType type = ChecksumType::CRC_REFLECTED); 44 | u32 UpdateCRC32(u8 *data, u32 startOffset, u32 size, ChecksumType type = ChecksumType::CRC_REFLECTED); 45 | void FixWACRC32s(u8 *data); 46 | void FixNLCRC32s(u8 *data); 47 | 48 | /* 49 | Wild World stuff. 50 | */ 51 | u16 CalculateWW(const u16 *buffer, u64 size, u16 checksumOffset); 52 | bool VerifyWW(const u16 *buffer, u64 size, u16 currentChecksum, u16 checksumOffset); 53 | void UpdateWWChecksum(WWRegion region, u8 *saveBuffer, u64 size); 54 | 55 | /* 56 | AC:HHD stuff. 57 | */ 58 | void FixHHDChecksum(u8 *data); 59 | }; 60 | 61 | #endif -------------------------------------------------------------------------------- /include/house/HouseWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_HOUSE_WW_HPP 28 | #define _LEAFEDIT_CORE_HOUSE_WW_HPP 29 | 30 | #include "House.hpp" 31 | 32 | #include 33 | 34 | class RoomWW : public Room { 35 | protected: 36 | std::shared_ptr RoomData; 37 | u32 Offset; 38 | WWRegion SaveRegion; 39 | public: 40 | virtual ~RoomWW() { }; 41 | RoomWW(std::shared_ptr roomData, u32 offset, WWRegion region) : 42 | Room(roomData, offset), RoomData(roomData), Offset(offset), SaveRegion(region) { }; 43 | private: 44 | u8 *roomPointer() const { return this->RoomData.get() + this->Offset; }; 45 | }; 46 | 47 | class HouseWW : public House { 48 | protected: 49 | std::shared_ptr HouseData; 50 | u32 Offset; 51 | WWRegion SaveRegion; 52 | public: 53 | virtual ~HouseWW() { }; 54 | HouseWW(std::shared_ptr houseData, u32 offset, WWRegion region) : 55 | House(houseData, offset), HouseData(houseData), Offset(offset), SaveRegion(region) { }; 56 | 57 | std::unique_ptr room(u8 room) const override; 58 | private: 59 | u8 *housePointer() const { return this->HouseData.get() + this->Offset; }; 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /source/itemUtils/itemUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "itemUtils.hpp" 28 | #include "stringDB.hpp" 29 | #include 30 | #include 31 | #include 32 | 33 | extern std::vector> itemDB; 34 | extern std::vector itemCategories; 35 | 36 | /* 37 | Get an Item's name. 38 | 39 | u16 ID: The Item ID. 40 | */ 41 | std::string ItemUtils::getName(u16 ID) { 42 | if (itemDB.empty()) return "???"; // Database empty. 43 | 44 | for (auto const& entry : itemDB) { 45 | if (std::get<0>(entry) == ID) return std::get<1>(entry); 46 | } 47 | 48 | return std::string("???"); 49 | } 50 | 51 | /* 52 | Get an Animal Crossing: Wild World's index Item's name. 53 | 54 | u8 category: The item category. 55 | u8 index: The index. 56 | */ 57 | std::string ItemUtils::getWWName(u8 category, u8 index) { 58 | std::vector> temp = StringDB::searchTuple("", {itemCategories[category]}, itemDB, true); 59 | 60 | if (temp.empty()) return "???"; // Database empty. 61 | 62 | if (temp.size() >= index) return std::get<1>(temp[index]); 63 | 64 | return std::string("???"); 65 | } -------------------------------------------------------------------------------- /include/pattern/PatternImageNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_IMAGE_NL_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_IMAGE_NL_HPP 29 | 30 | #include "PatternImage.hpp" 31 | 32 | class PatternImageNL : public PatternImage { 33 | protected: 34 | std::shared_ptr PatternData; 35 | u32 PatternOffset; 36 | u32 PaletteOffset; 37 | public: 38 | virtual ~PatternImageNL() { }; 39 | PatternImageNL(std::shared_ptr data, u32 patternOffset, u32 paletteOffset) : 40 | PatternImage(), PatternData(data), PatternOffset(patternOffset), PaletteOffset(paletteOffset) { }; 41 | 42 | bool isValid() const override { return this->Valid; }; 43 | 44 | u8 getPaletteColor(u8 plt) const override; 45 | 46 | u8 getWWPaletteIndex() const override; 47 | 48 | void setPaletteColor(u8 index, u8 color) override; 49 | 50 | pixel getPixel(u16 pixel) const override; 51 | 52 | void setPixel(u16 index, u8 color) override; 53 | 54 | void setPixel(u8 x, u8 y, u8 color) override; 55 | private: 56 | bool Valid = true; 57 | 58 | pixel *pixelPointer() const { return (pixel *)(this->PatternData.get() + this->PatternOffset); }; 59 | u8 *paletteData() const { return this->PatternData.get() + this->PaletteOffset; }; 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /include/pattern/PatternImageWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_IMAGE_WW_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_IMAGE_WW_HPP 29 | 30 | #include "PatternImage.hpp" 31 | 32 | class PatternImageWW : public PatternImage { 33 | protected: 34 | std::shared_ptr PatternData; 35 | u32 PatternOffset; 36 | u32 PaletteOffset; 37 | public: 38 | virtual ~PatternImageWW() { }; 39 | PatternImageWW(std::shared_ptr data, u32 patternOffset, u32 paletteOffset) : 40 | PatternImage(), PatternData(data), PatternOffset(patternOffset), PaletteOffset(paletteOffset) { }; 41 | 42 | bool isValid() const override { return this->Valid; }; 43 | 44 | u8 getPaletteColor(u8 plt) const override; 45 | 46 | u8 getWWPaletteIndex() const override; 47 | 48 | void setPaletteColor(u8 index, u8 color) override; 49 | 50 | pixel getPixel(u16 pixel) const override; 51 | 52 | void setPixel(u16 index, u8 color) override; 53 | 54 | void setPixel(u8 x, u8 y, u8 color) override; 55 | private: 56 | bool Valid = true; 57 | 58 | pixel *pixelPointer() const { return (pixel *)(this->PatternData.get() + this->PatternOffset); }; 59 | u8 *paletteData() const { return this->PatternData.get() + this->PaletteOffset; }; 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /include/coreUtils/stringUtils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_STRINGUTILS_HPP 28 | #define _LEAFEDIT_CORE_STRINGUTILS_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | 33 | namespace StringUtils { 34 | /* 35 | Converters. 36 | */ 37 | std::u16string UTF8toUTF16(const std::string& src); 38 | std::string UTF16toUTF8(const std::u16string& src); 39 | 40 | /* 41 | Other utilities. 42 | */ 43 | std::u16string& toFullWidth(std::u16string &in); 44 | u16 strToU16(const std::string &str); 45 | std::string DecimalToHex(int decimalVal); 46 | 47 | /* 48 | For New Leaf | Welcome Amiibo and Korean AC:WW. 49 | */ 50 | std::u16string ReadUTF16String(u8 *data, u32 offset, u32 maxSize); 51 | void WriteUTF16String(u8 *data, const std::u16string &str, u32 offset, u32 maxSize); 52 | 53 | /* 54 | Wild World all regions except Korean. 55 | */ 56 | std::u16string ReadUTF8String(u8 *data, u32 offset, u32 maxSize, WWRegion region); 57 | void WriteUTF8String(u8 *data, const std::u16string &str, u32 offset, u32 maxSize, WWRegion region); 58 | 59 | /* 60 | Wild World to unicode stuff. 61 | */ 62 | std::u16string wwToUnicode(const std::string &input, WWRegion region); 63 | std::string unicodeToWW(const std::u16string &input, WWRegion region); 64 | }; 65 | 66 | #endif -------------------------------------------------------------------------------- /source/sav/SavNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "checksum.hpp" 28 | #include "SavNL.hpp" 29 | 30 | /* 31 | Return a Player. 32 | 33 | u8 player: The player index. 34 | */ 35 | std::unique_ptr SavNL::player(u8 player) const { 36 | if (player > 3) return nullptr; // Player goes out of scope. 37 | 38 | return std::make_unique(this->SaveData, 0xA0 + (player * 0x9F10), player); 39 | } 40 | 41 | /* 42 | Return a Villager. 43 | 44 | u8 villager: The villager index. 45 | */ 46 | std::unique_ptr SavNL::villager(u8 villager) const { 47 | if (villager > 9) return nullptr; // Villager goes out of scope. 48 | 49 | return std::make_unique(this->SaveData, 0x027d10 + (villager * 0x24f8)); 50 | } 51 | 52 | /* 53 | Return the Town. 54 | */ 55 | std::unique_ptr SavNL::town() const { return std::make_unique(this->SaveData); }; 56 | 57 | /* 58 | Return the Island. 59 | */ 60 | std::unique_ptr SavNL::island() const { return std::make_unique(this->SaveData); }; 61 | 62 | /* 63 | Return the shops. 64 | */ 65 | std::unique_ptr SavNL::shop() const { return std::make_unique(this->SaveData, 0); }; 66 | 67 | /* 68 | Last call before writing to file. Update Checksum. 69 | */ 70 | void SavNL::Finish(void) { Checksum::FixNLCRC32s(this->savePointer()); }; -------------------------------------------------------------------------------- /source/sav/SavWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "checksum.hpp" 28 | #include "SavWA.hpp" 29 | 30 | /* 31 | Return a Player. 32 | 33 | u8 player: The player index. 34 | */ 35 | std::unique_ptr SavWA::player(u8 player) const { 36 | if (player > 3) return nullptr; // Player goes out of scope. 37 | 38 | return std::make_unique(this->SaveData, 0xA0 + (player * 0xA480), player); 39 | } 40 | 41 | /* 42 | Return a Villager. 43 | 44 | u8 villager: The villager index. 45 | */ 46 | std::unique_ptr SavWA::villager(u8 villager) const { 47 | if (villager > 9) return nullptr; // Villager goes out of scope. 48 | 49 | return std::make_unique(this->SaveData, 0x0292D0 + (villager * 0x2518)); 50 | } 51 | 52 | /* 53 | Return the Town. 54 | */ 55 | std::unique_ptr SavWA::town() const { return std::make_unique(this->SaveData); }; 56 | 57 | /* 58 | Return the Island. 59 | */ 60 | std::unique_ptr SavWA::island() const { return std::make_unique(this->SaveData); }; 61 | 62 | /* 63 | Return the Shops. 64 | */ 65 | std::unique_ptr SavWA::shop() const { return std::make_unique(this->SaveData, 0); }; 66 | 67 | /* 68 | Last call before writing to file. Update Checksum. 69 | */ 70 | void SavWA::Finish(void) { Checksum::FixWACRC32s(this->savePointer()); }; -------------------------------------------------------------------------------- /include/town/Town.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_TOWN_HPP 28 | #define _LEAFEDIT_CORE_TOWN_HPP 29 | 30 | #include "Acre.hpp" 31 | #include "Item.hpp" 32 | #include "Pattern.hpp" 33 | #include "types.hpp" 34 | #include 35 | 36 | class Town { 37 | protected: 38 | std::shared_ptr TownData; 39 | public: 40 | virtual ~Town() { }; 41 | Town(std::shared_ptr townData) : 42 | TownData(townData) { }; 43 | Town(const Town& town) = delete; 44 | Town& operator=(const Town& town) = delete; 45 | 46 | virtual u8 grasstype() const = 0; 47 | virtual void grasstype(u8 v) = 0; 48 | 49 | virtual std::u16string name() const = 0; 50 | virtual void name(std::u16string v) = 0; 51 | 52 | virtual std::unique_ptr acre(u8 Acre) const = 0; 53 | virtual std::unique_ptr item(u16 index) const = 0; 54 | 55 | virtual bool exist() const = 0; 56 | 57 | virtual u32 turnipPrices(bool isAM, u8 day) const = 0; 58 | virtual void turnipPrices(bool isAM, u8 day, u32 v) = 0; 59 | 60 | virtual std::unique_ptr townflag() const = 0; 61 | 62 | virtual bool itemBuried(u16 index) const = 0; 63 | virtual void itemBuried(u16 index, bool buried) = 0; 64 | 65 | virtual std::unique_ptr recycleItem(u8 slot) const = 0; 66 | virtual std::unique_ptr lostFoundItem(u8 slot) const = 0; 67 | }; 68 | 69 | #endif -------------------------------------------------------------------------------- /include/town/TownWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_TOWN_WW_HPP 28 | #define _LEAFEDIT_CORE_TOWN_WW_HPP 29 | 30 | #include "AcreWW.hpp" 31 | #include "ItemWW.hpp" 32 | #include "PatternWW.hpp" 33 | #include "Town.hpp" 34 | #include "types.hpp" 35 | #include 36 | 37 | class TownWW : public Town { 38 | protected: 39 | std::shared_ptr TownData; 40 | WWRegion SaveRegion; 41 | public: 42 | virtual ~TownWW() { }; 43 | TownWW(std::shared_ptr townData, WWRegion Region) : 44 | Town(townData), TownData(townData), SaveRegion(Region) { }; 45 | 46 | u8 grasstype() const override; 47 | void grasstype(u8 v) override; 48 | 49 | std::u16string name() const override; 50 | void name(std::u16string v) override; 51 | 52 | std::unique_ptr acre(u8 Acre) const override; 53 | 54 | std::unique_ptr item(u16 index) const override; 55 | 56 | bool exist() const override; 57 | 58 | u32 turnipPrices(bool isAM, u8 day) const override; 59 | void turnipPrices(bool isAM, u8 day, u32 v) override; 60 | 61 | std::unique_ptr townflag() const override; 62 | 63 | bool itemBuried(u16 index) const override; 64 | void itemBuried(u16 index, bool buried) override; 65 | 66 | std::unique_ptr recycleItem(u8 slot) const override; 67 | std::unique_ptr lostFoundItem(u8 slot) const override; 68 | private: 69 | u8 *townPointer() const { return this->TownData.get(); }; 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /include/town/TownNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_TOWN_NL_HPP 28 | #define _LEAFEDIT_CORE_TOWN_NL_HPP 29 | 30 | #include "AcreNL.hpp" 31 | #include "encryptedInt32.hpp" 32 | #include "ItemNL.hpp" 33 | #include "PatternNL.hpp" 34 | #include "Town.hpp" 35 | #include "types.hpp" 36 | #include 37 | 38 | class TownNL : public Town { 39 | protected: 40 | std::shared_ptr TownData; 41 | public: 42 | virtual ~TownNL() { }; 43 | TownNL(std::shared_ptr townData) : 44 | Town(townData), TownData(townData) { }; 45 | 46 | u8 grasstype() const override; 47 | void grasstype(u8 v) override; 48 | 49 | std::u16string name() const override; 50 | void name(std::u16string v) override; 51 | 52 | std::unique_ptr acre(u8 Acre) const override; 53 | 54 | std::unique_ptr item(u16 index) const override; 55 | 56 | bool exist() const override; 57 | 58 | u32 turnipPrices(bool isAM, u8 day) const override; 59 | void turnipPrices(bool isAM, u8 day, u32 v) override; 60 | 61 | std::unique_ptr townflag() const override; 62 | 63 | bool itemBuried(u16 index) const override; 64 | void itemBuried(u16 index, bool buried) override; 65 | 66 | std::unique_ptr recycleItem(u8 slot) const override { return nullptr; }; 67 | std::unique_ptr lostFoundItem(u8 slot) const override { return nullptr; }; 68 | private: 69 | u8 *townPointer() const { return this->TownData.get(); }; 70 | 71 | mutable EncryptedInt32 TurnipPrices[12]; 72 | }; 73 | 74 | #endif -------------------------------------------------------------------------------- /include/town/TownWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_TOWN_WA_HPP 28 | #define _LEAFEDIT_CORE_TOWN_WA_HPP 29 | 30 | #include "AcreWA.hpp" 31 | #include "encryptedInt32.hpp" 32 | #include "ItemWA.hpp" 33 | #include "PatternWA.hpp" 34 | #include "Town.hpp" 35 | #include "types.hpp" 36 | #include 37 | 38 | class TownWA : public Town { 39 | protected: 40 | std::shared_ptr TownData; 41 | public: 42 | virtual ~TownWA() { }; 43 | TownWA(std::shared_ptr townData) : 44 | Town(townData), TownData(townData) { }; 45 | 46 | u8 grasstype() const override; 47 | void grasstype(u8 v) override; 48 | 49 | std::u16string name() const override; 50 | void name(std::u16string v) override; 51 | 52 | std::unique_ptr acre(u8 Acre) const override; 53 | 54 | std::unique_ptr item(u16 index) const override; 55 | 56 | bool exist() const override; 57 | 58 | u32 turnipPrices(bool isAM, u8 day) const override; 59 | void turnipPrices(bool isAM, u8 day, u32 v) override; 60 | 61 | std::unique_ptr townflag() const override; 62 | 63 | bool itemBuried(u16 index) const override; 64 | void itemBuried(u16 index, bool buried) override; 65 | 66 | std::unique_ptr recycleItem(u8 slot) const override { return nullptr; }; 67 | std::unique_ptr lostFoundItem(u8 slot) const override { return nullptr; }; 68 | private: 69 | u8 *townPointer() const { return this->TownData.get(); }; 70 | 71 | mutable EncryptedInt32 TurnipPrices[12]; 72 | }; 73 | 74 | #endif -------------------------------------------------------------------------------- /include/sav/SavNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SAV_NL_HPP 28 | #define _LEAFEDIT_CORE_SAV_NL_HPP 29 | 30 | #include "IslandNL.hpp" 31 | #include "PlayerHHD.hpp" 32 | #include "PlayerNL.hpp" 33 | #include "Sav.hpp" 34 | #include "ShopNL.hpp" 35 | #include "TownNL.hpp" 36 | #include "types.hpp" 37 | #include "VillagerNL.hpp" 38 | #include 39 | 40 | class SavNL : public Sav { 41 | protected: 42 | std::shared_ptr SaveData; 43 | u32 SaveSize; 44 | public: 45 | virtual ~SavNL() { }; 46 | SavNL(std::shared_ptr data, u32 ssize) : 47 | Sav(data, ssize), SaveData(data), SaveSize(ssize) { }; 48 | 49 | void Finish(void) override; 50 | 51 | /* 52 | Get main core class contents. 53 | */ 54 | std::unique_ptr player(u8 player) const override; 55 | std::unique_ptr villager(u8 villager) const override; 56 | std::unique_ptr town() const override; 57 | std::unique_ptr island() const override; 58 | std::unique_ptr shop() const override; 59 | 60 | /* 61 | Special Getter's for AC:HHD. 62 | Return nullptr on that for the main series. 63 | */ 64 | std::unique_ptr playerhhd() const override { return nullptr; }; 65 | 66 | SaveType getType() const override { return SaveType::NL; }; 67 | WWRegion getRegion() const override { return WWRegion::EUR; }; // Just return the first region from there, i guess. 68 | 69 | u8 maxVillager() const override { return 9; }; 70 | private: 71 | u8 *savePointer() const { return this->SaveData.get(); }; 72 | }; 73 | 74 | #endif -------------------------------------------------------------------------------- /include/sav/SavWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SAV_WA_HPP 28 | #define _LEAFEDIT_CORE_SAV_WA_HPP 29 | 30 | #include "IslandWA.hpp" 31 | #include "PlayerHHD.hpp" 32 | #include "PlayerWA.hpp" 33 | #include "Sav.hpp" 34 | #include "ShopWA.hpp" 35 | #include "TownWA.hpp" 36 | #include "types.hpp" 37 | #include "VillagerWA.hpp" 38 | #include 39 | 40 | class SavWA : public Sav { 41 | protected: 42 | std::shared_ptr SaveData; 43 | u32 SaveSize; 44 | public: 45 | virtual ~SavWA() { }; 46 | SavWA(std::shared_ptr data, u32 ssize) : 47 | Sav(data, ssize), SaveData(data), SaveSize(ssize) { }; 48 | 49 | void Finish(void) override; 50 | 51 | /* 52 | Get main core class contents. 53 | */ 54 | std::unique_ptr player(u8 player) const override; 55 | std::unique_ptr villager(u8 villager) const override; 56 | std::unique_ptr town() const override; 57 | std::unique_ptr island() const override; 58 | std::unique_ptr shop() const override; 59 | 60 | /* 61 | Special Getter's for AC:HHD. 62 | Return nullptr on that for the main series. 63 | */ 64 | std::unique_ptr playerhhd() const override { return nullptr; }; 65 | 66 | SaveType getType() const override { return SaveType::WA; }; 67 | WWRegion getRegion() const override { return WWRegion::EUR; }; // Just return the first region from there, i guess. 68 | 69 | u8 maxVillager() const override { return 9; }; 70 | private: 71 | u8 *savePointer() const { return this->SaveData.get(); }; 72 | }; 73 | 74 | #endif -------------------------------------------------------------------------------- /include/sav/SavWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SAV_WW_HPP 28 | #define _LEAFEDIT_CORE_SAV_WW_HPP 29 | 30 | #include "Island.hpp" // Needed in any way, even if that does not exist inside AC:WW. 31 | #include "PlayerHHD.hpp" 32 | #include "PlayerWW.hpp" 33 | #include "Sav.hpp" 34 | #include "ShopWW.hpp" 35 | #include "TownWW.hpp" 36 | #include "types.hpp" 37 | #include "VillagerWW.hpp" 38 | #include 39 | 40 | class SavWW : public Sav { 41 | protected: 42 | std::shared_ptr SaveData; 43 | u32 SaveSize; 44 | WWRegion SaveRegion; 45 | public: 46 | virtual ~SavWW() { }; 47 | SavWW(std::shared_ptr data, WWRegion Region, u32 ssize) : 48 | Sav(data, ssize), SaveData(data), SaveSize(ssize), SaveRegion(Region) { }; 49 | 50 | void Finish(void) override; 51 | 52 | /* 53 | Get main core class contents. 54 | */ 55 | std::unique_ptr player(u8 player) const override; 56 | std::unique_ptr villager(u8 villager) const override; 57 | std::unique_ptr town() const override; 58 | std::unique_ptr island() const override; 59 | std::unique_ptr shop() const override; 60 | 61 | /* 62 | Special Getter's for AC:HHD. 63 | Return nullptr on that for the main series. 64 | */ 65 | std::unique_ptr playerhhd() const override { return nullptr; }; 66 | 67 | SaveType getType() const override { return SaveType::WW; }; 68 | WWRegion getRegion() const override { return this->SaveRegion; }; 69 | 70 | u8 maxVillager() const override { return 7; }; 71 | private: 72 | u8 *savePointer() const { return this->SaveData.get(); }; 73 | }; 74 | 75 | #endif -------------------------------------------------------------------------------- /include/villager/Villager.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_VILLAGER_HPP 28 | #define _LEAFEDIT_CORE_VILLAGER_HPP 29 | 30 | #include "Item.hpp" 31 | #include "types.hpp" 32 | #include 33 | 34 | class Villager { 35 | protected: 36 | std::shared_ptr VillagerData; 37 | u32 Offset; 38 | public: 39 | virtual ~Villager() { }; 40 | Villager(std::shared_ptr villagerData, u32 villagerOffset) : 41 | VillagerData(villagerData), Offset(villagerOffset) { }; 42 | Villager(const Villager& villager) = delete; 43 | Villager& operator=(const Villager& villager) = delete; 44 | virtual u32 getVillagerSize() const = 0; 45 | 46 | virtual u16 id() const = 0; 47 | virtual void id(u16 v) = 0; 48 | 49 | virtual bool exist() const = 0; 50 | 51 | virtual u8 personality() const = 0; 52 | virtual void personality(u8 v) = 0; 53 | 54 | /* 55 | Items. 56 | */ 57 | virtual std::unique_ptr song() const = 0; 58 | virtual std::unique_ptr shirt() const = 0; 59 | virtual std::unique_ptr wallpaper() const = 0; 60 | virtual std::unique_ptr carpet() const = 0; 61 | virtual std::unique_ptr umbrella() const = 0; 62 | 63 | /* 64 | AC:WW Indexes. 65 | */ 66 | virtual u8 songWW() const = 0; 67 | virtual void songWW(u8 sng) = 0; 68 | 69 | virtual u8 wallpaperWW() const = 0; 70 | virtual void wallpaperWW(u8 wlp) = 0; 71 | 72 | virtual u8 carpetWW() const = 0; 73 | virtual void carpetWW(u8 crp) = 0; 74 | 75 | virtual u8 umbrellaWW() const = 0; 76 | virtual void umbrellaWW(u8 umbr) = 0; 77 | 78 | virtual std::unique_ptr furniture(u8 slot) const = 0; 79 | }; 80 | 81 | #endif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LeafEdit-Core 2 | 3 | ## Note 4 | 5 | ***With the discontinue of LeafEdit, the core is now discontinued as well.*** 6 | 7 | ## This is the core which LeafEdit uses for save editing. 8 | 9 | ### LeafEdit-Core is going to support the following games: 10 | - Animal Crossing: Wild World 11 | - Animal Crossing: New Leaf 12 | - Animal Crossing: New Leaf Welcome amiibo 13 | - Animal Crossing: Happy Home Designer 14 | 15 | For a list of all currently implemented features, please take a look [here](https://github.com/Universal-Team/LeafEdit-Core/blob/master/core-features.md). 16 | 17 | If you notice a bug, which might be related to the core, feel free to create an issue at the issues section or let us know on the Universal-Team's discord server [here](https://universal-team.net/discord). Just let us know at the `#animal-crossing` channel, that's where all of the LeafEdit-Core and LeafEdit | WildEdit app stuff gets discussed. 18 | 19 | ## Using LeafEdit-Core 20 | NOTE: This requires C++17 or later(?), to compile. LeafEdit uses C++17. 21 | 22 | To use LeafEdit-Core, you will need to create a file called `leafedit_core.hpp`. 23 | 24 | The file SHOULD look like this: 25 | ```cpp 26 | #ifndef _LEAFEDIT_CORE_HPP 27 | #define _LEAFEDIT_CORE_HPP 28 | 29 | #define _LANG_PATH "romfs:/lang/strings" 30 | #define _ITEM_BIN_PATH "romfs:/itemBins" 31 | 32 | #endif 33 | ``` 34 | 35 | You can also do it within the Makefile with the CXXFLAGS for example. 36 | 37 | `-D_CORE_CONFIGURED` would be required if you use this.. so it does not read from the `leafedit_core.hpp` file then. 38 | 39 | While.. the definitions should be, where the specific stuff is stored. On 3DS, it'll be inside the ROM filesystem, hence `romfs:/`, while on different platforms, it might be just the path.. such as `strings`. 40 | 41 | If you would like to work with Item Whitelisting, you will also need the `.bin` files from the [ItemBins](https://github.com/Universal-Team/LeafEdit-Extras/tree/master/assets). These files should be placed in the path defined by `_ITEM_BIN_PATH`. 42 | 43 | ## Credits 44 | - [Cuyler](https://github.com/Cuyler36), [Slattz](https://github.com/Slattz), [NLTK](https://github.com/Slattz/NLTK), [ACSE](https://github.com/Cuyler36/ACSE): For previous core work from NLTK, ACSE and research. 45 | 46 | - [piepie62](https://github.com/piepie62): For helping me out by problems and [PKSM-Core](https://github.com/FlagBrew/PKSM-Core)'s Save Structure. LeafEdit's Core Structure is very similar to the one from PKSM-Core. 47 | 48 | - [Pk11](https://github.com/Epicpkmn11): For helping me with the Core Rewrite. 49 | 50 | - [RedShyGuy](https://github.com/RedShyGuy): For helping with the core. 51 | 52 | - [SuperSaiyajinStackZ](https://github.com/SuperSaiyajinStackZ): The Main Developer of LeafEdit. 53 | 54 | ## Contributors 55 | For a list of all contributors, look at [Contributors.md](https://github.com/Universal-Team/LeafEdit-Core/blob/master/Contributors.md). 56 | -------------------------------------------------------------------------------- /include/hhd/SavHHD.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SAV_HHD_HPP 28 | #define _LEAFEDIT_CORE_SAV_HHD_HPP 29 | 30 | #include "Island.hpp" 31 | #include "Player.hpp" 32 | #include "PlayerHHD.hpp" 33 | #include "Sav.hpp" 34 | #include "Shop.hpp" 35 | #include "Town.hpp" 36 | #include "types.hpp" 37 | #include "Villager.hpp" 38 | #include 39 | 40 | class SavHHD : public Sav { 41 | protected: 42 | std::shared_ptr SaveData; 43 | u32 SaveSize; 44 | public: 45 | virtual ~SavHHD() { }; 46 | SavHHD(std::shared_ptr dt, u32 ssize) : 47 | Sav(dt, ssize), SaveData(dt), SaveSize(ssize) { }; 48 | void Finish(void) override; 49 | 50 | /* 51 | Get main core class contents. 52 | Return nullptr on AC:HHD for that, cause we'll use special classes for it. 53 | */ 54 | std::unique_ptr player(u8 player) const override { return nullptr; }; 55 | std::unique_ptr villager(u8 villager) const override { return nullptr; }; 56 | std::unique_ptr town() const override { return nullptr; }; 57 | std::unique_ptr island() const override { return nullptr; }; 58 | std::unique_ptr shop() const override { return nullptr; }; 59 | 60 | /* 61 | Special Getter's for AC:HHD. 62 | */ 63 | std::unique_ptr playerhhd() const override; 64 | 65 | SaveType getType() const override { return SaveType::HHD; }; 66 | WWRegion getRegion() const override { return WWRegion::EUR; }; // Just return the first region from there, i guess. 67 | 68 | u8 maxVillager() const override { return 0; }; 69 | private: 70 | u8 *savePointer() const { return this->SaveData.get(); }; 71 | }; 72 | 73 | #endif -------------------------------------------------------------------------------- /include/hhd/PlayerHHD.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PLAYER_HHD_HPP 28 | #define _LEAFEDIT_CORE_PLAYER_HHD_HPP 29 | 30 | #include "PatternHHD.hpp" 31 | #include "types.hpp" 32 | #include 33 | 34 | class PlayerHHD { 35 | protected: 36 | std::shared_ptr PlayerData; 37 | public: 38 | ~PlayerHHD() { }; 39 | PlayerHHD(std::shared_ptr data) : 40 | PlayerData(data) { }; 41 | 42 | PlayerHHD(const PlayerHHD& p) = delete; 43 | PlayerHHD& operator=(const PlayerHHD& p) = delete; 44 | 45 | u8 hairstyle() const; 46 | void hairstyle(u8 v); 47 | 48 | u8 tan() const; 49 | void tan(u8 v); 50 | 51 | u8 haircolor() const; 52 | void haircolor(u8 v); 53 | 54 | u8 face() const; 55 | void face(u8 v); 56 | 57 | u8 eyecolor() const; 58 | void eyecolor(u8 v); 59 | 60 | u16 headwear() const; 61 | void headwear(u16 v); 62 | 63 | u16 accessories() const; 64 | void accessories(u16 v); 65 | 66 | u16 shirt() const; 67 | void shirt(u16 v); 68 | 69 | u16 pants() const; 70 | void pants(u16 v); 71 | 72 | u16 socks() const; 73 | void socks(u16 v); 74 | 75 | u16 shoes() const; 76 | void shoes(u16 v); 77 | 78 | u16 tools() const; 79 | void tools(u16 v); 80 | 81 | u16 playerid() const; 82 | void playerid(u16 v); 83 | 84 | std::u16string name() const; 85 | void name(std::u16string v); 86 | 87 | std::unique_ptr pattern(u8 slot) const; 88 | 89 | /* Misc. */ 90 | void unlockHandbooks(); 91 | void lockHandbooks(); 92 | void unlockEmotions(); 93 | void lockEmotions(); 94 | private: 95 | u8 *playerPointer() const { return this->PlayerData.get() + 0x1A0 + 0x1BFA88; }; 96 | }; 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /include/pattern/PatternNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_NL_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_NL_HPP 29 | 30 | #include "Pattern.hpp" 31 | #include "PatternImageNL.hpp" 32 | #include "Player.hpp" 33 | #include 34 | 35 | class PatternNL : public Pattern { 36 | protected: 37 | std::shared_ptr PatternData; 38 | u32 Offset; 39 | public: 40 | virtual ~PatternNL() { }; 41 | PatternNL(std::shared_ptr patternData, u32 offset) : 42 | Pattern(patternData, offset), PatternData(patternData), Offset(offset) { }; 43 | 44 | std::u16string name() const override; 45 | void name(std::u16string v) override; 46 | 47 | u16 creatorid() const override; 48 | void creatorid(u16 v) override; 49 | 50 | std::u16string creatorname() const override; 51 | void creatorname(std::u16string v) override; 52 | 53 | u8 creatorGender() const override; 54 | void creatorGender(u8 v) override; 55 | 56 | u16 origtownid() const override; 57 | void origtownid(u16 v) override; 58 | 59 | std::u16string origtownname() const override; 60 | void origtownname(std::u16string v) override; 61 | 62 | u8 designtype() const override; 63 | void designtype(u8 v) override; 64 | 65 | /* 66 | Pattern Misc. 67 | */ 68 | void ownPattern(std::unique_ptr player) override; 69 | void dumpPattern(const std::string fileName) override; 70 | void injectPattern(const std::string fileName) override; 71 | 72 | /* 73 | Pattern Image. 74 | */ 75 | std::unique_ptr image(u8 pattern) const override; 76 | private: 77 | u8 *patternPointer() const { return this->PatternData.get() + this->Offset; }; 78 | }; 79 | 80 | #endif -------------------------------------------------------------------------------- /include/pattern/PatternWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_WA_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_WA_HPP 29 | 30 | #include "Pattern.hpp" 31 | #include "PatternImageNL.hpp" 32 | #include "Player.hpp" 33 | #include 34 | 35 | class PatternWA : public Pattern { 36 | protected: 37 | std::shared_ptr PatternData; 38 | u32 Offset; 39 | public: 40 | virtual ~PatternWA() { }; 41 | PatternWA(std::shared_ptr patternData, u32 offset) : 42 | Pattern(patternData, offset), PatternData(patternData), Offset(offset) { }; 43 | 44 | std::u16string name() const override; 45 | void name(std::u16string v) override; 46 | 47 | u16 creatorid() const override; 48 | void creatorid(u16 v) override; 49 | 50 | std::u16string creatorname() const override; 51 | void creatorname(std::u16string v) override; 52 | 53 | u8 creatorGender() const override; 54 | void creatorGender(u8 v) override; 55 | 56 | u16 origtownid() const override; 57 | void origtownid(u16 v) override; 58 | 59 | std::u16string origtownname() const override; 60 | void origtownname(std::u16string v) override; 61 | 62 | u8 designtype() const override; 63 | void designtype(u8 v) override; 64 | 65 | /* 66 | Pattern Misc. 67 | */ 68 | void ownPattern(std::unique_ptr player) override; 69 | void dumpPattern(const std::string fileName) override; 70 | void injectPattern(const std::string fileName) override; 71 | 72 | /* 73 | Pattern Image. 74 | */ 75 | std::unique_ptr image(u8 pattern) const override; 76 | private: 77 | u8 *patternPointer() const { return this->PatternData.get() + this->Offset; }; 78 | }; 79 | 80 | #endif -------------------------------------------------------------------------------- /include/pattern/Pattern.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_HPP 29 | 30 | #include "PatternImage.hpp" 31 | #include "Player.hpp" 32 | #include "types.hpp" 33 | #include 34 | 35 | class Player; 36 | 37 | class Pattern { 38 | protected: 39 | std::shared_ptr PatternData; 40 | u32 Offset; 41 | public: 42 | virtual ~Pattern() { }; 43 | Pattern(std::shared_ptr data, u32 offset) : 44 | PatternData(data), Offset(offset) { }; 45 | Pattern(const Pattern& pattern) = delete; 46 | Pattern& operator=(const Pattern& pattern) = delete; 47 | 48 | virtual std::u16string name() const = 0; 49 | virtual void name(std::u16string v) = 0; 50 | 51 | virtual u16 creatorid() const = 0; 52 | virtual void creatorid(u16 v) = 0; 53 | 54 | virtual std::u16string creatorname() const = 0; 55 | virtual void creatorname(std::u16string v) = 0; 56 | 57 | virtual u8 creatorGender() const = 0; 58 | virtual void creatorGender(u8 v) = 0; 59 | 60 | virtual u16 origtownid() const = 0; 61 | virtual void origtownid(u16 v) = 0; 62 | 63 | virtual std::u16string origtownname() const = 0; 64 | virtual void origtownname(std::u16string v) = 0; 65 | 66 | virtual u8 designtype() const = 0; 67 | virtual void designtype(u8 v) = 0; 68 | 69 | /* 70 | Pattern Misc. 71 | */ 72 | virtual void ownPattern(std::unique_ptr player) = 0; 73 | virtual void dumpPattern(const std::string fileName) = 0; 74 | virtual void injectPattern(const std::string fileName) = 0; 75 | 76 | /* 77 | Pattern Image. 78 | */ 79 | virtual std::unique_ptr image(u8 pattern) const = 0; 80 | }; 81 | 82 | #endif -------------------------------------------------------------------------------- /include/hhd/PatternHHD.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_HHD_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_HHD_HPP 29 | 30 | #include "Pattern.hpp" 31 | #include "PatternImageNL.hpp" // NL & HHD are the same, anyways. 32 | #include "Player.hpp" 33 | #include 34 | 35 | class PatternHHD : public Pattern { 36 | protected: 37 | std::shared_ptr PatternData; 38 | u32 Offset; 39 | public: 40 | virtual ~PatternHHD() { }; 41 | PatternHHD(std::shared_ptr patternData, u32 offset) : 42 | Pattern(patternData, offset), PatternData(patternData), Offset(offset) { }; 43 | 44 | std::u16string name() const override; 45 | void name(std::u16string v) override; 46 | 47 | u16 creatorid() const override; 48 | void creatorid(u16 v) override; 49 | 50 | std::u16string creatorname() const override; 51 | void creatorname(std::u16string v) override; 52 | 53 | u8 creatorGender() const override; 54 | void creatorGender(u8 v) override; 55 | 56 | u16 origtownid() const override; 57 | void origtownid(u16 v) override; 58 | 59 | std::u16string origtownname() const override; 60 | void origtownname(std::u16string v) override; 61 | 62 | u8 designtype() const override; 63 | void designtype(u8 v) override; 64 | 65 | /* 66 | Pattern Misc. 67 | */ 68 | void ownPattern(std::unique_ptr player) override; 69 | void dumpPattern(const std::string fileName) override; 70 | void injectPattern(const std::string fileName) override; 71 | 72 | /* 73 | Pattern Image. 74 | */ 75 | std::unique_ptr image(u8 pattern) const override; 76 | private: 77 | u8 *patternPointer() const { return this->PatternData.get() + this->Offset; }; 78 | }; 79 | 80 | #endif -------------------------------------------------------------------------------- /core-features.md: -------------------------------------------------------------------------------- 1 | # LeafEdit-Core-Features 2 | 3 | Here you can see all core features of LeafEdit-Core, which are already implemented or set as TODO. 4 | 5 | # Main Core (AC:WW, AC:NL, AC:NL:WA) 6 | 7 | ## Acre 8 | - [x] Acre ID. 9 | 10 | ## House 11 | 12 | ## Item 13 | - [x] Item ID 14 | - [x] Item Flags 15 | - [ ] Rotation for furniture // TODO. 16 | - [x] Item Name 17 | - [x] Item Type 18 | 19 | ## Letter 20 | - [x] Receiver Town ID 21 | - [x] Receiver Town Name 22 | - [x] Receiver Player ID 23 | - [x] Receiver Player Name 24 | - [x] Sender Town ID 25 | - [x] Sender Town Name 26 | - [x] Sender Player ID 27 | - [x] Sender Player Name 28 | - [x] Intro 29 | - [x] Body 30 | - [x] End 31 | - [x] PaperID 32 | - [x] LetterFlag 33 | - [x] Letter Attachment / Item 34 | 35 | ## Pattern 36 | - [x] Pattern Name 37 | - [x] Creator Name 38 | - [x] Creator ID 39 | - [x] Creator Gender 40 | - [x] Origin Town Name 41 | - [x] Origin Town ID 42 | - [x] Pattern Image 43 | - [x] Designtype 44 | 45 | ## Pattern Image 46 | - [x] Palette Index 47 | - [x] Get and Set pixel 48 | 49 | ## Player 50 | - [x] Face 51 | - [x] Tan 52 | - [x] Gender 53 | - [x] HairStyle 54 | - [x] HairColor 55 | - [x] EyeColor 56 | - [x] Badges 57 | - [x] Player ID 58 | - [x] Town ID 59 | - [x] Town Name 60 | - [x] Player Exist 61 | - [x] Player Name 62 | - [x] Wallet Amount 63 | - [x] Bank Amount 64 | - [x] Island Medals 65 | - [x] Meow Coupons 66 | - [x] Pocket Items 67 | - [x] Dresser Items 68 | - [x] Islandbox items 69 | - [x] Storage Items 70 | - [x] Pattern Images 71 | - [x] TPC Image 72 | - [x] AC:WW Acorn Festival 73 | - [x] AC:WW Attic bed (JPN only as of now.) 74 | 75 | ## Room 76 | 77 | ## Shop 78 | - [x] Able Sister Pattern Images 79 | 80 | ## Town 81 | - [x] Grasstype 82 | - [x] Town Name 83 | - [x] Town Acres 84 | - [x] Town Map Items 85 | - [x] Town Exist 86 | - [x] Turnip Prices 87 | - [x] Town Flag Pattern 88 | - [x] Item Buried 89 | 90 | ## Villager 91 | - [x] Villager ID 92 | - [x] Villager Exist 93 | - [x] Villager Personality 94 | - [ ] Villager Song // Needs to be more researched. 95 | - [x] Villager Shirt 96 | - [x] Villager Wallpaper 97 | - [x] Villager Carpet 98 | - [x] Villager Umbrella 99 | - [x] Villager Furniture 100 | 101 | # ACHHD Core 102 | 103 | ## Pattern 104 | - [x] Pattern Name 105 | - [x] Creator Name 106 | - [x] Creator ID 107 | - [x] Creator Gender 108 | - [x] Pattern Image 109 | - [x] Designtype 110 | 111 | ## Pattern Image 112 | - [x] Palette Index 113 | - [x] Get and Set pixel 114 | 115 | ## Player 116 | - [x] HairStyle 117 | - [x] Tan 118 | - [x] HairColor 119 | - [x] Eyes 120 | - [x] EyeColor 121 | - [x] Headwear 122 | - [x] Accessories 123 | - [x] Shirt 124 | - [x] Pants 125 | - [x] Socks 126 | - [x] Shoes 127 | - [x] Held Tool 128 | - [x] Player ID 129 | - [x] Player Name 130 | - [x] Player Pattern 131 | - [x] Lock | Unlock Emotions 132 | 133 | ## Miscs 134 | - [x] Lock | Unlock everything -------------------------------------------------------------------------------- /source/coreUtils/saveUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "saveUtils.hpp" 28 | 29 | /* Credits: PKSM-Core: https://github.com/FlagBrew/PKSM-Core/blob/master/source/utils/flagUtil.cpp. */ 30 | 31 | /* 32 | Get a bit. 33 | 34 | const u8 *data: The save buffer. 35 | u32 offset: The offset. 36 | u8 bitIndex: The index of the bit. 37 | */ 38 | bool SaveUtils::GetBit(const u8 *data, u32 offset, u8 bitIndex) { 39 | bitIndex &= 7; // ensure bit access is 0-7. 40 | return (data[offset] >> bitIndex & 1) != 0; 41 | } 42 | 43 | /* 44 | Set a bit. 45 | 46 | const u8 *data: The save buffer. 47 | u32 offset: The offset. 48 | u8 bitIndex: The index of the bit. 49 | bool bit: if the bit is 1 (true) or 0 (false). 50 | */ 51 | void SaveUtils::SetBit(u8 *data, u32 offset, u8 bitIndex, bool bit) { 52 | bitIndex &= 7; // ensure bit access is 0-7. 53 | data[offset] &= ~(1 << bitIndex); 54 | data[offset] |= (bit ? 1 : 0) << bitIndex; 55 | 56 | if (save) save->setChangesMade(); 57 | } 58 | 59 | /* 60 | Write a Nibble to the Savefile. 61 | 62 | u8 *Buffer: The Buffer. 63 | u32 offset: The offset where to write to. 64 | bool first: If Nibble1 (0 - 3) or Nibble2 (4 - 7). (true is Nibble1, false is Nibble2). 65 | u8 data: The data what to write. 66 | const bool SaveWrite: If changesMade should be set to true. 67 | */ 68 | void SaveUtils::WriteNibble(u8 *Buffer, u32 offset, bool first, u8 data, const bool SaveWrite) { 69 | if (data > 0xF) return; 70 | 71 | if (first) reinterpret_cast(Buffer + offset)->Nibble1 = data; // 0 - 3. 72 | else reinterpret_cast(Buffer + offset)->Nibble2 = data; // 4 - 7. 73 | 74 | if (SaveWrite) { 75 | if (save) save->setChangesMade(true); 76 | } 77 | } -------------------------------------------------------------------------------- /include/villager/VillagerWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_VILLAGER_WA_HPP 28 | #define _LEAFEDIT_CORE_VILLAGER_WA_HPP 29 | 30 | #include "ItemWA.hpp" 31 | #include "Villager.hpp" 32 | #include "types.hpp" 33 | #include 34 | 35 | class VillagerWA : public Villager { 36 | protected: 37 | std::shared_ptr VillagerData; 38 | u32 Offset; 39 | public: 40 | virtual ~VillagerWA() { }; 41 | VillagerWA(std::shared_ptr villagerData, u32 villagerOffset) : 42 | Villager(villagerData, villagerOffset), VillagerData(villagerData), Offset(villagerOffset) { }; 43 | 44 | u32 getVillagerSize() const override { return 0x2518; }; 45 | 46 | u16 id() const override; 47 | void id(u16 v) override; 48 | 49 | bool exist() const override; 50 | 51 | u8 personality() const override; 52 | void personality(u8 v) override; 53 | 54 | /* Items. */ 55 | std::unique_ptr song() const override; 56 | std::unique_ptr shirt() const override; 57 | std::unique_ptr wallpaper() const override; 58 | std::unique_ptr carpet() const override; 59 | std::unique_ptr umbrella() const override; 60 | 61 | /* Only for AC:WW. */ 62 | u8 songWW() const override { return 0; }; 63 | void songWW(u8 sng) override { }; 64 | 65 | u8 wallpaperWW() const override { return 0; }; 66 | void wallpaperWW(u8 wlp) override { }; 67 | 68 | u8 carpetWW() const override { return 0; }; 69 | void carpetWW(u8 crp) override { }; 70 | 71 | u8 umbrellaWW() const override { return 0; }; 72 | void umbrellaWW(u8 umbr) override { }; 73 | 74 | std::unique_ptr furniture(u8 slot) const override; 75 | private: 76 | u8 *villagerPointer() const { return this->VillagerData.get() + this->Offset; }; 77 | }; 78 | 79 | #endif -------------------------------------------------------------------------------- /include/villager/VillagerNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_VILLAGER_NL_HPP 28 | #define _LEAFEDIT_CORE_VILLAGER_NL_HPP 29 | 30 | #include "ItemNL.hpp" 31 | #include "Villager.hpp" 32 | #include "types.hpp" 33 | #include 34 | 35 | class VillagerNL : public Villager { 36 | protected: 37 | std::shared_ptr VillagerData; 38 | u32 Offset; 39 | public: 40 | virtual ~VillagerNL() { }; 41 | VillagerNL(std::shared_ptr villagerData, u32 villagerOffset) : 42 | Villager(villagerData, villagerOffset), VillagerData(villagerData), Offset(villagerOffset) { }; 43 | 44 | u32 getVillagerSize() const override { return 0x24F8; }; 45 | 46 | u16 id() const override; 47 | void id(u16 v) override; 48 | 49 | bool exist() const override; 50 | 51 | u8 personality() const override; 52 | void personality(u8 v) override; 53 | 54 | /* 55 | Items. 56 | */ 57 | std::unique_ptr song() const override; 58 | std::unique_ptr shirt() const override; 59 | std::unique_ptr wallpaper() const override; 60 | std::unique_ptr carpet() const override; 61 | std::unique_ptr umbrella() const override; 62 | 63 | /* 64 | Only for AC:WW. 65 | */ 66 | u8 songWW() const override { return 0; }; 67 | void songWW(u8 sng) override { }; 68 | 69 | u8 wallpaperWW() const override { return 0; }; 70 | void wallpaperWW(u8 wlp) override { }; 71 | 72 | u8 carpetWW() const override { return 0; }; 73 | void carpetWW(u8 crp) override { }; 74 | 75 | u8 umbrellaWW() const override { return 0; }; 76 | void umbrellaWW(u8 umbr) override { }; 77 | 78 | std::unique_ptr furniture(u8 slot) const override; 79 | private: 80 | u8 *villagerPointer() const { return this->VillagerData.get() + this->Offset; }; 81 | }; 82 | 83 | #endif -------------------------------------------------------------------------------- /include/coreUtils/encryptedInt32.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | This file is part of NLTK 4 | Copyright (c) 2018-2019 Slattz, Cuyler 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | /* 26 | * This file is part of LeafEdit-Core 27 | * Copyright (C) 2020 LeafEdit-Core-Contributors 28 | * 29 | * This program is free software: you can redistribute it and/or modify 30 | * it under the terms of the GNU General Public License as published by 31 | * the Free Software Foundation, either version 3 of the License, or 32 | * (at your option) any later version. 33 | * 34 | * This program is distributed in the hope that it will be useful, 35 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 36 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 37 | * GNU General Public License for more details. 38 | * 39 | * You should have received a copy of the GNU General Public License 40 | * along with this program. If not, see . 41 | * 42 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 43 | * * Requiring preservation of specified reasonable legal notices or 44 | * author attributions in that material or in the Appropriate Legal 45 | * Notices displayed by works containing it. 46 | * * Prohibiting misrepresentation of the origin of that material, 47 | * or requiring that modified versions of such material be marked in 48 | * reasonable ways as different from the original version. 49 | */ 50 | 51 | #ifndef _LEAFEDIT_CORE_ENCRYPTEDINT32_HPP 52 | #define _LEAFEDIT_CORE_ENCRYPTEDINT32_HPP 53 | 54 | #include "types.hpp" 55 | 56 | class EncryptedInt32 { 57 | public: 58 | EncryptedInt32(); 59 | EncryptedInt32(u32 value); 60 | EncryptedInt32(u32 intLow, u32 intHigh); 61 | EncryptedInt32(u64 encryptedInt); 62 | 63 | mutable u32 value; 64 | void encrypt(u32 &encryptedIntOut, u32 &encryptionDataOut); 65 | u32 decrypt(u32 intLow, u32 intHigh) const; 66 | u32 decrypt(u64 encryptedInt) const; 67 | 68 | private: 69 | u8 calculateChecksum(u32 intHigh) const; 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /include/letter/LetterNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_LETTER_NL_HPP 28 | #define _LEAFEDIT_CORE_LETTER_NL_HPP 29 | 30 | #include "ItemNL.hpp" 31 | #include "Letter.hpp" 32 | #include 33 | 34 | class LetterNL : public Letter { 35 | protected: 36 | std::shared_ptr LetterData; 37 | u32 Offset; 38 | public: 39 | virtual ~LetterNL() { }; 40 | LetterNL(std::shared_ptr letterData, u32 offset) : 41 | Letter(letterData, offset), LetterData(letterData), Offset(offset) { }; 42 | 43 | u16 playerid(bool sender) const override; 44 | void playerid(u16 v, bool sender) override; 45 | 46 | std::u16string playername(bool sender) const override; 47 | void playername(std::u16string v, bool sender) override; 48 | 49 | u16 townid(bool sender) const override; 50 | void townid(u16 v, bool sender) override; 51 | 52 | std::u16string townname(bool sender) const override; 53 | void townname(std::u16string v, bool sender) override; 54 | 55 | u8 playerindex() const override; 56 | void playerindex(u8 v) override; 57 | 58 | std::u16string intro() const override; 59 | void intro(std::u16string v) override; 60 | 61 | std::u16string body() const override; 62 | void body(std::u16string v) override; 63 | 64 | std::u16string end() const override; 65 | void end(std::u16string v) override; 66 | 67 | u8 nameindex() const override; 68 | void nameindex(u8 v) override; 69 | 70 | u8 paperid() const override; 71 | void paperid(u8 v) override; 72 | 73 | u8 flag() const override; 74 | void flag(u8 v) override; 75 | 76 | u8 senderid() const override; 77 | void senderid(u8 v) override; 78 | 79 | u8 lettertype() const override; 80 | void lettertype(u8 v) override; 81 | 82 | std::unique_ptr item() const override; 83 | private: 84 | u8 *letterPointer() const { return this->LetterData.get() + this->Offset; }; 85 | }; 86 | 87 | #endif -------------------------------------------------------------------------------- /include/letter/LetterWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_LETTER_WA_HPP 28 | #define _LEAFEDIT_CORE_LETTER_WA_HPP 29 | 30 | #include "ItemWA.hpp" 31 | #include "Letter.hpp" 32 | #include 33 | 34 | class LetterWA : public Letter { 35 | protected: 36 | std::shared_ptr LetterData; 37 | u32 Offset; 38 | public: 39 | virtual ~LetterWA() { }; 40 | LetterWA(std::shared_ptr letterData, u32 offset) : 41 | Letter(letterData, offset), LetterData(letterData), Offset(offset) { }; 42 | 43 | u16 playerid(bool sender) const override; 44 | void playerid(u16 v, bool sender) override; 45 | 46 | std::u16string playername(bool sender) const override; 47 | void playername(std::u16string v, bool sender) override; 48 | 49 | u16 townid(bool sender) const override; 50 | void townid(u16 v, bool sender) override; 51 | 52 | std::u16string townname(bool sender) const override; 53 | void townname(std::u16string v, bool sender) override; 54 | 55 | u8 playerindex() const override; 56 | void playerindex(u8 v) override; 57 | 58 | std::u16string intro() const override; 59 | void intro(std::u16string v) override; 60 | 61 | std::u16string body() const override; 62 | void body(std::u16string v) override; 63 | 64 | std::u16string end() const override; 65 | void end(std::u16string v) override; 66 | 67 | u8 nameindex() const override; 68 | void nameindex(u8 v) override; 69 | 70 | u8 paperid() const override; 71 | void paperid(u8 v) override; 72 | 73 | u8 flag() const override; 74 | void flag(u8 v) override; 75 | 76 | u8 senderid() const override; 77 | void senderid(u8 v) override; 78 | 79 | u8 lettertype() const override; 80 | void lettertype(u8 v) override; 81 | 82 | std::unique_ptr item() const override; 83 | private: 84 | u8 *letterPointer() const { return this->LetterData.get() + this->Offset; }; 85 | }; 86 | 87 | #endif -------------------------------------------------------------------------------- /source/pattern/PatternImageNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "PatternImageNL.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | Return the palette color index as an uint8_t. 32 | 33 | u8 plt: Index of the palette color. 34 | */ 35 | u8 PatternImageNL::getPaletteColor(u8 plt) const { 36 | if (plt > 14) return 0; 37 | 38 | return (u8)this->paletteData()[plt]; 39 | } 40 | 41 | /* 42 | Return the Palette Index. 43 | 44 | This is not used in the NL format, cause they can be any color. 45 | */ 46 | u8 PatternImageNL::getWWPaletteIndex() const { return 0; }; 47 | 48 | /* 49 | Set the Palette color for an index. 50 | 51 | int index: The index of the palette. 52 | u8 color: The color index. 53 | */ 54 | void PatternImageNL::setPaletteColor(u8 index, u8 color) { 55 | if (index > 15) return; 56 | 57 | SaveUtils::Write(this->paletteData(), index, color); 58 | } 59 | 60 | /* 61 | Return a pixel struct for the Left & Right pixel buffer. 62 | 63 | u16 index: The pixel index of the pattern. 64 | */ 65 | pixel PatternImageNL::getPixel(u16 index) const { 66 | if (this->Valid) { 67 | if (this->pixelPointer()) return this->pixelPointer()[index]; 68 | } 69 | 70 | return { 0, 0 }; 71 | } 72 | 73 | /* 74 | Set a pixel's color to the Pattern Image. 75 | 76 | u16 index: The pixel index of the pattern. 77 | u8 color: The color index. 78 | */ 79 | void PatternImageNL::setPixel(u16 index, u8 color) { 80 | if (color > 14 || index > 0x3FF) return; // Out of scope. 81 | 82 | if (this->Valid) { 83 | if (this->pixelPointer()) { 84 | if (index % 2 == 0) this->pixelPointer()[index / 2].left = color; 85 | else this->pixelPointer()[index / 2].right = color; 86 | } 87 | } 88 | } 89 | 90 | /* 91 | Same as above, just with X & Y position instead of index. 92 | */ 93 | void PatternImageNL::setPixel(u8 x, u8 y, u8 color) { this->setPixel((x + (y * 32)), color); }; -------------------------------------------------------------------------------- /include/letter/Letter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_LETTER_HPP 28 | #define _LEAFEDIT_CORE_LETTER_HPP 29 | 30 | #include "Item.hpp" 31 | #include "types.hpp" 32 | #include 33 | 34 | class Letter { 35 | protected: 36 | std::shared_ptr LetterData; 37 | u32 Offset; 38 | public: 39 | virtual ~Letter() { }; 40 | Letter(std::shared_ptr data, u32 offset) : 41 | LetterData(data), Offset(offset) { }; 42 | Letter(const Letter& letter) = delete; 43 | Letter& operator=(const Letter& letter) = delete; 44 | 45 | virtual u16 playerid(bool sender) const = 0; 46 | virtual void playerid(u16 v, bool sender) = 0; 47 | 48 | virtual std::u16string playername(bool sender) const = 0; 49 | virtual void playername(std::u16string v, bool sender) = 0; 50 | 51 | virtual u16 townid(bool sender) const = 0; 52 | virtual void townid(u16 v, bool sender) = 0; 53 | 54 | virtual std::u16string townname(bool sender) const = 0; 55 | virtual void townname(std::u16string v, bool sender) = 0; 56 | 57 | virtual u8 playerindex() const = 0; 58 | virtual void playerindex(u8 v) = 0; 59 | 60 | virtual std::u16string intro() const = 0; 61 | virtual void intro(std::u16string v) = 0; 62 | 63 | virtual std::u16string body() const = 0; 64 | virtual void body(std::u16string v) = 0; 65 | 66 | virtual std::u16string end() const = 0; 67 | virtual void end(std::u16string v) = 0; 68 | 69 | virtual u8 nameindex() const = 0; 70 | virtual void nameindex(u8 v) = 0; 71 | 72 | virtual u8 paperid() const = 0; 73 | virtual void paperid(u8 v) = 0; 74 | 75 | virtual u8 flag() const = 0; 76 | virtual void flag(u8 v) = 0; 77 | 78 | virtual u8 senderid() const = 0; 79 | virtual void senderid(u8 v) = 0; 80 | 81 | virtual u8 lettertype() const = 0; 82 | virtual void lettertype(u8 v) = 0; 83 | 84 | virtual std::unique_ptr item() const = 0; 85 | }; 86 | 87 | #endif -------------------------------------------------------------------------------- /source/pattern/PatternImageWW.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "PatternImageWW.hpp" 28 | #include "saveUtils.hpp" 29 | 30 | /* 31 | Return the palette color index as an uint8_t. 32 | 33 | u8 plt: Index of the palette color. 34 | */ 35 | u8 PatternImageWW::getPaletteColor(u8 plt) const { 36 | if (plt > 15) return 0; 37 | 38 | return ((reinterpret_cast(this->paletteData())->Nibble2) * 15) + plt; 39 | } 40 | 41 | /* 42 | Return the Palette Index. 43 | */ 44 | u8 PatternImageWW::getWWPaletteIndex() const { return reinterpret_cast(this->paletteData())->Nibble2; }; 45 | 46 | /* 47 | Set the Palette Index instead of color for the palette. 48 | 49 | u8 index: The new palette index. (0 - 14) 50 | u8 color: The color index. (Unused) 51 | */ 52 | void PatternImageWW::setPaletteColor(u8 index, u8 color) { 53 | if (index > 14) return; 54 | 55 | SaveUtils::WriteNibble(this->paletteData(), 0x0, false, index); 56 | } 57 | 58 | /* 59 | Return a pixel struct for the Left & Right pixel buffer. 60 | 61 | u16 index: The pixel index of the pattern. 62 | */ 63 | pixel PatternImageWW::getPixel(u16 index) const { 64 | if (this->Valid) { 65 | if (this->pixelPointer()) return this->pixelPointer()[index]; 66 | } 67 | 68 | return { 0, 0 }; 69 | } 70 | 71 | /* 72 | Set a pixel's color to the Pattern Image. 73 | 74 | u16 index: The pixel index of the pattern. 75 | u8 color: The color index. 76 | */ 77 | void PatternImageWW::setPixel(u16 index, u8 color) { 78 | if (color > 15 || index > 0x3FF) return; // Out of scope. 79 | 80 | if (this->Valid) { 81 | if (this->pixelPointer()) { 82 | if (index % 2 == 0) this->pixelPointer()[index / 2].left = color; 83 | else this->pixelPointer()[index / 2].right = color; 84 | } 85 | } 86 | } 87 | 88 | /* 89 | Same as above, just with X & Y position instead of index. 90 | */ 91 | void PatternImageWW::setPixel(u8 x, u8 y, u8 color) { this->setPixel((x + (y * 32)), color); }; -------------------------------------------------------------------------------- /include/letter/LetterWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_LETTER_WW_HPP 28 | #define _LEAFEDIT_CORE_LETTER_WW_HPP 29 | 30 | #include "ItemWW.hpp" 31 | #include "Letter.hpp" 32 | #include 33 | 34 | class LetterWW : public Letter { 35 | protected: 36 | std::shared_ptr LetterData; 37 | u32 Offset; 38 | WWRegion SaveRegion; 39 | public: 40 | virtual ~LetterWW() { }; 41 | LetterWW(std::shared_ptr letterData, u32 offset, WWRegion saveregion) : 42 | Letter(letterData, offset), LetterData(letterData), Offset(offset), SaveRegion(saveregion) { }; 43 | 44 | u16 playerid(bool sender) const override; 45 | void playerid(u16 v, bool sender) override; 46 | 47 | std::u16string playername(bool sender) const override; 48 | void playername(std::u16string v, bool sender) override; 49 | 50 | u16 townid(bool sender) const override; 51 | void townid(u16 v, bool sender) override; 52 | 53 | std::u16string townname(bool sender) const override; 54 | void townname(std::u16string v, bool sender) override; 55 | 56 | u8 playerindex() const override; 57 | void playerindex(u8 v) override; 58 | 59 | std::u16string intro() const override; 60 | void intro(std::u16string v) override; 61 | 62 | std::u16string body() const override; 63 | void body(std::u16string v) override; 64 | 65 | std::u16string end() const override; 66 | void end(std::u16string v) override; 67 | 68 | u8 nameindex() const override; 69 | void nameindex(u8 v) override; 70 | 71 | u8 paperid() const override; 72 | void paperid(u8 v) override; 73 | 74 | u8 flag() const override; 75 | void flag(u8 v) override; 76 | 77 | u8 senderid() const override; 78 | void senderid(u8 v) override; 79 | 80 | u8 lettertype() const override; 81 | void lettertype(u8 v) override; 82 | 83 | std::unique_ptr item() const override; 84 | private: 85 | u8 *letterPointer() const { return this->LetterData.get() + this->Offset; }; 86 | }; 87 | 88 | #endif -------------------------------------------------------------------------------- /include/item/Item.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_HPP 28 | #define _LEAFEDIT_CORE_ITEM_HPP 29 | 30 | #include "types.hpp" 31 | #include 32 | #include 33 | #include 34 | 35 | extern std::map ItemDatabase; 36 | 37 | enum class FurnitureDirection { 38 | None, 39 | Up, 40 | Right, 41 | Down, 42 | Left 43 | }; 44 | 45 | /* Type of the Item. */ 46 | enum class ItemType { 47 | Empty, 48 | Furniture, 49 | Gyroid, 50 | Diary, 51 | Clothes, 52 | Song, 53 | Paper, 54 | Trash, 55 | Shell, 56 | Fruit, 57 | Turnip, 58 | Catchable, 59 | QuestItem, 60 | Item, 61 | RaffleTicket, 62 | WallpaperCarpet, 63 | Fossil, 64 | Tool, 65 | Tree, 66 | Weed, 67 | Flower, 68 | Rock, 69 | MoneyRock, 70 | Signboard, 71 | Money, 72 | HouseObject, 73 | Building, 74 | ParchedFlower, 75 | WateredFlower, 76 | Pattern, 77 | WiltedFlower, 78 | Occupied, 79 | Invalid 80 | }; 81 | 82 | class Item { 83 | protected: 84 | std::shared_ptr ItemData; 85 | u32 Offset; 86 | public: 87 | virtual ~Item() { }; 88 | Item(std::shared_ptr dt, u32 offset) : 89 | ItemData(dt), Offset(offset) { }; 90 | Item(const Item& item) = delete; 91 | Item& operator=(const Item& item) = delete; 92 | 93 | virtual u32 maxItems() const = 0; 94 | 95 | virtual u16 id() const = 0; 96 | virtual void id(u16 v) = 0; 97 | 98 | virtual u16 flags() const = 0; 99 | virtual void flags(u16 v) = 0; 100 | 101 | virtual u8 flag1() const = 0; 102 | virtual void flag1(u8 v) = 0; 103 | 104 | virtual u8 flag2() const = 0; 105 | virtual void flag2(u8 v) = 0; 106 | 107 | virtual std::string name() const = 0; 108 | 109 | virtual ItemType itemtype() const = 0; 110 | 111 | virtual FurnitureDirection rotation() const = 0; 112 | virtual void rotation(FurnitureDirection Direction) = 0; 113 | }; 114 | 115 | #endif -------------------------------------------------------------------------------- /source/villager/VillagerNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "saveUtils.hpp" 28 | #include "VillagerNL.hpp" 29 | 30 | /* 31 | Get and Set the Villager ID. 32 | */ 33 | u16 VillagerNL::id() const { return SaveUtils::Read(this->villagerPointer(), 0x0); }; 34 | void VillagerNL::id(u16 v) { SaveUtils::Write(this->villagerPointer(), 0x0, v); }; 35 | 36 | /* 37 | Return if the Villager exist. 38 | */ 39 | bool VillagerNL::exist() const { 40 | if (this->id() == 0xFFFF) return false; 41 | return true; 42 | } 43 | 44 | /* 45 | Get and Set for the Villager Personality. 46 | */ 47 | u8 VillagerNL::personality() const { return this->villagerPointer()[0x2]; }; 48 | void VillagerNL::personality(u8 v) { SaveUtils::Write(this->villagerPointer(), 0x2, v); }; 49 | 50 | /* 51 | Return the Villager Song. 52 | */ 53 | std::unique_ptr VillagerNL::song() const { return std::make_unique(this->VillagerData, this->Offset + 0x2452); }; 54 | 55 | /* 56 | Return the Villager Shirt. 57 | */ 58 | std::unique_ptr VillagerNL::shirt() const { return std::make_unique(this->VillagerData, this->Offset + 0x244E); }; 59 | 60 | /* 61 | Return the Villager Wallpaper. 62 | */ 63 | std::unique_ptr VillagerNL::wallpaper() const { return std::make_unique(this->VillagerData, this->Offset + 0x2456); }; 64 | 65 | /* 66 | Return the Villager Carpet. 67 | */ 68 | std::unique_ptr VillagerNL::carpet() const { return std::make_unique(this->VillagerData, this->Offset + 0x245A); }; 69 | 70 | /* 71 | Return the Villager Umbrella. 72 | */ 73 | std::unique_ptr VillagerNL::umbrella() const { return std::make_unique(this->VillagerData, this->Offset + 0x245E); }; 74 | 75 | /* 76 | Return the Villager Furniture. 77 | 78 | u8 slot: The Furniture index. 79 | */ 80 | std::unique_ptr VillagerNL::furniture(u8 slot) const { 81 | if (slot > 15) return nullptr; 82 | 83 | return std::make_unique(this->VillagerData, this->Offset + 0x2462 + slot * 4); 84 | } -------------------------------------------------------------------------------- /source/villager/VillagerWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "saveUtils.hpp" 28 | #include "VillagerWA.hpp" 29 | 30 | /* 31 | Get and Set the Villager ID. 32 | */ 33 | u16 VillagerWA::id() const { return SaveUtils::Read(this->villagerPointer(), 0x0); }; 34 | void VillagerWA::id(u16 v) { SaveUtils::Write(this->villagerPointer(), 0x0, v); }; 35 | 36 | /* 37 | Return if the Villager exist. 38 | */ 39 | bool VillagerWA::exist() const { 40 | if (this->id() == 0xFFFF) return false; 41 | return true; 42 | } 43 | 44 | /* 45 | Get and Set for the Villager Personality. 46 | */ 47 | u8 VillagerWA::personality() const { return this->villagerPointer()[0x2]; }; 48 | void VillagerWA::personality(u8 v) { SaveUtils::Write(this->villagerPointer(), 0x2, v); }; 49 | 50 | /* 51 | Return the Villager Song. 52 | */ 53 | std::unique_ptr VillagerWA::song() const { return std::make_unique(this->VillagerData, this->Offset + 0x2472); }; 54 | 55 | /* 56 | Return the Villager Shirt. 57 | */ 58 | std::unique_ptr VillagerWA::shirt() const { return std::make_unique(this->VillagerData, this->Offset + 0x246E); }; 59 | 60 | /* 61 | Return the Villager Wallpaper. 62 | */ 63 | std::unique_ptr VillagerWA::wallpaper() const { return std::make_unique(this->VillagerData, this->Offset + 0x2476); }; 64 | 65 | /* 66 | Return the Villager Carpet. 67 | */ 68 | std::unique_ptr VillagerWA::carpet() const { return std::make_unique(this->VillagerData, this->Offset + 0x247A); }; 69 | 70 | /* 71 | Return the Villager Umbrella. 72 | */ 73 | std::unique_ptr VillagerWA::umbrella() const { return std::make_unique(this->VillagerData, this->Offset + 0x247E); }; 74 | 75 | /* 76 | Return the Villager Furniture. 77 | 78 | u8 slot: The Furniture index. 79 | */ 80 | std::unique_ptr VillagerWA::furniture(u8 slot) const { 81 | if (slot > 15) return nullptr; 82 | 83 | return std::make_unique(this->VillagerData, this->Offset + 0x2482 + slot * 4); 84 | } -------------------------------------------------------------------------------- /include/pattern/PatternWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PATTERN_WW_HPP 28 | #define _LEAFEDIT_CORE_PATTERN_WW_HPP 29 | 30 | #include "Pattern.hpp" 31 | #include "PatternImageWW.hpp" 32 | #include "Player.hpp" 33 | #include 34 | 35 | class PatternWW : public Pattern { 36 | protected: 37 | std::shared_ptr PatternData; 38 | u32 Offset; 39 | WWRegion SaveRegion; 40 | public: 41 | virtual ~PatternWW() { }; 42 | PatternWW(std::shared_ptr patternData, u32 offset, WWRegion Region) : 43 | Pattern(patternData, offset), PatternData(patternData), Offset(offset), SaveRegion(Region) { }; 44 | 45 | std::u16string name() const override; 46 | void name(std::u16string v) override; 47 | 48 | u16 creatorid() const override; 49 | void creatorid(u16 v) override; 50 | 51 | std::u16string creatorname() const override; 52 | void creatorname(std::u16string v) override; 53 | 54 | u8 creatorGender() const override; 55 | void creatorGender(u8 v) override; 56 | 57 | u16 origtownid() const override; 58 | void origtownid(u16 v) override; 59 | 60 | std::u16string origtownname() const override; 61 | void origtownname(std::u16string v) override; 62 | 63 | u8 designtype() const override; 64 | void designtype(u8 v) override; 65 | 66 | /* 67 | Pattern Misc. 68 | */ 69 | void ownPattern(std::unique_ptr player) override; 70 | void dumpPattern(const std::string fileName) override; 71 | void injectPattern(const std::string fileName) override; 72 | 73 | /* 74 | Pattern Image. 75 | */ 76 | std::unique_ptr image(u8 pattern) const override; 77 | private: 78 | u8 *patternPointer() const { return this->PatternData.get() + this->Offset; }; 79 | 80 | u32 getPatternSize() const { 81 | switch(this->SaveRegion) { 82 | case WWRegion::EUR: 83 | case WWRegion::USA: 84 | return 0x228; 85 | 86 | case WWRegion::JPN: 87 | return 0x220; 88 | 89 | case WWRegion::KOR: 90 | return 0x234; 91 | } 92 | 93 | return 0; 94 | }; 95 | }; 96 | 97 | #endif -------------------------------------------------------------------------------- /source/itemUtils/ItemWhiteListNL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "ItemWhiteListNL.hpp" 28 | 29 | /* 30 | Return if the provided item ID in the parameter is a valid Hat. 31 | 32 | u16 itemID: The Item ID. 33 | */ 34 | bool ItemWhiteListNL::validHat(u16 itemID) const { 35 | return false; 36 | } 37 | 38 | /* 39 | Return if the provided item ID in the parameter is a valid Accessoires. 40 | 41 | u16 itemID: The Item ID. 42 | */ 43 | bool ItemWhiteListNL::validAccessoires(u16 itemID) const { 44 | return false; 45 | } 46 | 47 | /* 48 | Return if the provided item ID in the parameter is a valid Shirt. 49 | 50 | u16 itemID: The Item ID. 51 | */ 52 | bool ItemWhiteListNL::validShirt(u16 itemID) const { 53 | return false; 54 | } 55 | 56 | /* 57 | Return if the provided item ID in the parameter is a valid Pant. 58 | 59 | u16 itemID: The Item ID. 60 | */ 61 | bool ItemWhiteListNL::validPants(u16 itemID) const { 62 | return false; 63 | } 64 | 65 | /* 66 | Return if the provided item ID in the parameter is a valid Sock. 67 | 68 | u16 itemID: The Item ID. 69 | */ 70 | bool ItemWhiteListNL::validSocks(u16 itemID) const { 71 | return false; 72 | } 73 | 74 | /* 75 | Return if the provided item ID in the parameter is a valid Shoe. 76 | 77 | u16 itemID: The Item ID. 78 | */ 79 | bool ItemWhiteListNL::validShoes(u16 itemID) const { 80 | return false; 81 | } 82 | 83 | /* 84 | Return if the provided item ID in the parameter is a valid Tool. 85 | 86 | u16 itemID: The Item ID. 87 | */ 88 | bool ItemWhiteListNL::validTools(u16 itemID) const { 89 | return false; 90 | } 91 | 92 | /* 93 | Return if the provided item ID in the parameter is a valid Music. 94 | 95 | u16 itemID: The Item ID. 96 | */ 97 | bool ItemWhiteListNL::validMusic(u16 itemID) const { 98 | return false; 99 | } 100 | 101 | /* 102 | Return if the provided item ID in the parameter is a valid Item. 103 | 104 | u16 itemID: The Item ID. 105 | */ 106 | bool ItemWhiteListNL::validItem(u16 itemID) const { 107 | return false; 108 | } -------------------------------------------------------------------------------- /source/itemUtils/ItemWhiteListWW.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "ItemWhiteListWW.hpp" 28 | 29 | /* 30 | Return if the provided item ID in the parameter is a valid Hat. 31 | 32 | u16 itemID: The Item ID. 33 | */ 34 | bool ItemWhiteListWW::validHat(u16 itemID) const { 35 | return false; 36 | } 37 | 38 | /* 39 | Return if the provided item ID in the parameter is a valid Accessoires. 40 | 41 | u16 itemID: The Item ID. 42 | */ 43 | bool ItemWhiteListWW::validAccessoires(u16 itemID) const { 44 | return false; 45 | } 46 | 47 | /* 48 | Return if the provided item ID in the parameter is a valid Shirt. 49 | 50 | u16 itemID: The Item ID. 51 | */ 52 | bool ItemWhiteListWW::validShirt(u16 itemID) const { 53 | return false; 54 | } 55 | 56 | /* 57 | Return if the provided item ID in the parameter is a valid Pant. 58 | 59 | u16 itemID: The Item ID. 60 | */ 61 | bool ItemWhiteListWW::validPants(u16 itemID) const { 62 | return false; 63 | } 64 | 65 | /* 66 | Return if the provided item ID in the parameter is a valid Sock. 67 | 68 | u16 itemID: The Item ID. 69 | */ 70 | bool ItemWhiteListWW::validSocks(u16 itemID) const { 71 | return false; 72 | } 73 | 74 | /* 75 | Return if the provided item ID in the parameter is a valid Shoe. 76 | 77 | u16 itemID: The Item ID. 78 | */ 79 | bool ItemWhiteListWW::validShoes(u16 itemID) const { 80 | return false; 81 | } 82 | 83 | /* 84 | Return if the provided item ID in the parameter is a valid Tool. 85 | 86 | u16 itemID: The Item ID. 87 | */ 88 | bool ItemWhiteListWW::validTools(u16 itemID) const { 89 | return false; 90 | } 91 | 92 | /* 93 | Return if the provided item ID in the parameter is a valid Music. 94 | 95 | u16 itemID: The Item ID. 96 | */ 97 | bool ItemWhiteListWW::validMusic(u16 itemID) const { 98 | return false; 99 | } 100 | 101 | /* 102 | Return if the provided item ID in the parameter is a valid Item. 103 | 104 | u16 itemID: The Item ID. 105 | */ 106 | bool ItemWhiteListWW::validItem(u16 itemID) const { 107 | return false; 108 | } -------------------------------------------------------------------------------- /include/villager/VillagerWW.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_VILLAGER_WW_HPP 28 | #define _LEAFEDIT_CORE_VILLAGER_WW_HPP 29 | 30 | #include "ItemWW.hpp" 31 | #include "Villager.hpp" 32 | #include "types.hpp" 33 | #include 34 | 35 | class VillagerWW : public Villager { 36 | protected: 37 | std::shared_ptr VillagerData; 38 | u32 Offset; 39 | WWRegion SaveRegion; 40 | public: 41 | virtual ~VillagerWW() { }; 42 | VillagerWW(std::shared_ptr villagerData, u32 villagerOffset, WWRegion Region) : 43 | Villager(villagerData, villagerOffset), VillagerData(villagerData), Offset(villagerOffset), SaveRegion(Region) { }; 44 | 45 | u32 getVillagerSize() const override { 46 | switch(this->SaveRegion) { 47 | case WWRegion::EUR: 48 | case WWRegion::USA: 49 | return 0x700; 50 | 51 | case WWRegion::JPN: 52 | return 0x5C0; 53 | 54 | case WWRegion::KOR: 55 | return 0x7EC; 56 | } 57 | 58 | return 0; 59 | }; 60 | 61 | u16 id() const override; 62 | void id(u16 v) override; 63 | 64 | bool exist() const override; 65 | 66 | u8 personality() const override; 67 | void personality(u8 v) override; 68 | 69 | /* 70 | Items. 71 | NOTE: Carpet, Wallpaper, Umbrella & Song is an uint8_t index. [u8] 72 | */ 73 | std::unique_ptr song() const override { return nullptr; }; 74 | std::unique_ptr shirt() const override; 75 | std::unique_ptr wallpaper() const override { return nullptr; }; 76 | std::unique_ptr carpet() const override { return nullptr; }; 77 | std::unique_ptr umbrella() const override { return nullptr; }; 78 | 79 | u8 songWW() const override; 80 | void songWW(u8 sng) override; 81 | 82 | u8 wallpaperWW() const override; 83 | void wallpaperWW(u8 wlp) override; 84 | 85 | u8 carpetWW() const override; 86 | void carpetWW(u8 crp) override; 87 | 88 | u8 umbrellaWW() const override; 89 | void umbrellaWW(u8 umbr) override; 90 | 91 | std::unique_ptr furniture(u8 slot) const override; 92 | private: 93 | u8 *villagerPointer() const { return this->VillagerData.get() + this->Offset; }; 94 | }; 95 | 96 | #endif -------------------------------------------------------------------------------- /include/sav/Sav.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_SAV_HPP 28 | #define _LEAFEDIT_CORE_SAV_HPP 29 | 30 | #include "Island.hpp" 31 | #include "Player.hpp" 32 | #include "PlayerHHD.hpp" 33 | #include "Shop.hpp" 34 | #include "stringUtils.hpp" 35 | #include "Town.hpp" 36 | #include "types.hpp" 37 | #include "Villager.hpp" 38 | #include 39 | #include 40 | #include 41 | 42 | class Sav { 43 | protected: 44 | std::shared_ptr SaveData; 45 | u32 SaveLength; 46 | bool Changes; 47 | public: 48 | virtual ~Sav() { }; 49 | Sav(std::shared_ptr data, u32 length) : 50 | SaveData(data), SaveLength(length), Changes(false) { this->setChangesMade(false); }; 51 | Sav(const Sav& save) = delete; 52 | Sav& operator=(const Sav& save) = delete; 53 | 54 | /* 55 | Call this when finished editing. 56 | */ 57 | virtual void Finish(void) = 0; 58 | 59 | /* 60 | Get Sav Contents. 61 | */ 62 | virtual std::unique_ptr player(u8 player) const = 0; 63 | virtual std::unique_ptr villager(u8 villager) const = 0; 64 | virtual std::unique_ptr town() const = 0; 65 | virtual std::unique_ptr island() const = 0; 66 | virtual std::unique_ptr shop() const = 0; 67 | 68 | /* 69 | Special Getter's for AC:HHD. 70 | */ 71 | virtual std::unique_ptr playerhhd() const = 0; 72 | 73 | /* 74 | Call this when getting the SaveType. 75 | */ 76 | static std::unique_ptr getSave(std::shared_ptr data, u32 length); 77 | static std::unique_ptr check080000(std::shared_ptr data, u32 length); 78 | 79 | /* 80 | Get max Values. 81 | */ 82 | virtual u8 maxVillager() const = 0; 83 | 84 | /* 85 | return Sav stuff. 86 | */ 87 | u32 getLength() const { return this->SaveLength; }; 88 | std::shared_ptr rawData() const { return this->SaveData; }; 89 | 90 | virtual SaveType getType() const = 0; 91 | virtual WWRegion getRegion() const = 0; 92 | 93 | void setChangesMade(bool v = true) { if (v != this->Changes) this->Changes = v; }; 94 | bool changesMade() const { return this->Changes; }; 95 | 96 | u8 *savePointer() const { return this->SaveData.get(); }; 97 | }; 98 | 99 | #endif -------------------------------------------------------------------------------- /strings/ww/en/villager.txt: -------------------------------------------------------------------------------- 1 | //Anteater 2 | 0x0000, Cyrano 3 | 0x0001, Antonio 4 | 0x0002, Pango 5 | 0x0003, Anabelle 6 | //Bear 7 | 0x0004, Teddy 8 | 0x0005, Pinky 9 | 0x0006, Curt 10 | 0x0007, Chow 11 | //Bird 12 | 0x0008, Jay 13 | 0x0009, Robin 14 | 0x000A, Anchovy 15 | 0x000B, Twiggy 16 | 0x000C, Jitters 17 | //Bull 18 | 0x000D, Angus 19 | 0x000E, Rodeo 20 | //Cat 21 | 0x000F, Bob 22 | 0x0010, Mitzi 23 | 0x0011, Rosie 24 | 0x0012, Olivia 25 | 0x0013, Kiki 26 | 0x0014, Tangy 27 | 0x0015, Punchy 28 | 0x0016, Purrl 29 | 0x0017, Moe 30 | 0x0018, Kabuki 31 | 0x0019, Kid Cat 32 | 0x001A, Monique 33 | 0x001B, Tabby 34 | //Cub 35 | 0x001C, Bluebear 36 | 0x001D, Maple 37 | 0x001E, Poncho 38 | 0x001F, Pudge 39 | 0x0020, Kody 40 | 0x0021, Stitches 41 | //Chicken 42 | 0x0022, Goose 43 | 0x0023, Benedict 44 | 0x0024, Egbert 45 | //Cow 46 | 0x0025, Patty 47 | 0x0026, Tipper 48 | //Alligator 49 | 0x0027, Alfonso 50 | 0x0028, Alli 51 | //Dog 52 | 0x0029, Goldie 53 | 0x002A, Butch 54 | 0x002B, Lucky 55 | 0x002C, Biskit 56 | 0x002D, Bones 57 | 0x002E, Portia 58 | 0x002F, Walker 59 | 0x0030, Daisy 60 | //Duck 61 | 0x0031, Bill 62 | 0x0032, Joey 63 | 0x0033, Pate 64 | 0x0034, Maelle 65 | 0x0035, Deena 66 | 0x0036, Pompom 67 | 0x0037, Mallary 68 | 0x0038, Freckles 69 | 0x0039, Derwin 70 | 0x003A, Drake 71 | //Elephant 72 | 0x003B, Opal 73 | 0x003C, Dizzy 74 | 0x003D, Big Top 75 | 0x003E, Eloise 76 | 0x003F, Margie 77 | //Frog 78 | 0x0040, Lily 79 | 0x0041, Ribbot 80 | 0x0042, Frobert 81 | 0x0043, Camofrog 82 | 0x0044, Drift 83 | 0x0045, Wart Jr. 84 | 0x0046, Puddles 85 | 0x0047, Jeremiah 86 | //Goat 87 | 0x0048, Chevre 88 | 0x0049, Nan 89 | //Gorilla 90 | 0x004A, Cesar 91 | 0x004B, Peewee 92 | 0x004C, Boone 93 | //Hippo 94 | 0x004D, Rocco 95 | 0x004E, Buck 96 | //Horse 97 | 0x004F, Victoria 98 | 0x0050, Savannah 99 | 0x0051, Elmer 100 | 0x0052, Roscoe 101 | //Koala 102 | 0x0053, Yuka 103 | 0x0054, Alice 104 | 0x0055, Melba 105 | //Kangaroo 106 | 0x0056, Kitt 107 | 0x0057, Mathilda 108 | //Lion 109 | 0x0058, Bud 110 | 0x0059, Elvis 111 | //Mouse 112 | 0x005A, Dora 113 | 0x005B, Limberg 114 | 0x005C, Bella 115 | 0x005D, Bree 116 | 0x005E, Samson 117 | 0x005F, Rod 118 | //Octopus 119 | 0x0060, Octavian 120 | 0x0061, Marina 121 | //Ostrich 122 | 0x0062, Queenie 123 | 0x0063, Gladys 124 | //Eagle 125 | 0x0064, Apollo 126 | 0x0065, Amelia 127 | 0x0066, Pierce 128 | //Penguin 129 | 0x0067, Aurora 130 | 0x0068, Roald 131 | 0x0069, Cube 132 | 0x006A, Hopper 133 | 0x006B, Friga 134 | 0x006C, Gwen 135 | //Pig 136 | 0x006D, Curly 137 | 0x006E, Truffles 138 | 0x006F, Rasher 139 | 0x0070, Hugh 140 | 0x0071, Lucy 141 | //Rabbit 142 | 0x0072, Bunnie 143 | 0x0073, Dotty 144 | 0x0074, Coco 145 | 0x0075, Snake 146 | 0x0076, Gaston 147 | 0x0077, Gabi 148 | 0x0078, Pippy 149 | 0x0079, Tiffany 150 | 0x007A, Genji 151 | 0x007B, Ruby 152 | //Rhino 153 | 0x007C, Tank 154 | 0x007D, Rhonda 155 | 0x007E, Vesta 156 | 0x007F, Baabara 157 | 0x0080, Peanut 158 | 0x0081, Blaire 159 | 0x0082, Filbert 160 | 0x0083, Pecan 161 | 0x0084, Nibbles 162 | 0x0085, Agent S 163 | 0x0086, Caroline 164 | 0x0087, Sally 165 | 0x0088, Static 166 | 0x0089, Mint 167 | //Tiger 168 | 0x008A, Rolf 169 | 0x008B, Rowan 170 | //Wolf 171 | 0x008C, Chief 172 | 0x008D, Lobo 173 | 0x008E, Wolfgang 174 | 0x008F, Whitney 175 | //Monkey 176 | 0x0090, Champ 177 | 0x0091, Nana 178 | 0x0092, Simon 179 | 0x0093, Tammi 180 | 0x0094, Monty 181 | 0x0095, Elise 182 | //None 183 | 0x00FF, Empty -------------------------------------------------------------------------------- /include/itemUtils/itemKindWA.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_KIND_WA_HPP 28 | #define _LEAFEDIT_CORE_ITEM_KIND_WA_HPP 29 | 30 | #include "itemKind.hpp" 31 | #include "types.hpp" 32 | 33 | class ItemKindWA : public ItemKind { 34 | public: 35 | ItemKindWA(); 36 | ~ItemKindWA(); 37 | 38 | void loadItemBins() override; 39 | void closeItemBins() override; 40 | 41 | /* Return if that's a "normal" item. */ 42 | s32 IsNormalItem(u16 itemID) override; 43 | 44 | /* Axe Damage stuff. */ 45 | u16 GetAxeDamageValue(u16 ItemID, u16 Flags = 0) override; 46 | u16 GetAxeDamageIcon(u16 ItemID, u16 Flags = 0) override; 47 | 48 | /* 49 | Return if item is in the whitelist. 50 | This should avoid having a full grown Tree or such in a pocket. 51 | */ 52 | bool IsInvWhiteListed(u16 ItemID) override; 53 | 54 | /* Get an Item's category. */ 55 | u8 GetCategory(u16 ItemID) override; 56 | 57 | /* Get an Item's icon. */ 58 | u16 GetIconID(u16 ItemID, u16 Flags = 0) override; 59 | s32 GetSpritesheetID(u16 ItemID, u16 Flags = 0) override; 60 | 61 | FILE *GetItemBin() const { return this->ItemBin; } 62 | FILE *GetItemKind() const { return this->ItemKindBin; } 63 | private: 64 | FILE *ItemBin = nullptr, *ItemKindBin = nullptr; 65 | 66 | /* The ItemBin's struct per entry, containing information about each item. */ 67 | struct ItemBin_s { 68 | u16 ItemIcon; 69 | u16 ItemPrice; 70 | u16 Unknown0; 71 | u16 RefurbishID; 72 | u16 SoundID; 73 | u8 Category; 74 | s8 Unknown2; 75 | s8 Unknown3; 76 | s8 Unknown4; 77 | s8 PriceMultiplier; 78 | u8 Unknown5; 79 | s8 ClothingGroup; 80 | u8 CanRefurbish___; 81 | u8 DinosaurGroup; 82 | s8 ArtGroup; 83 | u8 Unknown6; 84 | u8 Unknown7; 85 | u8 Unknown8; 86 | u8 Unknown9; 87 | u8 Unknown10; 88 | u8 Unknown11; 89 | u8 Unknown12; 90 | u8 Unknown13; 91 | u8 Unknown14; 92 | u8 Unknown15; 93 | }; 94 | 95 | /* Real Max Item ID is 0x372B (excludes wrap paper) but for checks, ID -= 0x2000 from orig item ID. */ 96 | static constexpr u16 maxID = 0x172B; 97 | 98 | ItemKindWA::ItemBin_s *GetItemBinSlot(u16 ItemID); 99 | ItemKind_s *GetItemKindSlot(u16 ItemID); 100 | }; 101 | 102 | #endif -------------------------------------------------------------------------------- /include/itemUtils/itemKindNL.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_ITEM_KIND_NL_HPP 28 | #define _LEAFEDIT_CORE_ITEM_KIND_NL_HPP 29 | 30 | #include "itemKind.hpp" 31 | #include "types.hpp" 32 | 33 | class ItemKindNL : public ItemKind { 34 | public: 35 | ItemKindNL(); 36 | ~ItemKindNL(); 37 | 38 | void loadItemBins() override; 39 | void closeItemBins() override; 40 | 41 | /* Return if that's a "normal" item. */ 42 | s32 IsNormalItem(u16 itemID) override; 43 | 44 | /* Axe Damage stuff. */ 45 | u16 GetAxeDamageValue(u16 ItemID, u16 Flags = 0) override; 46 | u16 GetAxeDamageIcon(u16 ItemID, u16 Flags = 0) override; 47 | 48 | /* 49 | Return if item is in the whitelist. 50 | This should avoid having a full grown Tree or such in a pocket. 51 | */ 52 | bool IsInvWhiteListed(u16 ItemID) override; 53 | 54 | /* Get an Item's category. */ 55 | u8 GetCategory(u16 ItemID) override; 56 | 57 | /* Get an Item's icon. */ 58 | u16 GetIconID(u16 ItemID, u16 Flags = 0) override; 59 | s32 GetSpritesheetID(u16 ItemID, u16 Flags = 0) override; 60 | 61 | FILE *GetItemBin() const { return this->ItemBin; } 62 | FILE *GetItemKind() const { return this->ItemKindBin; } 63 | private: 64 | FILE *ItemBin = nullptr, *ItemKindBin = nullptr; 65 | 66 | struct ItemBin_s { 67 | u16 ItemIcon; 68 | u16 ItemPrice; 69 | u16 Unknown0; 70 | u16 RefurbishID; 71 | u16 SoundID; 72 | u8 Category; 73 | s8 Unknown2; 74 | s8 Unknown3; 75 | s8 Unknown4; 76 | s8 PriceMultiplier; 77 | u8 Unknown5; 78 | s8 ClothingGroup; 79 | u8 CanRefurbish___; 80 | u8 DinosaurGroup; 81 | s8 ArtGroup; 82 | u8 Unknown6; 83 | u8 Unknown7; 84 | u8 Unknown8; 85 | u8 Unknown9; 86 | u8 Unknown10; 87 | u8 Unknown11; 88 | u8 Unknown12; 89 | u8 Unknown13; 90 | u8 Unknown14; 91 | u8 Unknown15; 92 | u8 Unknown16; 93 | u8 Unknown17; 94 | u8 Unknown18; 95 | u8 Unknown19; 96 | }; 97 | 98 | /* Real Max Item ID is 0x31B4 (excludes wrap paper) but for checks, ID -= 0x2000 from orig item ID. */ 99 | static constexpr u16 maxID = 0x11B4; // is that right? TODO: CHECK!!!! 100 | 101 | ItemKindNL::ItemBin_s *GetItemBinSlot(u16 ItemID); 102 | ItemKind_s *GetItemKindSlot(u16 ItemID); 103 | }; 104 | 105 | #endif -------------------------------------------------------------------------------- /source/itemUtils/ItemWhiteListWA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #include "ItemWhiteListWA.hpp" 28 | 29 | /* 30 | Return if the provided item ID in the parameter is a valid Hat. 31 | 32 | u16 itemID: The Item ID. 33 | */ 34 | bool ItemWhiteListWA::validHat(u16 itemID) const { 35 | return (itemID > 0x280A && itemID < 0x28F4); 36 | } 37 | 38 | /* 39 | Return if the provided item ID in the parameter is a valid Accessoires. 40 | 41 | u16 itemID: The Item ID. 42 | */ 43 | bool ItemWhiteListWA::validAccessoires(u16 itemID) const { 44 | return (itemID > 0x28F4 && itemID < 0x295C); 45 | } 46 | 47 | /* 48 | Return if the provided item ID in the parameter is a valid Shirt. 49 | 50 | u16 itemID: The Item ID. 51 | */ 52 | bool ItemWhiteListWA::validShirt(u16 itemID) const { 53 | return (itemID > 0x2492 && itemID < 0x26F6); 54 | } 55 | 56 | /* 57 | Return if the provided item ID in the parameter is a valid Pant. 58 | 59 | u16 itemID: The Item ID. 60 | */ 61 | bool ItemWhiteListWA::validPants(u16 itemID) const { 62 | return (itemID > 0x26F7 && itemID < 0x2777); 63 | } 64 | 65 | /* 66 | Return if the provided item ID in the parameter is a valid Sock. 67 | 68 | u16 itemID: The Item ID. 69 | */ 70 | bool ItemWhiteListWA::validSocks(u16 itemID) const { 71 | return (itemID > 0x2776 && itemID < 0x279F); 72 | } 73 | 74 | /* 75 | Return if the provided item ID in the parameter is a valid Shoe. 76 | 77 | u16 itemID: The Item ID. 78 | */ 79 | bool ItemWhiteListWA::validShoes(u16 itemID) const { 80 | return (itemID > 0x279E && itemID < 0x27E6); 81 | } 82 | 83 | /* 84 | Return if the provided item ID in the parameter is a valid Tool. 85 | 86 | u16 itemID: The Item ID. 87 | */ 88 | bool ItemWhiteListWA::validTools(u16 itemID) const { 89 | return (itemID == 0x2001 || (itemID == 0x3729) || (itemID > 0x334B && itemID < 0x33A3)); 90 | } 91 | 92 | /* 93 | Return if the provided item ID in the parameter is a valid Music. 94 | 95 | u16 itemID: The Item ID. 96 | */ 97 | bool ItemWhiteListWA::validMusic(u16 itemID) const { 98 | if (itemID < 0xFFF) { 99 | if (itemID > 0x0DB && itemID < 0x10B) return false; 100 | return true; 101 | } 102 | 103 | return false; 104 | } 105 | 106 | /* 107 | Return if the provided item ID in the parameter is a valid Item. 108 | 109 | u16 itemID: The Item ID. 110 | */ 111 | bool ItemWhiteListWA::validItem(u16 itemID) const { 112 | return false; 113 | } -------------------------------------------------------------------------------- /include/player/Player.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LeafEdit-Core 3 | * Copyright (C) 2020 LeafEdit-Core-Contributors 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file: 19 | * * Requiring preservation of specified reasonable legal notices or 20 | * author attributions in that material or in the Appropriate Legal 21 | * Notices displayed by works containing it. 22 | * * Prohibiting misrepresentation of the origin of that material, 23 | * or requiring that modified versions of such material be marked in 24 | * reasonable ways as different from the original version. 25 | */ 26 | 27 | #ifndef _LEAFEDIT_CORE_PLAYER_HPP 28 | #define _LEAFEDIT_CORE_PLAYER_HPP 29 | 30 | #include "Item.hpp" 31 | #include "Letter.hpp" 32 | #include "Pattern.hpp" 33 | #include "types.hpp" 34 | #include 35 | 36 | class Pattern; 37 | 38 | class Player { 39 | protected: 40 | std::shared_ptr PlayerData; 41 | u32 Offset; 42 | public: 43 | virtual ~Player() { }; 44 | Player(std::shared_ptr data, u32 offset, u8 index) : 45 | PlayerData(data), Offset(offset) { }; 46 | 47 | Player(const Player& player) = delete; 48 | Player& operator=(const Player& player) = delete; 49 | 50 | virtual u32 getPlayerSize() const = 0; 51 | 52 | virtual u8 face() const = 0; 53 | virtual void face(u8 v) = 0; 54 | 55 | virtual u8 gender() const = 0; 56 | virtual void gender(u8 v) = 0; 57 | 58 | virtual u16 tan() const = 0; 59 | virtual void tan(u16 v) = 0; 60 | 61 | virtual u8 hairstyle() const = 0; 62 | virtual void hairstyle(u8 v) = 0; 63 | 64 | virtual u8 haircolor() const = 0; 65 | virtual void haircolor(u8 v) = 0; 66 | 67 | virtual u8 eyecolor() const = 0; 68 | virtual void eyecolor(u8 v) = 0; 69 | 70 | virtual u8 badge(int badge) const = 0; 71 | virtual void badge(int badge, u8 v) = 0; 72 | 73 | virtual u16 playerid() const = 0; 74 | virtual void playerid(u16 v) = 0; 75 | 76 | virtual u16 townid() const = 0; 77 | virtual void townid(u16 v) = 0; 78 | 79 | virtual std::u16string townname() const = 0; 80 | virtual void townname(std::u16string v) = 0; 81 | 82 | virtual bool exist() const = 0; 83 | 84 | virtual std::u16string name() const = 0; 85 | virtual void name(std::u16string v) = 0; 86 | 87 | virtual u32 wallet() const = 0; 88 | virtual void wallet(u32 v) = 0; 89 | 90 | virtual u32 bank() const = 0; 91 | virtual void bank(u32 v) = 0; 92 | 93 | virtual u32 islandmedals() const = 0; 94 | virtual void islandmedals(u32 v) = 0; 95 | 96 | virtual u32 coupons() const = 0; 97 | virtual void coupons(u32 v) = 0; 98 | 99 | virtual std::unique_ptr letter(u8 slot) const = 0; 100 | 101 | virtual std::unique_ptr pocket(u8 slot) const = 0; 102 | virtual std::unique_ptr dresser(u8 slot) const = 0; 103 | virtual std::unique_ptr islandbox(u8 slot) const = 0; 104 | virtual std::unique_ptr storage(u16 slot) const = 0; 105 | 106 | virtual std::unique_ptr pattern(u8 slot) const = 0; 107 | 108 | virtual u8 *tpcImage() const = 0; 109 | virtual bool hasTPC() const = 0; 110 | 111 | /* 112 | Dump & Inject. 113 | */ 114 | virtual void dumpPlayer(const std::string fileName) = 0; 115 | virtual bool injectPlayer(const std::string fileName) = 0; 116 | 117 | 118 | virtual u8 acornFestival() const = 0; 119 | virtual void acornFestival(u8 v) = 0; 120 | virtual u8 bed() const = 0; 121 | virtual void bed(u8 v) = 0; 122 | }; 123 | 124 | #endif --------------------------------------------------------------------------------