Skip to content

Commit

Permalink
Waiting period for single-player killer now 12 seconds (was 6). Posse…
Browse files Browse the repository at this point in the history
… kill waiting period shorter with each new member (2 wait 6 seconds, 3 wait 3 seconds, 4 wait 1.5 seconds, etc.)
  • Loading branch information
jasonrohrer committed Feb 7, 2020
1 parent d2ceb57 commit 34c5232
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
5 changes: 5 additions & 0 deletions documentation/changeLog.txt
Expand Up @@ -73,6 +73,11 @@ Version 309 ???

--Your twin sibs no longer count toward your genetic score. Fixes #530

--Waiting period for single-player killer now 12 seconds (was 6).

--Posse kill waiting period shorter with each new member (2 wait 6 seconds,
3 wait 3 seconds, 4 wait 1.5 seconds, etc.)




Expand Down
34 changes: 31 additions & 3 deletions server/server.cpp
Expand Up @@ -7148,6 +7148,11 @@ static void makeOffspringSayMarker( int inPlayerID, int inIDToSkip ) {



static double killDelayTime = 12.0;

static double posseDelayReductionFactor = 2.0;



// for placement of tutorials out of the way
static int maxPlacementX = 5000000;
Expand Down Expand Up @@ -7340,6 +7345,19 @@ int processLoggedInPlayer( char inAllowReconnect,



foodScaleFactor =
SettingsManager::getFloatSetting( "foodScaleFactor", 1.0 );


killDelayTime =
SettingsManager::getFloatSetting( "killDelayTime", 12.0 );


posseDelayReductionFactor =
SettingsManager::getFloatSetting( "posseDelayReductionFactor", 2.0 );




numConnections ++;

Expand Down Expand Up @@ -10718,7 +10736,6 @@ int readIntFromFile( const char *inFileName, int inDefaultValue ) {
}


double killDelayTime = 6.0;


typedef struct KillState {
Expand All @@ -10728,6 +10745,7 @@ typedef struct KillState {
double killStartTime;
double emotStartTime;
int emotRefreshSeconds;
int posseSize;
} KillState;


Expand Down Expand Up @@ -11562,6 +11580,8 @@ static void updatePosseSize( LiveObject *inTarget,

if( s->targetID == inTarget->id ) {
int killerID = s->killerID;

s->posseSize = p;

LiveObject *o = getLiveObject( killerID );

Expand Down Expand Up @@ -11676,7 +11696,8 @@ char addKillState( LiveObject *inKiller, LiveObject *inTarget,
inTarget->id,
curTime,
curTime,
30 };
30,
1 };

if( isNoWaitWeapon( inKiller->holdingID ) ) {
// allow it to happen right now
Expand Down Expand Up @@ -20310,7 +20331,14 @@ int main() {

double curTime = Time::getCurrentTime();

if( curTime - s->killStartTime > killDelayTime &&
// vary delay based on posse size
double delay = killDelayTime;
if( posseDelayReductionFactor > 0 && s->posseSize > 1 ) {
delay /=
pow( posseDelayReductionFactor, s->posseSize - 1 );
}

if( curTime - s->killStartTime > delay &&
getObject( killer->holdingID )->deadlyDistance >= dist &&
! directLineBlocked( playerPos, targetPos ) ) {
// enough warning time has passed
Expand Down
1 change: 1 addition & 0 deletions server/settings/killDelayTime.ini
@@ -0,0 +1 @@
12.0
1 change: 1 addition & 0 deletions server/settings/posseDelayReductionFactor.ini
@@ -0,0 +1 @@
2

0 comments on commit 34c5232

Please sign in to comment.