6class SCR_CharacterCommandHandlerComponent_Tests : SCR_CharacterCommandHandlerComponent
13 if ( pCurrentCommandFinished )
19 float die = pInputCtx.GetDie();
22 GetCommandModifier_Death().StartDeath();
33 if( pCurrentCommandFinished )
62 float waterDepth = pInputCtx.GetWaterBodyApproxDepth();
63 float waterCharSubmersion = pInputCtx.GetWaterCharacterSubmersion();
68 if( waterDepth < swimSettings.m_fWaterLevelOut )
79 if( waterDepth >= swimSettings.m_fWaterLevelIn && waterCharSubmersion >= swimSettings.m_fWaterLevelIn )
91 if( waterCharSubmersion > swimSettings.m_fToErectLevel )
95 else if( waterCharSubmersion > swimSettings.m_fToCrouchLevel )
121 vector mins =
"-0.5 -0.5 -0.5";
122 vector maxs =
"0.5 2.0 0.5";
125 trace.LayerMask = EPhysicsLayerDefs.Ladder;
127 trace.Start = charTM[3];
146 if (ladder.IsAbove(charTM[3]))
147 ladderTM[2] = ladderTM[2] * -1;
149 float cosFi =
vector.Dot(charTM[2], ladderTM[2]);
150 vector cross = charTM[2] * ladderTM[2];
151 float dirAngle =
Math.Acos(cosFi) *
Math.RAD2DEG;
154 dirAngle = -dirAngle;
160 pInputCtx.GetMovement(movementSpeed, movementDir);
163 if(((dirAngle <= 30 && dirAngle >= -30) ||
Math.AbsFloat(dirAngle) == 90) && movementDir[2] > 0)
166 StartCommand_Ladder(ladder);
194 if( fallCmd && fallCmd.PhysicsLanded() )
200 if( fFallYDiff < 0.5 )
202 else if( fFallYDiff < 1.0 )
204 else if( fFallYDiff < 2.0 )
217 StartCommand_Fall(0);
396 float lrAngle = m_CommandWeapons.GetAimAngleLR();
397 float udAngle = m_CommandWeapons.GetAimAngleUD();
400 float ya = Math.DEG2RAD * lrAngle;
401 float pa = Math.DEG2RAD * udAngle;
402 float cp = Math.Cos(0);
404 //enf::Vector3 dirMS{ cp * sinf(ya), sin(pa), cp * cosf(ya) };
405 vector dirMS = Vector(cp * Math.Sin(ya), Math.Sin(pa), cp * Math.Cos(ya));
406 //enf::Vector3 dirWS = m_pOwner->GetWorldTransform().TransformVector(dirMS.Normalized());
407 vector dirWS = m_OwnerEntity.VectorToParent(dirMS.Normalized());
409 m_WeaponManager.Throw(m_OwnerEntity, true, dirWS, m_fThrowingForce);
410 m_ThrowingState = EThrowingState.THROWING_FINISH;
414 case EThrowingState.THROWING_FINISH:
415 if( m_CommandWeapons.IsThrowTag() )
417 m_fThrowingForce = 0.0;
418 m_ThrowingState = EThrowingState.THROWING_NONE;
421 case EThrowingState.THROWING_CANCEL_ENTER:
422 if( !m_CommandWeapons.IsGrenadeAttachmentAnimTag() )
424 m_CommandWeapons.StartPinGrenadeAction(1);
425 m_WeaponManager.OnAnimationEvent("Weapon_Repin", nullptr, -1);
426 m_fThrowingForce = 0.0;
427 m_ThrowingState = EThrowingState.THROWING_CANCEL_EXIT;
431 case EThrowingState.THROWING_CANCEL_EXIT:
432 if( !m_CommandWeapons.IsGrenadeAttachmentAnimTag() )
434 m_ThrowingState = EThrowingState.THROWING_NONE;
446 if ( pInputCtx.GetJump() > 0.0 )
448 CancelThrowDefault();
453 vector grabPoint = climbTestResult.m_ClimbGrabPointLS;
454 if ( climbTestResult.m_ClimbParent )
457 climbTestResult.m_ClimbParent.GetWorldTransform(grabParentTM);
458 grabPoint = grabPoint.Multiply4(grabParentTM);
463 const float climbHeight = grabPoint[1] - charTM[3][1];
466 if ( climbTestResult.m_bIsClimb || climbTestResult.m_bIsClimbOver )
468 if ( climbHeight < 1.1 )
470 else if( climbHeight >= 1.1 && climbHeight < 1.7 )
472 else if( climbHeight >= 1.7 && climbHeight < 2.5 )
475 if ( climbType != -1 )
477 StartCommand_Climb(climbTestResult, climbType);
481 if ( climbType == -1 )
484 StartCommand_Fall(pInputCtx.GetJump());
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_AIUtilityComponentClass m_OwnerEntity
BaseWeaponManagerComponent m_WeaponManager
CharacterAnimationComponent m_CharacterAnimComp
SCR_CharacterControllerComponent m_CharacterControllerComp
ref CharacterMovementState m_MovementState
override bool HandleFalling(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
ref SCR_CharacterCommandSwim m_SwimCommand
override bool TransitionMove_JumpClimb(CharacterInputContext pInputCtx)
override bool HandleLadders(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
override bool HandleFinishedCommands(bool pCurrentCommandFinished)
override bool HandleClimbing(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
override bool HandleSwimming(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID)
ref SCR_CharacterCommandFly m_FlyCommand
ref SCR_CharacterCommandSwimST m_SwimST
SCR_CharacterCommandHandlerComponent_TestsClass SCR_CharacterCommandHandlerComponentClass HandleDeath(CharacterInputContext pInputCtx, float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void SCR_CharacterCommandSwimST(CharacterAnimationComponent pAnimationComponent)
class SCR_CharacterCommandSwimST SCR_CharacterCommandSwim(BaseAnimPhysComponent pAnimPhysComponent, SCR_CharacterCommandSwimST pTable, ChimeraCharacter pCharacter, CharacterControllerComponent pController)
CharacterCommandSwim - swimming implementation.
proto external Managed FindComponent(typename typeName)
proto external void GetTransform(out vector mat[])
HYBRID_COMPONENT_ICON
Default icon for all components written in script that don't inherit ScriptComponent.
BaseCommandHandlerComponentClass GameComponentClass SetSimulationDisabled(bool pSimulationDisabled)