diff --git a/gameSource/LivingLifePage.cpp b/gameSource/LivingLifePage.cpp index fb8a9431..18e18c89 100644 --- a/gameSource/LivingLifePage.cpp +++ b/gameSource/LivingLifePage.cpp @@ -2631,7 +2631,9 @@ void LivingLifePage::useOnSelf() { sprintf( msg, "SELF %d %d %d#", x, y, -1 ); setNextActionMessage( msg, x, y ); - if( getObject( ourLiveObject->holdingID )->foodValue > 0) + // this is for eatEverything mode + // not sure if these two condition are redundant + if( getObject( ourLiveObject->holdingID )->foodValue > 0 || holdingYumOrMeh ) nextActionEating = true; } diff --git a/gameSource/objectBank.cpp b/gameSource/objectBank.cpp index 5e7045bc..de178419 100644 --- a/gameSource/objectBank.cpp +++ b/gameSource/objectBank.cpp @@ -55,6 +55,8 @@ static SimpleVector allPossibleDeathMarkerIDs; static SimpleVector allPossibleFoodIDs; +static SimpleVector allPossibleNonPermanentIDs; + static SimpleVector tapoutRecords; @@ -1124,6 +1126,10 @@ float initObjectBankStep() { allPossibleFoodIDs.push_back( r->id ); } + if( ! r->permanent ) { + allPossibleNonPermanentIDs.push_back( r->id ); + } + next++; @@ -2445,6 +2451,7 @@ static void freeObjectRecord( int inID ) { deathMarkerObjectIDs.deleteElementEqualTo( inID ); allPossibleDeathMarkerIDs.deleteElementEqualTo( inID ); allPossibleFoodIDs.deleteElementEqualTo( inID ); + allPossibleNonPermanentIDs.deleteElementEqualTo( inID ); if( race <= MAX_RACE ) { racePersonObjectIDs[ race ].deleteElementEqualTo( inID ); @@ -2534,6 +2541,7 @@ void freeObjectBank() { deathMarkerObjectIDs.deleteAll(); allPossibleDeathMarkerIDs.deleteAll(); allPossibleFoodIDs.deleteAll(); + allPossibleNonPermanentIDs.deleteAll(); for( int i=0; i<= MAX_RACE; i++ ) { racePersonObjectIDs[i].deleteAll(); @@ -3435,6 +3443,7 @@ int addObject( const char *inDescription, deathMarkerObjectIDs.deleteElementEqualTo( newID ); allPossibleDeathMarkerIDs.deleteElementEqualTo( newID ); allPossibleFoodIDs.deleteElementEqualTo( newID ); + allPossibleNonPermanentIDs.deleteElementEqualTo( newID ); if( r->deathMarker ) { deathMarkerObjectIDs.push_back( newID ); @@ -4659,6 +4668,12 @@ SimpleVector *getAllPossibleFoodIDs() { +SimpleVector *getAllPossibleNonPermanentIDs() { + return &allPossibleNonPermanentIDs; +} + + + ObjectRecord **getAllObjects( int *outNumResults ) { SimpleVector records; diff --git a/gameSource/objectBank.h b/gameSource/objectBank.h index 15bb0f5b..60bf0e86 100644 --- a/gameSource/objectBank.h +++ b/gameSource/objectBank.h @@ -745,6 +745,8 @@ SimpleVector *getAllPossibleDeathIDs(); // does NOT included use dummies SimpleVector *getAllPossibleFoodIDs(); +// NOT destroyed or modified by caller +SimpleVector *getAllPossibleNonPermanentIDs(); diff --git a/server/cravings.cpp b/server/cravings.cpp index 4a9a076e..b2d7ecd3 100644 --- a/server/cravings.cpp +++ b/server/cravings.cpp @@ -11,6 +11,8 @@ Craving noCraving = { -1, -1, 0 }; +int eatEverythingModeEnabled = 0; + @@ -48,6 +50,11 @@ static Craving getRandomFood( int inLineageMaxFoodDepth, SimpleVector *allFoods = getAllPossibleFoodIDs(); + if( eatEverythingModeEnabled ) { + // everything can be eaten + allFoods = getAllPossibleNonPermanentIDs(); + } + SimpleVector possibleFoods; if( inLineageMaxFoodDepth > 0 ) { diff --git a/server/cravings.h b/server/cravings.h index f03136e5..6ff3ed02 100644 --- a/server/cravings.h +++ b/server/cravings.h @@ -9,6 +9,8 @@ typedef struct Craving { extern Craving noCraving; +extern int eatEverythingModeEnabled; + Craving getCravedFood( int inLineageEveID, int inPlayerGenerationNumber, diff --git a/server/server.cpp b/server/server.cpp index 291a2a8d..9a70348e 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -154,6 +154,8 @@ static int canYumChainBreak = 0; static double minAgeForCravings = 10; +static int eatEverythingMode = 0; + // static double posseSizeSpeedMultipliers[4] = { 0.75, 1.25, 1.5, 2.0 }; @@ -6081,7 +6083,7 @@ static char isYummy( LiveObject *inPlayer, int inObjectID ) { o = getObject( inObjectID ); } - if( o->foodValue == 0 ) { + if( o->foodValue == 0 && ! eatEverythingMode ) { return false; } @@ -6111,7 +6113,7 @@ static char isReallyYummy( LiveObject *inPlayer, int inObjectID ) { o = getObject( inObjectID ); } - if( o->foodValue == 0 ) { + if( o->foodValue == 0 && ! eatEverythingMode ) { return false; } @@ -7085,6 +7087,11 @@ int processLoggedInPlayer( char inAllowReconnect, minAgeForCravings = SettingsManager::getDoubleSetting( "minAgeForCravings", 10 ); + eatEverythingMode = SettingsManager::getIntSetting( "eatEverythingMode", 0 ); + + // change the setting from cravings + eatEverythingModeEnabled = eatEverythingMode; + numConnections ++; @@ -18483,7 +18490,7 @@ int main() { ObjectRecord *obj = getObject( nextPlayer->holdingID ); - if( obj->foodValue > 0 ) { + if( obj->foodValue > 0 || eatEverythingMode ) { holdingFood = true; if( strstr( obj->description, "noFeeding" ) @@ -18960,7 +18967,7 @@ int main() { } // next case, holding food // that couldn't be put into clicked clothing - else if( (obj->foodValue > 0 || obj->bonusValue > 0) && + else if( (obj->foodValue > 0 || obj->bonusValue > 0 || eatEverythingMode) && (targetPlayer->foodStore < cap || strstr( obj->description, "modTool")) && ! couldHaveGoneIn ) { @@ -18973,7 +18980,13 @@ int main() { targetPlayer->lastAteFillMax = targetPlayer->foodStore; - targetPlayer->foodStore += obj->foodValue; + if ( eatEverythingMode ) { + // set the sustenance of everything to 1 + targetPlayer->foodStore += 1; + } + else { + targetPlayer->foodStore += obj->foodValue; + } updateYum( targetPlayer, obj->id, targetPlayer == nextPlayer ); diff --git a/server/settings/eatEverythingMode.ini b/server/settings/eatEverythingMode.ini new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/server/settings/eatEverythingMode.ini @@ -0,0 +1 @@ +0