mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 15:21:54 +00:00
o Removed an animation debug setting from Balance.txt
o Made map view and enthier propagated before game start so that the map is fully viewable o PGs and IPs now apply a pushback instead of telefragging o Ghost structures: Placing a structure will flag it as ghosted till it's been starting building. Untill then, aliens can destroy it by touching it. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@387 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
d320c7006b
commit
959b74445d
10 changed files with 107 additions and 8 deletions
|
@ -75,7 +75,7 @@
|
||||||
#define kCommanderPlayerSpeed 4000
|
#define kCommanderPlayerSpeed 4000
|
||||||
#define kCustomIconColorLength 3
|
#define kCustomIconColorLength 3
|
||||||
#define kCustomIconNameLength 5
|
#define kCustomIconNameLength 5
|
||||||
#define kDebugAnimations 1
|
#define kDebugAnimations 0
|
||||||
#define kDebugServerCaching 1
|
#define kDebugServerCaching 1
|
||||||
#define kDebugShowEntityLog 1
|
#define kDebugShowEntityLog 1
|
||||||
#define kDefenseChamberBuildTime 20
|
#define kDefenseChamberBuildTime 20
|
||||||
|
|
|
@ -187,6 +187,23 @@ void AvHBaseBuildable::BuildableTouch(CBaseEntity* inEntity)
|
||||||
if(inEntity->pev->team != this->pev->team)
|
if(inEntity->pev->team != this->pev->team)
|
||||||
{
|
{
|
||||||
this->Uncloak();
|
this->Uncloak();
|
||||||
|
|
||||||
|
// GHOSTBUILDING: Destroy and return res.
|
||||||
|
if (this->mGhost && inEntity->IsAlive() && inEntity->IsPlayer())
|
||||||
|
{
|
||||||
|
this->TakeDamage(inEntity->pev, this->pev, 80000, DMG_GENERIC);
|
||||||
|
|
||||||
|
AvHTeam* theTeam = GetGameRules()->GetTeam(AvHTeamNumber(this->pev->team));
|
||||||
|
|
||||||
|
if (theTeam)
|
||||||
|
{
|
||||||
|
float thePercentage = .8f;
|
||||||
|
float thePointsBack = GetGameRules()->GetCostForMessageID(this->mMessageID) * thePercentage;
|
||||||
|
theTeam->SetTeamResources(theTeam->GetTeamResources() + thePointsBack);
|
||||||
|
|
||||||
|
AvHSUPlayNumericEventAboveStructure(thePointsBack, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,6 +281,13 @@ void AvHBaseBuildable::ConstructUse( CBaseEntity *pActivator, CBaseEntity *pCall
|
||||||
this->SetNormalizedBuildPercentage(thePercentage);
|
this->SetNormalizedBuildPercentage(thePercentage);
|
||||||
|
|
||||||
theSuccess = true;
|
theSuccess = true;
|
||||||
|
|
||||||
|
// GHOSTBUILD: Manifest structure.
|
||||||
|
pev->renderamt = 255;
|
||||||
|
pev->rendermode = kRenderNormal;
|
||||||
|
pev->solid = SOLID_BBOX;
|
||||||
|
this->mGhost = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -852,6 +876,10 @@ void AvHBaseBuildable::InternalSetConstructionComplete(bool inForce)
|
||||||
this->pev->rendermode = kRenderNormal;
|
this->pev->rendermode = kRenderNormal;
|
||||||
this->pev->renderamt = 255;
|
this->pev->renderamt = 255;
|
||||||
|
|
||||||
|
// GHOSTBUILD: Ensure that finished buildings aren't ghosted.
|
||||||
|
this->mGhost = false;
|
||||||
|
this->pev->solid = SOLID_BBOX;
|
||||||
|
|
||||||
this->SetHasBeenBuilt();
|
this->SetHasBeenBuilt();
|
||||||
|
|
||||||
this->SetActive();
|
this->SetActive();
|
||||||
|
@ -932,6 +960,14 @@ void AvHBaseBuildable::Spawn()
|
||||||
|
|
||||||
if(this->pev->spawnflags & 1)
|
if(this->pev->spawnflags & 1)
|
||||||
this->SetConstructionComplete(true);
|
this->SetConstructionComplete(true);
|
||||||
|
|
||||||
|
// GHOSTBUILD: Mark as unmanifested if it's a marine structure.
|
||||||
|
if (!this->GetIsOrganic())
|
||||||
|
{
|
||||||
|
pev->renderamt = 170;
|
||||||
|
pev->rendermode = kRenderTransTexture;
|
||||||
|
this->mGhost = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -957,6 +993,7 @@ int AvHBaseBuildable::GetSequenceForBoundingBox() const
|
||||||
void AvHBaseBuildable::Materialize()
|
void AvHBaseBuildable::Materialize()
|
||||||
{
|
{
|
||||||
this->pev->solid = SOLID_BBOX;
|
this->pev->solid = SOLID_BBOX;
|
||||||
|
|
||||||
this->pev->movetype = this->GetMoveType();
|
this->pev->movetype = this->GetMoveType();
|
||||||
|
|
||||||
this->pev->classname = MAKE_STRING(this->mClassName);
|
this->pev->classname = MAKE_STRING(this->mClassName);
|
||||||
|
|
|
@ -255,6 +255,8 @@ private:
|
||||||
float mTimeRecycleDone;
|
float mTimeRecycleDone;
|
||||||
|
|
||||||
bool mKilled;
|
bool mKilled;
|
||||||
|
|
||||||
|
bool mGhost;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -143,7 +143,6 @@ void AvHEntityHierarchy::BuildFromTeam(const AvHTeam* inTeam, BaseEntityListType
|
||||||
// Loop through all entities in the world
|
// Loop through all entities in the world
|
||||||
for(BaseEntityListType::iterator theIter = inBaseEntityList.begin(); theIter != inBaseEntityList.end(); theIter++)
|
for(BaseEntityListType::iterator theIter = inBaseEntityList.begin(); theIter != inBaseEntityList.end(); theIter++)
|
||||||
{
|
{
|
||||||
|
|
||||||
CBaseEntity* theBaseEntity = *theIter;
|
CBaseEntity* theBaseEntity = *theIter;
|
||||||
|
|
||||||
int theEntityIndex = theBaseEntity->entindex();
|
int theEntityIndex = theBaseEntity->entindex();
|
||||||
|
|
|
@ -2450,7 +2450,9 @@ void AvHHud::ResetGame(bool inMapChanged)
|
||||||
|
|
||||||
// Selection and commander variables
|
// Selection and commander variables
|
||||||
this->mNumLocalSelectEvents = 0;
|
this->mNumLocalSelectEvents = 0;
|
||||||
this->mMapMode = MAP_MODE_UNDEFINED;
|
// Removed to allow map to be shown before gamestart.
|
||||||
|
// The map-mode will be re-set by the Gamestate messages anyway.
|
||||||
|
//this->mMapMode = MAP_MODE_UNDEFINED;
|
||||||
this->mInTopDownMode = false;
|
this->mInTopDownMode = false;
|
||||||
this->mLeftMouseStarted = false;
|
this->mLeftMouseStarted = false;
|
||||||
this->mLeftMouseEnded = false;
|
this->mLeftMouseEnded = false;
|
||||||
|
|
|
@ -1281,7 +1281,8 @@ void AvHPhaseGate::TeleportUse(CBaseEntity *pActivator, CBaseEntity *pCaller, US
|
||||||
this->SetTimeOfLastDeparture(gpGlobals->time);
|
this->SetTimeOfLastDeparture(gpGlobals->time);
|
||||||
AvHSUPlayPhaseInEffect(theFlags, this, thePlayer);
|
AvHSUPlayPhaseInEffect(theFlags, this, thePlayer);
|
||||||
|
|
||||||
AvHSUKillPlayersTouchingPlayer(thePlayer, this->pev);
|
// AvHSUKillPlayersTouchingPlayer(thePlayer, this->pev);
|
||||||
|
AvHSUPushbackPlayersTouchingPlayer(thePlayer, this->pev);
|
||||||
KillBuildablesTouchingPlayer(thePlayer, this->pev);
|
KillBuildablesTouchingPlayer(thePlayer, this->pev);
|
||||||
|
|
||||||
Vector theFadeColor;
|
Vector theFadeColor;
|
||||||
|
@ -1813,7 +1814,8 @@ void AvHInfantryPortal::ResetReinforcingPlayer(bool inSuccess)
|
||||||
|
|
||||||
if(theTelefrag)
|
if(theTelefrag)
|
||||||
{
|
{
|
||||||
AvHSUKillPlayersTouchingPlayer(thePlayer, this->pev);
|
//AvHSUKillPlayersTouchingPlayer(thePlayer, this->pev);
|
||||||
|
AvHSUPushbackPlayersTouchingPlayer(thePlayer, this->pev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -854,6 +854,17 @@ void AvHOverviewMap::UpdateDrawData(float inCurrentTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* cl_entity_t* clientEntity = gEngfuncs.GetEntityByIndex(theLocalPlayerIndex);
|
||||||
|
if(clientEntity)
|
||||||
|
{
|
||||||
|
DrawableEntity theDrawableEntity;
|
||||||
|
theDrawableEntity.mX = clientEntity->origin.x;
|
||||||
|
theDrawableEntity.mY = clientEntity->origin.y;
|
||||||
|
theDrawableEntity.mAngleRadians = clientEntity->angles[1] * M_PI / 180;
|
||||||
|
this->mDrawableEntityList.push_back(theDrawableEntity);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
std::sort(mDrawableEntityList.begin(), mDrawableEntityList.end(), DrawingOrderSort());
|
std::sort(mDrawableEntityList.begin(), mDrawableEntityList.end(), DrawingOrderSort());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9812,7 +9812,10 @@ void AvHPlayer::UpdateEntityHierarchy()
|
||||||
|
|
||||||
AvHTeam* theTeam = player->GetTeamPointer();
|
AvHTeam* theTeam = player->GetTeamPointer();
|
||||||
|
|
||||||
if(theTeam && GetGameRules()->GetGameStarted())
|
// Removed the check for gamestart. This ensures that the entity-hierarchy is propagated before
|
||||||
|
// game start.
|
||||||
|
//if((theTeam) && GetGameRules()->GetGameStarted())
|
||||||
|
if((theTeam)) // && GetGameRules()->GetGameStarted())
|
||||||
{
|
{
|
||||||
if (theTeam->GetTeamType() == AVH_CLASS_TYPE_MARINE ||
|
if (theTeam->GetTeamType() == AVH_CLASS_TYPE_MARINE ||
|
||||||
theTeam->GetTeamType() == AVH_CLASS_TYPE_ALIEN)
|
theTeam->GetTeamType() == AVH_CLASS_TYPE_ALIEN)
|
||||||
|
|
|
@ -302,6 +302,48 @@ void AvHSUKillPlayersTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor)
|
||||||
END_FOR_ALL_ENTITIES(kAvHPlayerClassName)
|
END_FOR_ALL_ENTITIES(kAvHPlayerClassName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvHSUPushbackPlayersTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor)
|
||||||
|
{
|
||||||
|
FOR_ALL_ENTITIES(kAvHPlayerClassName, AvHPlayer*)
|
||||||
|
if((theEntity != inPlayer) && (theEntity->GetIsRelevant()))
|
||||||
|
{
|
||||||
|
// tankefugl: 0000892 -- fixed to allow spawnkilling of crouching players on IP
|
||||||
|
float theDistanceToPlayer = VectorDistance(inPlayer->pev->origin, theEntity->pev->origin);
|
||||||
|
float zDistance = inPlayer->pev->origin[2] - theEntity->pev->origin[2];
|
||||||
|
float xyDistance = VectorDistance2D(inPlayer->pev->origin, theEntity->pev->origin);
|
||||||
|
if(theDistanceToPlayer < 30 || (xyDistance < 30 && zDistance > 0 && zDistance < 40))
|
||||||
|
{
|
||||||
|
vec3_t theDirection;
|
||||||
|
// If distance == 0, generate a random direction.
|
||||||
|
if (xyDistance < 0.1f)
|
||||||
|
{
|
||||||
|
theDirection[0] = RANDOM_FLOAT(-1, 1);
|
||||||
|
theDirection[1] = RANDOM_FLOAT(-1, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VectorSubtract(inPlayer->pev->origin, theEntity->pev->origin, theDirection);
|
||||||
|
}
|
||||||
|
theDirection[2] = 0;
|
||||||
|
VectorNormalize(theDirection);
|
||||||
|
|
||||||
|
// Project the speed orthogonal to the direction to the spawning player
|
||||||
|
// proj n a = (n . a)/||n||^2 * n
|
||||||
|
float n_dot_a = DotProduct(theDirection, theEntity->pev->velocity);
|
||||||
|
vec3_t parallelVec;
|
||||||
|
VectorScale(theDirection, n_dot_a, parallelVec);
|
||||||
|
VectorSubtract(theEntity->pev->velocity, theDirection, theEntity->pev->velocity);
|
||||||
|
|
||||||
|
// Apply a pushback velocity away from the spawning player
|
||||||
|
VectorScale(theDirection, -200, theDirection);
|
||||||
|
theDirection[2] = 150;
|
||||||
|
|
||||||
|
VectorAdd(theEntity->pev->velocity, theDirection, theEntity->pev->velocity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END_FOR_ALL_ENTITIES(kAvHPlayerClassName)
|
||||||
|
}
|
||||||
|
|
||||||
void AvHSUBuildingJustCreated(AvHMessageID inBuildID, CBaseEntity* theBuilding, AvHPlayer* inPlayer)
|
void AvHSUBuildingJustCreated(AvHMessageID inBuildID, CBaseEntity* theBuilding, AvHPlayer* inPlayer)
|
||||||
{
|
{
|
||||||
if((inBuildID == BUILD_RESOURCES) || (inBuildID == ALIEN_BUILD_RESOURCES))
|
if((inBuildID == BUILD_RESOURCES) || (inBuildID == ALIEN_BUILD_RESOURCES))
|
||||||
|
|
|
@ -136,6 +136,7 @@ bool AvHSUGetIsValidAuthID(const string& inAuthID);
|
||||||
string AvHSUGetPlayerAuthIDString(edict_t* inPlayer);
|
string AvHSUGetPlayerAuthIDString(edict_t* inPlayer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void AvHSUPushbackPlayersTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
|
||||||
void AvHSUKillPlayersTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
|
void AvHSUKillPlayersTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
|
||||||
void AvHSUKillBuildablesTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
|
void AvHSUKillBuildablesTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
|
||||||
void AvHSUBuildingJustCreated(AvHMessageID inBuildID, CBaseEntity* theBuilding, AvHPlayer* inPlayer);
|
void AvHSUBuildingJustCreated(AvHMessageID inBuildID, CBaseEntity* theBuilding, AvHPlayer* inPlayer);
|
||||||
|
|
Loading…
Reference in a new issue