Skip to content

Commit

Permalink
- Add cCreatureCitizen::GetHandheldItemForTool() and enum Simulator::…
Browse files Browse the repository at this point in the history
…HandheldItem

- Add cCreatureBase::IsHervibore()
  • Loading branch information
emd4600 committed Oct 10, 2024
1 parent 6a332bb commit 25649a6
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions Spore ModAPI/SourceCode/Simulator/cCreatureAnimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
51 changes: 51 additions & 0 deletions Spore ModAPI/Spore/Simulator/SimulatorEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
3 changes: 3 additions & 0 deletions Spore ModAPI/Spore/Simulator/cCreatureBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ namespace Simulator
/// @returns
int PlayVoice(const char* pName, int param2, int param3);

bool IsHervibore();


/* 54h */ virtual void CreateLocomotionStrategy();

Expand Down Expand Up @@ -415,5 +417,6 @@ namespace Simulator
DeclareAddress(OnJumpLand); // 0xC14670 0xC14E10
DeclareAddress(OnStartSwimming); // 0xC147D0 0xC14F70
DeclareAddress(Update); // 0xC20C50 0xC21530
DeclareAddress(IsHervibore); // 0xC0B040 0xC0B8E0
}
}
7 changes: 7 additions & 0 deletions Spore ModAPI/Spore/Simulator/cCreatureCitizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -53,5 +59,6 @@ namespace Simulator
namespace Addresses(cCreatureCitizen) {
DeclareAddress(Update); // 0xC24210 0xC24A30
DeclareAddress(DoAction); // 0xC26EF0 0xC27710
DeclareAddress(GetHandheldItemForTool); // 0xC22E70 0xC23740
}
}

0 comments on commit 25649a6

Please sign in to comment.