Skip to content

Commit

Permalink
Eldritch Knight pretty much done & Levelup Feats GUI WIP 5
Browse files Browse the repository at this point in the history
  • Loading branch information
DMD authored and DMD committed Aug 19, 2016
1 parent 6285513 commit 4aa0f31
Show file tree
Hide file tree
Showing 10 changed files with 302 additions and 58 deletions.
1 change: 1 addition & 0 deletions Infrastructure/include/graphics/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ struct TigRect {
void FitInto(const TigRect &boundingRect);
bool Intersects(const TigRect &other);
bool Intersects(const TigRect &other, TigRect &intersection);
bool ContainsPoint(int px, int py);
};
4 changes: 4 additions & 0 deletions TemplePlus/d20_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ bool D20ClassSystem::IsSelectingFeatsOnLevelup(objHndl handle, Stat classEnum){
return pythonClassIntegration.IsSelectingFeatsOnLevelup(handle, classEnum);
}

void D20ClassSystem::LevelupGetBonusFeats(objHndl handle, Stat classEnum){
pythonClassIntegration.LevelupGetBonusFeats(handle, classEnum);
}

bool D20ClassSystem::IsSelectingSpellsOnLevelup(objHndl handle, Stat classEnum){

return pythonClassIntegration.IsSelectingSpellsOnLevelup(handle, classEnum);
Expand Down
1 change: 1 addition & 0 deletions TemplePlus/d20_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ struct D20ClassSystem : temple::AddressTable

// Levelup
bool IsSelectingFeatsOnLevelup(objHndl handle, Stat classEnum);
void LevelupGetBonusFeats( objHndl handle, Stat classEnum);

bool IsSelectingSpellsOnLevelup(objHndl handle, Stat classEnum);
void LevelupInitSpellSelection(objHndl handle, Stat classEnum);
Expand Down
14 changes: 14 additions & 0 deletions TemplePlus/python/python_integration_class_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@ bool PythonClassSpecIntegration::IsSelectingFeatsOnLevelup(objHndl handle, Stat

}

void PythonClassSpecIntegration::LevelupGetBonusFeats(objHndl handle, Stat classEnum){
auto classSpecEntry = mScripts.find(classEnum);
if (classSpecEntry == mScripts.end())
return;

auto attachee = PyObjHndl_Create(handle);
auto args = Py_BuildValue("(O)", attachee);
Py_DECREF(attachee);

RunScriptDefault0(classSpecEntry->second.id, (EventId)ClassSpecFunc::LevelupGetBonusFeats, args) ;
Py_DECREF(args);
}

bool PythonClassSpecIntegration::IsSelectingSpellsOnLevelup(objHndl handle, Stat classEnum){
auto classSpecEntry = mScripts.find(classEnum);
if (classSpecEntry == mScripts.end())
Expand Down Expand Up @@ -265,6 +278,7 @@ static std::map<ClassSpecFunc, std::string> classSpecFunctions = {
{ ClassSpecFunc::GetFeats,"GetClassFeats" },

{ ClassSpecFunc::IsSelectingFeatsOnLevelup, "IsSelectingFeatsOnLevelup" },
{ ClassSpecFunc::LevelupGetBonusFeats, "LevelupGetBonusFeats" },

{ ClassSpecFunc::LevelupCheckSpells, "LevelupCheckSpells" },
{ ClassSpecFunc::IsSelectingSpellsOnLevelup, "IsSelectingSpellsOnLevelup" },
Expand Down
2 changes: 2 additions & 0 deletions TemplePlus/python/python_integration_class_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum class ClassSpecFunc : int {

// levelup callbacks
IsSelectingFeatsOnLevelup,
LevelupGetBonusFeats,

LevelupCheckSpells,
IsSelectingSpellsOnLevelup,
Expand Down Expand Up @@ -62,6 +63,7 @@ class PythonClassSpecIntegration : public PythonIntegration {

// levelup
bool IsSelectingFeatsOnLevelup(objHndl handle, Stat classEnum);
void LevelupGetBonusFeats(objHndl handle, Stat classEnum);

bool IsSelectingSpellsOnLevelup(objHndl handle, Stat classEnum);
void LevelupInitSpellSelection(objHndl handle, Stat classEnum);
Expand Down
1 change: 1 addition & 0 deletions TemplePlus/temple_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ enum feat_enums : int {
FEAT_GREATER_RAGE = 675,
FEAT_GREATER_WEAPON_SPECIALIZATION_GAUNTLET = 676,
FEAT_GREATER_WEAPON_SPECIALIZATION_UNARMED_STRIKE_MEDIUM_SIZED_BEING = 677,
FEAT_GREATER_WEAPON_SPECIALIZATION_BASTARD_SWORD = 733,
/// ... rest of Greater Weapon Specializations ...
FEAT_GREATER_WEAPON_SPECIALIZATION_GRAPPLE = 746,
FEAT_TIRELESS_RAGE = 747,
Expand Down
5 changes: 5 additions & 0 deletions TemplePlus/tig/tig.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "..\..\Infrastructure\include\graphics\math.h"
#include "stdafx.h"
#include "tig.h"
#include "tig_tabparser.h"
Expand Down Expand Up @@ -273,6 +274,10 @@ bool TigRect::Intersects(const TigRect& other, TigRect& intersection) {
return true;
}

bool TigRect::ContainsPoint(int pX, int pY){
return (pX >= x && pX <= x + width && pY >= y && pY <= y + height);
}

RECT TigRect::ToRect() {
return{x, y, x + width, y + height};
}
Loading

0 comments on commit 4aa0f31

Please sign in to comment.