Skip to content

Commit

Permalink
Merge branch 'jasonrohrer-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbz committed Jan 4, 2019
2 parents 0b15d6e + 2356bf6 commit de5cb0b
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 16 deletions.
20 changes: 20 additions & 0 deletions documentation/changeLog.txt
Expand Up @@ -3,6 +3,26 @@ This file only list changes to game code. Changes to content can be found here:
http://onehouronelife.com/updateLog.php


Version 188 2019-January-4

--Fixed swap of baskets with different numbers of items in a larger container.
Fixes #184

--Fixed tutorial wording to avoid confusion about Eve. Fixes #185

--Min age for default actions (open door, rouse bear) now 3. Fixes #186

--On reconnect, don't clear home markers unless we see a new player ID.
Fixes #188

--/DIE command no longer blocks crafting hints for DIE when older than 2.
Fixes #189

--Tutorial button on main menu page (appears after you beat tutorial).
Fixes #190




Version 187 2019-January-3

Expand Down
17 changes: 17 additions & 0 deletions gameSource/ExistingAccountPage.cpp
Expand Up @@ -58,6 +58,8 @@ ExistingAccountPage::ExistingAccountPage()
translate( "postReviewButton" ) ),
mRedetectButton( mainFont, 0, 198, translate( "redetectButton" ) ),
mViewAccountButton( mainFont, 0, 64, translate( "view" ) ),
mTutorialButton( mainFont, 522, 300,
translate( "tutorial" ) ),
mPageActiveStartTime( 0 ),
mFramesCounted( 0 ),
mFPSMeasureDone( false ),
Expand Down Expand Up @@ -90,6 +92,7 @@ ExistingAccountPage::ExistingAccountPage()
setButtonStyle( &mPasteButton );
setButtonStyle( &mRedetectButton );
setButtonStyle( &mViewAccountButton );
setButtonStyle( &mTutorialButton );

setButtonStyle( &mDisableCustomServerButton );

Expand All @@ -112,6 +115,7 @@ ExistingAccountPage::ExistingAccountPage()
addComponent( &mDisableCustomServerButton );

addComponent( &mViewAccountButton );
addComponent( &mTutorialButton );

mLoginButton.addActionListener( this );
mFriendsButton.addActionListener( this );
Expand All @@ -128,6 +132,7 @@ ExistingAccountPage::ExistingAccountPage()
mRedetectButton.addActionListener( this );

mViewAccountButton.addActionListener( this );
mTutorialButton.addActionListener( this );

mDisableCustomServerButton.addActionListener( this );

Expand Down Expand Up @@ -179,6 +184,15 @@ void ExistingAccountPage::showDisableCustomServerButton( char inShow ) {

void ExistingAccountPage::makeActive( char inFresh ) {

if( SettingsManager::getIntSetting( "tutorialDone", 0 ) ) {
mTutorialButton.setVisible( true );
}
else {
// tutorial forced anyway
mTutorialButton.setVisible( false );
}


mFramesCounted = 0;
mPageActiveStartTime = game_getCurrentTime();
mFPSMeasureDone = false;
Expand Down Expand Up @@ -303,6 +317,9 @@ void ExistingAccountPage::actionPerformed( GUIComponent *inTarget ) {
if( inTarget == &mLoginButton ) {
processLogin( true, "done" );
}
else if( inTarget == &mTutorialButton ) {
processLogin( true, "tutorial" );
}
else if( inTarget == &mClearAccountButton ) {
SettingsManager::setSetting( "email", "" );
SettingsManager::setSetting( "accountKey", "" );
Expand Down
2 changes: 2 additions & 0 deletions gameSource/ExistingAccountPage.h
Expand Up @@ -72,6 +72,8 @@ class ExistingAccountPage : public GamePage, public ActionListener {

TextButton mViewAccountButton;

TextButton mTutorialButton;


double mPageActiveStartTime;
int mFramesCounted;
Expand Down
20 changes: 16 additions & 4 deletions gameSource/LivingLifePage.cpp
Expand Up @@ -180,6 +180,10 @@ typedef struct {

static SimpleVector<HomePos> homePosStack;

// used on reconnect to decide whether to delete old home positions
static int lastPlayerID = -1;



// returns pointer to record, NOT destroyed by caller, or NULL if
// home unknown
Expand Down Expand Up @@ -13782,6 +13786,12 @@ void LivingLifePage::step() {

ourID = ourObject->id;

if( ourID != lastPlayerID ) {
// different ID than last time, delete home markers
homePosStack.deleteAll();
}
lastPlayerID = ourID;

// we have no measurement yet
ourObject->lastActionSendStartTime = 0;
ourObject->lastResponseTimeDelta = 0;
Expand Down Expand Up @@ -16610,7 +16620,6 @@ void LivingLifePage::makeActive( char inFresh ) {
nextActionMessageToSend = NULL;
}

homePosStack.deleteAll();

for( int i=0; i<NUM_HOME_ARROWS; i++ ) {
mHomeArrowStates[i].solid = false;
Expand Down Expand Up @@ -19071,7 +19080,9 @@ void LivingLifePage::keyDown( unsigned char inASCII ) {

if( strstr( typedText, filterCommand ) == typedText ) {
// starts with filter command


LiveObject *ourLiveObject = getOurLiveObject();

int emotIndex = getEmotionIndex( typedText );

if( emotIndex != -1 ) {
Expand All @@ -19083,8 +19094,9 @@ void LivingLifePage::keyDown( unsigned char inASCII ) {
}
else if( strstr( typedText,
translate( "dieCommand" ) )
== typedText ) {
// die command issued
== typedText &&
computeCurrentAge( ourLiveObject ) < 2 ) {
// die command issued from baby
char *message =
autoSprintf( "DIE 0 0#" );

Expand Down
18 changes: 15 additions & 3 deletions gameSource/game.cpp
@@ -1,4 +1,4 @@
int versionNumber = 187;
int versionNumber = 188;
int dataVersionNumber = 0;
int clientVersionNumber = versionNumber;
int expectedVersionNumber = 0;
Expand Down Expand Up @@ -1814,7 +1814,7 @@ void drawFrame( char inUpdate ) {
currentGamePage = twinPage;
currentGamePage->base_makeActive( true );
}
else if( existingAccountPage->checkSignal( "done" )
else if( existingAccountPage->checkSignal( "done" )
||
mapPullMode || autoLogIn ) {

Expand All @@ -1829,7 +1829,19 @@ void drawFrame( char inUpdate ) {
delete [] userTwinCode;
userTwinCode = NULL;
}


startConnecting();
}
else if( existingAccountPage->checkSignal( "tutorial" ) ) {
livingLifePage->runTutorial();

// tutorial button clears twin status
// they have to login from twin page to play as twin
if( userTwinCode != NULL ) {
delete [] userTwinCode;
userTwinCode = NULL;
}

startConnecting();
}
else if( autoUpdatePage->checkSignal( "relaunchFailed" ) ) {
Expand Down
4 changes: 2 additions & 2 deletions gameSource/languages/English.txt
Expand Up @@ -11,7 +11,7 @@ vsyncWarning3 "GRAPHICS CARD CONTROL PANEL CAN FIX THIS"
vsyncContinueMessage "PRESS Y TO CONTINUE WITHOUT VSYNC OR ESC TO QUIT"


fpsErrorLogin "ERROR: FPS MISMATCH DETECTED. VSYNC CHANGED?##MEASURED %0.1f FPS, EXPECTING %d FPS"
fpsErrorLogin "ERROR: FPS MISMATCH DETECTED.##VSYNC CHANGED? MEASURED %0.1f FPS, EXPECTING %d FPS"



Expand Down Expand Up @@ -423,7 +423,7 @@ tutorial_17 "PRESS [ENTER] AND TYPE, AND THEN PRESS [ENTER] AGAIN TO SPEAK.##YOU

tutorial_18 "PRESS [ENTER] TO SPEAK AGAIN, OR PRESS [UP ARROW] AND##[DOWN ARROW] TO CYCLE THROUGH PREVIOUSLY SPOKEN PHRASES."

tutorial_19 "SAY I AM JONES TO SET YOUR LAST NAME AS EVE.##MOUSE OVER YOURSELF TO SEE YOUR NAME."
tutorial_19 "SAY I AM JONES TO SET YOUR LAST NAME.##MOUSE OVER YOURSELF TO SEE YOUR NAME."

tutorial_1921 "SAY YOU ARE SALLY TO SET THE FIRST NAME OF YOUR HELD BABY.##(TRY IT LATER, WHEN YOU HAVE A BABY IN THE GAME.)"

Expand Down
25 changes: 18 additions & 7 deletions server/server.cpp
Expand Up @@ -84,6 +84,10 @@ int minPickupBabyAge = 10;

int babyAge = 5;

// age when bare-hand actions become available to a baby (opening doors, etc.)
int defaultActionAge = 3;


double forceDeathAge = age_death;


Expand Down Expand Up @@ -1790,7 +1794,7 @@ char isFertileAge( LiveObject *inPlayer ) {

int computeFoodCapacity( LiveObject *inPlayer ) {
int ageInYears = lrint( computeAge( inPlayer ) );

int returnVal = 0;

if( ageInYears < (age_old + 4) ) {
Expand All @@ -1799,7 +1803,7 @@ int computeFoodCapacity( LiveObject *inPlayer ) {
ageInYears = 16;
}

return ageInYears + 4;
returnVal = ageInYears + 4;
}
else {
// food capacity decreases as we near age_death
Expand All @@ -1809,7 +1813,7 @@ int computeFoodCapacity( LiveObject *inPlayer ) {
cap = 4;
}

return cap;
returnVal = cap;
}

return ceil( returnVal * inPlayer->foodCapModifier );
Expand Down Expand Up @@ -5407,7 +5411,7 @@ static char addHeldToContainer( LiveObject *inPlayer,
numInNow );

if( bottomNum != topNum ) {
same = true;
same = false;
}
else {
for( int b=0; b<bottomNum; b++ ) {
Expand Down Expand Up @@ -9606,6 +9610,9 @@ int main() {
target );
}

double playerAge = computeAge( nextPlayer );


if( r != NULL && containmentTransfer ) {
// special case contained items
// moving from actor into new target
Expand All @@ -9628,9 +9635,13 @@ int main() {
else if( r != NULL &&
// are we old enough to handle
// what we'd get out of this transition?
( r->newActor == 0 ||
getObject( r->newActor )->minPickupAge <=
computeAge( nextPlayer ) )
( ( r->newActor == 0 &&
playerAge >= defaultActionAge )
||
( r->newActor > 0 &&
getObject( r->newActor )->minPickupAge
<=
playerAge ) )
&&
// does this create a blocking object?
// only consider vertical-blocking
Expand Down

0 comments on commit de5cb0b

Please sign in to comment.