Пример #1
0
 public void UseHeadBoneFaceGenScaling(
     Skeleton skeleton,
     sbyte headLookDirectionBoneIndex,
     MatrixFrame frame)
 {
     EngineApplicationInterface.IMetaMesh.UseHeadBoneFaceGenScaling(this.Pointer, skeleton.Pointer, headLookDirectionBoneIndex, ref frame);
 }
Пример #2
0
 public void CheckReinforcement(int numberOfTroops)
 {
     if (!this.IsInitialSpawnOver)
     {
         return;
     }
     for (int index = 0; index < 2; ++index)
     {
         int val1 = numberOfTroops;
         if (val1 > 0 && this._numberOfTroopsInQueueForReinforcement[index] > 0 && this._missionSides[index].TroopSpawningActive)
         {
             int number = Math.Min(MBMath.Floor((float)val1 * this.BattleSizeEffect), this._numberOfTroopsInQueueForReinforcement[index]);
             this._missionSides[index].SpawnTroops(number, true);
             InformationManager.AddQuickInformation(this._missionSides[index].IsPlayerSide ? GameTexts.FindText("str_new_reinforcements_have_arrived_for_ally_side") : GameTexts.FindText("str_new_reinforcements_have_arrived_for_enemy_side"));
             MatrixFrame cameraFrame = Mission.Current.GetCameraFrame();
             Vec3        position    = cameraFrame.origin + cameraFrame.rotation.u;
             MBSoundEvent.PlaySound(this._missionSides[index].IsPlayerSide ? SoundEvent.GetEventIdFromString("event:/alerts/report/reinforcements_ally") : SoundEvent.GetEventIdFromString("event:/alerts/report/reinforcements_enemy"), position);
             int num1 = Math.Min(val1, this._numberOfTroopsInQueueForReinforcement[index]);
             this._numberOfTroopsInQueueForReinforcement[index] -= num1;
             int num2 = num1 - number;
             this.GetActivePhaseForSide((BattleSideEnum)index).RemainingSpawnNumber += num2;
             Debug.Print("Side: " + (object)(BattleSideEnum)index, color: Debug.DebugColor.Green, debugFilter: 64UL);
             Debug.Print("NumberOfTroopsRemovedFromQueue: " + (object)num1, color: Debug.DebugColor.Green, debugFilter: 64UL);
             Debug.Print("NumberOfTroopsAddedToRemainingPool: " + (object)num2, color: Debug.DebugColor.Green, debugFilter: 64UL);
         }
     }
 }
Пример #3
0
        static bool Prefix(Agent __instance, ref Blow b)
        {
            if (InvulnerableSettings.Instance.Enabled == false)
            {
                return(true);
            }
            if (__instance.IsMainAgent)
            {
                if (!b.BlowFlag.HasAnyFlag(BlowFlags.NoSound))
                {
                    Agent agent = (b.OwnerId != -1) ? __instance.Mission.FindAgentWithIndex(b.OwnerId) : __instance;

                    int   soundIndex     = GetSoundIndex(GetWeaponClass(ref b));
                    float forceParameter = GetForceParameter(ref b);
                    SoundEventParameter soundEventParameter = new SoundEventParameter("Force", forceParameter);
                    Mission.Current.MakeSound(soundIndex, b.Position, true, false, -1, -1, ref soundEventParameter);
                    MatrixFrame f       = __instance.Frame;
                    Vec3        dirDist = b.Position - f.origin;
                    Vec3        dir     = dirDist.NormalizedCopy();
                    float       offset  = 0.05f * agent.GetEyeGlobalHeight();
                    f.origin = b.Position + dir * offset;
                    Mission.Current.Scene.CreateBurstParticle(ParticleSystemManager.GetRuntimeIdByName("psys_game_metal_metal_coll"), f);
                    __instance.Mission.AddSoundAlarmFactorToAgents(b.OwnerId, b.Position, 15f);
                }
                return(false);
            }
            return(true);
        }
Пример #4
0
        private void ApplyDisplacement(float dt)
        {
            float       num1        = this._kmPerHour * dt;
            MatrixFrame globalFrame = this.GameEntity.GetGlobalFrame();
            MatrixFrame matrixFrame = globalFrame;
            Vec3        f           = globalFrame.rotation.f;
            Vec3        u           = globalFrame.rotation.u;
            double      num2        = (double)f.Normalize();
            double      num3        = (double)u.Normalize();

            if (this._state == Bird.State.TakingOff)
            {
                matrixFrame.origin = matrixFrame.origin - f * 0.3076923f + u * 0.1f;
            }
            else if (this._state == Bird.State.Airborne)
            {
                globalFrame.origin -= f * num1;
                matrixFrame.origin -= f * num1;
            }
            else if (this._state == Bird.State.Landing)
            {
                matrixFrame.origin = matrixFrame.origin - f * 0.3076923f - u * 0.1f;
            }
            this.GameEntity.SetGlobalFrame(globalFrame);
        }
Пример #5
0
 public void CreateParticleSystemAttachedToBone(
     int runtimeParticleindex,
     sbyte boneIndex,
     ref MatrixFrame boneLocalParticleFrame)
 {
     MBAPI.IMBAgentVisuals.CreateParticleSystemAttachedToBone(this.GetPtr(), runtimeParticleindex, boneIndex, ref boneLocalParticleFrame);
 }
Пример #6
0
 public void CreateParticleSystemAttachedToBone(
     string particleName,
     sbyte boneIndex,
     ref MatrixFrame boneLocalParticleFrame)
 {
     this.CreateParticleSystemAttachedToBone(ParticleSystemManager.GetRuntimeIdByName(particleName), boneIndex, ref boneLocalParticleFrame);
 }
Пример #7
0
        public MatrixFrame GetFrame()
        {
            MatrixFrame outFrame = new MatrixFrame();

            MBAPI.IMBAgentVisuals.GetFrame(this.GetPtr(), ref outFrame);
            return(outFrame);
        }
 public void Initialize(
     int managedNavigationFaceId,
     MatrixFrame managedFrame,
     Vec3 managedDirection,
     BattleSideEnum managedSide,
     int maxUserCount,
     float arcAngle,
     float queueBeginDistance,
     float queueRowSize,
     float costPerRow,
     float baseCost,
     bool blockUsage,
     float agentSpacing,
     float zDifferenceToStopUsing,
     float distanceToStopUsing2d)
 {
     this.ManagedNavigationFaceId = managedNavigationFaceId;
     this._managedFrame           = managedFrame;
     this._managedDirection       = managedDirection;
     this._managedSide            = managedSide;
     this._maxUserCount           = maxUserCount;
     this._arcAngle               = arcAngle;
     this._queueBeginDistance     = queueBeginDistance;
     this._queueRowSize           = queueRowSize;
     this._costPerRow             = costPerRow;
     this._baseCost               = baseCost;
     this._blockUsage             = blockUsage;
     this._agentSpacing           = agentSpacing;
     this._zDifferenceToStopUsing = zDifferenceToStopUsing;
     this._distanceToStopUsing2d  = distanceToStopUsing2d;
     this.UpdateNavigationFaceCost();
 }
Пример #9
0
        public void HandleCursor()
        {
            Vec3 zero1         = Vec3.Zero;
            Vec3 zero2         = Vec3.Zero;
            Vec2 viewportPoint = this.MissionScreen.SceneLayer.SceneView.ScreenPointToViewportPoint(new Vec2(0.5f, 0.5f));

            this.MissionScreen.CombatCamera.ViewportPointToWorldRay(ref zero1, ref zero2, viewportPoint);
            PathFaceRecord currentFace = new PathFaceRecord();
            Vec3           intersectionPoint;

            GetCursorIntersectionPoint(ref zero1, ref zero2, out float _, out intersectionPoint, ref currentFace, BodyFlags.CommonFocusRayCastExcludeFlags);
            this.MissionScreen.SceneLayer.SceneView.ProjectedMousePositionOnGround(ref intersectionPoint, false, false);
            MatrixFrame frame = this._cursor.GetFrame();

            frame.origin       = intersectionPoint;
            frame.rotation.f   = this.MissionScreen.CombatCamera.Frame.rotation.f;
            frame.rotation.f.z = 0.0f;
            double num1 = (double)frame.rotation.f.Normalize();

            frame.rotation.s   = this.MissionScreen.CombatCamera.Frame.rotation.s;
            frame.rotation.s.z = 0.0f;
            double num2 = (double)frame.rotation.s.Normalize();

            frame.rotation.u = Vec3.CrossProduct(frame.rotation.s, frame.rotation.f);
            frame.rotation.RotateAboutSide(-1.570796f);
            BoundingBox boundingBox = this._cursor.GetMetaMesh(0).GetBoundingBox();
            float       num3        = boundingBox.max.y - boundingBox.min.y;

            frame.Advance(-num3);
            this._cursor.SetFrame(ref frame);
            this._cursor.GetFirstMesh().SetMeshRenderOrder(200);
        }