Exemplo n.º 1
0
        // Executes every GTA-frame
        private void OnPerFrameDrawing(object sender, GraphicsEventArgs e)
        {
            e.Graphics.Scaling = FontScaling.ScreenUnits;
            if (modEnabled && (gameMode == -1))
            {
                radar = e.Graphics.GetRadarRectangle(FontScaling.ScreenUnits);
                //e.Graphics.DrawText("tick-counter:" + tickCounter.ToString(), 0.5f, 0.5f);
               // e.Graphics.DrawText("no1. timelim:" + killNotificationArray[0].timeLimit.ToString(), 0.5f, 0.75f);
               // e.Graphics.DrawText("Test", 0.1f, 0.1f);
               // e.Graphics.DrawText("HS-start:" + hsStart.ToString(), 0.5f, 0.1f);
                if ((Player.Character.Health == -100) && (!deathEventBool))
                {
                    deathEventBool = true;
                    numberOfKillsSinceLastDeath = 0;
                    numberOfHeadshotsSinceLastDeath = 0;
                    dominatingPlayed = false;
                    wickedSickPlayed = false;
                    killingSpreePlayed = false;
                }
                else if ((Player.Character.Health != -100) && (deathEventBool))
                {
                    deathEventBool = false;
                }

                int tempkills = getIntStat((int)gtaStats.STAT_PEOPLE_KILLED);
                if (tempkills > numberOfkillsStart) // the player has made a kill
                {

                    int amountOfKills = tempkills - numberOfkillsStart; // this is the amount of kills the player made THIS FRAME. (is correct!!)
                    //Game.DisplayText("Amount of kills:" + amountOfKills.ToString()); // if this is > 1, problems occur =/. (double names)

                    // what to do? delay the 2nd, 3rd, etc kills to next frames! How?
                    //int[] randomIntArray = new int[amountOfKills],
                    //      randomIntArray2 = new int[amountOfKills];
                    //Random[] randomNumberArray = new Random[amountOfKills],
                    //        randomNumberArray2 = new Random[amountOfKills];

                    //for (int i = 0; i < randomIntArray.Length; i++)
                    //{
                    //  randomNumberArray[i] = new Random();
                    //  randomNumberArray2[i] = new Random();
                    //  randomIntArray[i] = randomNumberArray[i].Next(0, 26);
                    //  randomIntArray2[i] = randomNumberArray2[i].Next(0, numberOfSurnames - 1);
                    //}

                    //for (int i = 0; i < amountOfKills; i++) // loop through all made kills and assign stuff
                    //{
                    int notificationNumber = getAvailableKillNotification();
                    string killType = getKillType();
                    int tempHScounter = numberOfHeadshotsSinceLastDeath;
                    if (string.Compare(killType, "headshot") == 0)
                    {
                        numberOfHeadshotsSinceLastDeath += 1;
                        comboWhoreCounter += 1;
                        string killType2 = getKillType();
                        killType = (killType + "_" + killType2);
                    }
                    else
                    {
                        comboWhoreCounter = 0;
                    }

                    if (playSound)
                    {
                        int tempMultiKillCounter = 1,
                            tempRampageCounter = 1,
                            tempRampageExclusionNumber = 0,
                            tempExclusionNumber = 0,
                            tempOwnageExclusionNumber = 0,
                            tempOwnageCounter = 1,
                            tempMegaKillCounter = 1,
                            tempUnstoppableCounter = 1,
                            tempUnstoppableExclusionNumber = 0;
                        for (int i = 0; i < killEventArray.Length; i++)
                        {
                            if ((killEventArray[i].eventTime > globalCounter - MULTIKILL_TIMELIMIT) && (killEventArray[i].eventTime > multiKillExclusionNumber))
                            {
                                if (killEventArray[i].eventTime > tempExclusionNumber)
                                {
                                    tempExclusionNumber = killEventArray[i].eventTime;
                                }
                                tempMultiKillCounter += 1;
                            }
                            if ((killEventArray[i].eventTime > globalCounter - UNSTOPPABLE_TIME) && (killEventArray[i].eventTime > unstoppableExclusionNumber) && (killEventArray[i].eventInVehicle == true))
                            {
                                if (killEventArray[i].eventTime > tempUnstoppableExclusionNumber)
                                {
                                    tempUnstoppableExclusionNumber = killEventArray[i].eventTime;
                                }
                                tempUnstoppableCounter += 1;
                            }
                            if ((killEventArray[i].eventTime > globalCounter - RAMPAGE_TIME) && (killEventArray[i].eventTime > rampageExclusionNumber) && (killEventArray[i].eventType.Contains("grenadelauncher") || killEventArray[i].eventType.Contains("pipebomb") || killEventArray[i].eventType.Contains("rpg") || killEventArray[i].eventType.Contains("grenade") || killEventArray[i].eventType.Contains("sticky")))
                            {
                                if (killEventArray[i].eventTime > tempRampageExclusionNumber)
                                {
                                    tempRampageExclusionNumber = killEventArray[i].eventTime;
                                }
                                tempRampageCounter += 1;
                            }
                            if ((killEventArray[i].eventTime > globalCounter - OWNAGE_TIMELIMIT) && (killEventArray[i].eventTime > ownageExclusionNumber))
                            {
                                if (killEventArray[i].eventTime > tempOwnageExclusionNumber)
                                {
                                    tempOwnageExclusionNumber = killEventArray[i].eventTime;
                                }
                                tempOwnageCounter += 1;
                            }
                            if (killEventArray[i].eventTime > globalCounter - MEGAKILL_TIMELIMIT)
                            {
                                tempMegaKillCounter += 1;
                            }
                        }
            #if DEBUG
                        Game.Console.Print("rampage counter: " + tempRampageCounter.ToString());
            #endif
                        numberOfKillsSinceLastDeath += 1;

                        if (numberOfKillsSinceLastDeath == 1)
                        {
                            firstBloodSound.Play();
                        }
                        else if ((tempUnstoppableCounter >= KILLS_FOR_UNSTOPPABLE) && Player.Character.isInVehicle())
                        {
                            unstoppableSound.Play();
                            unstoppableExclusionNumber = tempUnstoppableExclusionNumber;
                        }
                        else if ((killType.CompareTo("pool_cue") == 0) || (killType.CompareTo("knife") == 0) || (killType.CompareTo("unarmed") == 0) || (killType.CompareTo("baseball") == 0))
                        {
                            humiliationSound.Play();
                        }
                        else if (tempRampageCounter >= KILLS_FOR_RAMPAGE)
                        {
                            rampageExclusionNumber = tempRampageExclusionNumber;
                            rampageSound.Play();
                        }
                        else if ((tempOwnageCounter >= KILLS_FOR_OWNAGE) && !(killType.Contains("grenadelauncher") || killType.Contains("pipebomb") || killType.Contains("rpg") || killType.Contains("grenade") || killType.Contains("sticky")) && !(Player.Character.isInVehicle()))
                        {
                            ownageExclusionNumber = tempOwnageExclusionNumber;
                            ownageSound.Play();
                        }
                        else if ((tempMegaKillCounter > 3) && (killType.Contains("grenadelauncher") || killType.Contains("pipebomb") || killType.Contains("rpg") || killType.Contains("grenade") || killType.Contains("sticky")))
                        {
                            megaKillSound.Play();
                        }
                        else if (tempMultiKillCounter >= KILLS_FOR_MULTIKILL)
                        {
                            multiKillExclusionNumber = tempExclusionNumber;
                            multiKillSound.Play();
                        }
                        else if (tempHScounter < numberOfHeadshotsSinceLastDeath)
                        {
                            if (comboWhoreCounter == KILLS_FOR_HOLYSHIT)
                            {
                                holyShitSound.Play();
                            }
                            else if (comboWhoreCounter == KILLS_FOR_COMBOWHORE)
                            {
                                //comboWhoreCounter = 0;
                                comboWhoreSound.Play();
                            }
                            else
                            {
                                headshotSoundPlayer.Play();
                            }
                        }
                        else if ((globalCounter > GODLIKE_TIME + godlikeTimer) && (Player.WantedLevel > 4))
                        {
                            godlikeSound.Play();
                            godlikeTimer = globalCounter;
                        }
                        else if ((numberOfKillsSinceLastDeath >= KILLS_FOR_DOMINATING) && (!dominatingPlayed))
                        {
                            dominatingPlayed = true;
                            dominatingSound.Play();
                        }
                        else if ((numberOfKillsSinceLastDeath >= KILLS_FOR_KILLINGSPREE) && (!killingSpreePlayed))
                        {
                            killingSpreePlayed = true;
                            killingSpreeSound.Play();
                        }
                        else if ((numberOfKillsSinceLastDeath >= KILLS_FOR_WICKEDSICK) && (!wickedSickPlayed))
                        {
                            wickedSickPlayed = true;
                            wickedSickSound.Play();
                        }
                    }

                    int randomNumber,
                        randomNumber2;
                    Random randomInt = new Random(),
                           randomInt2 = new Random();

                    randomNumber = randomInt.Next(0, 26);
                    randomNumber2 = randomInt2.Next(0, numberOfSurnames);

                    if (currentEpisode == GameEpisode.GTAIV)
                    {
                        killNotificationArray[notificationNumber].Attacker = "N. Bellic";
                    }
                    else if (currentEpisode == GameEpisode.TBOGT)
                    {
                        killNotificationArray[notificationNumber].Attacker = "L. Lopez";
                    }
                    else if (currentEpisode == GameEpisode.TLAD)
                    {
                        killNotificationArray[notificationNumber].Attacker = "J. Klebitz";
                    }
                    else
                    {
                        killNotificationArray[notificationNumber].Attacker = "You";
                    }

                    killNotificationArray[notificationNumber].Weapon = killType;
                    killNotificationArray[notificationNumber].Victim = (alphabetArray[randomNumber] + ". " + surnameArray[randomNumber2]);
                    killNotificationArray[notificationNumber].isVisible = true;
                    killNotificationArray[notificationNumber].timeLimit = killStayTime;

                    numberOfKillEvents += 1;

                    if (numberOfKillEvents >= killEventArray.Length - 2)
                    {
                        killEvent[] tempArray = killEventArray;
                        killEventArray = new killEvent[killEventArray.Length + 10];
                        currentEventArraySize += 10;
                        for (int i = 0; i < killEventArray.Length; i++)
                        {

                            killEventArray[i] = new killEvent();
                            if (i < tempArray.Length)
                            {
                                killEventArray[i] = tempArray[i];

                            }
                        }

                    }
                    killEventArray[numberOfKillEvents] = new killEvent();
                    killEventArray[numberOfKillEvents].eventType = killType;
                    killEventArray[numberOfKillEvents].eventTime = globalCounter;
                    killEventArray[numberOfKillEvents].eventInVehicle = false;
                    if (Player.Character.isInVehicle())
                    {
                        killEventArray[numberOfKillEvents].eventInVehicle = true;
                    }

            #if DEBUG
                        Game.Console.Print("KeA: " + killEventArray[numberOfKillEvents].eventType + "|" + killEventArray[numberOfKillEvents].eventTime + "|" + killEventArray[numberOfKillEvents].eventInVehicle.ToString());
            #endif

            #if DEBUG
                        Game.Console.Print("[DEBUG]: Notification No: " + notificationNumber.ToString());
                        Game.Console.Print("[DEBUG]: Victim: " + (alphabetArray[randomNumber] + ". " + surnameArray[randomNumber2]));

            #endif
                    numberOfkillsStart += 1;

                    //}
                }

                int tempRunOver = getIntStat((int)gtaStats.STAT_PEOPLE_RUN_DOWN);
                if (tempRunOver > runoverStart)
                {
                    runoverStart = tempRunOver;
                }
                //e.Graphics.DrawSprite(testTexture, 0.5f, 0.5f, 0.3f, 0.3f, 0);
                if (showIcons)
                {
                    for (int i = 0; i < killNotificationArray.Length; i++)
                    {
                        if (killNotificationArray[i].isVisible) // Dubbele....!
                        {
                            //e.Graphics.Scaling = FontScaling.ScreenUnits;
                            e.Graphics.Scaling = FontScaling.Pixel;
                            RectangleF radarRect = e.Graphics.GetRadarRectangle(FontScaling.Pixel);
                            float scaler = radarRect.Width / 210; // at 1680x1050 this is 210

                            //e.Graphics.DrawText(killNotificationArray[i].Attacker + "-" + killNotificationArray[i].Weapon + "-" + killNotificationArray[i].Victim, 0.033f, 0.1f * (0.3f*i));
                            if ((i % 2) == 0)
                            {
                                e.Graphics.DrawRectangle(new RectangleF(iconX * scaler, (iconHeight + iconYdiff) * i * scaler, iconWidth * scaler, iconHeight * scaler), Color.FromArgb(100, Color.White));
                                e.Graphics.DrawText(killNotificationArray[i].Attacker, attackerX * scaler, (iconHeight + iconYdiff) * i * scaler + 0.25f * iconHeight * scaler, Color.FromArgb(255, 120, 120, 120));
                                e.Graphics.DrawText(killNotificationArray[i].Victim, victimX * scaler, (iconHeight + iconYdiff) * i * scaler + 0.25f * iconHeight * scaler, Color.FromArgb(255, 120, 120, 120));
                                //e.Graphics.DrawRectangle(new RectangleF(0.032f, 0.098f * (0.35f * i), 0.25f, 0.032f), Color.FromArgb(100, Color.White));
                                //e.Graphics.DrawText(killNotificationArray[i].Attacker + "                         " + killNotificationArray[i].Victim, 0.033f, 0.1f * (0.35f * i), Color.Gray);
                            }
                            else
                            {
                                e.Graphics.DrawRectangle(new RectangleF(iconHeight * scaler, (iconHeight + iconYdiff) * i * scaler, iconWidth * scaler, iconHeight * scaler), Color.FromArgb(100, Color.Gray));
                                e.Graphics.DrawText(killNotificationArray[i].Attacker, attackerX * scaler, (iconHeight + iconYdiff) * i * scaler + 0.25f * iconHeight * scaler, Color.White);
                                e.Graphics.DrawText(killNotificationArray[i].Victim, victimX * scaler, (iconHeight + iconYdiff) * i * scaler + 0.25f * iconHeight * scaler, Color.White);
                                //e.Graphics.DrawRectangle(new RectangleF(0.032f, 0.098f * (0.35f * i), 0.25f, 0.032f), Color.FromArgb(100, Color.Gray));
                                // e.Graphics.DrawText(killNotificationArray[i].Attacker + "                         " + killNotificationArray[i].Victim, 0.033f, 0.1f * (0.35f * i), Color.White);
                            }

                            // e.Graphics.Scaling = FontScaling.Pixel;

                            /*
                            float scaler = radarRect.Width; // at 1680x1050 this is 210
                            RectangleF placeRect = new RectangleF(
                                                            new PointF(
                                                                radarRect.X + (0.35f * scaler),
                                                                radarRect.Y - (3.74f * scaler) + (i * 0.17f * scaler)),
                                                                    new SizeF(
                                                                        (256 * imageSizeMultiplier) * (scaler / 210),
                                                                        (128 * imageSizeMultiplier) * (scaler / 210)));
                            */

                            //RectangleF placeRect = new RectangleF(new PointF((int)180 * scaler, (int)(17 * scaler) * i), new SizeF(256 * scaler * 0.7f , 128 * scaler * 0.7f));
                            Vector4 placeVect = new Vector4(weaponX * scaler,                               // X
                                                            (iconHeight + iconYdiff) * i * scaler + 0.5f * iconHeight * scaler,        // Y
                                                            256 * scaler * 0.6f,                        // width
                                                            128 * scaler * 0.6f);                       // height
                            /*
                            RectangleF placeRect = new RectangleF(
                                                            new PointF(
                                                                0.033f + 0.06f,
                                                                0.035f * i - 0.0165f),
                                                                    new SizeF(
                                                                        0.07f,
                                                                        0.07f));
                             * */

                            if (killNotificationArray[i].Weapon.Contains("headshot") && useHsModifier)
                            {
                                e.Graphics.DrawSprite(headshotModifier, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(headshot, placeRect);
                            }
                            if (killNotificationArray[i].Weapon.Contains("unarmed"))
                            {
                                e.Graphics.DrawSprite(unarmed, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                // e.Graphics.DrawSprite(unarmed, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("aa12regular"))
                            {
                                e.Graphics.DrawSprite(aa12, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("aa12explosive"))
                            {
                                e.Graphics.DrawSprite(aa12, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("auto_pistol"))
                            {
                                e.Graphics.DrawSprite(auto_pistol, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("assault_shotgun"))
                            {
                                e.Graphics.DrawSprite(assault_shotgun, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("lmg"))
                            {
                                e.Graphics.DrawSprite(lmg, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("sawnoff_shotgun"))
                            {
                                e.Graphics.DrawSprite(sawnoff_shotgun, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("pipebomb"))
                            {
                                e.Graphics.DrawSprite(pipebomb, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("advanced_sniper"))
                            {
                                e.Graphics.DrawSprite(advanced_sniper, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("pool_cue"))
                            {
                                e.Graphics.DrawSprite(poolcue, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("sticky"))
                            {
                                e.Graphics.DrawSprite(sticky, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("grenadelauncher"))
                            {
                                e.Graphics.DrawSprite(grenadelauncher, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("p90"))
                            {
                                e.Graphics.DrawSprite(p90, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("golden_smg"))
                            {
                                e.Graphics.DrawSprite(golden_smg, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("pistol44"))
                            {
                                e.Graphics.DrawSprite(pistol44, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("baseball"))
                            {
                                e.Graphics.DrawSprite(baseball, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(baseball, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("knife"))
                            {
                                e.Graphics.DrawSprite(knife, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(knife, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("pistol"))
                            {
                                e.Graphics.DrawSprite(pistol, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(pistol, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("grenade"))
                            {
                                e.Graphics.DrawSprite(grenade, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                // e.Graphics.DrawSprite(grenade, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("molotov"))
                            {
                                e.Graphics.DrawSprite(molotov, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(molotov, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("deagle"))
                            {
                                e.Graphics.DrawSprite(deagle, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                // e.Graphics.DrawSprite(deagle, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("vehicle_explosion"))
                            {
                                e.Graphics.DrawSprite(vehicle_explosion, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(vehicle_explosion, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("combat_shotgun"))
                            {
                                e.Graphics.DrawSprite(combat_shotgun, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(combat_shotgun, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("shotgun"))
                            {
                                e.Graphics.DrawSprite(shotgun, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(shotgun, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("micro_smg"))
                            {
                                e.Graphics.DrawSprite(micro_smg, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(micro_smg, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("mp5"))
                            {
                                e.Graphics.DrawSprite(mp5, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(mp5, placeRect);
                            }
                            /*else if (killNotificationArray[i].Weapon.Contains("m4"))
                            {
                                e.Graphics.DrawSprite(m4, 0.5f, (0.1f * (0.3f * i)) + 0.03f, 0.08f, (0.08f * (103f / 245f)) * (radar.Height / radar.Width), 0f);
                            }*/
                            else if (killNotificationArray[i].Weapon.Contains("m4"))
                            {
                                e.Graphics.DrawSprite(m4, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(m4, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("ak47"))
                            {
                                e.Graphics.DrawSprite(ak47, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(ak47, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("rpg"))
                            {
                                e.Graphics.DrawSprite(rpg, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(rpg, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("combat_sniper"))
                            {
                                e.Graphics.DrawSprite(combat_sniper, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(combat_sniper, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("sniper"))
                            {
                                e.Graphics.DrawSprite(sniper, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(sniper, placeRect);
                            }
                            else if (killNotificationArray[i].Weapon.Contains("runover"))
                            {
                                e.Graphics.DrawSprite(runover, placeVect.X, placeVect.Y, placeVect.Z, placeVect.W, 0);
                                //e.Graphics.DrawSprite(runover, placeRect);
                            }
                            e.Graphics.Scaling = FontScaling.ScreenUnits;

                        }
                    }
                }
                if ((tempBool1 != 0) && (tempBool1 != 1))
                {
                    e.Graphics.DrawText("I told you not to mess with that. \n I explicitely told you so: \n \n'Definitely don't touch this. You'll screw up everything.' \n\n But noooo, you just had to be stupid. \n Now be a good boy/girl and change that value back! \n \n \n Thank you.", 0.3f, 0.3f, Color.Yellow);
                }
                //e.Graphics.DrawText("Enabled", 0.5f, 0.5f);
            #if DEBUG
                //Game.Console.Print("x " + Game.Mouse.PositionPixel.X.ToString() + " y " + Game.Mouse.PositionPixel.Y.ToString());
            #endif
            }
        }
Exemplo n.º 2
0
        // each and every tick (interval is specified above)
        private void TickEvent(object sender, EventArgs e)
        {
            if (modEnabled && (gameMode == -1))
            {
            #if DEBUG
               // Game.Console.Print("kill event array size: " + killEventArray.Length.ToString() +"\ntime: " + globalCounter.ToString());
            #endif
                globalCounter += 1;
                tickCounter += 1;
                if (playSound)
                {
                    int highestI = -1;
                    for (int i = 0; i < killEventArray.Length; i++)
                    {
                        if (killEventArray[i].eventTime != 0)
                        {
                            ///  Game.Console.Print("KeA|" + i.ToString() + "|" + killEventArray[i].eventTime.ToString() + "|" + killEventArray[i].eventType);
                            if (killEventArray[i].eventTime + killEventRemoveTime < globalCounter)
                            {
            #if DEBUG
                                //       Game.Console.Print("R: " + killEventArray[i].eventType + "|" + killEventArray[i].eventTime.ToString() + "|" + globalCounter.ToString());
            #endif
                                highestI = i;
                                numberOfKillEvents -= 1;
                            }
                        }
                    }
                    if (highestI != -1)
                    {
                        killEvent[] tempArray = killEventArray;
                        killEventArray = new killEvent[tempArray.Length - highestI - 1];

                        for (int i = 0; i < killEventArray.Length; i++)
                        {
                            killEventArray[i] = new killEvent();
                            killEventArray[i] = tempArray[i + highestI + 1];
                        }
                    }
                }
                if (tickCounter == 200)
                {
                    tickCounter = 100;
                }

                if ((tickCounter % 10) == 0) // every second
                {
                    for (int i = 0; i < killNotificationArray.Length; i++)
                    {
                        if (killNotificationArray[i].isVisible)
                        {
                            killNotificationArray[i].timeLimit -= 1;
                            if (killNotificationArray[i].timeLimit < 1)
                            {
                                killNotificationArray[i].isVisible = false;
                                shuffleNotifications();
                            }
                        }
                    }
                }
            }
        }