00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PARTY_H
00019 #define PARTY_H
00020
00021 #include <iostream>
00022 #include <string>
00023 #include "constants.h"
00024 #include "map.h"
00025 #include "calendar.h"
00026 #include "rpg/character.h"
00027 #include "rpg/monster.h"
00028 #include "rpg/rpgitem.h"
00029 #include "events/thirsthungerevent.h"
00030
00031 using namespace std;
00032
00033 class Session;
00034
00035 class Party {
00036 private:
00037
00038 Session *session;
00039 Creature *player;
00040 Creature *party[MAX_PARTY_SIZE];
00041 bool partyDead;
00042 bool player_only;
00043 Uint32 playerMoved;
00044 int formation;
00045 Calendar * calendar;
00046 bool startRound;
00047 int partySize;
00048 Creature *savedPlayer;
00049 bool savedPlayerOnly;
00050 int storylineIndex;
00051
00052 static Creature *lastPlayer;
00053
00054 Creature *loadedParty[MAX_PARTY_SIZE];
00055 int loadedCount;
00056
00057 public:
00058
00059 Party(Session *session);
00060 virtual ~Party();
00061
00062 inline Uint32 getPlayerMoved() { return playerMoved; }
00063 inline void setPlayerMoved() { playerMoved = SDL_GetTicks(); }
00064 inline void clearPlayerMoved() { playerMoved = 0; }
00065
00066 inline int getStorylineIndex() { return storylineIndex; }
00067
00068 void reset();
00069 void resetMultiplayer(Creature *c);
00070
00071 void deleteParty();
00072
00073 inline Calendar *getCalendar() { return calendar; }
00074
00075 inline Creature *getPlayer() { return player; }
00076
00077 void setPlayer(int n);
00078
00079 void setPartyMotion(int motion);
00080
00081 void setFormation(int formation);
00082
00083 inline int getFormation() { return formation; }
00084
00085 inline Creature *getParty(int i) { return party[i]; }
00086
00087
00088 void setSelXY( Uint16 mapx, Uint16 mapy );
00089 void movePlayers();
00090
00091
00092
00093 bool switchToNextLivePartyMember();
00094
00095 void togglePlayerOnly(bool keepTargets = false);
00096
00097 void forceStopRound();
00098 void toggleRound(bool test);
00099 void toggleRound();
00100 inline bool isRealTimeMode() { return startRound; }
00101
00102 void startPartyOnMission();
00103
00104 void setFirstLivePlayer();
00105
00106 void followTargets();
00107
00108 void setTargetCreature(Creature *creature);
00109 inline bool isPartyDead() { return partyDead; }
00110 inline bool isPlayerOnly() { return player_only; }
00111 inline int getPartySize() { return partySize; }
00112
00113 int getTotalLevel();
00114
00118 Creature *getClosestPlayer(int x, int y, int w, int h, int radius);
00119
00120 void startEffect(int effect_type, int duration=Constants::DAMAGE_DURATION);
00121
00122 static void createHardCodedParty(Session *session, Creature **party, int *partySize);
00123
00124 void savePlayerSettings();
00125 void restorePlayerSettings();
00126
00127 void setParty(int count, Creature **creatures, int storylineIndex);
00128
00129 bool isEquipped( Item *item );
00130
00131 protected:
00132 void resetPartyUI();
00133 };
00134
00135 #endif