1 [
ComponentEditorProps(
category:
"GameScripted/Character", description:
"Scripted character command handler FOR TESTING", icon: HYBRID_COMPONENT_ICON)]
6 class SCR_CharacterCommandHandlerComponent_Tests : SCR_CharacterCommandHandlerComponent
11 if ( pCurrentCommandID == ECharacterCommandIDs.DEATH )
13 if ( pCurrentCommandFinished )
19 float die = pInputCtx.GetDie();
33 if( pCurrentCommandFinished )
58 if( pCurrentCommandID == ECharacterCommandIDs.VEHICLE )
62 if( pInputCtx.GetVehicleAction() == 2 )
64 cmdVeh.GetOutVehicle(1, 0, tmp);
68 if( pInputCtx.GetVehicleAction() == 3 )
70 cmdVeh.GetOutVehicle(3, 0, tmp);
86 vector pp = charTM[3];
87 float waterDepth = pInputCtx.GetWaterBodyApproxDepth();
88 float waterCharSubmersion = pInputCtx.GetWaterCharacterSubmersion();
90 if( pCurrentCommandID == ECharacterCommandIDs.SWIM )
111 if( pCurrentCommandID == ECharacterCommandIDs.MOVE )
139 if (pCurrentCommandID == ECharacterCommandIDs.LADDER )
145 vector mins =
"-0.5 -0.5 -0.5";
146 vector maxs =
"0.5 2.0 0.5";
147 autoptr TraceBox trace =
new TraceBox;
149 trace.LayerMask = EPhysicsLayerDefs.Ladder;
150 trace.Flags = TraceFlags.ENTS | TraceFlags.WORLD;
151 trace.Start = charTM[3];
164 LadderComponent ladder = LadderComponent.Cast(ge.FindComponent(LadderComponent));
168 ge.GetTransform(ladderTM);
170 if (ladder.IsAbove(charTM[3]))
171 ladderTM[2] = ladderTM[2] * -1;
173 float cosFi = vector.Dot(charTM[2], ladderTM[2]);
174 vector cross = charTM[2] * ladderTM[2];
175 float dirAngle = Math.Acos(cosFi) * Math.RAD2DEG;
178 dirAngle = -dirAngle;
184 pInputCtx.GetMovement(movementSpeed, movementDir);
187 if(((dirAngle <= 30 && dirAngle >= -30) || Math.AbsFloat(dirAngle) == 90) && movementDir[2] > 0)
202 if( pCurrentCommandID == ECharacterCommandIDs.CLIMB )
211 if ( pCurrentCommandID == ECharacterCommandIDs.FALL )
218 if( fallCmd && fallCmd.PhysicsLanded() )
224 if( fFallYDiff < 0.5 )
226 else if( fFallYDiff < 1.0 )
228 else if( fFallYDiff < 2.0 )
470 if ( pInputCtx.GetJump() > 0.0 )
478 if ( climbTestResult.m_bIsClimb || climbTestResult.m_bIsClimbOver )
480 if ( climbTestResult.m_fClimbHeight < 1.1 )
482 else if( climbTestResult.m_fClimbHeight >= 1.1 && climbTestResult.m_fClimbHeight < 1.7 )
484 else if( climbTestResult.m_fClimbHeight >= 1.7 && climbTestResult.m_fClimbHeight < 2.5 )
487 if ( climbType != -1 )
493 if ( climbType == -1 )
509 if( pInputCtx.GetVehicleAction() == 1 )
511 BaseCompartmentSlot getInCompartment = pInputCtx.GetVehicleCompartment();
512 if ( getInCompartment )
523 override protected void OnInit(IEntity owner)