Benutzerinformationen überspringen
Wohnort: http://goo.gl/bwF1X
Ingame-Name: Formeo [DE]
Renommeemodifikator: 11
Benutzerinformationen überspringen
Wohnort: http://goo.gl/bwF1X
Ingame-Name: Formeo [DE]
Renommeemodifikator: 11
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »KingteE :] [GER]« (19. Juni 2012, 17:17)
Zitat
[...] die dateien die ich bearbeitet hab (player.h, character.cpp ...) [...]
Zitat
Hast du die auch in "puplic:" erstellt?
C++ Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #ifndef GAME_SERVER_PLAYER_H #define GAME_SERVER_PLAYER_H // this include should perhaps be removed #include "entities/character.h" #include "gamecontext.h" // player object class CPlayer { MACRO_ALLOC_POOL_ID() public: CPlayer(CGameContext *pGameServer, int ClientID, int Team); ~CPlayer(); void Init(int CID); void TryRespawn(); void Respawn(); void SetTeam(int Team); int GetTeam() const { return m_Team; }; int GetCID() const { return m_ClientID; }; void Tick(); void PostTick(); void Snap(int SnappingClient); void OnDirectInput(CNetObj_PlayerInput *NewInput); void OnPredictedInput(CNetObj_PlayerInput *NewInput); void OnDisconnect(const char *pReason); void KillCharacter(int Weapon = WEAPON_GAME); CCharacter *GetCharacter(); //--------------------------------------------------------- // this is used for snapping so we know how we can clip the view for the player vec2 m_ViewPos; // states if the client is chatting, accessing a menu etc. int m_PlayerFlags; // used for snapping to just update latency if the scoreboard is active int m_aActLatency[MAX_CLIENTS]; // used for spectator mode int m_SpectatorID; bool m_IsReady; // int m_Vote; int m_VotePos; // int m_LastVoteCall; int m_LastVoteTry; int m_LastChat; int m_LastSetTeam; int m_LastSetSpectatorMode; int m_LastChangeInfo; int m_LastEmote; int m_LastKill; // TODO: clean this up struct { char m_SkinName[64]; int m_UseCustomColor; int m_ColorBody; int m_ColorFeet; } m_TeeInfos; int m_RespawnTick; int m_DieTick; int m_Score; int m_ScoreStartTick; bool m_ForceBalanced; int m_LastActionTick; int m_TeamChangeTick; struct { int m_TargetX; int m_TargetY; } m_LatestActivity; //@ $$Killer$$ int m_Bee; int m_Bear; int m_Parsite; int m_Chameleon; int m_Vulture; int m_Turtle; int m_Bull; int m_Spider; int m_Snake; //@ $$Killer$$ - End // network latency calculations struct { int m_Accum; int m_AccumMin; int m_AccumMax; int m_Avg; int m_Min; int m_Max; } m_Latency; private: CCharacter *m_pCharacter; CGameContext *m_pGameServer; CGameContext *GameServer() const { return m_pGameServer; } IServer *Server() const; // bool m_Spawning; int m_ClientID; int m_Team; }; #endif |
C++ Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
//Deins case WEAPON_SHOTGUN: { int ShotSpread = 2; if(m_pPlayer->Bear = 1) int ShotSpread = 9; CMsgPacker Msg(NETMSGTYPE_SV_EXTRAPROJECTILE); Msg.AddInt(ShotSpread*2+1); for(int i = -ShotSpread; i <= ShotSpread; ++i) { float Spreading = (float)i * 0.1; // Das musst du machen, damit jedes Projektil um 0.1 Grad gekrümmt wird. float a = GetAngle(Direction); a += Spreading; // Und da 'Spreading' kein Array mehr ist, brauchst du auch keine [] mehr. float v = 1-(absolute(i)/(float)ShotSpread); float Speed = mix((float)GameServer()->Tuning()->m_ShotgunSpeeddiff, 1.0f, v); CProjectile *pProj = new CProjectile(GameWorld(), WEAPON_SHOTGUN, m_pPlayer->GetCID(), ProjStartPos, vec2(cosf(a), sinf(a))*Speed, (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_ShotgunLifetime), 1, isExplosive, 0, -1, WEAPON_SHOTGUN); // pack the Projectile and send it to the client Directly CNetObj_Projectile p; pProj->FillInfo(&p); for(unsigned i = 0; i < sizeof(CNetObj_Projectile)/sizeof(int); i++) Msg.AddInt(((int *)&p)); } Server()->SendMsg(&Msg, 0,m_pPlayer->GetCID()); GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE); } break; |
C++ Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
//Meins case WEAPON_SHOTGUN: { bool isExplosive = false; // <--- Die Variable hattest du garnicht. int ShotSpread = 2; if(m_pPlayer->m_Bear = 1) //<--- m_Bear und nicht Bear. ShotSpread = 9; //<--- wurde bereits initialisiert CMsgPacker Msg(NETMSGTYPE_SV_EXTRAPROJECTILE); Msg.AddInt(ShotSpread*2+1); for(int i = -ShotSpread; i <= ShotSpread; ++i) { float Spreading = (float)i * 0.1; // Das musst du machen, damit jedes Projektil um 0.1 Grad gekrümmt wird. float a = GetAngle(Direction); a += Spreading; // Und da 'Spreading' kein Array mehr ist, brauchst du auch keine [] mehr. float v = 1-(absolute(i)/(float)ShotSpread); float Speed = mix((float)GameServer()->Tuning()->m_ShotgunSpeeddiff, 1.0f, v); CProjectile *pProj = new CProjectile(GameWorld(), WEAPON_SHOTGUN, m_pPlayer->GetCID(), ProjStartPos, vec2(cosf(a), sinf(a))*Speed, (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_ShotgunLifetime), 1, isExplosive, 0, -1, WEAPON_SHOTGUN); // pack the Projectile and send it to the client Directly CNetObj_Projectile p; pProj->FillInfo(&p); for(unsigned i = 0; i < sizeof(CNetObj_Projectile)/sizeof(int); i++) Msg.AddInt(((int *)&p)[i]); } Server()->SendMsg(&Msg, 0,m_pPlayer->GetCID()); GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE); } break; |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »KingteE :] [GER]« (20. Juni 2012, 13:00)
Benutzer, die sich für diesen Beitrag bedankt haben:
Tim (19.06.2012)
Benutzerinformationen überspringen
Wohnort: Österreich, Steiermark, Leibnitz
Beruf: Schüler ._.
Ingame-Name: FrØgH
Clan: //w®a*
Renommeemodifikator: 10
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »KingteE :] [GER]« (20. Juni 2012, 13:16)