00001
00002
00003
00004
00005
00006
00007
00008
00009 @class Team;
00010
00011 #import <Cocoa/Cocoa.h>
00012 #import "Ship.h"
00013 #import "Team.h"
00014 #import "PlayerStats.h"
00015 #import "Entity.h"
00016
00017
00018 #define PLAYER_FREE 0
00019 #define PLAYER_OUTFIT 1
00020 #define PLAYER_ALIVE 2
00021 #define PLAYER_EXPLODE 3
00022 #define PLAYER_DEAD 4
00023
00024 #define PLAYER_MAX_NR_OF_PLAYERS 16
00025
00026 #define PLAYER_SHIELD 0x00000001
00027 #define PLAYER_REPAIR 0x00000002
00028 #define PLAYER_BOMB 0x00000004
00029 #define PLAYER_ORBIT 0x00000008
00030 #define PLAYER_CLOAK 0x00000010
00031 #define PLAYER_WEP 0x00000020
00032 #define PLAYER_ENG 0x00000040
00033 #define PLAYER_ROBOT 0x00000080
00034 #define PLAYER_BEAMUP 0x00000100
00035 #define PLAYER_BEAMDOWN 0x00000200
00036 #define PLAYER_SELFDEST 0x00000400
00037 #define PLAYER_GREEN 0x00000800
00038 #define PLAYER_YELLOW 0x00001000
00039 #define PLAYER_RED 0x00002000
00040 #define PLAYER_PLOCK 0x00004000 // Locked on a player
00041 #define PLAYER_PLLOCK 0x00008000 // Locked on a planet
00042 #define PLAYER_COPILOT 0x00010000 // Allow copilots
00043 #define PLAYER_WAR 0x00020000 // computer reprogramming for war
00044 #define PLAYER_PRACTR 0x00040000 // practice type robot (no kills)
00045 #define PLAYER_DOCK 0x00080000 // true if docked to a starbase
00046 #define PLAYER_REFIT 0x00100000 // true if about to refit
00047 #define PLAYER_REFITTING 0x00200000 // true if currently refitting
00048 #define PLAYER_TRACT 0x00400000 // tractor beam activated
00049 #define PLAYER_PRESS 0x00800000 // pressor beam activated
00050 #define PLAYER_DOCKOK 0x01000000 // docking permission
00051 #define PLAYER_OBSERV 0x8000000 // observer
00052 #define PLAYER_CLOAK_PHASES 16
00053
00054 @interface Player : Entity {
00055 int playerId;
00056 Ship *ship;
00057 Team *team;
00058 NSMutableArray *torps;
00059 PlayerStats *stats;
00060 NSString *mapChars;
00061 int previousStatus;
00062 int status;
00063 int previousFlags;
00064 int flags;
00065 NSString *name;
00066 NSString *login;
00067 NSString *monitor;
00068
00069 int damage;
00070 int shield;
00071 int cloakphase;
00072 int ntorp;
00073 int nplasmatorp;
00074 int hostile;
00075 int swar;
00076 int kills;
00077 Planet *planet;
00078 id playerLock;
00079 int armies;
00080 int fuel;
00081 int explode;
00082 int etemp;
00083 int wtemp;
00084 int whydead;
00085 int whodead;
00086 id tractor;
00087
00088 bool me;
00089 }
00090
00091 - (id) initWithPlayerId:(int)player;
00092
00093 - (Planet*) planetLock;
00094 - (void) setPlanetLock:(Planet *)planetInLock;
00095 - (id) playerLock;
00096 - (void) setPlayerLock:(id) playerInLock;
00097 - (int) previousStatus;
00098 - (void) setPreviousStatus:(int) status;
00099 - (int) previousFlags;
00100 - (void) setPreviousFlags:(int) flags;
00101 - (NSString *) mapChars;
00102 - (NSString *) statusString;
00103 - (bool)isMe;
00104 - (int) status;
00105 - (int) flags;
00106 - (int) playerId;
00107 - (int) damage;
00108 - (int) kills;
00109 - (int) phaserId;
00110 - (int) plasmaId;
00111 - (int) hostile;
00112 - (int) armies;
00113 - (int) maxArmiesForKills;
00114 - (Player *) tractorTarget;
00115 - (int) stickyWar;
00116 - (Team*)team;
00117 - (Ship*)ship;
00118 - (PlayerStats *) stats;
00119 - (int)wins;
00120 - (int)losses;
00121 - (int) maxSpeed;
00122 - (int) shield;
00123 - (int)maxKills;
00124 - (NSString *) mapCharsWithKillIndicator;
00125 - (NSString*)nameWithRank;
00126 - (NSString*)longNameWithKillIndicator;
00127 - (NSString*)longName;
00128 - (NSString*)name;
00129 - (NSMutableArray*) torps;
00130 - (int) hull;
00131 - (int) fuel;
00132 - (int) speed;
00133 - (int) engineTemp;
00134 - (int) weaponTemp;
00135 - (int) maxArmies;
00136 - (int) maxTorps;
00137 - (int) maxPhaserShots;
00138 - (int) availableTorps;
00139 - (int) availablePhaserShots;
00140 - (void) setShip:(Ship *)ship;
00141 - (void) setKills:(int)kill;
00142 - (void) setTeam:(Team *)team;
00143 - (void) setFlags:(int)newFlags;
00144 - (void) setStickyWar:(int)newSWar;
00145 - (void) setHostile:(int)newhostile;
00146 - (void) setName:(NSString*)name;
00147 - (void) setLogin:(NSString*)login;
00148 - (void) setMonitor:(NSString*)monitor;
00149 - (void) setStatus:(int)newStatus;
00150 - (void) setExplode:(int)newExplode;
00151 - (void) setTorps:(NSMutableArray*) newTorps;
00152 - (void) setPlasmaCount:(int)nrOfPlasmas;
00153 - (void) setTorpCount:(int)nrOfTorps;
00154 - (void) setIsMe:(bool)newMe;
00155 - (void) setTractorTarget:(Player *)new;
00156
00157 - (int) cloakPhase;
00158 - (void) increaseCloakPhase;
00159 - (void) decreaseCloakPhase;
00160 - (void) increaseTorpCount;
00161 - (void) decreaseTorpCount;
00162 - (void) increasePlasmaCount;
00163 - (void) decreasePlasmaCount;
00164 - (bool) friendlyToPlayer:(Player*) player;
00165
00166
00167 - (void) updateHostile: (int) newhostile
00168 stickyWar: (int) newSWar
00169 armies: (int) newArmies
00170 flags: (int) newFlags
00171 damage: (int) newDamage
00172 shieldStrenght: (int) newShield
00173 fuel: (int) newFuel
00174 engineTemp: (int) newETemp
00175 weaponsTemp: (int) newWTemp
00176 whyDead: (int) newWhyDead
00177 whoKilledMe: (int) newWhoDead
00178 thisIsMe: (bool) newIsMe;
00179
00180 - (void) updateHostile: (int) newhostile
00181 stickyWar: (int) newSWar
00182 armies: (int) newArmies
00183 flags: (int) newFlags
00184 whyDead: (int) newWhyDead
00185 whoKilledMe: (int) newWhoDead
00186 thisIsMe: (bool) newIsMe;
00187
00188 - (void) updateDamage: (int) newDamage
00189 shieldStrenght: (int) newShield
00190 fuel: (int) newFuel
00191 engineTemp: (int) newETemp
00192 weaponsTemp: (int) newWTemp
00193 thisIsMe: (bool) newIsMe;
00194
00195
00196 @end