/* =============== CG_HumanCkitText =============== */ static void CG_HumanCkitText( char *text, playerState_t *ps ) { buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; if( buildable > BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to place the %s\n", CG_KeyNameForCommand( "+attack" ), BG_FindHumanNameForBuildable( buildable ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to cancel placing the %s\n", CG_KeyNameForCommand( "+button5" ), BG_FindHumanNameForBuildable( buildable ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to build a structure\n", CG_KeyNameForCommand( "+attack" ) ) ); if( CG_BuildableInRange( ps ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to destroy this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } } }
/* =============== CG_AlienLevel4Text =============== */ static void CG_AlienLevel4Text( char *text, playerState_t *ps ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to swipe\n", CG_KeyNameForCommand( "+attack" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold down and release %s to charge\n", CG_KeyNameForCommand( "+button5" ) ) ); }
/* =============== CG_AlienLevel1Text =============== */ static void CG_AlienLevel1Text( char *text ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to swipe\n" ), CG_KeyNameForCommand( "+attack" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to walk on walls\n" ), CG_KeyNameForCommand( "+movedown" ) ) ); }
/* =============== CG_AlienLevel4Text =============== */ static void CG_AlienLevel4Text( char *text, playerState_t *ps ) { Q_UNUSED(ps); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to swipe\n" ), CG_KeyNameForCommand( "+attack" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold down and release %s while moving forwards to trample\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); }
/* =============== CG_SpectatorText =============== */ static void CG_SpectatorText( char *text, playerState_t *ps ) { if ( cgs.clientinfo[ cg.clientNum ].team != TEAM_NONE ) { if ( ps->pm_flags & PMF_QUEUED ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to leave spawn queue\n" ), CG_KeyNameForCommand( "+attack" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to spawn\n" ), CG_KeyNameForCommand( "+attack" ) ) ); } } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to join a team\n" ), CG_KeyNameForCommand( "+attack" ) ) ); } if ( ps->pm_flags & PMF_FOLLOW ) { if ( !cg.chaseFollow ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to switch to chase-cam spectator mode\n" ), CG_KeyNameForCommand( "+useitem" ) ) ); } else if ( cgs.clientinfo[ cg.clientNum ].team == TEAM_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to return to free spectator mode\n" ), CG_KeyNameForCommand( "+useitem" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to stop following\n" ), CG_KeyNameForCommand( "+useitem" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Use %s and %s to change between players\n" ), CG_KeyNameForCommand( "weapprev" ), CG_KeyNameForCommand( "weapnext" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to follow a player\n" ), CG_KeyNameForCommand( "+useitem" ) ) ); } }
/* =============== CG_AlienBuilderText =============== */ static void CG_AlienBuilderText( char *text, playerState_t *ps ) { buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; if( buildable > BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to place the %s\n", CG_KeyNameForCommand( "+attack" ), BG_FindHumanNameForBuildable( buildable ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to cancel placing the %s\n", CG_KeyNameForCommand( "+button5" ), BG_FindHumanNameForBuildable( buildable ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to build a structure\n", CG_KeyNameForCommand( "+attack" ) ) ); if( CG_BuildableInRange( ps ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to destroy this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } } /*if( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG ) { if( ( ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) == BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to swipe\n", CG_KeyNameForCommand( "+button5" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to launch a projectile\n", CG_KeyNameForCommand( "+button2" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to walk on walls\n", CG_KeyNameForCommand( "+movedown" ) ) ); }*/ }
/* =============== CG_AlienLevel2Text =============== */ static void CG_AlienLevel2Text( char *text, playerState_t *ps ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to bite\n" ), CG_KeyNameForCommand( "+attack" ) ) ); if ( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL2_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to invoke an electrical attack\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold down %s then touch a wall to wall jump\n" ), CG_KeyNameForCommand( "+moveup" ) ) ); }
/* =============== CG_AlienLevel3Text =============== */ static void CG_AlienLevel3Text( char *text, playerState_t *ps ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to bite\n" ), CG_KeyNameForCommand( "+attack" ) ) ); if ( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL3_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to launch a projectile\n" ), CG_KeyNameForCommand( "+useitem" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold down and release %s to pounce\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); }
/* =============== CG_BuilderText =============== */ static void CG_BuilderText( char *text, playerState_t *ps ) { buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; entityState_t *es; if ( buildable > BA_NONE ) { const char *item = _( BG_Buildable( buildable )->humanName ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to place the %s\n"), CG_KeyNameForCommand( "+attack" ), item ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to cancel placing the %s\n" ), CG_KeyNameForCommand( "+attack2" ), item ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to build a structure\n" ), CG_KeyNameForCommand( "+attack" ) ) ); } if ( ( es = CG_BuildableInRange( ps, NULL ) ) ) { const char *key = CG_KeyNameForCommand( "if alt \"/deconstruct marked\" /deconstruct" ); if ( cgs.markDeconstruct ) { if ( es->eFlags & EF_B_MARKED ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to unmark this structure for replacement\n" ), key ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to mark this structure for replacement\n" ), key ) ); } } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to destroy this structure\n" ), key ) ); } } }
/* =============== CG_AlienLevel0Text =============== */ static void CG_AlienLevel0Text( char *text, playerState_t *ps ) { Q_strcat( text, MAX_TUTORIAL_TEXT, "Touch a human to damage it\n" ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to walk on walls\n", CG_KeyNameForCommand( "+movedown" ) ) ); }
/* =============== CG_AlienLevel0Text =============== */ static void CG_AlienLevel0Text( char *text, playerState_t *ps ) { Q_UNUSED(ps); Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Touch humans to damage them\n" "Aim at their heads to cause more damage\n" ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to walk on walls\n" ), CG_KeyNameForCommand( "+movedown" ) ) ); if ( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL0_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to pounce\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); } }
/* =============== CG_AlienLevel1Text =============== */ static void CG_AlienLevel1Text( char *text, playerState_t *ps ) { Q_strcat( text, MAX_TUTORIAL_TEXT, "Touch a human to grab it\n" ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to swipe\n", CG_KeyNameForCommand( "+attack" ) ) ); if( ps->stats[ STAT_PCLASS ] == PCL_ALIEN_LEVEL1_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to spray poisonous gas\n", CG_KeyNameForCommand( "+button5" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to walk on walls\n", CG_KeyNameForCommand( "+movedown" ) ) ); }
/* =============== CG_AlienLevel0Text =============== */ static void CG_AlienLevel0Text( char *text, playerState_t *ps ) { Q_UNUSED(ps); Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Touch humans to damage them\n" "Aim at their heads to cause more damage\n" ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to walk on walls\n" ), CG_KeyNameForCommand( "+movedown" ) ) ); }
/* =============== CG_AlienLevel1Text =============== */ static void CG_AlienLevel1Text( char *text, playerState_t *ps ) { Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Touch humans to grab them\n" "Look at them to maintain the grab\n" ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to swipe\n" ), CG_KeyNameForCommand( "+attack" ) ) ); if ( ps->stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL1_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to spray disorienting gas\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to walk on walls\n" ), CG_KeyNameForCommand( "+movedown" ) ) ); }
/* =============== CG_AlienBuilderText =============== */ static void CG_AlienBuilderText( char *text, playerState_t *ps ) { CG_BuilderText( text, ps ); if ( ( ps->stats[ STAT_BUILDABLE ] & SB_BUILDABLE_MASK ) == BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to swipe\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); } if ( ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to launch a projectile\n" ), CG_KeyNameForCommand( "+useitem" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to walk on walls\n" ), CG_KeyNameForCommand( "+movedown" ) ) ); } }
/* =============== CG_SpectatorText =============== */ static void CG_SpectatorText( char *text, playerState_t *ps ) { if( cgs.clientinfo[ cg.clientNum ].team != TEAM_NONE ) { if( ps->pm_flags & PMF_QUEUED ) Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to leave spawn queue\n", CG_KeyNameForCommand( "+attack" ) ) ); else Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to spawn\n", CG_KeyNameForCommand( "+attack" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to join a team\n", CG_KeyNameForCommand( "+attack" ) ) ); } if( ps->pm_flags & PMF_FOLLOW ) { if( !cg.chaseFollow ) Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to switch to chase-cam spectator mode\n", CG_KeyNameForCommand( "+button2" ) ) ); else Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to return to free spectator mode\n", CG_KeyNameForCommand( "+button2" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s or ", CG_KeyNameForCommand( "weapprev" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "%s to change player\n", CG_KeyNameForCommand( "weapnext" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to follow a player\n", CG_KeyNameForCommand( "+button2" ) ) ); } }
static void CG_AlienLevel0Text( char *text, playerState_t *ps ) #endif { Q_UNUSED(ps); #ifdef UNREALARENA // [TODO] UNIMPLEMENTED #else Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Touch humans to damage them\n" "Aim at their heads to cause more damage\n" ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to walk on walls\n" ), CG_KeyNameForCommand( "+movedown" ) ) ); #endif }
/* =============== CG_HumanCkitText =============== */ static void CG_HumanCkitText( char *text, playerState_t *ps ) { buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; entityState_t *es; if( buildable > BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to place the %s\n", CG_KeyNameForCommand( "+attack" ), BG_Buildable( buildable )->humanName ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to cancel placing the %s\n", CG_KeyNameForCommand( "+button5" ), BG_Buildable( buildable )->humanName ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to build a structure\n", CG_KeyNameForCommand( "+attack" ) ) ); } if( ( es = CG_BuildableInRange( ps, NULL ) ) ) { if( cgs.markDeconstruct ) { if( es->eFlags & EF_B_MARKED ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to unmark this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to mark this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to destroy this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } } }
/* =============== CG_SpectatorText =============== */ static void CG_SpectatorText( char *text, playerState_t *ps ) { if( ps->pm_flags & PMF_FOLLOW ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to return to free spectator mode\n", CG_KeyNameForCommand( "+button2" ) ) ); if( CG_PlayerCount( ) > 1 ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s or ", CG_KeyNameForCommand( "weapprev" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "%s to change player\n", CG_KeyNameForCommand( "weapnext" ) ) ); } } else if( ps->pm_type == PM_SPECTATOR ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to join a team\n", CG_KeyNameForCommand( "+attack" ) ) ); if( CG_PlayerCount( ) > 0 ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to enter spectator follow mode\n", CG_KeyNameForCommand( "+button2" ) ) ); } } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to spawn\n", CG_KeyNameForCommand( "+attack" ) ) ); } }
/* =============== CG_AlienBuilderText =============== */ static void CG_AlienBuilderText( char *text, playerState_t *ps ) { buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; entityState_t *es; if( buildable > BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to place the %s\n", CG_KeyNameForCommand( "+attack" ), BG_Buildable( buildable )->humanName ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to cancel placing the %s\n", CG_KeyNameForCommand( "+button5" ), BG_Buildable( buildable )->humanName ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to build a structure\n", CG_KeyNameForCommand( "+attack" ) ) ); } if( ( es = CG_BuildableInRange( ps, NULL ) ) ) { if( cgs.markDeconstruct ) { if( es->eFlags & EF_B_MARKED ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to unmark this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to mark this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } } else { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to destroy this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); } } if( ( ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) == BA_NONE ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to swipe\n", CG_KeyNameForCommand( "+button5" ) ) ); } if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to launch a projectile\n", CG_KeyNameForCommand( "+button2" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to walk on walls\n", CG_KeyNameForCommand( "+movedown" ) ) ); } }
/* =============== CG_HumanText =============== */ static void CG_HumanText( char *text, playerState_t *ps ) { const char *name; upgrade_t upgrade = UP_NONE; if ( cg.weaponSelect < 32 ) { name = cg_weapons[ cg.weaponSelect ].humanName; } else { name = cg_upgrades[ cg.weaponSelect - 32 ].humanName; upgrade = cg.weaponSelect - 32; } if ( !ps->ammo && !ps->clips && !BG_Weapon( ps->weapon )->infiniteAmmo ) { //no ammo switch ( ps->weapon ) { case WP_MACHINEGUN: case WP_CHAINGUN: case WP_SHOTGUN: case WP_FLAMER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Find an Armoury and press %s for more ammo\n" ), CG_KeyNameForCommand( "buy ammo" ) ) ); break; case WP_LAS_GUN: case WP_PULSE_RIFLE: case WP_MASS_DRIVER: case WP_LUCIFER_CANNON: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Find an Armoury, Reactor, or Repeater and press %s for more ammo\n" ), CG_KeyNameForCommand( "buy ammo" ) ) ); break; default: break; } } else { switch ( ps->weapon ) { case WP_BLASTER: case WP_MACHINEGUN: case WP_SHOTGUN: case WP_LAS_GUN: case WP_CHAINGUN: case WP_PULSE_RIFLE: case WP_FLAMER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to fire the %s\n" ), CG_KeyNameForCommand( "+attack" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); break; case WP_MASS_DRIVER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to fire the %s\n" ), CG_KeyNameForCommand( "+attack" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold %s to zoom\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); break; case WP_PAIN_SAW: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold %s to activate the %s\n" ), CG_KeyNameForCommand( "+attack" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); break; case WP_LUCIFER_CANNON: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold and release %s to fire a charged shot\n" ), CG_KeyNameForCommand( "+attack" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to fire the %s\n" ), CG_KeyNameForCommand( "+attack2" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); break; case WP_HBUILD: CG_HumanCkitText( text, ps ); break; default: break; } } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Use %s and %s to select an upgrade\n" ), CG_KeyNameForCommand( "weapprev" ), CG_KeyNameForCommand( "weapnext" ) ) ); if ( upgrade == UP_NONE || ( upgrade > UP_NONE && BG_Upgrade( upgrade )->usable ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to use the %s\n" ), CG_KeyNameForCommand( "+useitem" ), name ) ); } if ( ps->stats[ STAT_HEALTH ] <= 35 && BG_InventoryContainsUpgrade( UP_MEDKIT, ps->stats ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to use your %s\n" ), CG_KeyNameForCommand( "itemact medkit" ), _( BG_Upgrade( UP_MEDKIT )->humanName ) ) ); } if ( ps->stats[ STAT_STAMINA ] <= STAMINA_BLACKOUT_LEVEL ) { Q_strcat( text, MAX_TUTORIAL_TEXT, _( "You are blacking out. Stop sprinting to recover stamina\n" ) ); } else if ( ps->stats[ STAT_STAMINA ] <= STAMINA_SLOW_LEVEL ) { Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Your stamina is low. Stop sprinting to recover\n" ) ); } switch ( cg.nearUsableBuildable ) { case BA_H_ARMOURY: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to buy equipment upgrades at the %s. Sell your old weapon first!\n" ), CG_KeyNameForCommand( "+activate" ), _( BG_Buildable( cg.nearUsableBuildable )->humanName ) ) ); break; case BA_H_REPEATER: case BA_H_REACTOR: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to refill your energy weapon's ammo at the %s\n" ), CG_KeyNameForCommand( "+activate" ), _( BG_Buildable( cg.nearUsableBuildable )->humanName ) ) ); break; case BA_NONE: break; default: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to use the %s\n" ), CG_KeyNameForCommand( "+activate" ), _( BG_Buildable( cg.nearUsableBuildable )->humanName ) ) ); break; } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s and any direction to sprint\n" ), CG_KeyNameForCommand( "+sprint" ) ) ); }
/* =============== CG_HumanText =============== */ static void CG_HumanText( char *text, playerState_t *ps ) { const char *name; upgrade_t upgrade = UP_NONE; if ( cg.weaponSelect < 32 ) { name = cg_weapons[ cg.weaponSelect ].humanName; } else { name = cg_upgrades[ cg.weaponSelect - 32 ].humanName; upgrade = (upgrade_t) ( cg.weaponSelect - 32 ); } if ( !ps->ammo && !ps->clips && !BG_Weapon( ps->weapon )->infiniteAmmo ) { //no ammo switch ( ps->weapon ) { case WP_MACHINEGUN: case WP_CHAINGUN: case WP_SHOTGUN: case WP_FLAMER: Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Find an Armoury for more ammo\n" ) ); break; case WP_LAS_GUN: case WP_PULSE_RIFLE: case WP_MASS_DRIVER: case WP_LUCIFER_CANNON: Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Find an Armoury, Reactor, or Repeater for more ammo\n" ) ); break; default: break; } } else { switch ( ps->weapon ) { case WP_BLASTER: case WP_MACHINEGUN: case WP_SHOTGUN: case WP_LAS_GUN: case WP_CHAINGUN: case WP_PULSE_RIFLE: case WP_FLAMER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to fire the %s\n" ), CG_KeyNameForCommand( "+attack" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); break; case WP_MASS_DRIVER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to fire the %s\n" ), CG_KeyNameForCommand( "+attack" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold %s to zoom\n" ), CG_KeyNameForCommand( "+attack2" ) ) ); break; case WP_PAIN_SAW: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold %s to activate the %s\n" ), CG_KeyNameForCommand( "+attack" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); break; case WP_LUCIFER_CANNON: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Hold and release %s to fire a charged shot\n" ), CG_KeyNameForCommand( "+attack" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to fire the %s\n" ), CG_KeyNameForCommand( "+attack2" ), _( BG_Weapon( ps->weapon )->humanName ) ) ); break; case WP_HBUILD: CG_HumanCkitText( text, ps ); break; default: break; } } if ( upgrade == UP_NONE || ( upgrade > UP_NONE && BG_Upgrade( upgrade )->usable ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to use the %s\n" ), CG_KeyNameForCommand( "+useitem" ), name ) ); } if ( ps->stats[ STAT_HEALTH ] <= 35 && BG_InventoryContainsUpgrade( UP_MEDKIT, ps->stats ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to use your %s\n" ), CG_KeyNameForCommand( "itemact medkit" ), _( BG_Upgrade( UP_MEDKIT )->humanName ) ) ); } switch ( cg.nearUsableBuildable ) { case BA_H_ARMOURY: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to buy equipment upgrades at the %s\n" ), CG_KeyNameForCommand( "+activate" ), _( BG_Buildable( cg.nearUsableBuildable )->humanName ) ) ); break; case BA_NONE: break; default: Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to use the %s\n" ), CG_KeyNameForCommand( "+activate" ), _( BG_Buildable( cg.nearUsableBuildable )->humanName ) ) ); break; } Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s and any direction to sprint\n" ), CG_KeyNameForCommand( "+sprint" ) ) ); if ( BG_InventoryContainsUpgrade( UP_FIREBOMB, ps->stats ) || BG_InventoryContainsUpgrade( UP_GRENADE, ps->stats ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to throw a grenade\n" ), CG_KeyNameForCommand( "itemact grenade" ) )); } }
/* =============== CG_HumanText =============== */ static void CG_HumanText( char *text, playerState_t *ps ) { char *name; upgrade_t upgrade = UP_NONE; if( cg.weaponSelect < 32 ) name = cg_weapons[ cg.weaponSelect ].humanName; else { name = cg_upgrades[ cg.weaponSelect - 32 ].humanName; upgrade = cg.weaponSelect - 32; } if( !ps->ammo && !ps->clips && !BG_Weapon( ps->weapon )->infiniteAmmo ) { //no ammo switch( ps->weapon ) { case WP_MACHINEGUN: case WP_CHAINGUN: case WP_SHOTGUN: case WP_FLAMER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Find an Armoury and press %s for more ammo\n", CG_KeyNameForCommand( "buy ammo" ) ) ); break; case WP_LAS_GUN: case WP_PULSE_RIFLE: case WP_MASS_DRIVER: case WP_LUCIFER_CANNON: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Find a Reactor or Repeater and press %s for more ammo\n", CG_KeyNameForCommand( "buy ammo" ) ) ); break; default: break; } } else { switch( ps->weapon ) { case WP_BLASTER: case WP_MACHINEGUN: case WP_SHOTGUN: case WP_LAS_GUN: case WP_CHAINGUN: case WP_PULSE_RIFLE: case WP_FLAMER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire the %s\n", CG_KeyNameForCommand( "+attack" ), BG_Weapon( ps->weapon )->humanName ) ); break; case WP_MASS_DRIVER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire the %s\n", CG_KeyNameForCommand( "+attack" ), BG_Weapon( ps->weapon )->humanName ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold %s to zoom\n", CG_KeyNameForCommand( "+button5" ) ) ); break; case WP_PAIN_SAW: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold %s to activate the %s\n", CG_KeyNameForCommand( "+attack" ), BG_Weapon( ps->weapon )->humanName ) ); break; case WP_LUCIFER_CANNON: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold and release %s to fire a charged shot\n", CG_KeyNameForCommand( "+attack" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire the %s\n", CG_KeyNameForCommand( "+button5" ), BG_Weapon( ps->weapon )->humanName ) ); break; case WP_HBUILD: CG_HumanCkitText( text, ps ); break; default: break; } } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s and ", CG_KeyNameForCommand( "weapprev" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "%s to select an upgrade\n", CG_KeyNameForCommand( "weapnext" ) ) ); if( upgrade == UP_NONE || ( upgrade > UP_NONE && BG_Upgrade( upgrade )->usable ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use the %s\n", CG_KeyNameForCommand( "+button2" ), name ) ); } if( ps->stats[ STAT_HEALTH ] <= 35 && BG_InventoryContainsUpgrade( UP_MEDKIT, ps->stats ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use your %s\n", CG_KeyNameForCommand( "itemact medkit" ), BG_Upgrade( UP_MEDKIT )->humanName ) ); } if( ps->stats[ STAT_STAMINA ] <= STAMINA_BLACKOUT_LEVEL ) { Q_strcat( text, MAX_TUTORIAL_TEXT, "You are blacking out. Stop sprinting to recover stamina.\n" ); } else if( ps->stats[ STAT_STAMINA ] <= STAMINA_SLOW_LEVEL ) { Q_strcat( text, MAX_TUTORIAL_TEXT, "Your stamina is low. Stop sprinting to recover.\n" ); } if( cg.nearUsableBuildable ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use this structure\n", CG_KeyNameForCommand( "+button7" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s and any direction to sprint\n", CG_KeyNameForCommand( "+button8" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s and back or strafe to dodge\n", CG_KeyNameForCommand( "+button6" ) ) ); }
/* =============== CG_TutorialText Returns context help for the current class/weapon =============== */ const char *CG_TutorialText( void ) { playerState_t *ps; static char text[ MAX_TUTORIAL_TEXT ]; CG_GetBindings( ); text[ 0 ] = '\0'; ps = &cg.snap->ps; if( !cg.intermissionStarted && !cg.demoPlayback ) { if( ps->persistant[ PERS_TEAM ] == TEAM_SPECTATOR || ps->pm_flags & PMF_FOLLOW ) { CG_SpectatorText( text, ps ); } else if( ps->stats[ STAT_HEALTH ] > 0 ) { switch( ps->stats[ STAT_PCLASS ] ) { case PCL_ALIEN_BUILDER0: case PCL_ALIEN_BUILDER0_UPG: CG_AlienBuilderText( text, ps ); break; case PCL_ALIEN_LEVEL0: CG_AlienLevel0Text( text, ps ); break; case PCL_ALIEN_LEVEL1: case PCL_ALIEN_LEVEL1_UPG: CG_AlienLevel1Text( text, ps ); break; case PCL_ALIEN_LEVEL2: case PCL_ALIEN_LEVEL2_UPG: CG_AlienLevel2Text( text, ps ); break; case PCL_ALIEN_LEVEL3: case PCL_ALIEN_LEVEL3_UPG: CG_AlienLevel3Text( text, ps ); break; case PCL_ALIEN_LEVEL4: CG_AlienLevel4Text( text, ps ); break; case PCL_HUMAN: CG_HumanText( text, ps ); break; default: break; } if( ps->stats[ STAT_PTEAM ] == PTE_ALIENS && BG_UpgradeClassAvailable( ps ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to evolve\n", CG_KeyNameForCommand( "+button7" ) ) ); } } Q_strcat( text, MAX_TUTORIAL_TEXT, "Press ESC for the menu" ); } return text; }
/* =============== CG_TutorialText Returns context help for the current class/weapon =============== */ const char *CG_TutorialText() { playerState_t *ps; static char text[ MAX_TUTORIAL_TEXT ]; static int refreshBindings = 0; text[ 0 ] = '\0'; ps = &cg.snap->ps; if ( refreshBindings == 0 ) { CG_GetBindings( (team_t) ps->persistant[ PERS_TEAM ] ); } refreshBindings = ( refreshBindings + 1 ) % BINDING_REFRESH_INTERVAL; if ( !cg.intermissionStarted && !cg.demoPlayback ) { if ( ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || ps->pm_flags & PMF_FOLLOW ) { CG_SpectatorText( text, ps ); } else if ( ps->stats[ STAT_HEALTH ] > 0 ) { switch ( ps->stats[ STAT_CLASS ] ) { case PCL_ALIEN_BUILDER0: case PCL_ALIEN_BUILDER0_UPG: CG_AlienBuilderText( text, ps ); break; case PCL_ALIEN_LEVEL0: CG_AlienLevel0Text( text, ps ); break; case PCL_ALIEN_LEVEL1: CG_AlienLevel1Text( text ); break; case PCL_ALIEN_LEVEL2: case PCL_ALIEN_LEVEL2_UPG: CG_AlienLevel2Text( text, ps ); break; case PCL_ALIEN_LEVEL3: case PCL_ALIEN_LEVEL3_UPG: CG_AlienLevel3Text( text, ps ); break; case PCL_ALIEN_LEVEL4: CG_AlienLevel4Text( text, ps ); break; case PCL_HUMAN_NAKED: case PCL_HUMAN_LIGHT: case PCL_HUMAN_MEDIUM: case PCL_HUMAN_BSUIT: CG_HumanText( text, ps ); break; default: break; } if ( ps->persistant[ PERS_TEAM ] == TEAM_ALIENS ) { if ( BG_AlienCanEvolve( ps->stats[ STAT_CLASS ], ps->persistant[ PERS_CREDIT ] ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to evolve\n" ), CG_KeyNameForCommand( "+activate" ) ) ); } } } } else if ( !cg.demoPlayback ) { if ( !CG_ClientIsReady( ps->clientNum ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s when ready to continue\n" ), CG_KeyNameForCommand( "+attack" ) ) ); } else { Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Waiting for other players to be ready\n" ) ); } } if ( !cg.demoPlayback ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( _( "Press %s to open the console\n" ), CG_KeyNameForCommand( "toggleconsole" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, _( "Press ESC for the menu" ) ); } return text; }
/* =============== CG_HumanText =============== */ static void CG_HumanText( char *text, playerState_t *ps ) { char *name; int ammo, clips; upgrade_t upgrade = UP_NONE; if( cg.weaponSelect <= 32 ) name = cg_weapons[ cg.weaponSelect ].humanName; else if( cg.weaponSelect > 32 ) { name = cg_upgrades[ cg.weaponSelect - 32 ].humanName; upgrade = cg.weaponSelect - 32; } BG_UnpackAmmoArray( ps->weapon, &ps->ammo, ps->powerups, &ammo, &clips ); if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( ps->weapon ) ) { //no ammo switch( ps->weapon ) { case WP_MACHINEGUN: case WP_CHAINGUN: case WP_SHOTGUN: case WP_LAUNCHER: case WP_ROCKET_LAUNCHER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Find an Armoury and press %s for more ammo\n", CG_KeyNameForCommand( "buy ammo" ) ) ); break; case WP_LAS_GUN: case WP_MASS_DRIVER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Find a Reactor or Repeater and press %s for more ammo\n", CG_KeyNameForCommand( "buy ammo" ) ) ); break; default: break; } } else { switch( ps->weapon ) { case WP_LAUNCHER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire the %s\n", CG_KeyNameForCommand( "+attack" ), BG_FindHumanNameForWeapon( ps->weapon ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire incendiary grenade\n", CG_KeyNameForCommand( "+button5" ) ) ); break; case WP_PISTOL: case WP_MACHINEGUN: case WP_SHOTGUN: case WP_LAS_GUN: case WP_CHAINGUN: case WP_MASS_DRIVER: case WP_ROCKET_LAUNCHER: Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire the %s\n", CG_KeyNameForCommand( "+attack" ), BG_FindHumanNameForWeapon( ps->weapon ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold %s to zoom\n", CG_KeyNameForCommand( "+button5" ) ) ); break; case WP_HBUILD: case WP_HBUILD2: CG_HumanCkitText( text, ps ); break; default: break; } } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s and ", CG_KeyNameForCommand( "weapprev" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "%s to select an upgrade\n", CG_KeyNameForCommand( "weapnext" ) ) ); if( upgrade == UP_NONE || ( upgrade > UP_NONE && BG_FindUsableForUpgrade( upgrade ) ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use the %s\n", CG_KeyNameForCommand( "+button2" ), name ) ); } if( ps->stats[ STAT_HEALTH ] <= 35 && BG_InventoryContainsUpgrade( UP_MEDKIT, ps->stats ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use your %s\n", CG_KeyNameForCommand( "itemact medkit" ), BG_FindHumanNameForUpgrade( UP_MEDKIT ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use a structure\n", CG_KeyNameForCommand( "+button7" ) ) ); }