#include "b_local.h"#include "g_nav.h"#include "anims.h"#include "w_saber.h"#include "../namespace_begin.h"#include "../namespace_end.h"Go to the source code of this file.
|
|
Definition at line 4469 of file NPC_AI_Jedi.c. Referenced by NPC_BSJump(). |
|
|
Definition at line 34 of file NPC_AI_Jedi.c. |
|
|
Definition at line 27 of file NPC_AI_Jedi.c. |
|
|
Definition at line 30 of file NPC_AI_Jedi.c. |
|
|
Definition at line 23 of file NPC_AI_Jedi.c. |
|
|
Definition at line 25 of file NPC_AI_Jedi.c. |
|
|
Definition at line 24 of file NPC_AI_Jedi.c. |
|
|
Definition at line 4471 of file NPC_AI_Jedi.c. |
|
|
Definition at line 31 of file NPC_AI_Jedi.c. |
|
|
Definition at line 36 of file NPC_AI_Jedi.c. |
|
|
Definition at line 21 of file NPC_AI_Jedi.c. |
|
|
Definition at line 22 of file NPC_AI_Jedi.c. |
|
|
Definition at line 4470 of file NPC_AI_Jedi.c. |
|
|
Definition at line 33 of file NPC_AI_Jedi.c. |
|
|
Definition at line 29 of file NPC_AI_Jedi.c. |
|
|
Definition at line 96 of file NPC_AI_Jedi.c.
00097 {
00098 LSTATE_NONE = 0,
00099 LSTATE_UNDERFIRE,
00100 LSTATE_INVESTIGATE,
00101 };
|
|
|
Definition at line 49 of file bg_panimate.c.
00050 {
00051 switch ( anim )
00052 {
00053 case BOTH_SIT1: //# Normal chair sit.
00054 case BOTH_SIT2: //# Lotus position.
00055 case BOTH_SIT3: //# Sitting in tired position: elbows on knees
00056 case BOTH_CROUCH1: //# Transition from standing to crouch
00057 case BOTH_CROUCH1IDLE: //# Crouching idle
00058 case BOTH_CROUCH1WALK: //# Walking while crouched
00059 case BOTH_CROUCH1WALKBACK: //# Walking while crouched
00060 case BOTH_CROUCH2TOSTAND1: //# going from crouch2 to stand1
00061 case BOTH_CROUCH3: //# Desann crouching down to Kyle (cin 9)
00062 case BOTH_KNEES1: //# Tavion on her knees
00063 case BOTH_CROUCHATTACKBACK1://FIXME: not if in middle of anim?
00064 case BOTH_ROLL_STAB:
00065 return qtrue;
00066 break;
00067 }
00068 return qfalse;
00069 }
|
|
|
Definition at line 1941 of file bg_misc.c.
|
|
|
Definition at line 433 of file bg_panimate.c.
00434 {
00435 switch ( anim )
00436 {
00437 case BOTH_FLIP_F: //# Flip forward
00438 case BOTH_FLIP_B: //# Flip backwards
00439 case BOTH_FLIP_L: //# Flip left
00440 case BOTH_FLIP_R: //# Flip right
00441 case BOTH_WALL_RUN_RIGHT_FLIP:
00442 case BOTH_WALL_RUN_LEFT_FLIP:
00443 case BOTH_WALL_FLIP_RIGHT:
00444 case BOTH_WALL_FLIP_LEFT:
00445 case BOTH_FLIP_BACK1:
00446 case BOTH_FLIP_BACK2:
00447 case BOTH_FLIP_BACK3:
00448 case BOTH_WALL_FLIP_BACK1:
00449 //Not really flips, but...
00450 case BOTH_WALL_RUN_RIGHT:
00451 case BOTH_WALL_RUN_LEFT:
00452 case BOTH_WALL_RUN_RIGHT_STOP:
00453 case BOTH_WALL_RUN_LEFT_STOP:
00454 case BOTH_BUTTERFLY_LEFT:
00455 case BOTH_BUTTERFLY_RIGHT:
00456 case BOTH_BUTTERFLY_FL1:
00457 case BOTH_BUTTERFLY_FR1:
00458 //
00459 case BOTH_ARIAL_LEFT:
00460 case BOTH_ARIAL_RIGHT:
00461 case BOTH_ARIAL_F1:
00462 case BOTH_CARTWHEEL_LEFT:
00463 case BOTH_CARTWHEEL_RIGHT:
00464 case BOTH_JUMPFLIPSLASHDOWN1:
00465 case BOTH_JUMPFLIPSTABDOWN:
00466 case BOTH_JUMPATTACK6:
00467 case BOTH_JUMPATTACK7:
00468 //JKA
00469 case BOTH_FORCEWALLRUNFLIP_END:
00470 case BOTH_FORCEWALLRUNFLIP_ALT:
00471 case BOTH_FLIP_ATTACK7:
00472 case BOTH_A7_SOULCAL:
00473 return qtrue;
00474 break;
00475 }
00476 return qfalse;
00477 }
|
|
||||||||||||
|
|
|
|
Definition at line 201 of file bg_pmove.c.
00202 {
00203 if ( !ps->saberHolstered )
00204 {
00205 return qfalse;
00206 }
00207 if ( ps->fd.saberAnimLevelBase == SS_DUAL
00208 || ps->fd.saberAnimLevelBase == SS_STAFF )
00209 {
00210 if ( ps->saberHolstered < 2 )
00211 {
00212 return qfalse;
00213 }
00214 }
00215 return qtrue;
00216 }
|
|
|
|
Definition at line 193 of file NPC_AI_Jedi.c. References EV_GENERAL_SOUND, G_AddEvent(), G_SoundIndex(), NPC, NPC_ChangeWeapon(), gentity_s::s, and entityState_s::weapon. Referenced by Boba_FireDecide(), and NPC_BSJedi_Default().
00194 {
00195 if ( NPC->s.weapon == wp )
00196 {
00197 return;
00198 }
00199 NPC_ChangeWeapon( wp );
00200 G_AddEvent( NPC, EV_GENERAL_SOUND, G_SoundIndex( "sound/weapons/change.wav" ));
00201 }
|
|
|
Definition at line 471 of file NPC_AI_Jedi.c. References Boba_FireFlameThrower(), Boba_StartFlameThrower(), BOTH_FORCELIGHTNING_HOLD, gentity_t, NPC_SetAnim(), SETANIM_FLAG_HOLD, SETANIM_FLAG_OVERRIDE, SETANIM_TORSO, and TIMER_Done(). Referenced by Boba_FireDecide().
00472 {
00473 NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCELIGHTNING_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
00474 if ( TIMER_Done( self, "nextAttackDelay" ) && TIMER_Done( self, "flameTime" ) )
00475 {
00476 Boba_StartFlameThrower( self );
00477 }
00478 Boba_FireFlameThrower( self );
00479 }
|
|
|
TIMER_Done( NPC, "stick" ) || Definition at line 481 of file NPC_AI_Jedi.c. References AngleVectors(), BG_FlippingAnim(), Boba_ChangeWeapon(), Boba_DoFlameThrower(), Boba_FlyStart(), gNPC_t::burstMax, gNPC_t::burstMean, gNPC_t::burstMin, gNPC_t::burstSpacing, BUTTON_ALT_ATTACK, BUTTON_ATTACK, usercmd_s::buttons, CalcEntitySpot(), gentity_s::client, entityShared_t::currentOrigin, gNPC_t::desiredPitch, gNPC_t::desiredYaw, DotProduct, trace_t::endpos, gentity_s::enemy, enemyDist, gNPC_t::enemyLastSeenLocation, gNPC_t::enemyLastSeenTime, gclient_s::enemyTeam, ENTITYNUM_NONE, playerState_s::fd, forcedata_s::forceJumpZStart, g_entities, gentity_t, playerState_s::groundEntityNum, gNPC_t::group, gentity_s::health, AIGroupInfo_s::lastSeenEnemyTime, playerState_s::legsAnim, level, MASK_SHOT, clientPersistant_t::maxHealth, MIN_ROCKET_DIST_SQUARED, NPC, NPC_ChangeWeapon(), NPC_ClearLOS4(), NPC_ShotEntity(), NPC_UpdateAngles(), NPCInfo, NULL, entityState_s::number, gclient_s::pers, PITCH, gclient_s::playerTeam, gclient_s::ps, Q_irand(), qboolean, qfalse, qtrue, gentity_s::r, gentity_s::s, SCF_ALT_FIRE, SCF_FIRE_WEAPON, gNPC_t::scriptFlags, SPOT_HEAD, SVF_GLASS_BRUSH, entityShared_t::svFlags, gentity_s::takedamage, level_locals_t::time, TIMER_Done(), TIMER_Set(), trap_InPVS(), trap_Trace(), ucmd, vec3_origin, vec3_t, vectoangles(), VectorClear, VectorCopy, VectorMA, VectorNormalize(), VectorSubtract, playerState_s::viewangles, entityState_s::weapon, playerState_s::weapon, WeaponThink(), playerState_s::weaponTime, WP_BLASTER, WP_DET_PACK, WP_DISRUPTOR, WP_EMPLACED_GUN, WP_FLECHETTE, WP_NONE, WP_REPEATER, WP_ROCKET_LAUNCHER, WP_SABER, WP_THERMAL, WP_TRIP_MINE, and YAW. Referenced by NPC_BSSeeker_Default().
00482 {
00483 qboolean enemyLOS = qfalse;
00484 qboolean enemyCS = qfalse;
00485 qboolean enemyInFOV = qfalse;
00486 //qboolean move = qtrue;
00487 qboolean faceEnemy = qfalse;
00488 qboolean shoot = qfalse;
00489 qboolean hitAlly = qfalse;
00490 vec3_t impactPos;
00491 float enemyDist;
00492 float dot;
00493 vec3_t enemyDir, shootDir;
00494
00495 if ( NPC->client->ps.groundEntityNum == ENTITYNUM_NONE
00496 && NPC->client->ps.fd.forceJumpZStart
00497 && !BG_FlippingAnim( NPC->client->ps.legsAnim )
00498 && !Q_irand( 0, 10 ) )
00499 {//take off
00500 Boba_FlyStart( NPC );
00501 }
00502
00503 if ( !NPC->enemy )
00504 {
00505 return;
00506 }
00507
00508 /*
00509 if ( NPC->enemy->enemy != NPC && NPC->health == NPC->client->pers.maxHealth )
00510 {
00511 NPCInfo->scriptFlags |= SCF_ALT_FIRE;
00512 Boba_ChangeWeapon( WP_DISRUPTOR );
00513 }
00514 else */if ( NPC->enemy->s.weapon == WP_SABER )
00515 {
00516 NPCInfo->scriptFlags &= ~SCF_ALT_FIRE;
00517 Boba_ChangeWeapon( WP_ROCKET_LAUNCHER );
00518 }
00519 else
00520 {
00521 if ( NPC->health < NPC->client->pers.maxHealth*0.5f )
00522 {
00523 NPCInfo->scriptFlags |= SCF_ALT_FIRE;
00524 Boba_ChangeWeapon( WP_BLASTER );
00525 NPCInfo->burstMin = 3;
00526 NPCInfo->burstMean = 12;
00527 NPCInfo->burstMax = 20;
00528 NPCInfo->burstSpacing = Q_irand( 300, 750 );//attack debounce
00529 }
00530 else
00531 {
00532 NPCInfo->scriptFlags &= ~SCF_ALT_FIRE;
00533 Boba_ChangeWeapon( WP_BLASTER );
00534 }
00535 }
00536
00537 VectorClear( impactPos );
00538 enemyDist = DistanceSquared( NPC->r.currentOrigin, NPC->enemy->r.currentOrigin );
00539
00540 VectorSubtract( NPC->enemy->r.currentOrigin, NPC->r.currentOrigin, enemyDir );
00541 VectorNormalize( enemyDir );
00542 AngleVectors( NPC->client->ps.viewangles, shootDir, NULL, NULL );
00543 dot = DotProduct( enemyDir, shootDir );
00544 if ( dot > 0.5f ||( enemyDist * (1.0f-dot)) < 10000 )
00545 {//enemy is in front of me or they're very close and not behind me
00546 enemyInFOV = qtrue;
00547 }
00548
00549 if ( (enemyDist < (128*128)&&enemyInFOV) || !TIMER_Done( NPC, "flameTime" ) )
00550 {//flamethrower
00551 Boba_DoFlameThrower( NPC );
00552 enemyCS = qfalse;
00553 shoot = qfalse;
00554 NPCInfo->enemyLastSeenTime = level.time;
00555 faceEnemy = qtrue;
00556 ucmd.buttons &= ~(BUTTON_ATTACK|BUTTON_ALT_ATTACK);
00557 }
00558 else if ( enemyDist < MIN_ROCKET_DIST_SQUARED )//128
00559 {//enemy within 128
00560 if ( (NPC->client->ps.weapon == WP_FLECHETTE || NPC->client->ps.weapon == WP_REPEATER) &&
00561 (NPCInfo->scriptFlags & SCF_ALT_FIRE) )
00562 {//shooting an explosive, but enemy too close, switch to primary fire
00563 NPCInfo->scriptFlags &= ~SCF_ALT_FIRE;
00564 //FIXME: we can never go back to alt-fire this way since, after this, we don't know if we were initially supposed to use alt-fire or not...
00565 }
00566 }
00567 else if ( enemyDist > 65536 )//256 squared
00568 {
00569 if ( NPC->client->ps.weapon == WP_DISRUPTOR )
00570 {//sniping... should be assumed
00571 if ( !(NPCInfo->scriptFlags&SCF_ALT_FIRE) )
00572 {//use primary fire
00573 NPCInfo->scriptFlags |= SCF_ALT_FIRE;
00574 //reset fire-timing variables
00575 NPC_ChangeWeapon( WP_DISRUPTOR );
00576 NPC_UpdateAngles( qtrue, qtrue );
00577 return;
00578 }
00579 }
00580 }
00581
00582 //can we see our target?
00583 if ( TIMER_Done( NPC, "nextAttackDelay" ) && TIMER_Done( NPC, "flameTime" ) )
00584 {
00585 if ( NPC_ClearLOS4( NPC->enemy ) )
00586 {
00587 NPCInfo->enemyLastSeenTime = level.time;
00588 enemyLOS = qtrue;
00589
00590 if ( NPC->client->ps.weapon == WP_NONE )
00591 {
00592 enemyCS = qfalse;//not true, but should stop us from firing
00593 }
00594 else
00595 {//can we shoot our target?
00596 if ( ( |