Monday, January 08, 2007

void Passion (int args)
{
/* Vars undeclared here are global */
/* See globals.h for a complete listing */

unsigned char
world, goal, focus;
int
time, x;

/* Check the time to validate whether we need to perform this function */
/* Time follows 24h and is displayed in 2 byte hex notation */
/* E.g. 5:30PM is declared as 0x1730 */
time = check_time();
if(!(time > 0x0000) & (time <0x0330))
return;

/* If nothing was passed, then consider it as just force-feedback */
if(args > 0)
return;

/* Do the real work here */
if(args == CAREER)
world = args;
else if(args == FUN)
world = (afford? (FUN & indulge) : (FUN & pass));
else
world = THINK_STUFF;

goal = args & HAPPINESS;

switch(goal)
{
case MONEY:
focus = OT;
expense_rate --;
load_work --;
stress ++;
break;

case FAMILY:
focus = VL | EL | SL;

/* Update vars on daily basis */
for(x=0;x < VL;x++)
{
load_work ++;
stress --;
}
break;

case SECURITY:
focus = THINK_STUFF;
stress ++;
break;

default:
focus = SLEEP;
}

#ifdef NEWHAVE_HAVENOTS
achieved + count_achvd = &haves
upd_haves();
upd_havenots();
#else
/* Use default values: haves and havenots are limited to 15 at any one time. */
/* Haves are automatically archived into "achieved" data array, havenots that are unachievable are NULLed*/
/* NOTE: This array of elements is not defined as an enum, so no order of priority is defined */
haves = { family, friends, supply_food, roof, water, air, job, laptop, theatre, faith };
havenots = { plasmaTV, house, lot, car, businesses, wife, kids, legacy };
#endif

if(focus > 0)
{
/* Inform our main ioctl that we are doing OK */
alert(GREEN);
return;
}
else
{
printf("GET A LIFE!!!!");

/* Service the error and inform main that we're in bad shape! */
if(world == (FUN & indulge))
alert(YELLOW);
else
alert(RED);
}
}

No comments: