| 84 | } |
| 85 | |
| 86 | static qboolean NPC_Howler_Move( int randomJumpChance = 0 ) |
| 87 | { |
| 88 | if ( !TIMER_Done( NPC, "standing" ) ) |
| 89 | {//standing around |
| 90 | return qfalse; |
| 91 | } |
| 92 | if ( NPC->client->ps.groundEntityNum == ENTITYNUM_NONE ) |
| 93 | {//in air, don't do anything |
| 94 | return qfalse; |
| 95 | } |
| 96 | if ( (!NPC->enemy&&TIMER_Done( NPC, "running" )) || !TIMER_Done( NPC, "walking" ) ) |
| 97 | { |
| 98 | ucmd.buttons |= BUTTON_WALKING; |
| 99 | } |
| 100 | if ( (!randomJumpChance||Q_irand( 0, randomJumpChance )) |
| 101 | && NPC_MoveToGoal( qtrue ) ) |
| 102 | { |
| 103 | if ( VectorCompare( NPC->client->ps.moveDir, vec3_origin ) |
| 104 | || !NPC->client->ps.speed ) |
| 105 | {//uh.... wtf? Got there? |
| 106 | if ( NPCInfo->goalEntity ) |
| 107 | { |
| 108 | NPC_FaceEntity( NPCInfo->goalEntity, qfalse ); |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | NPC_UpdateAngles( qfalse, qtrue ); |
| 113 | } |
| 114 | return qtrue; |
| 115 | } |
| 116 | //TEMP: don't want to strafe |
| 117 | VectorClear( NPC->client->ps.moveDir ); |
| 118 | ucmd.rightmove = 0.0f; |
| 119 | // Com_Printf( "Howler moving %d\n",ucmd.forwardmove ); |
| 120 | //if backing up, go slow... |
| 121 | if ( ucmd.forwardmove < 0.0f ) |
| 122 | { |
| 123 | ucmd.buttons |= BUTTON_WALKING; |
| 124 | //if ( NPC->client->ps.speed > NPCInfo->stats.walkSpeed ) |
| 125 | {//don't walk faster than I'm allowed to |
| 126 | NPC->client->ps.speed = NPCInfo->stats.walkSpeed; |
| 127 | } |
| 128 | } |
| 129 | else |
| 130 | { |
| 131 | if ( (ucmd.buttons&BUTTON_WALKING) ) |
| 132 | { |
| 133 | NPC->client->ps.speed = NPCInfo->stats.walkSpeed; |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | NPC->client->ps.speed = NPCInfo->stats.runSpeed; |
| 138 | } |
| 139 | } |
| 140 | NPCInfo->lockedDesiredYaw = NPCInfo->desiredYaw = NPCInfo->lastPathAngles[YAW]; |
| 141 | NPC_UpdateAngles( qfalse, qtrue ); |
| 142 | } |
| 143 | else if ( NPCInfo->goalEntity ) |
no test coverage detected