diff --git a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp index 212849a2..efd0baaa 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp @@ -219,6 +219,7 @@ namespace Simulator namespace Addresses(cCreatureCitizen) { DefineAddress(Update, SelectAddress(0xC24210, 0xC24A30)); DefineAddress(DoAction, SelectAddress(0xC26EF0, 0xC27710)); + DefineAddress(GetHandheldItemForTool, SelectAddress(0xC22E70, 0xC23740)); } namespace Addresses(cCreatureBase) @@ -244,6 +245,7 @@ namespace Simulator DefineAddress(OnJumpLand, SelectAddress(0xC14670, 0xC14E10)); DefineAddress(OnStartSwimming, SelectAddress(0xC147D0, 0xC14F70)); DefineAddress(Update, SelectAddress(0xC20C50, 0xC21530)); + DefineAddress(IsHervibore, SelectAddress(0xC0B040, 0xC0B8E0)); } namespace Addresses(cCropCirclesToolStrategy) diff --git a/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp b/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp index e147c453..3aaa9997 100644 --- a/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp +++ b/Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp @@ -96,7 +96,11 @@ namespace Simulator auto_METHOD_VOID(cCreatureBase, ConsumeEnergy, Args(float energyConsumed), Args(energyConsumed)); + auto_METHOD_(cCreatureBase, bool, IsHervibore); + auto_METHOD_VOID(cCreatureCitizen, DoAction, Args(int actionId, cGameData* actionObject, App::Property* prop), Args(actionId, actionObject, prop)); + + auto_METHOD(cCreatureCitizen, int, GetHandheldItemForTool, Args(int toolType), Args(toolType)); } #endif diff --git a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h index a3a6c5d1..feb1ae22 100644 --- a/Spore ModAPI/Spore/Simulator/SimulatorEnums.h +++ b/Spore ModAPI/Spore/Simulator/SimulatorEnums.h @@ -766,4 +766,55 @@ namespace Simulator kCitizenActionRecruit = 26, kCitizenActionGatherMeat = 27, }; + + enum HandheldItem + { + kHandheldItemNone = 0, + /// trg_hunting_tool1 + kHandheldItemTrgHuntingTool1 = 1, + /// trg_hunting_tool2 + kHandheldItemTrgHuntingTool1 = 2, + /// trg_hunting_tool3 + kHandheldItemTrgHuntingTool1 = 3, + /// trg_fishing_tool and related + kHandheldItemTrgFishingTool = 4, + /// Either trg_eating_fish or trg_fishing_tool1_fish, etc + kHandheldItemTrgFish = 5, + /// Either trg_eating_seaweed or trg_fishing_tool1_seaweed, etc + kHandheldItemTrgFish = 6, + /// trg_eating_fruit + kHandheldItemTrgEatingFruit = 7, + /// trg_eating_seaweed or trg_eating_fish + kHandheldItemTrgEatingSeaweedOrFish = 8, + /// trg_eating_meat + kHandheldItemTrgEatingMeat = 9, + /// trg_eating_seaweed + kHandheldItemTrgEatingSeaweed = 10, + /// city_protest_sign_hunger + kHandheldItemCityProtestSignHunger = 11, + /// trg_recruit_staff + kHandheldItemTrgRecruitStaff = 12, + /// trg_social_maraca + kHandheldItemTrgSocialMaraca = 13, + /// trg_social_horn + kHandheldItemTrgSocialHorn = 14, + /// trg_social_didgeridoo + kHandheldItemTrgSocialDidgeridoo = 15, + /// trg_gathering_treesmacker + kHandheldItemTrgGatheringTreeSmacker = 16, + /// trg_chieftain_staff + kHandheldItemTrgChieftainStaff = 17, + /// trg_healing_staff + kHandheldItemTrgHealingStaff = 18, + /// trg_repair_mallet + kHandheldItemTrgRepairMallet = 19, + /// trg_water_bucket + kHandheldItemTrgWaterBucket = 20, + /// 0xA8F747AE, some tribal horn + kHandheldItemUnk21 = 21, + /// trg_firebomb + kHandheldItemTrgFireBomb = 22, + /// trg_eating_egg + kHandheldItemTrgEatingEgg = 23, + }; } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cCreatureBase.h b/Spore ModAPI/Spore/Simulator/cCreatureBase.h index faa54bdf..11e48019 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureBase.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureBase.h @@ -208,6 +208,8 @@ namespace Simulator /// @returns int PlayVoice(const char* pName, int param2, int param3); + bool IsHervibore(); + /* 54h */ virtual void CreateLocomotionStrategy(); @@ -415,5 +417,6 @@ namespace Simulator DeclareAddress(OnJumpLand); // 0xC14670 0xC14E10 DeclareAddress(OnStartSwimming); // 0xC147D0 0xC14F70 DeclareAddress(Update); // 0xC20C50 0xC21530 + DeclareAddress(IsHervibore); // 0xC0B040 0xC0B8E0 } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h b/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h index 424ea6a1..04f0b434 100644 --- a/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h +++ b/Spore ModAPI/Spore/Simulator/cCreatureCitizen.h @@ -29,6 +29,12 @@ namespace Simulator /// @param property [Optional] void DoAction(int actionId, cGameData* actionObject, App::Property* property = nullptr); + /// For a given tribal tool from Simulator::TribeToolType, returns which item must be held by + /// the citizen. The item is part of the Simulator::HandheldItem enum. + /// @param toolType + /// @returns An integer identifying the kind of item to be held + int GetHandheldItemForTool(int toolType); + public: /* FC0h */ int field_FC0; // 3 /* FC4h */ uint32_t mFavoredGrasperlikeAppendage; // -1 @@ -53,5 +59,6 @@ namespace Simulator namespace Addresses(cCreatureCitizen) { DeclareAddress(Update); // 0xC24210 0xC24A30 DeclareAddress(DoAction); // 0xC26EF0 0xC27710 + DeclareAddress(GetHandheldItemForTool); // 0xC22E70 0xC23740 } } \ No newline at end of file