Skip to content
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

Developer Tools (fixed, improved, expanded) #601

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
15d64ae
Merge pull request #24 from Attnam/master
AquariusPower May 24, 2018
99ef7d6
Merge pull request #25 from Attnam/master
AquariusPower May 28, 2018
af8c444
Merge pull request #26 from Attnam/master
AquariusPower May 29, 2018
9979cf8
Merge pull request #27 from Attnam/master
AquariusPower May 30, 2018
8714ec6
Merge pull request #28 from Attnam/master
AquariusPower May 31, 2018
47044b9
Merge pull request #29 from Attnam/master
AquariusPower May 31, 2018
b4be00e
Merge branch 'master' of https://github.com/Attnam/ivan into Attnam-m…
AquariusPower Jun 1, 2018
a5387b8
Merge branch 'master' of https://github.com/Attnam/ivan into Attnam-m…
AquariusPower Jun 1, 2018
9f2cf80
Merge pull request #30 from Attnam/master
AquariusPower Jun 6, 2018
6d71776
Merge pull request #31 from Attnam/master
AquariusPower Jun 13, 2018
0f7bbaa
Merge pull request #32 from Attnam/master
AquariusPower Jun 19, 2018
932103d
Merge pull request #33 from Attnam/master
AquariusPower Jun 28, 2018
d5bfecc
Merge pull request #34 from Attnam/master
AquariusPower Jul 19, 2018
d028bf9
Merge pull request #35 from Attnam/master
AquariusPower Jul 19, 2018
1812c10
Merge pull request #37 from Attnam/master
AquariusPower Jul 20, 2018
cf1dc8e
Merge pull request #38 from Attnam/master
AquariusPower Jul 21, 2018
91dd7fd
Merge pull request #39 from Attnam/master
AquariusPower Aug 29, 2018
11f489a
Merge pull request #40 from Attnam/master
AquariusPower Sep 1, 2018
10b7dab
Merge pull request #41 from Attnam/master
AquariusPower Oct 2, 2018
5e97b45
Merge pull request #42 from Attnam/master
AquariusPower Oct 2, 2018
2bcac17
Merge pull request #43 from Attnam/master
AquariusPower Dec 15, 2018
2adf952
Merge pull request #44 from Attnam/master
AquariusPower Dec 17, 2018
2ea63f2
Merge pull request #45 from Attnam/master
AquariusPower Dec 21, 2018
e9ef42d
Merge pull request #46 from Attnam/master
AquariusPower Jan 9, 2019
720ec65
Merge pull request #48 from Attnam/master
AquariusPower Jan 21, 2019
57200e5
Merge pull request #49 from Attnam/master
AquariusPower Feb 6, 2019
8d98a16
Merge branch 'master' of https://github.com/Attnam/ivan into Attnam-m…
AquariusPower Apr 24, 2020
9bb7bd1
Developer Tools:
AquariusPower May 8, 2020
39df2b7
devCons:
AquariusPower Jun 1, 2020
4d8e612
Merge branch 'master' into DevTools
AquariusPower Jun 2, 2020
12ae83d
Merge branch 'master' into DevTools
ryfactor Sep 14, 2021
3a0f523
Merge branch 'master' into DevTools
ryfactor Oct 26, 2021
900575b
Merge branch 'master' into DevTools
ryfactor Oct 26, 2021
dbf59ed
Merge branch 'master' into DevTools
AquariusPower Jan 23, 2022
34e8e80
Update char.cpp
AquariusPower Jan 23, 2022
1fd6b53
Update dungeon.cpp
AquariusPower Jan 23, 2022
fcef088
Update dungeon.cpp
AquariusPower Jan 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions FeLib/Include/rawbit.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class rawbitmap
cpackalpha* = 0,
cuchar* = 0, cuchar* = 0, truth = true) const;
v2 GetSize() const { return Size; }
v2 GetFontSize() { return v2FontSize; }

void AlterGradient(v2, v2, int, int, truth);
void SwapColors(v2, v2, int, int);
Expand All @@ -74,6 +75,7 @@ class rawbitmap
uchar* Palette;
paletteindex** PaletteBuffer;
fontcache FontCache;
v2 v2FontSize=v2(8,8); //TODO everywhere using 8 to calculate font size should use this variable, so one day we can have dynamic size font, after that we can set this var to any other proper value
};

#endif
5 changes: 5 additions & 0 deletions FeLib/Source/bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,11 @@ void bitmap::DrawLine(int FromX, int FromY, v2 To, col16 Color, truth Wide)
void bitmap::DrawLine(v2 From, v2 To, col16 Color, truth Wide)
{ DrawLine(From.X, From.Y, To.X, To.Y, Color, Wide); }

/**
* TODO this needs a fix:
* If a line is drawn from x,1 to anywhere and it is WIDE, the game will SEGFAULT.
* Every drawn dot must be checked if is inside the bitmap boundaries...
*/
void bitmap::DrawLine(int OrigFromX, int OrigFromY, int OrigToX, int OrigToY, col16 Color, truth Wide)
{
if(OrigFromY == OrigToY)
Expand Down
4 changes: 2 additions & 2 deletions Main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ set_source_files_properties(
Source/smoke.cpp Source/square.cpp Source/stack.cpp Source/team.cpp
Source/terra.cpp Source/trap.cpp Source/traps.cpp Source/worldmap.cpp
Source/wsquare.cpp Source/wterra.cpp Source/wterras.cpp Source/hiteffect.cpp
Source/cmdcraft.cpp Source/cmdcraftfilters.cpp
Source/cmdswapweap.cpp
Source/cmdcraft.cpp Source/cmdcraftfilters.cpp Source/cmdswapweap.cpp
Source/curseddeveloper.cpp Source/wizautoplay.cpp
PROPERTIES HEADER_FILE_ONLY TRUE)

add_executable(ivan ${IVAN_SOURCES} Resource/Ivan.rc)
Expand Down
2 changes: 1 addition & 1 deletion Main/Include/bugworkaround.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class bugfixdp{

private:
static character* BugWorkaroundDupPlayer();
static void DevConsCmd(std::string strCmdParams);
static void DevConsCmd(festring fsCmdParams);

static void GatherAllItemInLevel();
static bool ItemWork(character* Char, item* it, bool bFix, const char* cInfo, std::vector<item*>* pvItem,bool bSendToHell);
Expand Down
22 changes: 4 additions & 18 deletions Main/Include/char.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ class character : public entity, public id
public:
friend class databasecreator<character>;
friend class corpse;
friend class curseddeveloper;
friend class wizautoplay;
typedef characterprototype prototype;
typedef characterdatabase database;
character();
Expand Down Expand Up @@ -364,6 +366,7 @@ class character : public entity, public id
void ActivateEquipmentState(long What) { EquipmentState |= What; }
void DeActivateEquipmentState(long What) { EquipmentState &= ~What; }
truth TemporaryStateIsActivated(long What) const;
truth HasStateFlag(long Flag);
truth EquipmentStateIsActivated(long What) const { return EquipmentState & What; }
truth StateIsActivated(long What) const;
truth LoseConsciousness(int, truth = false);
Expand Down Expand Up @@ -688,6 +691,7 @@ class character : public entity, public id
void LycanthropyHandler();
void SearchingHandler();
void SaveLife();
void SaveLifeBase();
void BeginInvisibility();
void BeginInfraVision();
void BeginESP();
Expand Down Expand Up @@ -1183,7 +1187,6 @@ class character : public entity, public id
void SignalBurn();
void Extinguish(truth);
truth IsBurnt() const;
truth IsPlayerAutoPlay();
truth CheckAIZapOpportunity();
int GetAdjustedStaminaCost(int, int);
truth TryToStealFromShop(character*, item*);
Expand Down Expand Up @@ -1220,23 +1223,6 @@ class character : public entity, public id
void StandIdleAI();
virtual void CreateCorpse(lsquare*);
void GetPlayerCommand();

truth AutoPlayAICommand(int&);
truth AutoPlayAIPray();
bool AutoPlayAIChkInconsistency();
static void AutoPlayAIDebugDrawSquareRect(v2 v2SqrPos, col16 color, int iPrintIndex=-1, bool bWide=false, bool bKeepColor=false);
static void AutoPlayAIDebugDrawOverlay();
static bool AutoPlayAICheckAreaLevelChangedAndReset();
truth AutoPlayAIDropThings();
bool IsAutoplayAICanPickup(item* it,bool bPlayerHasLantern);
truth AutoPlayAIEquipAndPickup(bool bPlayerHasLantern);
int AutoPlayAIFindWalkDist(v2 v2To);
truth AutoPlayAITestValidPathTo(v2 v2To);
truth AutoPlayAINavigateDungeon(bool bPlayerHasLantern);
truth AutoPlayAISetAndValidateKeepGoingTo(v2 v2KGTo);
void AutoPlayAITeleport(bool bDeathCountBased);
void AutoPlayAIReset(bool bFailedToo);

virtual void GetAICommand();
truth MoveTowardsTarget(truth);
virtual cchar* FirstPersonUnarmedHitVerb() const;
Expand Down
56 changes: 56 additions & 0 deletions Main/Include/curseddeveloper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
*
* Iter Vehemens ad Necem (IVAN)
* Copyright (C) Timo Kiviluoto
* Released under the GNU General
* Public License
*
* See LICENSING which should be included
* along with this file for more details
*
*/

#ifndef __CURSEDDEVELOPER_H__
#define __CURSEDDEVELOPER_H__

class bodypart;
class character;
class festring;

class curseddeveloper {
public:
static bool IsCursedDeveloper();

#ifdef CURSEDDEVELOPER
public:
static void Init();
static bool IsCursedDeveloperTeleport(){return bCursedDeveloperTeleport;}
static bool LifeSaveJustABitIfRequested();
static bool LifeSaveJustABit(character* Killer);
static long UpdateKillCredit(character* Victim=NULL,int iMod=0);
static long ModKillCredit(int i){UpdateKillCredit(NULL,i);return lKillCredit;}
static long GetKillCredit(){return lKillCredit;}
static void RequestResurrect(character* C){if(!Killer)Killer=C;bResurrect=true;}
protected:
static bool BuffAndDebuffPlayerKiller(character* Killer,int& riBuff,int& riDebuff,bool& rbRev);
static void RestoreLimbs(festring fsCmdParams = CONST_S(""));
static bool HealTorso(bodypart* bp);
static bool HealBP(int iIndex,int iMode,int iMinHpOK=0);
static bool CreateBP(int iIndex);
static void NightmareWakeUp(character* P);
static void ResetKillCredit(festring fsCmdParams = CONST_S(""));
private:
static bool bCursedDeveloper;
static bool bCursedDeveloperTeleport;
static bool bInit;
static long lKillCredit;
static bool bNightmareWakeUp;
static bool bResurrect;
static character* Killer;
#else
public:
static bool IsCursedDeveloperTeleport(){return false;}
#endif
};

#endif //__CURSEDDEVELOPER_H__
Loading