Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Wizard flag toggles added

Fixed compiler complaints on newlines at EOF
Refactored some wizard functions into its own file
  • Loading branch information...
commit 2e06e3a09ba7c57056a76037b7cf83615af71a94 1 parent cde5e5a
@vsrz vsrz authored
Showing with 580 additions and 465 deletions.
  1. +1 −1  Omega/src/Food.cpp
  2. +37 −38 Omega/src/GameState.cpp
  3. +39 −32 Omega/src/GameState.h
  4. +5 −5 Omega/src/Monster.cpp
  5. +2 −2 Omega/src/Monster_mtalk.cpp
  6. +1 −1  Omega/src/Object.h
  7. +1 −1  Omega/src/Scroll.cpp
  8. +12 −12 Omega/src/aux1.cpp
  9. +11 −11 Omega/src/aux2.cpp
  10. +9 −9 Omega/src/aux3.cpp
  11. +2 −2 Omega/src/bank.cpp
  12. +9 −9 Omega/src/command1.cpp
  13. +12 −12 Omega/src/command2.cpp
  14. +3 −30 Omega/src/command3.cpp
  15. +0 −1  Omega/src/defs.h
  16. +0 −224 Omega/src/effect1.cpp
  17. +5 −5 Omega/src/effect3.cpp
  18. +3 −3 Omega/src/file.cpp
  19. +2 −2 Omega/src/gen1.cpp
  20. +3 −3 Omega/src/gen2.cpp
  21. +2 −2 Omega/src/guild2.cpp
  22. +8 −8 Omega/src/move.cpp
  23. +2 −2 Omega/src/movef.cpp
  24. +3 −3 Omega/src/pdump.cpp
  25. +3 −3 Omega/src/save.cpp
  26. +16 −10 Omega/src/scr.cpp
  27. +1 −1  Omega/src/site1.cpp
  28. +12 −12 Omega/src/site2.cpp
  29. +2 −2 Omega/src/time.cpp
  30. +10 −10 Omega/src/trap.cpp
  31. +9 −9 Omega/src/util.cpp
  32. +351 −0 Omega/src/wiz.cpp
  33. +1 −0  build/win32/vs2012/OmegaRPG.vcxproj
  34. +3 −0  build/win32/vs2012/OmegaRPG.vcxproj.filters
View
2  Omega/src/Food.cpp
@@ -59,4 +59,4 @@ void Food::use()
mprint("Tastes like home cooking!");
break;
}
-}
+}
View
75 Omega/src/GameState.cpp
@@ -1,6 +1,5 @@
#include "GameState.h"
-
GameState State;
GameState::GameState ( void )
@@ -37,7 +36,17 @@ void GameState::resetGameStatus( long l )
bool GameState::getGameStatus( long l )
{
- return _state & l;
+ return (_state & l) > 0;
+}
+
+bool GameState::getSpokeToDruid()
+{
+ return(getGameStatus(SPOKE_TO_DRUID));
+}
+
+void GameState::setSpokeToDruid( bool b)
+{
+ setGameStatus(b, SPOKE_TO_DRUID);
}
bool GameState::toggleGameStatus( long l )
@@ -50,18 +59,7 @@ bool GameState::toggleGameStatus( long l )
return true;
}
-
-bool GameState::hasSpokeToDruid()
-{
- return(getGameStatus(SPOKE_TO_DRUID));
-}
-
-void GameState::setSpokeToDruid( bool b)
-{
- setGameStatus(b, SPOKE_TO_DRUID);
-}
-
-bool GameState::hasCompletedCaves()
+bool GameState::getCompletedCaves()
{
return(getGameStatus(COMPLETED_CAVES));
}
@@ -72,7 +70,7 @@ void GameState::setCompletedCaves( bool b )
}
-bool GameState::hasCompletedSewers()
+bool GameState::getCompletedSewers()
{
return(getGameStatus(COMPLETED_SEWERS));
}
@@ -82,7 +80,7 @@ void GameState::setCompletedSewers( bool b )
setGameStatus(b, COMPLETED_SEWERS);
}
-bool GameState::hasCompletedCastle()
+bool GameState::getCompletedCastle()
{
return(getGameStatus(COMPLETED_CASTLE));
}
@@ -93,7 +91,7 @@ void GameState::setCompletedCastle( bool b )
}
-bool GameState::hasCompletedAstral()
+bool GameState::getCompletedAstral()
{
return(getGameStatus(COMPLETED_ASTRAL));
}
@@ -104,7 +102,7 @@ void GameState::setCompletedAstral( bool b )
}
-bool GameState::hasCompletedVolcano()
+bool GameState::getCompletedVolcano()
{
return(getGameStatus(COMPLETED_VOLCANO));
}
@@ -115,7 +113,7 @@ void GameState::setCompletedVolcano( bool b )
}
-bool GameState::hasKilledDragonlord()
+bool GameState::getKilledDragonlord()
{
return(getGameStatus(KILLED_DRAGONLORD));
}
@@ -126,7 +124,7 @@ void GameState::setKilledDragonlord( bool b )
}
-bool GameState::hasKilledEater()
+bool GameState::getKilledEater()
{
return(getGameStatus(KILLED_EATER));
}
@@ -137,7 +135,7 @@ void GameState::setKilledEater( bool b )
}
-bool GameState::hasKilledLawbringer()
+bool GameState::getKilledLawbringer()
{
return(getGameStatus(KILLED_LAWBRINGER));
}
@@ -148,7 +146,7 @@ void GameState::setKilledLawbringer( bool b )
}
-bool GameState::hasCompletedChallenge()
+bool GameState::getCompletedChallenge()
{
return(getGameStatus(COMPLETED_CHALLENGE));
}
@@ -159,7 +157,7 @@ void GameState::setCompletedChallenge( bool b )
}
-bool GameState::hasPurchasedCondo()
+bool GameState::getPurchasedCondo()
{
return(getGameStatus(SOLD_CONDO));
}
@@ -170,7 +168,7 @@ void GameState::setPurchasedCondo( bool b )
}
-bool GameState::hasFastMove()
+bool GameState::getFastMove()
{
return(getGameStatus(FAST_MOVE));
}
@@ -181,7 +179,7 @@ void GameState::setFastMove( bool b )
}
-bool GameState::hasSkipPlayer()
+bool GameState::getSkipPlayer()
{
return(getGameStatus(SKIP_PLAYER));
}
@@ -192,7 +190,7 @@ void GameState::setSkipPlayer( bool b )
}
-bool GameState::hasSkipMonsters()
+bool GameState::getSkipMonsters()
{
return(getGameStatus(SKIP_MONSTERS));
}
@@ -203,7 +201,7 @@ void GameState::setSkipMonsters( bool b )
}
-bool GameState::isMounted()
+bool GameState::getMounted()
{
return(getGameStatus(MOUNTED));
}
@@ -214,7 +212,7 @@ void GameState::setMounted( bool b )
}
-bool GameState::hasSuppressPrinting()
+bool GameState::getSuppressPrinting()
{
return(getGameStatus(SUPPRESS_PRINTING));
}
@@ -225,7 +223,7 @@ void GameState::setSuppressPrinting( bool b )
}
-bool GameState::isLost()
+bool GameState::getLost()
{
return(getGameStatus(LOST));
}
@@ -236,7 +234,7 @@ void GameState::setLost( bool b )
}
-bool GameState::isInArena()
+bool GameState::getInArena()
{
return(getGameStatus(ARENA_MODE));
}
@@ -247,7 +245,7 @@ void GameState::setInArena( bool b )
}
-bool GameState::isCheater()
+bool GameState::getCheater()
{
return(getGameStatus(CHEATED));
}
@@ -259,7 +257,7 @@ void GameState::setCheater( bool b )
}
-bool GameState::isBankBroken()
+bool GameState::getBankBroken()
{
return(getGameStatus(BANK_BROKEN));
}
@@ -270,7 +268,7 @@ void GameState::setBankBroken( bool b )
}
-bool GameState::isExplorerClubMember()
+bool GameState::getExplorerClubMember()
{
return(getGameStatus(CLUB_MEMBER));
}
@@ -281,7 +279,7 @@ void GameState::setExplorerClubMember( bool b )
}
-bool GameState::hasPreparedVoid()
+bool GameState::getPreparedVoid()
{
return(getGameStatus(PREPARED_VOID));
}
@@ -292,7 +290,7 @@ void GameState::setPreparedVoid( bool b )
}
-bool GameState::hasDestroyedOrder()
+bool GameState::getDestroyedOrder()
{
return(getGameStatus(DESTROYED_ORDER));
}
@@ -303,7 +301,7 @@ void GameState::setDestroyedOrder( bool b )
}
-bool GameState::hasGivenStargem()
+bool GameState::getGivenStargem()
{
return(getGameStatus(GAVE_STARGEM));
}
@@ -314,7 +312,7 @@ void GameState::setGivenStargem( bool b )
}
-bool GameState::hasAttackedOracle()
+bool GameState::getAttackedOracle()
{
return(getGameStatus(ATTACKED_ORACLE));
}
@@ -324,7 +322,7 @@ void GameState::setAttackedOracle( bool b )
setGameStatus(b, ATTACKED_ORACLE);
}
-bool GameState::hasUndeadGuards()
+bool GameState::getUndeadGuards()
{
return(getGameStatus(UNDEAD_GUARDS));
}
@@ -334,3 +332,4 @@ void GameState::setUndeadGuards( bool b )
setGameStatus(b, UNDEAD_GUARDS);
}
+
View
71 Omega/src/GameState.h
@@ -4,6 +4,7 @@
#pragma once
+//#include <map>
class GameState
{
@@ -12,6 +13,8 @@ class GameState
/* gamestate bit vector */
long _state;
+public:
+
/* static definitions */
static const long SPOKE_TO_DRUID = 0x1;
static const long COMPLETED_CAVES = 0x2;
@@ -40,122 +43,126 @@ class GameState
static const long ATTACKED_ORACLE = 0x1000000;
static const long UNDEAD_GUARDS = 0x2000000;
+ GameState( void );
+ GameState( long );
+ ~GameState( void );
+
+ /* toggling option */
+ bool toggleGameStatus( long );
+
/* internal methods for setting gamestate */
void setGameStatus( long );
void setGameStatus( bool, long );
bool getGameStatus( long );
void resetGameStatus( long );
- bool toggleGameStatus( long );
-public:
- GameState( void );
- GameState( long );
- ~GameState( void );
-
/* has the player spoken to the druid in the north forest */
- bool hasSpokeToDruid();
+ bool getSpokeToDruid();
void setSpokeToDruid( bool b = true );
/* has the player defeated the goblin king in the caves */
- bool hasCompletedCaves();
+ bool getCompletedCaves();
void setCompletedCaves( bool b = true );
/* has the player defeated the great wyrm in the sewers under rampart */
- bool hasCompletedSewers();
+ bool getCompletedSewers();
void setCompletedSewers( bool b = true );
/* has the player entered the arch mages court */
- bool hasCompletedCastle();
+ bool getCompletedCastle();
void setCompletedCastle( bool b = true );
/* has the player acquired and used the star gem */
- bool hasCompletedAstral();
+ bool getCompletedAstral();
void setCompletedAstral( bool b = true );
/* has the player defeated the demon emperor */
- bool hasCompletedVolcano();
+ bool getCompletedVolcano();
void setCompletedVolcano( bool b = true );
/* has the player defeated the Dragon Lord */
- bool hasKilledDragonlord();
+ bool getKilledDragonlord();
void setKilledDragonlord( bool b = true );
/* has the player defeated the Eater of Magic */
- bool hasKilledEater();
+ bool getKilledEater();
void setKilledEater( bool b = true );
/* has the player defeated the lawbringer */
- bool hasKilledLawbringer();
+ bool getKilledLawbringer();
void setKilledLawbringer( bool b = true );
/* has the player defeated the challenge of omega */
- bool hasCompletedChallenge();
+ bool getCompletedChallenge();
void setCompletedChallenge( bool b = true );
/* has the player purchased the condo */
- bool hasPurchasedCondo();
+ bool getPurchasedCondo();
void setPurchasedCondo( bool b = true );
/* is the game in fastmove mode */
- bool hasFastMove();
+ bool getFastMove();
void setFastMove( bool b = true );
/* is the player losing a turn */
- bool hasSkipPlayer();
+ bool getSkipPlayer();
void setSkipPlayer( bool b = true );
/* are NPC's losing a turn */
- bool hasSkipMonsters();
+ bool getSkipMonsters();
void setSkipMonsters( bool b = true );
/* is the player mounted */
- bool isMounted();
+ bool getMounted();
void setMounted( bool b = true );
/* used when for whatever reason we do not want to print status messages */
- bool hasSuppressPrinting();
+ bool getSuppressPrinting();
void setSuppressPrinting( bool b = true );
/* is the player lost in the wilderness */
- bool isLost();
+ bool getLost();
void setLost( bool b = true );
/* toggled when the player is in the rampart arena */
- bool isInArena();
+ bool getInArena();
void setInArena( bool b = true );
/* if the player has become a wizard */
- bool isCheater();
+ bool getCheater();
void setCheater( bool b = true );
/* if the player has broken the ATM */
- bool isBankBroken();
+ bool getBankBroken();
void setBankBroken( bool b = true );
/* if the player is a member of the explorers club */
- bool isExplorerClubMember();
+ bool getExplorerClubMember();
void setExplorerClubMember( bool b = true );
/* has the player satisified the void's hunger? */
- bool hasPreparedVoid();
+ bool getPreparedVoid();
void setPreparedVoid( bool b = true );
/* destroy the order if the justicar has been killed and all guards are dead */
- bool hasDestroyedOrder();
+ bool getDestroyedOrder();
void setDestroyedOrder( bool b = true );
/* if the player has given the stargem to the lawbringer */
- bool hasGivenStargem();
+ bool getGivenStargem();
void setGivenStargem( bool b = true );
/* set if the player chooses to attack the oracle after ringing the bell */
- bool hasAttackedOracle();
+ bool getAttackedOracle();
void setAttackedOracle( bool b = true );
/* entire city is undead? this feature does not appear to have been implemented yet */
- bool hasUndeadGuards();
+ bool getUndeadGuards();
void setUndeadGuards( bool b = true );
+ /* returns a list of settable flags */
+ //std::map<const char*,long> getFlagList( void );
+
};
#endif
View
10 Omega/src/Monster.cpp
@@ -510,7 +510,7 @@ void Monster::m_death()
/* just a tad complicated. Promote a new justiciar if any
guards are left in the city, otherwise Destroy the Order! */
Player.alignment -= 100;
- if (! State.hasDestroyedOrder()) {
+ if (! State.getDestroyedOrder()) {
curr = Level->site[this->x][this->y].things;
while (curr && curr->thing->id != OB_JUSTICIAR_BADGE) {
prev = curr;
@@ -580,14 +580,14 @@ void Monster::m_death()
alert_guards();
break;
case GOBLIN_KING:
- if ( State.hasAttackedOracle() == false ) {
+ if ( State.getAttackedOracle() == false ) {
mprint("You seem to hear a woman's voice from far off:");
mprint("'Well done! Come to me now....'");
}
State.setCompletedCaves( true );
break; /* gob king */
case GREAT_WYRM:
- if (State.hasAttackedOracle() == false) {
+ if (State.getAttackedOracle() == false) {
mprint("A female voice sounds from just behind your ear:");
mprint("'Well fought! I have some new advice for you....'");
}
@@ -604,7 +604,7 @@ void Monster::m_death()
break;
case DEMON_EMP:
State.setCompletedVolcano();
- if (State.hasAttackedOracle() == false) {
+ if (State.getAttackedOracle() == false) {
mprint("You feel a soft touch on your shoulder...");
mprint("You turn around but there is no one there!");
mprint("You turn back and see a note: 'See me soon.'");
@@ -612,7 +612,7 @@ void Monster::m_death()
}
break;
case ELEM_MASTER:
- if (State.hasAttackedOracle() == false) {
+ if (State.getAttackedOracle() == false) {
mprint("Words appear before you, traced in blue flame!");
mprint("'Return to the Prime Plane via the Circle of Sorcerors....'");
}
View
4 Omega/src/Monster_mtalk.cpp
@@ -12,7 +12,7 @@ void Monster::m_talk_druid()
if (! m_statusp(this,HOSTILE)) {
print1("The Archdruid raises a hand in greeting.");
- if (State.hasSpokeToDruid() == false) {
+ if (State.getSpokeToDruid() == false) {
State.setSpokeToDruid( true );
morewait();
print1("The Archdruid congratulates you on reaching his sanctum.");
@@ -645,7 +645,7 @@ void Monster::m_talk_horse()
mprint("The horse neighs angrily at you.");
else if (m_statusp(this,HUNGRY))
mprint("The horse noses curiously at your pack.");
- else if (State.isMounted())
+ else if (State.getMounted())
mprint("The horse and your steed don't seem to get along.");
else if (Current_Environment == Current_Dungeon)
mprint("The horse shies; maybe he doesn't like the dungeon air....");
View
2  Omega/src/Object.h
@@ -39,4 +39,4 @@ class Object
};
-#endif
+#endif
View
2  Omega/src/Scroll.cpp
@@ -40,4 +40,4 @@ void Scroll::initialize()
void Scroll::use()
{
-}
+}
View
24 Omega/src/aux1.cpp
@@ -174,11 +174,11 @@ int p_moveable(int x, int y)
}
}
else if (loc_statusp(x,y,SECRET)) {
- if (State.hasFastMove() == false) print3("Ouch!");
+ if (State.getFastMove() == false) print3("Ouch!");
return(false);
}
else if (Level->site[x][y].creature != NULL) {
- if (State.hasFastMove() == false) {
+ if (State.getFastMove() == false) {
Level->site[x][y].creature->fight_monster();
State.setSkipMonsters(false);
return(false);
@@ -189,7 +189,7 @@ int p_moveable(int x, int y)
(Level->site[x][y].locchar == STATUE) ||
(Level->site[x][y].locchar == PORTCULLIS) ||
(Level->site[x][y].locchar == CLOSED_DOOR) ||
- (State.hasFastMove() &&
+ (State.getFastMove() &&
((Level->site[x][y].locchar == HEDGE) ||
(Level->site[x][y].locchar == LAVA) ||
(Level->site[x][y].locchar == ABYSS) ||
@@ -199,7 +199,7 @@ int p_moveable(int x, int y)
(Level->site[x][y].locchar == WATER) ||
(Level->site[x][y].locchar == LIFT) ||
(Level->site[x][y].locchar == TRAP)))) {
- if (State.hasFastMove() == false) print3("Ouch!");
+ if (State.getFastMove() == false) print3("Ouch!");
return(false);
}
else if (optionp(CONFIRM)) {
@@ -214,7 +214,7 @@ int p_moveable(int x, int y)
(Level->site[x][y].locchar == LIFT) ||
(Level->site[x][y].locchar == TRAP)) {
/* horses WILL go into water... */
- if (State.isMounted()) {
+ if (State.getMounted()) {
if (Level->site[x][y].locchar != WATER ||
Level->site[x][y].p_locf != L_WATER) {
print1("You can't convince your steed to continue.");
@@ -225,7 +225,7 @@ int p_moveable(int x, int y)
}
else if (cinema_confirm("Look where you're about to step!") == 'y') State.setSkipMonsters(false);
else State.setSkipMonsters();
- return(State.hasSkipMonsters() == false);
+ return(State.getSkipMonsters() == false);
}
else {
State.setSkipMonsters(false);
@@ -328,7 +328,7 @@ void calc_melee(void)
Player.speed = max(1,min(25,Player.speed));
- if (State.isMounted()) {
+ if (State.getMounted()) {
Player.speed = 3;
Player.hit += 10;
Player.dmg += 10;
@@ -404,7 +404,7 @@ int damage_item(Object* o)
if (o->id == OB_STARGEM) {
print1("The Star Gem shatters into a million glistening shards....");
if (Current_Environment == E_STARPEAK) {
- if (!State.hasKilledLawbringer())
+ if (!State.getKilledLawbringer())
print2("You hear an agonizing scream of anguish and despair.");
morewait();
print1("A raging torrent of energy escapes in an explosion of magic!");
@@ -484,7 +484,7 @@ int damage_item(Object* o)
/* do dmg points of damage of type dtype, from source fromstring */
void p_damage(int dmg, int dtype, char *fromstring)
{
- if (State.hasFastMove()) {
+ if (State.getFastMove()) {
drawvision(Player.x,Player.y);
State.setFastMove(false);
}
@@ -629,7 +629,7 @@ void describe_player(void)
nprint1(levelname(Player.level));
nprint1(" named ");
nprint1(Player.name);
- if (State.isMounted())
+ if (State.getMounted())
nprint1(" (riding a horse.)");
}
@@ -719,13 +719,13 @@ void foodcheck(void)
print3("You are ravenously hungry.");
else if (Player.food == 3) {
print3("You feel weak.");
- if (State.hasFastMove()) {
+ if (State.getFastMove()) {
drawvision(Player.x,Player.y);
State.setFastMove(false);
}
}
else if (Player.food < 0) {
- if (State.hasFastMove()) {
+ if (State.getFastMove()) {
drawvision(Player.x,Player.y);
State.setFastMove(false);
}
View
22 Omega/src/aux2.cpp
@@ -495,7 +495,7 @@ void gain_level(void)
int gained=false;
int hp_gain; /* FIXED! 12/30/98 */
- if (State.hasSuppressPrinting())
+ if (State.getSuppressPrinting())
return;
while (expval(Player.level+1) <= Player.xp) {
if (!gained)
@@ -868,7 +868,7 @@ void change_environment(char new_environment)
Player.sy = -1; /* reset sanctuary if there was one */
/* missing message if gets lost on site... */
- if (State.isLost())
+ if (State.getLost())
{
State.setLost( false ); /* in case the player gets lost _on_ a site */
mprint("You know where you are now."); /* but didn't inform player... DAG */
@@ -1008,7 +1008,7 @@ void change_environment(char new_environment)
case E_DLAIR:
setPlayerXY(0, 8);
- load_dlair(State.hasKilledDragonlord(), true);
+ load_dlair(State.getKilledDragonlord(), true);
ScreenOffset = 0;
ScreenXOffset = 0;
show_screen();
@@ -1016,7 +1016,7 @@ void change_environment(char new_environment)
case E_STARPEAK:
setPlayerXY(2, 9);
- load_speak(State.hasKilledLawbringer(), true);
+ load_speak(State.getKilledLawbringer(), true);
ScreenOffset = 0;
ScreenXOffset = 0;
show_screen();
@@ -1024,7 +1024,7 @@ void change_environment(char new_environment)
case E_MAGIC_ISLE:
setPlayerXY(62, 14);
- load_misle(State.hasKilledEater(), true);
+ load_misle(State.getKilledEater(), true);
ScreenOffset = 0;
ScreenXOffset = 0;
show_screen();
@@ -1105,7 +1105,7 @@ void change_environment(char new_environment)
case E_CAVES:
print1("You enter a dark cleft in a hillside;");
print2("You note signs of recent passage in the dirt nearby.");
- if (State.isMounted()) {
+ if (State.getMounted()) {
morewait();
print1("Seeing as you might not be coming back, you feel compelled");
print2("to let your horse go, rather than keep him hobbled outside.");
@@ -1123,7 +1123,7 @@ void change_environment(char new_environment)
break;
case E_VOLCANO:
print1("You pass down through the glowing crater.");
- if (State.isMounted()) {
+ if (State.getMounted()) {
morewait();
print1("Seeing as you might not be coming back, you feel compelled");
print2("to let your horse go, rather than keep him hobbled outside.");
@@ -1141,7 +1141,7 @@ void change_environment(char new_environment)
break;
case E_ASTRAL:
print1("You are in a weird flickery maze.");
- if (State.isMounted()) {
+ if (State.getMounted()) {
print2("Your horse doesn't seem to have made it....");
State.setMounted(false);
calc_melee();
@@ -1157,7 +1157,7 @@ void change_environment(char new_environment)
break;
case E_CASTLE:
print1("You cross the drawbridge. Strange forms move beneath the water.");
- if (State.isMounted()) {
+ if (State.getMounted()) {
morewait();
print1("Seeing as you might not be coming back, you feel compelled");
print2("to let your horse go, rather than keep him hobbled outside.");
@@ -1174,7 +1174,7 @@ void change_environment(char new_environment)
break;
case E_SEWERS:
print1("You pry open a manhole and descend into the sewers below.");
- if (State.isMounted()) {
+ if (State.getMounted()) {
print2("You horse waits patiently outside the sewer entrance....");
dismount_steed();
}
@@ -1228,7 +1228,7 @@ void change_environment(char new_environment)
break;
case E_PALACE:
print1("You enter the dungeons of the ruined palace.");
- if (State.isMounted()) {
+ if (State.getMounted()) {
morewait();
print1("Seeing as you might not be coming back, you feel compelled");
print2("to let your horse go, rather than keep him hobbled outside.");
View
18 Omega/src/aux3.cpp
@@ -257,7 +257,7 @@ void outdoors_random_event(void)
gain_item(ob);
}
else if (num < 80) {
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("Your horse screams as he is transformed into an");
morewait();
mprint("imaginary unseen dead tortoise.");
@@ -312,7 +312,7 @@ void outdoors_random_event(void)
case 11:
mprint("You find a Traveller's Aid station with maps of the local area.");
morewait();
- if (State.isLost()) {
+ if (State.getLost()) {
State.setLost( false );
mprint("You know where you are now.");
}
@@ -330,7 +330,7 @@ void outdoors_random_event(void)
show_screen();
break;
case 12:
- if (! State.isMounted()) {
+ if (! State.getMounted()) {
mprint("You develop blisters....");
p_damage(1,UNSTOPPABLE,"blisters");
}
@@ -423,7 +423,7 @@ void terrain_check(int takestime)
break;
}
}
- else if (State.isMounted()) {
+ else if (State.getMounted()) {
faster = 1;
switch(random_range(32)) {
case 0:
@@ -639,14 +639,14 @@ void terrain_check(int takestime)
}
break;
case CITY:
- if (State.isLost()) {
+ if (State.getLost()) {
State.setLost( false );
mprint("Well, I guess you know where you are now....");
}
locprint("Outside Rampart, the city.");
break;
case VILLAGE:
- if (State.isLost()) {
+ if (State.getLost()) {
State.setLost( false );
mprint("The village guards let you know where you are....");
}
@@ -1186,14 +1186,14 @@ void alert_guards(void)
Level->site[40][60].p_locf = L_NO_OP; /* pacify_guards restores this */
}
if ((! foundguard) && (Current_Environment == E_CITY) &&
- !State.hasDestroyedOrder()) {
- suppress = State.hasSuppressPrinting();
+ !State.getDestroyedOrder()) {
+ suppress = State.getSuppressPrinting();
State.setSuppressPrinting( false );
print2("The last member of the Order of Paladins dies....");
morewait();
gain_experience(1000);
Player.alignment -= 250;
- if (!State.hasKilledLawbringer()) {
+ if (!State.getKilledLawbringer()) {
print1("A chime sounds from far away.... The sound grows stronger....");
print2("Suddenly the great shadowy form of the LawBringer appears over");
print3("the city. He points his finger at you....");
View
4 Omega/src/bank.cpp
@@ -1023,7 +1023,7 @@ void l_bank (void)
mvwaddstr(Bankw, 2, 2, " Welcome to The Bank of Rampart ");
/* bank working? or not? */
- if (State.isBankBroken() == true)
+ if (State.getBankBroken() == true)
{
mvwaddstr(Bankw, 9, 2, " Autoteller Out of Order ");
wrefresh(Bankw);
@@ -1107,7 +1107,7 @@ void l_bank (void)
}
}
- if (State.isBankBroken() == false) clearmsg();
+ if (State.getBankBroken() == false) clearmsg();
xredraw();
}
View
18 Omega/src/command1.cpp
@@ -17,13 +17,13 @@ void p_process(void)
State.setSkipPlayer( true );
drawvision(Player.x,Player.y);
}
- if (!State.hasSkipPlayer()) {
+ if (!State.getSkipPlayer()) {
if (searchval > 0) {
searchval--;
if (searchval == 0) State.setFastMove(false);
}
drawvision(Player.x,Player.y);
- if (State.hasFastMove() == false) {
+ if (State.getFastMove() == false) {
searchval = 0;
Cmd = mgetc();
clear_if_necessary();
@@ -49,7 +49,7 @@ void p_process(void)
xredraw();
break; /* ^i */
case 11:
- if (State.isCheater()) frobgamestatus();
+ if (State.getCheater()) frobgamestatus();
break;
case 12:
xredraw();
@@ -71,10 +71,10 @@ void p_process(void)
State.setSkipMonsters();
break; /* ^r */
case 23:
- if (State.isCheater()) drawscreen();
+ if (State.getCheater()) drawscreen();
break; /* ^w */
case 24: /* ^x */
- if (State.isCheater() ||
+ if (State.getCheater() ||
Player.rank[ADEPT])
wish(1);
Command_Duration = 5;
@@ -227,7 +227,7 @@ void p_process(void)
Command_Duration = 5;
break;
case '#':
- if (State.isCheater()) editstats();
+ if (State.getCheater()) editstats();
break; /* RAC - char editor */
case '/':
charid();
@@ -386,10 +386,10 @@ void p_country_process(void)
no_op = true;
break; /* ^r */
case 23:
- if (State.isCheater()) drawscreen();
+ if (State.getCheater()) drawscreen();
break; /* ^w */
case 24:
- if (State.isCheater() ||
+ if (State.getCheater() ||
Player.rank[ADEPT]) wish(1);
break; /* ^x */
case 'd':
@@ -443,7 +443,7 @@ void p_country_process(void)
enter_site(Country[Player.x][Player.y].base_terrain_type);
break;
case '#':
- if (State.isCheater()) editstats();
+ if (State.getCheater()) editstats();
break; /* RAC - char editor */
case '/':
charid();
View
24 Omega/src/command2.cpp
@@ -173,7 +173,7 @@ void search(int *searchval)
if (Player.status[AFRAID] > 0)
print3("You are too terror-stricken to stop to search for anything.");
else {
- if (State.hasFastMove() == false) {
+ if (State.getFastMove() == false) {
State.setFastMove();
*searchval = Searchnum;
}
@@ -492,7 +492,7 @@ void upstairs(void)
else if (Level->site[Player.x][Player.y].p_locf == L_ESCALATOR)
p_movefunction(Level->site[Player.x][Player.y].p_locf);
else {
- if (State.isMounted())
+ if (State.getMounted())
print2("You manage to get your horse upstairs.");
print1("You ascend a level.");
if (Level->depth <= 1) {
@@ -515,7 +515,7 @@ void downstairs(void)
Level->site[Player.x][Player.y].p_locf == L_ENTER_COURT)
p_movefunction(Level->site[Player.x][Player.y].p_locf);
else {
- if (State.isMounted())
+ if (State.getMounted())
print2("You manage to get your horse downstairs.");
if (Current_Environment == Current_Dungeon) {
print1("You descend a level.");
@@ -925,7 +925,7 @@ void save(int force)
int pos, ok = true;
clearmsg();
- if (State.isInArena()) {
+ if (State.getInArena()) {
if (force) {
State.setInArena( false );
change_environment(E_CITY);
@@ -1050,7 +1050,7 @@ void moveplayer(int dx, int dy)
else if ((Player.maxweight < Player.itemweight) &&
random_range(2) &&
(! Player.status[LEVITATING])) {
- if (State.isMounted()) {
+ if (State.getMounted()) {
print1("Your horse refuses to carry you and your pack another step!");
print2("Your steed bucks wildly and throws you off!");
p_damage(10,UNSTOPPABLE,"a cruelly abused horse");
@@ -1083,7 +1083,7 @@ void moveplayer(int dx, int dy)
having effects from being on the Level, a kluge, but hey,... */
if (Current_Environment != E_COUNTRYSIDE) {
- if (State.hasFastMove())
+ if (State.getFastMove())
if ((Level->site[Player.x][Player.y].things != NULL) ||
(optionp(RUNSTOP) &&
loc_statusp(Player.x,Player.y,STOPS)))
@@ -1094,7 +1094,7 @@ void moveplayer(int dx, int dy)
}
}
}
- else if (State.hasFastMove()) {
+ else if (State.getFastMove()) {
drawvision(Player.x,Player.y);
State.setFastMove(false);
}
@@ -1108,7 +1108,7 @@ void movepincountry(int dx, int dy)
if ((Player.maxweight < Player.itemweight) &&
random_range(2) &&
(! Player.status[LEVITATING])) {
- if (State.isMounted()) {
+ if (State.getMounted()) {
print1("Your horse refuses to carry you and your pack another step!");
print2("Your steed bucks wildly and throws you off!");
p_damage(10,UNSTOPPABLE,"a cruelly abused horse");
@@ -1135,7 +1135,7 @@ void movepincountry(int dx, int dy)
}
}
else {
- if (State.isLost()) {
+ if (State.getLost()) {
print3("Being lost, you strike out randomly....");
morewait();
dx = random_range(3)-1;
@@ -1147,7 +1147,7 @@ void movepincountry(int dx, int dy)
else {
Player.x += dx;
Player.y += dy;
- if ((! State.isMounted())&&(Player.possessions[O_BOOTS] != NULL)) {
+ if ((! State.getMounted())&&(Player.possessions[O_BOOTS] != NULL)) {
if (Player.possessions[O_BOOTS]->usef == I_BOOTS_7LEAGUE) {
takestime = false;
if (Player.possessions[O_BOOTS]->blessing < 0) {
@@ -1165,13 +1165,13 @@ void movepincountry(int dx, int dy)
}
}
}
- if (State.isLost() && (Precipitation < 1) &&
+ if (State.getLost() && (Precipitation < 1) &&
c_statusp(Player.x, Player.y, SEEN)) {
print3("Ah! Now you know where you are!");
morewait();
State.setLost( false );
}
- else if (State.isLost()) {
+ else if (State.getLost()) {
print3("You're still lost.");
morewait();
}
View
33 Omega/src/command3.cpp
@@ -349,7 +349,7 @@ die automatically.... */
void nap(void)
{
static int naptime;
- if (State.hasFastMove()) {
+ if (State.getFastMove()) {
if (naptime-- < 1) {
clearmsg();
mprint("Yawn. You wake up.");
@@ -517,7 +517,7 @@ void charid(void)
void wizard(void)
{
State.setSkipMonsters();
- if (State.isCheater()) mprint("You're already in wizard mode!");
+ if (State.getCheater()) mprint("You're already in wizard mode!");
else {
clearmsg();
print1("You just asked to enter wizard mode.");
@@ -1038,7 +1038,7 @@ void hunt(Symbol terrain)
void dismount_steed(void)
{
MonsterList* ml;
- if (! State.isMounted())
+ if (! State.getMounted())
print3("You're on foot already!");
else if (Current_Environment == E_COUNTRYSIDE) {
if (cinema_confirm("If you leave your steed here he will wander away!")=='y')
@@ -1106,30 +1106,3 @@ void city_move(void)
}
}
}
-
-void frobgamestatus(void)
-{
- char response;
- long num;
- mprint("Set or Reset or Forget it [s,r,ESCAPE]:");
- do response = (char) mcigetc();
- while ((response != 'r') && (response != 's') && (response != ESCAPE));
- if (response == ESCAPE) {
- clearmsg();
- } else {
- num = (int) parsenum("Enter log2 of flag:");
- if (num > -1) {
- num = pow2(num);
- /*
- if (num == CHEATED) {
- mprint("Can't alter Wizard flag.");
- return;
- }
-
- if (response == 's') setgamestatus(num);
- else resetgamestatus(num);
- mprint("Done....");
- */
- }
- }
-}
View
1  Omega/src/defs.h
@@ -8,7 +8,6 @@ definitions in the following section. */
/*--------------------------USER DEFINITIONS--------------------------*/
#ifdef WIN32
-#include <windows.h>
#include <ShlObj.h>
#include <malloc.h>
View
224 Omega/src/effect1.cpp
@@ -622,227 +622,3 @@ int stolen_item(void)
return random_item();
}
-
-/* various kinds of wishes */
-void wish(int blessing)
-{
- int i;
- char wishstr[80];
- clearmsg();
- print1("What do you wish for? ");
- if (blessing < 0)
- deathprint();
- else
- strcpy(wishstr,msgscanstring());
- if (blessing < 0 || strcmp(wishstr,"Death")==0) {
- print2("As you wish, so shall it be.");
- p_death("a deathwish");
- }
- if (strcmp(wishstr,"Power")==0) {
- print2("You feel a sudden surge of energy");
- Player.mana=calcmana()*10;
- }
- else if (strcmp(wishstr,"Skill")==0) {
- print2("You feel more competent.");
- if (State.isCheater())
- gain_experience(10000);
- else
- gain_experience(min(10000,Player.xp));
- }
- else if (strcmp(wishstr,"Wealth")==0) {
- print2("You are submerged in shower of gold pieces!");
- Player.cash += 10000;
- }
- else if (strcmp(wishstr,"Balance")==0) {
- print2("You feel neutral.");
- Player.alignment = 0;
- }
- else if (strcmp(wishstr,"Chaos")==0) {
- print2("You feel chaotic.");
- Player.alignment -= 25;
- }
- else if (strcmp(wishstr,"Law")==0) {
- print2("You feel lawful.");
- Player.alignment += 25;
- }
- else if (strcmp(wishstr,"Location")==0)
- strategic_teleport(1);
- else if (strcmp(wishstr,"Knowledge")==0) {
- print2("You feel more knowledgeable.");
- i = random_range(NUMSPELLS);
- if (Spells[i].known)
- Spells[i].powerdrain =
- (max(1,Spells[i].powerdrain/2));
- else Spells[i].known = true;
- }
- else if (strcmp(wishstr,"Health")==0) {
- print2("You feel vigorous");
- Player.hp = max( Player.hp, Player.maxhp);
- Player.status[DISEASED] = 0;
- Player.status[POISONED] = 0;
- Player.food = 43;
- /* Wish for Health when starving does some good. PGM */
- }
- else if (strcmp(wishstr,"Destruction")==0)
- annihilate(State.isCheater());
- else if (strcmp(wishstr,"Acquisition")==0)
- acquire(State.isCheater());
- else if (strcmp(wishstr,"Summoning")==0)
- summon(State.isCheater(),-1);
- else if (strcmp(wishstr,"Stats") == 0 && State.isCheater())
- {
- Player.str = Player.maxstr = Player.con = Player.maxcon =
- Player.agi = Player.maxagi = Player.dex = Player.maxdex =
- Player.iq = Player.maxiq = Player.pow = Player.maxpow = 200;
- calc_melee();
- }
- else print2("You feel stupid.");
- dataprint();
- showflags();
-}
-
-/* gain for an item */
-void acquire(int blessing)
-{
- char otype;
- int index,id = ABORT;
- Object* newthing;
-
- if (blessing < 0) {
- index = random_item();
- if (index == ABORT)
- mprint("You feel fortunate.");
- else {
- print1("Smoke drifts out of your pack.... ");
- print2("Destroyed: ");
- nprint2(itemid(Player.possessions[index]));
- morewait();
- dispose_lost_objects(1,Player.possessions[index]);
- }
- }
- else {
- newthing = ((Object*) checkmalloc(sizeof(Object)));
- /* DAG this assignment looks unneccessary */
- newthing->id = -1;
- if (State.isCheater())
- print1("Acquire which kind of item: !?][}{)/=%%\\& ");
- else
- print1("Acquire which kind of item: !?][}{)/=%%\\ ");
- otype = mgetc();
- switch (otype) {
- case (POTION&0xff):
- if (blessing > 0)
- id = itemlist(POTIONID,NUMPOTIONS);
- else
- id = random_range(NUMPOTIONS);
- if (id < 0) print2("You feel stupid.");
- else make_potion(newthing,id);
- break;
- case (SCROLL&0xff):
- if (blessing > 0)
- id = itemlist(SCROLLID,NUMSCROLLS);
- else
- id = random_range(NUMSCROLLS);
- if (id < 0) print2("You feel stupid.");
- else make_scroll(newthing,id);
- break;
- case (RING&0xff):
- if (blessing > 0)
- id = itemlist(RINGID,NUMRINGS);
- else
- id = random_range(NUMRINGS);
- if (id < 0) print2("You feel stupid.");
- else make_ring(newthing,id);
- break;
- case (STICK&0xff):
- if (blessing > 0)
- id = itemlist(STICKID,NUMSTICKS);
- else
- id = random_range(NUMSTICKS);
- if (id < 0) print2("You feel stupid.");
- else make_stick(newthing,id);
- break;
- case (ARMOR&0xff):
- if (blessing > 0)
- id = itemlist(ARMORID,NUMARMOR);
- else
- id = random_range(NUMARMOR);
- if (id < 0) print2("You feel stupid.");
- else make_armor(newthing,id);
- break;
- case (SHIELD&0xff):
- if (blessing > 0)
- id = itemlist(SHIELDID,NUMSHIELDS);
- else
- id = random_range(NUMSHIELDS);
- if (id < 0) print2("You feel stupid.");
- else make_shield(newthing,id);
- break;
- case (WEAPON&0xff):
- if (blessing > 0)
- id = itemlist(WEAPONID,NUMWEAPONS);
- else
- id = random_range(NUMWEAPONS);
- if (id < 0) print2("You feel stupid.");
- else make_weapon(newthing,id);
- break;
- case (BOOTS&0xff):
- if (blessing > 0)
- id = itemlist(BOOTID,NUMBOOTS);
- else
- id = random_range(NUMBOOTS);
- if (id < 0) print2("You feel stupid.");
- else make_boots(newthing,id);
- break;
- case (CLOAK&0xff):
- if (blessing > 0)
- id = itemlist(CLOAKID,NUMCLOAKS);
- else
- id = random_range(NUMCLOAKS);
- if (id < 0) print2("You feel stupid.");
- else make_cloak(newthing,id);
- break;
- case (FOOD&0xff):
- if (blessing > 0)
- id = itemlist(FOODID,NUMFOODS);
- else
- id = random_range(NUMFOODS);
- if (id < 0) print2("You feel stupid.");
- else make_food(newthing,id);
- break;
- case (THING&0xff):
- if (blessing > 0)
- id = itemlist(THINGID,NUMTHINGS);
- else
- id = random_range(NUMTHINGS);
- if (id < 0) print2("You feel stupid.");
- else make_thing(newthing,id);
- break;
- case (ARTIFACT&0xff):
- if (State.isCheater())
- id = itemlist(ARTIFACTID,NUMARTIFACTS);
- else
- id = -1;
- if (id < 0) print2("You feel stupid.");
- else make_artifact(newthing,id);
- break;
- default:
- print2("You feel stupid.");
- }
- xredraw();
- if (id != ABORT) {
- if (blessing > 0) {
- newthing->known = 2;
- Objects[id].known = 1;
- }
- newthing->used = false;
- gain_item(newthing);
- }
- else
- {
- /* DAG newthing allocated but was not freed... was YA memory leak */
- /* use free() rather than free_obj() since newthing not initialized */
- free( (char *) newthing );
- }
- }
-}
View
10 Omega/src/effect3.cpp
@@ -572,7 +572,7 @@ void strategic_teleport(int blessing)
* as well. Seems to me that Hy Magic ought to allow it, and nothing
* else (aside from the Star Gem, of course). */
if ((Current_Environment == E_CIRCLE || Current_Environment == E_ASTRAL) &&
- !State.isCheater())
+ !State.getCheater())
{
mprint("Some property of this eerie place interferes with the magic!\n");
return;
@@ -604,7 +604,7 @@ void strategic_teleport(int blessing)
menuprint("m: Temple of Destiny\n");
menuprint("n: HellWell Volcano\n");
menuprint("o: Ruined Palace\n");
- if (State.isCheater())
+ if (State.getCheater())
menuprint("z: Anywhere\n");
menuprint("ANYTHING ELSE: Avoid entering a portal.");
showmenu();
@@ -670,13 +670,13 @@ void strategic_teleport(int blessing)
setPlayerXY( 51, 51 );
break;
default:
- if (State.isCheater()) {
+ if (State.getCheater()) {
new_env = (int) parsenum("Enter environment number: ");
change_environment(new_env);
}
}
xredraw();
- if (State.isLost()) {
+ if (State.getLost()) {
print1("You know where you are now.");
State.setLost( false );
Precipitation = 0;
@@ -709,7 +709,7 @@ void hero(int blessing)
void levitate(int blessing)
{
if (blessing > -1) {
- if (State.isMounted())
+ if (State.getMounted())
mprint("You have a strange feeling of lightness in your saddle.");
else {
mprint("You start to float a few inches above the floor.");
View
6 Omega/src/file.cpp
@@ -281,7 +281,7 @@ void save_hiscore_npc(int npc)
char buffer[80];
int i;
- if (State.isCheater())
+ if (State.getCheater())
return;
lock_score_file();
strcpy(Str1,Omegalib);
@@ -377,7 +377,7 @@ void checkhigh(char *descrip, int behavior)
if (FixedPoints > 0) points = FixedPoints;
else points = calc_points();
- if (!State.isCheater()) {
+ if (!State.getCheater()) {
if (Hiscore < points) {
strcpy(Hiscorer, Player.name);
strcpy(Hidescrip, descrip);
@@ -414,7 +414,7 @@ void extendlog(char *descrip, int lifestatus)
FILE *fd;
int npcbehavior;
- if ((Player.level > 0) && (! State.isCheater())) {
+ if ((Player.level > 0) && (! State.getCheater())) {
change_to_game_perms();
npcbehavior=fixnpc(lifestatus);
checkhigh(descrip,npcbehavior);
View
4 Omega/src/gen1.cpp
@@ -547,7 +547,7 @@ void cavern_level(void)
straggle_corridor(fx,fy,tx,ty,WATER,RS_PONDS);
}
if (Current_Dungeon == E_CAVES) {
- if ((Level->depth == CAVELEVELS) && (State.hasCompletedCaves() == false)) {
+ if ((Level->depth == CAVELEVELS) && (State.getCompletedCaves() == false)) {
findspace(&tx,&ty,-1);
Level->mlist = ((MonsterList*) checkmalloc(sizeof(MonsterList)));
Level->mlist->next = NULL;
@@ -605,7 +605,7 @@ void sewer_level(void)
sewer_corridor(l+e,t+e,1,1,lchar);
}
if (Current_Dungeon == E_SEWERS) {
- if ((Level->depth == SEWERLEVELS) && (State.hasCompletedSewers() == false)) {
+ if ((Level->depth == SEWERLEVELS) && (State.getCompletedSewers() == false)) {
findspace(&tx,&ty,-1);
Level->mlist = ((MonsterList*) checkmalloc(sizeof(MonsterList)));
Level->mlist->next = NULL;
View
6 Omega/src/gen2.cpp
@@ -332,7 +332,7 @@ void room_level(void)
}
}
else if (Current_Environment == E_VOLCANO) {
- if (Level->depth == VOLCANOLEVELS && !State.hasCompletedVolcano()) {
+ if (Level->depth == VOLCANOLEVELS && !State.getCompletedVolcano()) {
findspace(&tx,&ty,-1);
Level->mlist = ((MonsterList*) checkmalloc(sizeof(MonsterList)));
Level->mlist->next = NULL;
@@ -483,7 +483,7 @@ void maze_level (void)
Level->site[tx][ty].locchar = STAIRS_DOWN;
}
- if (State.hasCompletedAstral() == false)
+ if (State.getCompletedAstral() == false)
{
findspace(&tx, &ty, -1);
Level->mlist = (MonsterList*) checkmalloc(sizeof(MonsterList));
@@ -498,7 +498,7 @@ void maze_level (void)
}
else if (E_VOLCANO == Current_Environment)
{
- if (VOLCANOLEVELS == Level->depth && !State.hasCompletedVolcano())
+ if (VOLCANOLEVELS == Level->depth && !State.getCompletedVolcano())
{
findspace(&tx, &ty, -1);
Level->mlist = (MonsterList*) checkmalloc(sizeof(MonsterList));
View
4 Omega/src/guild2.cpp
@@ -1012,7 +1012,7 @@ void l_order(void)
morewait();
if ((Player.rank[ORDER]==PALADIN) &&
(Player.level > Justiciarlevel) &&
- State.hasGivenStargem() &&
+ State.getGivenStargem() &&
Player.alignment > 300) {
print1("You have succeeded in your quest!");
morewait();
@@ -1085,7 +1085,7 @@ void l_order(void)
}
} else {
print1("'Welcome back, Paladin.'");
- if (!State.isMounted()) {
+ if (!State.getMounted()) {
print2("You are given a new steed.");
State.setMounted( true );
}
View
16 Omega/src/move.cpp
@@ -7,7 +7,7 @@
/* various miscellaneous location functions */
void l_water(void)
{
- if (! State.isMounted()) {
+ if (! State.getMounted()) {
if ((Player.possessions[O_ARMOR] != NULL)) {
print1("Your heavy armor drags you under the water!");
morewait();
@@ -55,7 +55,7 @@ void l_water(void)
void l_chaos(void)
{
- if (State.isMounted()) {
+ if (State.getMounted()) {
print1("Your steed tries to swim in the raw Chaos, but seems to");
print2("be having some difficulties...");
morewait();
@@ -137,7 +137,7 @@ void l_hedge(void)
void l_lava(void)
{
print1("Very clever -- walking into a pool of lava...");
- if (State.isMounted()) {
+ if (State.getMounted()) {
print2("Your horse is incinerated... You fall in too!");
State.setMounted(false);
}
@@ -158,7 +158,7 @@ void l_lava(void)
void l_fire(void)
{
print1("You boldly stride through the curtain of fire...");
- if (State.isMounted()) {
+ if (State.getMounted()) {
print2("Your horse is fried and so are you...");
State.setMounted(false);
}
@@ -298,7 +298,7 @@ void l_magic_pool(void)
{
int possibilities=random_range(100);
print1("This pool seems to be enchanted....");
- if (State.isMounted()) {
+ if (State.getMounted()) {
if (random_range(2)) {
print2("Your horse is polymorphed into a fig newton.");
State.setMounted(false);
@@ -736,7 +736,7 @@ void l_void_station(void)
print2("Your disrupted essence merges with the megaflow.");
p_death("the Power of the Void");
}
- else if (!State.hasPreparedVoid()) {
+ else if (!State.getPreparedVoid()) {
print1("The hungry void swallows you whole!");
print2("Your being dissipates with a pathetic little sigh....");
p_death("the Emptyness of the Void");
@@ -972,8 +972,8 @@ void l_enter_court(void)
{
print1("You have found a magical portal! Enter it? [yn] ");
if (ynq1()=='y') {
- if (State.hasCompletedCastle() == false) {
- if (State.hasAttackedOracle() == false) {
+ if (State.getCompletedCastle() == false) {
+ if (State.getAttackedOracle() == false) {
print2("A dulcet voice says: 'Jolly good show!'");
morewait();
}
View
4 Omega/src/movef.cpp
@@ -103,7 +103,7 @@ void p_movefunction(int movef)
break;
}
else if ((! Player.status[LEVITATING]) ||
- State.isMounted() ||
+ State.getMounted() ||
(Cmd == '@') || /* @ command activates all effects under player */
(movef < LEVITATION_AVOIDANCE)) {
if (movef != L_NO_OP) {
@@ -521,7 +521,7 @@ void sign_print(int x, int y, int signp)
case L_CONDO:
if (signp) {
print1("You notice a sign:");
- if (State.hasPurchasedCondo())
+ if (State.getPurchasedCondo())
print2("Home Sweet Home");
else print2("Luxury Condominium For Sale; Inquire Within");
}
View
6 Omega/src/pdump.cpp
@@ -368,7 +368,7 @@ short dump_possessions( FILE *dumpfile )
if ( !dump_pack( dumpfile ) )
return false;
- if ( State.hasPurchasedCondo() )
+ if ( State.getPurchasedCondo() )
{
if ( !dump_condo( dumpfile ) )
return false;
@@ -863,7 +863,7 @@ short dump_options( FILE *dumpfile )
if ( !dump( dumpfile, "\n-- Cheats --\n\n", false ) )
return false;
- if ( State.isCheater() )
+ if ( State.getCheater() )
{
if ( !dump( dumpfile, "Entered Wizard Mode\n", true ) )
return false;
@@ -906,7 +906,7 @@ short dump_basic( FILE *dumpfile )
return false;
curcol = sprintf( dump_buf, "Name : %s\n", Player.name );
- if ( State.isCheater() )
+ if ( State.getCheater() )
{
if ( 72 > strlen( dump_buf ) )
cp = strrchr( dump_buf, '\n' );
View
6 Omega/src/save.cpp
@@ -799,13 +799,13 @@ void restore_level(FILE *fd, int version)
load_house(Level->environment, 0);
break;
case E_DLAIR:
- load_dlair(State.hasKilledDragonlord(), 0);
+ load_dlair(State.getKilledDragonlord(), 0);
break;
case E_STARPEAK:
- load_speak(State.hasKilledLawbringer(), 0);
+ load_speak(State.getKilledLawbringer(), 0);
break;
case E_MAGIC_ISLE:
- load_misle(State.hasKilledEater(), 0);
+ load_misle(State.getKilledEater(), 0);
break;
case E_TEMPLE:
load_temple(Country[LastCountryLocX][LastCountryLocY].aux, false);
View
26 Omega/src/scr.cpp
@@ -27,6 +27,8 @@ WINDOW *Cinema;
WINDOW *Showline[MAXITEMS];
+WINDOW *Wizlistw;
+
#define SL3_LEN 160
char screenLine3[SL3_LEN];
@@ -363,7 +365,7 @@ void erase_level(void)
/* direct print to first msg line */
void print1(const char *s)
{
- if (! State.hasSuppressPrinting()) {
+ if (! State.getSuppressPrinting()) {
buffercycle(s);
wclear(Msg1w);
wprintw(Msg1w,s);
@@ -374,7 +376,7 @@ void print1(const char *s)
/* for run on-messages -- print1 clears first.... */
void nprint1(char *s)
{
- if (! State.hasSuppressPrinting()) {
+ if (! State.getSuppressPrinting()) {
if (bufferappend(s)) {
wprintw(Msg1w,s);
wrefresh(Msg1w);
@@ -385,7 +387,7 @@ void nprint1(char *s)
/* direct print to second msg line */
void print2(char *s)
{
- if (! State.hasSuppressPrinting()) {
+ if (! State.getSuppressPrinting()) {
buffercycle(s);
wclear(Msg2w);
wprintw(Msg2w,s);
@@ -396,7 +398,7 @@ void print2(char *s)
/* for run on-messages -- print2 clears first.... */
void nprint2(char *s)
{
- if (! State.hasSuppressPrinting()) {
+ if (! State.getSuppressPrinting()) {
if (bufferappend(s)) {
wprintw(Msg2w,s);
wrefresh(Msg2w);
@@ -412,7 +414,7 @@ void nprint2(char *s)
* things can use. */
void print3 (char *s)
{
- if (!State.hasSuppressPrinting())
+ if (!State.getSuppressPrinting())
{
buffercycle(s);
erasemsg3();
@@ -425,7 +427,7 @@ void print3 (char *s)
/* for run on-messages -- print3 clears first.... */
void nprint3(char *s)
{
- if (!State.hasSuppressPrinting())
+ if (!State.getSuppressPrinting())
{
if (bufferappend(s))
{
@@ -443,7 +445,7 @@ it should morewait and clear window */
void mprint(char *s)
{
int x,y;
- if (! State.hasSuppressPrinting()) {
+ if (! State.getSuppressPrinting()) {
getyx(Msgw,y,x);
if (x+strlen(s) >= ScreenWidth) {
buffercycle(s);
@@ -539,6 +541,10 @@ void initgraf(void)
Bankw = newwin( 20, 50, ( ScreenLength - 20 ) / 2 + 3, 7 );
scrollok( Bankw, 0 );
+ // Wiz flag list window
+ Wizlistw = newwin( 20, 50, 3, 0 );
+ scrollok( Wizlistw, 0 );
+
Locw = newwin(1,80,ScreenLength+3,0);
scrollok(Locw, 0);
Levelw = newwin(ScreenLength,ScreenWidth,3,0);
@@ -880,7 +886,7 @@ void drawvision(int x, int y)
drawmonsters(false); /* erase all monsters */
drawmonsters(true); /* draw those now visible */
}
- if ((State.hasFastMove() == false) || (! optionp(JUMPMOVE)))
+ if ((State.getFastMove() == false) || (! optionp(JUMPMOVE)))
omshowcursor(Player.x,Player.y);
oldx = x;
oldy = y;
@@ -1214,7 +1220,7 @@ void morewait(void)
{
int display=true;
int c;
- if (State.hasSuppressPrinting())
+ if (State.getSuppressPrinting())
return;
do {
wclear(Morew);
@@ -1718,7 +1724,7 @@ void showflags(void)
wprintw(Flagw,"Diseased\n");
else wprintw(Flagw,"Healthy\n");
- if (State.isMounted()) wprintw(Flagw,"Mounted\n");
+ if (State.getMounted()) wprintw(Flagw,"Mounted\n");
else if (Player.status[LEVITATING]) wprintw(Flagw,"Levitating\n");
else wprintw(Flagw,"Afoot\n");
View
2  Omega/src/site1.cpp
@@ -80,7 +80,7 @@ void l_club(void)
char response;
print1("Rampart Explorers' Club.");
- if (!State.isExplorerClubMember()) {
+ if (!State.getExplorerClubMember()) {
if (Player.level < 2) print3("Only reknowned adventurers need apply.");
else {
print2("Dues are 100Au. Pay it? [yn] ");
View
24 Omega/src/site2.cpp
@@ -10,7 +10,7 @@ void l_condo(void)
int i,done=false,over=false,weeksleep=false;
char response;
- if (!State.hasPurchasedCondo()) {
+ if (!State.getPurchasedCondo()) {
response = cinema_interact
("rp","Rampart Arms. Weekly Condo Rentals and Purchases",
"Which are you interested in [r,p, or ESCAPE] ",
@@ -247,7 +247,7 @@ void send_to_jail(void)
print2("Your name is expunged from the records....");
Player.rank[ORDER] = -1;
}
- else if (State.hasDestroyedOrder())
+ else if (State.getDestroyedOrder())
print1("The destruction of the Order of Paladins has negated the law!");
else if ((Current_Environment != E_CITY) &&
(Last_Environment != E_CITY))
@@ -264,7 +264,7 @@ void send_to_jail(void)
State.setSuppressPrinting( false );
}
if (Current_Environment == E_CITY) {
- if (State.hasUndeadGuards()) {
+ if (State.getUndeadGuards()) {
print1("You are taken to a weirdly deserted chamber where an undead");
print2("Magistrate presides over a court of ghosts and haunts.");
morewait();
@@ -347,7 +347,7 @@ void send_to_jail(void)
void l_adept(void)
{
print1("You see a giant shimmering gate in the form of an omega.");
- if (State.hasAttackedOracle() == false) {
+ if (State.getAttackedOracle() == false) {
if (Player.str+Player.con+Player.iq+Player.pow < 100)
print2("A familiar female voice says: I would not advise this now....");
else print2("A familiar female voice says: Go for it!");
@@ -657,7 +657,7 @@ void l_countryside(void)
void l_oracle(void)
{
char response;
- if (State.hasAttackedOracle() && (State.hasCompletedAstral() == false)) {
+ if (State.getAttackedOracle() && (State.getCompletedAstral() == false)) {
print1("You come before a blue crystal dais. You see a broken mirror.");
print2("Look in the mirror? [yn] ");
if (ynq2()=='y') {
@@ -687,19 +687,19 @@ void l_oracle(void)
}
else {
print2("She stares at you...and speaks:");
- if (State.hasSpokeToDruid() == false) {
+ if (State.getSpokeToDruid() == false) {
print3("'The ArchDruid speaks wisdom in his forest shrine.'");
}
- else if ( State.hasCompletedCaves() == false ) {
+ else if ( State.getCompletedCaves() == false ) {
print3("'Thou mayest find aught of interest in the caves to the South.'");
}
- else if (State.hasCompletedSewers() == false) {
+ else if (State.getCompletedSewers() == false) {
print3("'Turn thy attention to the abyssal depths of the city.'");
}
- else if (State.hasCompletedCastle() == false) {
+ else if (State.getCompletedCastle() == false) {
print3("'Explorest thou the depths of the Castle of the ArchMage.'");
}
- else if (State.hasCompletedAstral() == false) {
+ else if (State.getCompletedAstral() == false) {
morewait();
print1("'Journey to the Astral Plane and meet the Gods' servants.'");
print2("The oracle holds out her hand. Do you take it? [yn] ");
@@ -717,10 +717,10 @@ void l_oracle(void)
}
else print3("You detect the hint of a sneer from the oracle.");
}
- else if (State.hasCompletedVolcano() == false) {
+ else if (State.getCompletedVolcano() == false) {
print3("'The infernal maw may yield its secrets to thee now.'");
}
- else if (State.hasCompletedChallenge() == false) {
+ else if (State.getCompletedChallenge() == false) {
print3("'The challenge of adepthood yet awaits thee.'");
}
else {
View
4 Omega/src/time.cpp
@@ -31,12 +31,12 @@ void time_clock(int reset)
env = Current_Environment;
while ((Tick == Player.click) && (Current_Environment != E_COUNTRYSIDE) &&
Current_Environment == env) {
- if (!State.hasSkipPlayer())
+ if (!State.getSkipPlayer())
do {
State.setSkipMonsters(false);
if ((! Player.status[SLEPT]) &&
(Current_Environment != E_COUNTRYSIDE)) p_process();
- } while (State.hasSkipMonsters() &&
+ } while (State.getSkipMonsters() &&
(Current_Environment != E_COUNTRYSIDE));
else State.setSkipPlayer( false );
Player.click = (Player.click + Command_Duration) % 60;
View
20 Omega/src/trap.cpp
@@ -19,7 +19,7 @@ void l_trap_siren(void)
clearmsg();
if ((Current_Environment == E_HOUSE) ||
(Current_Environment == E_MANSION)) {
- if (! State.hasDestroyedOrder()) {
+ if (! State.getDestroyedOrder()) {
print1("The city guard arrives!");
print2("You are apprehended....");
morewait();
@@ -50,7 +50,7 @@ void l_trap_dart(void)
{
Level->site[Player.x][Player.y].locchar = TRAP;
lset(Player.x, Player.y, CHANGED);
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("A dart annoys your horse....");
}
else if (random_range(100) < Player.absorption)
@@ -70,7 +70,7 @@ void l_trap_pit(void)
{
Level->site[Player.x][Player.y].locchar = TRAP;
lset(Player.x, Player.y, CHANGED);
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("Your horse stumbles into a pit and breaks a leg!");
morewait();
mprint("You are forced to put it out of its misery.");
@@ -99,7 +99,7 @@ void l_trap_door(void)
else {
Level->site[Player.x][Player.y].locchar = TRAP;
lset(Player.x, Player.y, CHANGED);
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("You and your horse fall through a trap door!");
morewait();
mprint("Your horse breaks its back. Snif.");
@@ -135,7 +135,7 @@ void l_trap_snare(void)
{
Level->site[Player.x][Player.y].locchar = TRAP;
lset(Player.x, Player.y, CHANGED);
- if (State.isMounted())
+ if (State.getMounted())
mprint("Your horse steps out of a snare trap.");
else if (random_range(100) < Player.agi)
mprint("You agilely avoid a snare.");
@@ -152,7 +152,7 @@ void l_trap_blade(void)
if (random_range(30) < Player.agi+Player.level)
mprint("You duck under a scything blade!");
else {
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("Your horse is struck by a scything blade and killed instantly.");
morewait();
State.setMounted(false);
@@ -170,7 +170,7 @@ void l_trap_blade(void)
void l_trap_fire(void)
{
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("Your horse is struck by a blast of fire and is charbroiled!");
morewait();
State.setMounted(false);
@@ -204,7 +204,7 @@ void l_trap_disintegrate(void)
lset(Player.x, Player.y, CHANGED);
mprint("Oh, no! A disintegration trap!");
morewait();
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("Your horse falls apart into its component atoms...");
morewait();
State.setMounted(false);
@@ -233,7 +233,7 @@ void l_trap_acid(void)
if (Player.agi+Player.level < random_range(100)) {
mprint("You are drenched by a spray of acid!");
morewait();
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("Your horse dies unpleasantly.");
morewait();
State.setMounted(false);
@@ -258,7 +258,7 @@ void l_trap_abyss(void)
{
Level->site[Player.x][Player.y].locchar = ABYSS;
lset(Player.x, Player.y, CHANGED);
- if (State.isMounted()) {
+ if (State.getMounted()) {
mprint("You and your horse fall into the infinite abyss!");
morewait();
l_abyss();
View
18 Omega/src/util.cpp
@@ -447,15 +447,15 @@ long calc_points(void)
int i;
long points=0;
- if (State.hasSpokeToDruid()) points += 50;
- if (State.hasCompletedCaves()) points += 100;
- if (State.hasCompletedSewers()) points += 200;
- if (State.hasCompletedCastle()) points += 300;
- if (State.hasCompletedAstral()) points += 400;
- if (State.hasCompletedVolcano()) points += 500;
- if (State.hasKilledDragonlord()) points += 100;
- if (State.hasKilledEater()) points += 100;
- if (State.hasKilledLawbringer()) points += 100;
+ if (State.getSpokeToDruid()) points += 50;
+ if (State.getCompletedCaves()) points += 100;
+ if (State.getCompletedSewers()) points += 200;
+ if (State.getCompletedCastle()) points += 300;
+ if (State.getCompletedAstral()) points += 400;
+ if (State.getCompletedVolcano()) points += 500;
+ if (State.getKilledDragonlord()) points += 100;
+ if (State.getKilledEater()) points += 100;
+ if (State.getKilledLawbringer()) points += 100;
points += Player.xp/50;
View
351 Omega/src/wiz.cpp
@@ -0,0 +1,351 @@
+/* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */
+/* wiz.cpp */
+/* various wizard and omegan adept functions */
+
+#include "glob.h"
+
+/* window for wizard flag list in scr.cpp */
+extern WINDOW *Wizlistw;
+extern GameState State;
+