-
-
Notifications
You must be signed in to change notification settings - Fork 115
Battle Points economy for super weapons #1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FS-21
wants to merge
24
commits into
Phobos-developers:develop
Choose a base branch
from
FS-21:feature/batte-points
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+506
−6
Open
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3392074
Initial commit
FS-21 54a141e
More code
FS-21 2398e31
Small additions
FS-21 c69bb45
- Now AI-controlled super weapons managed by Ares dll will obey the p…
FS-21 d440d4e
Documentation and bugfixes
FS-21 6f78cd0
small fix
FS-21 fb8f5f0
doc tweaks
FS-21 4a5d9dd
Merge remote-tracking branch 'origin/develop' into feature/batte-points
FS-21 b65fb81
tweak
FS-21 bc96d8f
renamed tag
FS-21 384ee39
bugfix
FS-21 a58c346
By mistake I interted the sign of the operations
FS-21 762cbd5
Merge remote-tracking branch 'origin/develop' into feature/batte-points
FS-21 b4edaaf
Merge remote-tracking branch 'origin/develop' into feature/batte-points
FS-21 655e2ec
Code improvements
FS-21 fd57aef
Code tweaks
FS-21 5c81621
Merge branch 'develop' into feature/batte-points
FS-21 e74c242
Merge branch 'develop' into feature/batte-points
FS-21 2837e63
Merge branch 'develop' into feature/batte-points
FS-21 44df416
Merge branch 'develop' into feature/batte-points
FS-21 db1560f
Merge branch 'develop' into feature/batte-points
FS-21 f448d09
Merge branch 'develop' into feature/batte-points
FS-21 0cba2bd
Merge branch 'develop' into feature/batte-points
FS-21 2c23dca
Merge branch 'develop' into feature/batte-points
FS-21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
#include "Body.h" | ||
|
||
#include <Utilities/GeneralUtils.h> | ||
|
||
static constexpr DWORD Canary = 0x1111111A; | ||
HouseTypeExt::ExtContainer HouseTypeExt::ExtMap; | ||
|
||
void HouseTypeExt::ExtData::Initialize() | ||
{ | ||
} | ||
|
||
// ============================= | ||
// load / save | ||
|
||
void HouseTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) | ||
{ | ||
auto pThis = this->OwnerObject(); | ||
const char* pSection = pThis->ID; | ||
|
||
if (!pINI->GetSection(pSection)) | ||
return; | ||
|
||
INI_EX exINI(pINI); | ||
|
||
this->BattlePoints.Read(exINI, pSection, "BattlePoints"); | ||
this->BattlePoints_CanUseStandardPoints.Read(exINI, pSection, "BattlePoints.CanUseStandardPoints"); | ||
} | ||
|
||
void HouseTypeExt::ExtData::CompleteInitialization() | ||
{ | ||
auto const pThis = this->OwnerObject(); | ||
UNREFERENCED_PARAMETER(pThis); | ||
} | ||
|
||
template <typename T> | ||
void HouseTypeExt::ExtData::Serialize(T& Stm) | ||
{ | ||
Stm | ||
.Process(this->BattlePoints) | ||
.Process(this->BattlePoints_CanUseStandardPoints) | ||
; | ||
} | ||
|
||
void HouseTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) | ||
{ | ||
Extension<HouseTypeClass>::LoadFromStream(Stm); | ||
this->Serialize(Stm); | ||
} | ||
|
||
void HouseTypeExt::ExtData::SaveToStream(PhobosStreamWriter& Stm) | ||
{ | ||
Extension<HouseTypeClass>::SaveToStream(Stm); | ||
this->Serialize(Stm); | ||
} | ||
|
||
bool HouseTypeExt::ExtContainer::Load(HouseTypeClass* pThis, IStream* pStm) | ||
{ | ||
HouseTypeExt::ExtData* pData = this->LoadKey(pThis, pStm); | ||
return pData != nullptr; | ||
}; | ||
|
||
bool HouseTypeExt::LoadGlobals(PhobosStreamReader& Stm) | ||
{ | ||
return Stm.Success(); | ||
} | ||
|
||
bool HouseTypeExt::SaveGlobals(PhobosStreamWriter& Stm) | ||
{ | ||
return Stm.Success(); | ||
} | ||
|
||
// ============================= | ||
// container | ||
|
||
HouseTypeExt::ExtContainer::ExtContainer() : Container("HouseTypeClass") { } | ||
|
||
HouseTypeExt::ExtContainer::~ExtContainer() = default; | ||
|
||
// ============================= | ||
// container hooks | ||
|
||
DEFINE_HOOK(0x511635, HouseTypeClass_CTOR_1, 0x5) | ||
{ | ||
GET(HouseTypeClass*, pItem, EAX); | ||
|
||
HouseTypeExt::ExtMap.Allocate(pItem); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x511643, HouseTypeClass_CTOR_2, 0x5) | ||
{ | ||
GET(HouseTypeClass*, pItem, EAX); | ||
|
||
HouseTypeExt::ExtMap.Allocate(pItem); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x5127CF, HouseTypeClass_DTOR, 0x6) | ||
{ | ||
GET(HouseTypeClass*, pItem, ESI); | ||
|
||
HouseTypeExt::ExtMap.Remove(pItem); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK_AGAIN(0x512480, HouseTypeClass_SaveLoad_Prefix, 0x5) | ||
DEFINE_HOOK(0x512290, HouseTypeClass_SaveLoad_Prefix, 0x5) | ||
{ | ||
GET_STACK(HouseTypeClass*, pItem, 0x4); | ||
GET_STACK(IStream*, pStm, 0x8); | ||
|
||
HouseTypeExt::ExtMap.PrepareStream(pItem, pStm); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x51246D, HouseTypeClass_Load_Suffix, 0x5) | ||
{ | ||
HouseTypeExt::ExtMap.LoadStatic(); | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x51255C, HouseTypeClass_Save_Suffix, 0x5) | ||
{ | ||
HouseTypeExt::ExtMap.SaveStatic(); | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK_AGAIN(0x51215A, HouseTypeClass_LoadFromINI, 0x5) | ||
DEFINE_HOOK(0x51214F, HouseTypeClass_LoadFromINI, 0x5) | ||
{ | ||
GET(HouseTypeClass*, pItem, EBX); | ||
GET_BASE(CCINIClass*, pINI, 0x8); | ||
|
||
HouseTypeExt::ExtMap.LoadFromINI(pItem, pINI); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.