Пример #1
0
static INLINE void CheckStatusKnowledge( unlockableType_t type, int itemNum )
{
	unlockable_t dummy;

	if ( !unlockables[ unlockablesTypeOffset[ type ] + itemNum ].statusKnown )
	{
		dummy.type = type;
		dummy.num  = itemNum;

		Com_Printf( S_WARNING "Asked for the status of unlockable item %s but the status is unknown.\n",
		            UnlockableHumanName( &dummy ) );
	}
}
Пример #2
0
static void InformUnlockableStatusChanges(int* statusChanges, int count) {
    char text[MAX_STRING_CHARS];
    char* textptr = text;
    int unlockableNum;
    bool firstPass = true, unlocked = true;
    unlockable_t* unlockable;

    for (unlockableNum = 0; unlockableNum < NUM_UNLOCKABLES; unlockableNum++) {
        unlockable = &unlockables[unlockableNum];

        if (!statusChanges[unlockableNum] || Disabled(unlockable)) {
            continue;
        }

        if (firstPass) {
            if (statusChanges[unlockableNum] > 0) {
                Com_sprintf(text, sizeof(text), S_COLOR_GREEN "ITEM%s UNLOCKED: " S_COLOR_WHITE, (count > 1) ? "S" : "");
            } else {
                unlocked = false;
                Com_sprintf(text, sizeof(text), S_COLOR_RED "ITEM%s LOCKED: " S_COLOR_WHITE, (count > 1) ? "S" : "");
            }

            textptr = text + strlen(text);
            firstPass = false;
        } else {
            Com_sprintf(textptr, sizeof(text) - (textptr - text), ", ");
            textptr += 2;
        }

        Com_sprintf(textptr, sizeof(text) - (textptr - text), "%s", UnlockableHumanName(unlockable));
        textptr += strlen(textptr);
    }

    // TODO: Add sound for items being locked for each team
    switch (cg.snap->ps.persistant[PERS_TEAM]) {
        case TEAM_ALIENS:
            if (unlocked) {
                trap_S_StartLocalSound(cgs.media.weHaveEvolved, CHAN_ANNOUNCER);
            }
            break;

        case TEAM_HUMANS:
        default:
            if (unlocked) {
                trap_S_StartLocalSound(cgs.media.reinforcement, CHAN_ANNOUNCER);
            }
            break;
    }

    CG_CenterPrint(text, SCREEN_HEIGHT * 0.3, GIANTCHAR_WIDTH * 2);
}
Пример #3
0
static void InformUnlockableStatusChanges( int *statusChanges, int count )
{
	char         text[ MAX_STRING_CHARS ];
	char         *textptr = text;
	int          unlockableNum;
	qboolean     firstPass = qtrue;
	unlockable_t *unlockable;

	for ( unlockableNum = 0; unlockableNum < NUM_UNLOCKABLES; unlockableNum++ )
	{
		unlockable = &unlockables[ unlockableNum ];

		if ( !statusChanges[ unlockableNum ] || Disabled( unlockable ) )
		{
			continue;
		}

		if ( firstPass )
		{
			if ( statusChanges[ unlockableNum ] > 0 )
			{
				Com_sprintf( text, sizeof( text ),
				             S_COLOR_GREEN "ITEM%s UNLOCKED: " S_COLOR_WHITE, ( count > 1 ) ? "S" : "" );
			}
			else
			{
				Com_sprintf( text, sizeof( text ),
				             S_COLOR_RED   "ITEM%s LOCKED: "   S_COLOR_WHITE, ( count > 1 ) ? "S" : "" );
			}

			textptr = text + strlen( text );
			firstPass = qfalse;
		}
		else
		{
			Com_sprintf( textptr, sizeof( text ) - ( textptr - text ), ", " );
			textptr += 2;
		}

		Com_sprintf( textptr, sizeof( text ) - ( textptr - text ), "%s", UnlockableHumanName( unlockable ) );
		textptr += strlen( textptr );
	}

	Com_Printf( "%s\n", text );
}