Beispiel #1
0
        // Handles motion (dx, dy) in screen space.
        // The "edge" parameter specifies which edges the user is dragging.
        public void HandleMotion(HitPosition edge, float dx, float dy)
        {
            var r = ComputeLayout();

            switch (edge)
            {
            case HitPosition.None:
                return;

            case HitPosition.Move:
                // Convert to image space before sending to moveBy().
                MoveBy(dx * (_cropRect.Width() / r.Width()),
                       dy * (_cropRect.Height() / r.Height()));
                break;

            default:
                if (!edge.HasFlag(HitPosition.GrowLeftEdge) && !edge.HasFlag(HitPosition.GrowRightEdge))
                {
                    dx = 0;
                }

                if (!edge.HasFlag(HitPosition.GrowTopEdge) && !edge.HasFlag(HitPosition.GrowBottomEdge))
                {
                    dy = 0;
                }

                // Convert to image space before sending to growBy().
                var xDelta = dx * (_cropRect.Width() / r.Width());
                var yDelta = dy * (_cropRect.Height() / r.Height());

                GrowBy((edge.HasFlag(HitPosition.GrowLeftEdge) ? -1 : 1) * xDelta,
                       (edge.HasFlag(HitPosition.GrowTopEdge) ? -1 : 1) * yDelta);
                break;
            }
        }
        // THIS IS WHERE I WILL ADD CODE TO MAKE GAZE INTREACTIONS
        private void Update()
        {
            if (!FindGazeTransform())
            {
                return;
            }

            if (DebugDrawRay)
            {
                // GazeOrigin is the HoloLens device, or my head
                // HitPosition is the closest object a ray from the HoloLens hits
                Debug.DrawRay(GazeOrigin, (HitPosition - GazeOrigin), Color.white);
                Debug.Log("My head is at position: " + GazeOrigin.ToString());
                Debug.Log("Object closest to me is at position: " + HitPosition.ToString());
            }

            // If I see the pink cube it should spin
            if (HitObject.transform.name == "SpinningCube")
            {
                HitObject.transform.GetComponent <CubeManager>().SpinCube();
                seenObjects.Add(HitObject.transform.name);
            }
            if (HitObject.transform.name != "SpinningCube")
            {
                HitObject.transform.GetComponent <CubeManager>().StopSpinCube();
            }

            // Homework: Detect the hidden object
        }
        // Handles motion (dx, dy) in screen space.
        // The "edge" parameter specifies which edges the user is dragging.
        public void HandleMotion(HitPosition edge, float dx, float dy)
        {
            Rect r = computeLayout();

            if (edge == HitPosition.None)
            {
                return;
            }
            else if (edge == HitPosition.Move)
            {
                // Convert to image space before sending to moveBy().
                moveBy(dx * (cropRect.Width() / r.Width()),
                       dy * (cropRect.Height() / r.Height()));
            }
            else
            {
                if (!edge.HasFlag(HitPosition.GrowLeftEdge) && !edge.HasFlag(HitPosition.GrowRightEdge))
                {
                    dx = 0;
                }

                if (!edge.HasFlag(HitPosition.GrowTopEdge) && !edge.HasFlag(HitPosition.GrowBottomEdge))
                {
                    dy = 0;
                }

                // Convert to image space before sending to growBy().
                float xDelta = dx * (cropRect.Width() / r.Width());
                float yDelta = dy * (cropRect.Height() / r.Height());

                growBy((edge.HasFlag(HitPosition.GrowLeftEdge) ? -1 : 1) * xDelta,
                       (edge.HasFlag(HitPosition.GrowTopEdge) ? -1 : 1) * yDelta);
            }
        }
 void Hit(float Lifetime,float Damage,HitPosition HitArea)
 {
     AttackHitbox.hitboxClass.hitArea = HitArea;
     AttackHitbox.hitboxClass.damage = Damage;
     AttackHitbox.hitboxClass.lifetime = Lifetime;
     AttackHitbox.objectGameObject.SetActive(true);
 }
Beispiel #5
0
        public void UpdateBulletData(float time, ref WorldMovement Movement)
        {
            if (Movement != default)
            {
                Vector3 currentPos   = Movement.Position;
                Vector3 nextFramePos = Movement.Position + (Movement.MoveDirection * MuzzleVelocity * time);
                RayDistance = Vector3.Magnitude(nextFramePos - currentPos);

                if (RayDistance > 0)
                {
                    if (IsHit)
                    {
                        Movement.SetPosition(HitPosition);
                    }
                    else
                    {
                        NextFramePos = nextFramePos;
                        Movement.SetPosition(nextFramePos);
                    }
                }
                else
                {
                    "Log: Bullet is hit, position is ({0})".Log(HitPosition.ToString());
                }
            }
        }
Beispiel #6
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="hit"></param>
        /// <returns></returns>
        /// <created>UPh,29.08.2015</created>
        /// <changed>UPh,29.08.2015</changed>
        // ********************************************************************************
        int HitTest(Point pt, out HitPosition hit)
        {
            hit = HitPosition.None;

            for (int i = TopIndex; i < Items.Count; i++)
            {
                Rectangle rc = GetItemRectangle(i);
                if (!rc.Contains(pt))
                {
                    continue;
                }
                hit = HitPosition.Item;

                if (GetCheckBoxRect(i).Contains(pt))
                {
                    hit = HitPosition.CheckBox;
                }

                return(i);
            }
            return(-1);
        }
        private void TourStopList_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Y < 10)
            {
                return;
            }
            bool extendingRange = false;
            int index = GetItemIndexFromCursor(e.Location);
            if (index > -1)
            {

                if (multiSelectMode)
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Right)
                    {
                        if (SelectedItems.ContainsKey(index) && SelectedItems.Count > 1)
                        {
                            // We are right clicking on a multi selection.. Set focus only
                            selectedItem = index;
                            return;
                        }
                    }

                    if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                    {
                        // No control key means clear existing selection and replace
                        SelectedItems.Clear();
                    }

                    if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                    {
                        extendingRange = true;
                        // Add Range to selection
                        int a = Math.Min(index, selectedItem);
                        int b = Math.Max(index, selectedItem);

                        for (int i = a; i <= b; i++)
                        {
                            if (!SelectedItems.ContainsKey(i))
                            {
                                SelectedItems.Add(i, Items[i]);
                            }
                        }
                    }
                    else
                    {
                        // Simple Selection
                        if (SelectedItems.ContainsKey(index))
                        {
                            // Remove an item only if there is more than one selection.
                            if (SelectedItems.Count > 1)
                            {
                                SelectedItems.Remove(index);
                            }
                        }
                        else
                        {
                            SelectedItems.Add(index, Items[index]);
                        }
                    }

                    multipleSelection = (SelectedItems.Count > 1);
                }
                else
                {
                    multipleSelection = false;
                    SelectedItems.Clear();
                    SelectedItems.Add(index, Items[index]);
                }

                // In multiselect case this acts as focus
                if (!extendingRange)
                {
                    selectedItem = index;
                }

                if (((Control.ModifierKeys & Keys.Control) == Keys.Control) || ((Control.ModifierKeys & Keys.Shift) == Keys.Shift))
                {
                    // Early exit if multi-selecting
                    return;
                }

                hitType = this.GetCusorSytleFromCursorPosition(e.Location);

                if (ItemClicked != null)
                {
                    ItemClicked.Invoke(this, Items[index]);
                }

                if (Tour.EditMode)
                {
                    if (hitType == HitPosition.EditTime)
                    {
                        int item = GetItemIndexFromCursor(e.Location);
                        Point pnt = GetTimeEditLocation(e.Location);
                        if (timeEditor != null)
                        {
                            timeEditor.Close();
                            timeEditor.Dispose();
                            timeEditor = null;
                        }
                        timeEditor = new DurrationEditor();
                        timeEditor.target = Items[index];
                        timeEditor.Show();
                        timeEditor.Focus();

                        pnt = PointToScreen(pnt);
                        pnt.X += 4;
                        pnt.Y += 65;
                        timeEditor.Location = pnt;
                    }

                    if (hitType == HitPosition.EditName)
                    {
                        int item = GetItemIndexFromCursor(e.Location);
                        Point pnt = GetTimeEditLocation(e.Location);
                        if (textEditor != null)
                        {
                            textEditor.Close();
                            textEditor.Dispose();
                            textEditor = null;
                        }
                        textEditor = new PopupTextEditor();
                        textEditor.target = Items[index];
                        textEditor.Show();
                        textEditor.Focus();

                        pnt = PointToScreen(pnt);
                        pnt.X += 15;
                        pnt.Y += 49;
                        textEditor.Location = pnt;
                    }

                    if (hitType == HitPosition.StartPosition)
                    {
                        if (ShowStartPosition != null)
                        {

                            ShowStartPosition.Invoke(this, Items[index]);
                        }
                    }
                    if (hitType == HitPosition.EndPosition)
                    {
                        if (ShowStartPosition != null)
                        {
                            ShowEndPosition.Invoke(this, Items[index]);
                        }
                    }

                    if (hitType == HitPosition.Transition)
                    {
                        TransitionsPopup transPopup = new TransitionsPopup();
                        transPopup.Target = Items[index];
                        transPopup.TargetWasChanged += new EventHandler(transPopup_TargetWasChanged);
                        Point pnt = new Point((int)((int)(e.X / horzMultiple) * horzMultiple), Height);

                        transPopup.Show();
                        transPopup.Focus();
                        pnt = PointToScreen(pnt);
                        pnt.X -= 10;
                        pnt.Y -= 18;
                        transPopup.Location = pnt;

                    }
                }
            }
            else if (addButtonHover)
            {
                if (e.Button != System.Windows.Forms.MouseButtons.Right)
                {
                    if (Tour.EditMode && showAddButton)
                    {
                        if (AddNewSlide != null)
                        {
                            AddNewSlide.Invoke(this, null);
                        }
                    }
                }
                else
                {
                    SelectedItems.Clear();
                    SelectedItem = -1;
                }
            }
            else if (index == -2)
            {
                SelectedItems.Clear();
                SelectedItem = -1;
                if (ItemClicked != null)
                {
                    ItemClicked.Invoke(this, null);
                }
            }
        }
        // Handles motion (dx, dy) in screen space.
        // The "edge" parameter specifies which edges the user is dragging.
        public void HandleMotion(HitPosition edge, float dx, float dy)
        {
            Rect r = computeLayout();
            if (edge == HitPosition.None)
            {
                return;
            }
            else if (edge == HitPosition.Move)
            {
                // Convert to image space before sending to moveBy().
                moveBy(dx * (cropRect.Width() / r.Width()),
                       dy * (cropRect.Height() / r.Height()));
            }
            else
            {
                if (!edge.HasFlag(HitPosition.GrowLeftEdge) && !edge.HasFlag(HitPosition.GrowRightEdge))
                {
                    dx = 0;
                }

                if (!edge.HasFlag(HitPosition.GrowTopEdge) && !edge.HasFlag(HitPosition.GrowBottomEdge))
                {
                    dy = 0;
                }

                // Convert to image space before sending to growBy().
                float xDelta = dx * (cropRect.Width() / r.Width());
                float yDelta = dy * (cropRect.Height() / r.Height());

                growBy((edge.HasFlag(HitPosition.GrowLeftEdge) ? -1 : 1) * xDelta,
                       (edge.HasFlag(HitPosition.GrowTopEdge) ? -1 : 1) * yDelta);
            }
        }
        static void Main()
        {
            Console.CursorVisible = false;
            Console.BufferHeight  = Console.WindowHeight = 18;
            Console.WindowWidth   = 20;
            Console.BufferWidth   = 20;

            Random randomGenerator = new Random();
            double sleeptime       = 200;
            double score           = 0;
            int    lives           = 5;

            Dwarf newDwarf = new Dwarf();

            newDwarf.col   = 9;
            newDwarf.row   = Console.WindowHeight - 1;
            newDwarf.color = ConsoleColor.Gray;

            List <Rock> Rocks = new List <Rock>();

            PrintOnPosition(0, 5, " The aim of the game is to avoid all the rocks. Good luck!", ConsoleColor.Yellow);
            PrintOnPosition(0, 9, "Pick", ConsoleColor.Yellow);
            PrintOnPosition(5, 9, (char)3, ConsoleColor.Red);
            PrintOnPosition(7, 9, "for lives", ConsoleColor.Yellow);
            PrintOnPosition(0, 10, "Pick", ConsoleColor.Yellow);
            PrintOnPosition(5, 10, '$', ConsoleColor.Green);
            PrintOnPosition(7, 10, "for money", ConsoleColor.Yellow);
            PrintOnPosition(5, 13, "Good luck!", ConsoleColor.Red);
            PrintOnPosition(17, 0, ' ', ConsoleColor.Black);
            Console.ReadLine();
            Console.Clear();

            for (int i = 0; i <= Console.WindowWidth - 1; i++)
            {
                PrintOnPosition(i, 4, '_', ConsoleColor.White);
            }

            while (true)
            {
                HitPosition newHitPosition = HitPosition.None;

                int chance = randomGenerator.Next(0, 100);

                {
                    Rock newRock = new Rock();
                    newRock.col = randomGenerator.Next(0, 19);
                    newRock.row = 5;


                    if (chance < 1)
                    {
                        newRock.shape = (char)RockShape.Heart;
                        newRock.color = ConsoleColor.Red;
                    }
                    else if (chance < 10)
                    {
                        newRock.shape = (char)RockShape.Money;
                        newRock.color = ConsoleColor.Green;
                    }
                    else if (chance < 100)
                    {
                        newRock.shape = (char)RockShape.Rock;
                        newRock.color = ConsoleColor.Cyan;
                    }
                    Rocks.Add(newRock);
                }

                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo userInput = Console.ReadKey();
                    while (Console.KeyAvailable)
                    {
                        Console.ReadKey(true);
                    }
                    if (userInput.Key == ConsoleKey.LeftArrow && newDwarf.col > 0)
                    {
                        PrintOnPosition(newDwarf.col--, newDwarf.row, "   ", newDwarf.color);
                    }
                    if (userInput.Key == ConsoleKey.RightArrow && newDwarf.col < Console.WindowWidth - 2)
                    {
                        PrintOnPosition(newDwarf.col++, newDwarf.row, "   ", newDwarf.color);
                    }
                }
                PrintOnPosition(newDwarf.col, newDwarf.row, newDwarf.shape, newDwarf.color);

                List <Rock> newList = new List <Rock>();
                for (int i = 0; i < Rocks.Count; i++)
                {
                    Rock oldRock = Rocks[i];
                    Rock newRock = new Rock();
                    newRock.col   = oldRock.col;
                    newRock.row   = oldRock.row + 1;
                    newRock.shape = oldRock.shape;
                    newRock.color = oldRock.color;

                    if ((newRock.col == newDwarf.col || newRock.col == newDwarf.col + 1 || newRock.col == newDwarf.col + 2) && newRock.row == newDwarf.row)
                    {
                        switch (newRock.shape)
                        {
                        case '@':
                            newHitPosition = (HitPosition)Enum.Parse(typeof(HitPosition), ((newRock.col - newDwarf.col) + 1).ToString());
                            break;

                        case '$':
                            score += 500;
                            break;

                        case (char)3:
                            lives += 1;
                            break;
                        }
                    }
                    if (newRock.row < Console.WindowHeight)
                    {
                        newList.Add(newRock);
                    }
                }

                if (newHitPosition != HitPosition.None)
                {
                    PrintOnPosition(newDwarf.col, newDwarf.row, hitshapes[(int)newHitPosition], ConsoleColor.Red);
                    if (lives < 2)
                    {
                        PrintOnPosition(0, 0, "GAME OVER!", ConsoleColor.Red);
                        PrintOnPosition(17, 0, ' ', ConsoleColor.Black);
                        Console.ReadLine();
                        PrintOnPosition(0, 0, @"           ", ConsoleColor.Red);
                        return;
                    }

                    PrintOnPosition(0, 0, "Press enter", ConsoleColor.Red);
                    PrintOnPosition(17, 0, ' ', ConsoleColor.Black);
                    Console.ReadLine();
                    PrintOnPosition(0, 0, @"           ", ConsoleColor.Red);
                    foreach (Rock rock in Rocks)
                    {
                        PrintOnPosition(rock.col, rock.row, ' ', ConsoleColor.Black);
                    }
                    Rocks.Clear();
                    newList.Clear();
                    lives--;
                    sleeptime += 20;
                }

                foreach (Rock rock in Rocks)
                {
                    PrintOnPosition(rock.col, rock.row, ' ', ConsoleColor.Black);
                }
                Rocks = newList;

                foreach (Rock rock in Rocks)
                {
                    PrintOnPosition(rock.col, rock.row, rock.shape, rock.color);
                }

                PrintOnPosition(7, 2, "Score: " + (int)score, ConsoleColor.Cyan);
                PrintOnPosition(7, 3, "Lives: " + lives, ConsoleColor.Yellow);

                score     += 14.66;
                sleeptime -= 0.5;
                if (sleeptime < 100)
                {
                    sleeptime = 100;
                }

                if (sleeptime > 200)
                {
                    sleeptime = 200;
                }

                Thread.Sleep((int)sleeptime);
            }
        }
Beispiel #10
0
 public void HitCheck(int PlayerCode, HitPosition HitPos, float HitTime)
 {
     hitPos[PlayerCode]      = HitPos;
     hitTime[PlayerCode]     = HitTime;
     playerReady[PlayerCode] = true;
 }
Beispiel #11
0
        // ********************************************************************************
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="hit"></param>
        /// <returns></returns>
        /// <created>UPh,29.08.2015</created>
        /// <changed>UPh,29.08.2015</changed>
        // ********************************************************************************
        int HitTest(Point pt, out HitPosition hit)
        {
            hit = HitPosition.None;

            for (int i = TopIndex; i < Items.Count; i++)
            {
                Rectangle rc = GetItemRectangle(i);
                if (!rc.Contains(pt))
                    continue;
                hit = HitPosition.Item;

                if (GetCheckBoxRect(i).Contains(pt))
                    hit = HitPosition.CheckBox;

                return i;
            }
            return -1;
        }
    public bool Damage(int iFinalAttackPower, int iCriticalRate, HitPosition eHitPosition, bool isDefense = false, bool isSkillDamage = false)
    {
        iCharacterInfo getCharacterInfo;
        Character      nPCCharacter;
        bool           flag = true;

        this.m_bBlowCritical = false;
        this.m_SkillAttrInfo.Clear();
        this.DefenseBuffandDeBuffCheck();
        int num = 0;

        num = InGameFormular.GetFinalCharDefencePower((float)this.m_NormalDefensePower, this.m_iEquipItemDefensePower, this.m_fPassiveDefencePower, this.m_SkillAttrInfo, this.m_ArrBuildingBuffInfo);
        if (isSkillDamage && (InGameSystem.Instance.SkillInfo.AttributeType1 == 0x2712))
        {
            num = 0;
        }
        if ((this.m_eUser == InGameUser.NPC) && (StartGameInfo.GameType == EGAME_TYPE.eGameType_BreakDownStressForNPC))
        {
            num = 100;
        }
        if (this.m_eUser == InGameUser.Player)
        {
            getCharacterInfo = InGameSystem.Instance.NPCCharacter.GetCharacterInfo;
            nPCCharacter     = InGameSystem.Instance.NPCCharacter;
        }
        else
        {
            getCharacterInfo = InGameSystem.Instance.PlayerCharacter.GetCharacterInfo;
            nPCCharacter     = InGameSystem.Instance.PlayerCharacter;
        }
        EELEMENTAL_TYPE elementalType             = (EELEMENTAL_TYPE)getCharacterInfo.ElementalType;
        EELEMENTAL_TYPE eElementalTypeForDefender = (EELEMENTAL_TYPE)this.GetCharacterInfo.ElementalType;
        int             num2             = CContentsFormular.GetDamage(iFinalAttackPower, elementalType, num, eElementalTypeForDefender);
        int             iDamage          = (int)Math.Round((double)(num2 * 0.05f));
        int             min              = num2 - iDamage;
        int             max              = num2 + iDamage;
        int             iRnadAttackPower = UnityEngine.Random.Range(min, max);
        float           num7             = UnityEngine.Random.Range((float)1f, (float)101f);
        float           num8             = ((float)iCriticalRate) / 100f;

        if (((num7 <= num8) && !isDefense) && !isSkillDamage)
        {
            float num9 = nPCCharacter.m_iCriticalAttackPower * 0.0001f;
            iRnadAttackPower     = (int)Math.Round((double)(iRnadAttackPower * num9));
            this.m_bBlowCritical = true;
            this.AudioPlay(CharacterSoundState.Critical_Blow);
        }
        else if (!isDefense)
        {
            int hitSoundCombo;
            if (this.m_eUser == InGameUser.Player)
            {
                hitSoundCombo = InGameSystem.Instance.NPCCharacter.HitSoundCombo;
            }
            else
            {
                hitSoundCombo = InGameSystem.Instance.PlayerCharacter.HitSoundCombo;
            }
            if ((hitSoundCombo % 3) == 0)
            {
                this.AudioPlay(CharacterSoundState.Blow);
            }
            else if (isSkillDamage)
            {
                this.AudioPlay(CharacterSoundState.Blow);
            }
        }
        if (isDefense)
        {
            float num12 = iRnadAttackPower;
            num12           *= 0.2f;
            iRnadAttackPower = (int)num12;
        }
        this.m_iRealAttackPower = iRnadAttackPower;
        if (isSkillDamage)
        {
            if (InGameSystem.Instance.IsSkillAttribute2Apply(this.m_eUser) && (InGameSystem.Instance.SkillInfo.AttributeType2 == 0x4e23))
            {
                float num13 = ((float)InGameSystem.Instance.SkillInfo.AttributeValue2) / 10000f;
                float num14 = iRnadAttackPower * num13;
                InGameSystem.Instance.SkillBloodSucking(this.m_eUser, (int)num14);
            }
        }
        else
        {
            this.CheckSkillHyena(iRnadAttackPower);
        }
        if (!this.IsInvincible && !this.m_Animator.GetBool("Invincible"))
        {
            BaseSkill skill;
            if (isSkillDamage && (InGameSystem.Instance.SkillInfo.AttributeType1 == 0x2713))
            {
                if (!isDefense)
                {
                    this.OnCharacterEffect(this.m_bBlowCritical, eHitPosition);
                }
                return(flag);
            }
            if (isSkillDamage && (InGameSystem.Instance.SkillInfo.AttributeType1 == 0x2714))
            {
                if (!isDefense)
                {
                    this.OnCharacterEffect(this.m_bBlowCritical, eHitPosition);
                }
                return(flag);
            }
            if (!isDefense)
            {
                InGameSystem.Instance.IndicateHit(this.m_eUser, this.m_bBlowCritical, iRnadAttackPower);
            }
            if ((this.m_arrBaseSkill.TryGetValue(0x4e36, out skill) && skill.IsSkillOnOffState(ESKILL_ATTR_TYPE.eSkillAttrType_Shield)) && !isDefense)
            {
                SkillShield shield = (SkillShield)skill;
                int         num15  = shield.GetSaveValue - iRnadAttackPower;
                if (num15 >= 0)
                {
                    shield.SetSaveValue = shield.GetSaveValue - iRnadAttackPower;
                    iRnadAttackPower    = 0;
                }
                else
                {
                    iRnadAttackPower -= shield.GetSaveValue;
                    shield.StopSkill();
                }
            }
            if (this.m_arrBaseSkill.TryGetValue(0x4e4a, out skill) && skill.IsSkillOnOffState(ESKILL_ATTR_TYPE.eSkillAttrType_Share))
            {
                SkillShare share = (SkillShare)skill;
                float      num16 = iRnadAttackPower * (((float)skill.GetSkillInfo.AttributeValue2) / 10000f);
                share.ApplyShareDamage(num16);
                iRnadAttackPower -= (int)num16;
            }
            //Mod here
            if (this.m_eUser != InGameUser.Player)
            {
                this.m_iCurrentHP = 0;
            }
            //Mod here
            if (this.m_arrBaseSkill.TryGetValue(0x4e33, out skill) && skill.IsSkillOnOffState(ESKILL_ATTR_TYPE.eSkillAttrType_AmplificationHealthPoint))
            {
                SkillAmplificationHealthPoint point = (SkillAmplificationHealthPoint)skill;
                point.SetDamageValue = point.GetDamageValue + iRnadAttackPower;
            }
            if (this.m_arrBaseSkill.TryGetValue(0x4e34, out skill) && skill.IsSkillOnOffState(ESKILL_ATTR_TYPE.eSkillAttrType_ThornsAura))
            {
                float num17 = iRnadAttackPower * (((float)skill.GetSkillInfo.AttributeValue2) / 10000f);
                iDamage = (int)num17;
                InGameSystem.Instance.PlayThornsDamage(this.m_eUser, iDamage);
            }
            InGameSystemEvent.DamageEvent(this, iRnadAttackPower);
        }
        if (InGameTutorialSystem.Instance.IsDefaultTutorialGuide)
        {
            if (this.m_eUser == InGameUser.Player)
            {
                if (((this.m_iCurrentHP <= 2) && (InGameSystem.Instance.GameState != InGameState.KO)) && (InGameSystem.Instance.GameState != InGameState.KO_FEVER))
                {
                    this.m_iCurrentHP = 2;
                }
            }
            else if (((this.m_iCurrentHP <= 2) && InGameTutorialSystem.Instance.IsInvincible) && ((InGameSystem.Instance.GameState != InGameState.KO) && (InGameSystem.Instance.GameState != InGameState.KO_FEVER)))
            {
                this.m_iCurrentHP = 2;
            }
        }
        InGameTutorialSystem.Instance.CheckHp(this.m_eUser, this.m_iCurrentHP, this.m_iTotalHeathPoint);
        if (this.m_iCurrentHP <= 0)
        {
            flag = false;
            this.m_CharacterInfo.State = CharacterState.KO;
            this.m_iCurrentHP          = 0;
            InGameSystem.Instance.KO(this.m_eUser, false);
        }
        else
        {
            this.CheckSkillChangeChar(isSkillDamage);
            this.CheckSkillFury();
        }
        InGameSystem.Instance.UpdateHP(this.m_eUser, true, false);
        if (!isDefense)
        {
            this.OnCharacterEffect(this.m_bBlowCritical, eHitPosition);
        }
        return(flag);
    }
        private void TourStopList_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Y < 10)
            {
                return;
            }
            bool extendingRange = false;
            int  index          = GetItemIndexFromCursor(e.Location);

            if (index > -1)
            {
                if (multiSelectMode)
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Right)
                    {
                        if (SelectedItems.ContainsKey(index) && SelectedItems.Count > 1)
                        {
                            // We are right clicking on a multi selection.. Set focus only
                            selectedItem = index;
                            return;
                        }
                    }


                    if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                    {
                        // No control key means clear existing selection and replace
                        SelectedItems.Clear();
                    }

                    if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                    {
                        extendingRange = true;
                        // Add Range to selection
                        int a = Math.Min(index, selectedItem);
                        int b = Math.Max(index, selectedItem);

                        for (int i = a; i <= b; i++)
                        {
                            if (!SelectedItems.ContainsKey(i))
                            {
                                SelectedItems.Add(i, Items[i]);
                            }
                        }
                    }
                    else
                    {
                        // Simple Selection
                        if (SelectedItems.ContainsKey(index))
                        {
                            // Remove an item only if there is more than one selection.
                            if (SelectedItems.Count > 1)
                            {
                                SelectedItems.Remove(index);
                            }
                        }
                        else
                        {
                            SelectedItems.Add(index, Items[index]);
                        }
                    }

                    multipleSelection = (SelectedItems.Count > 1);
                }
                else
                {
                    multipleSelection = false;
                    SelectedItems.Clear();
                    SelectedItems.Add(index, Items[index]);
                }

                // In multiselect case this acts as focus
                if (!extendingRange)
                {
                    selectedItem = index;
                }

                if (((Control.ModifierKeys & Keys.Control) == Keys.Control) || ((Control.ModifierKeys & Keys.Shift) == Keys.Shift))
                {
                    // Early exit if multi-selecting
                    return;
                }

                hitType = this.GetCusorSytleFromCursorPosition(e.Location);

                if (ItemClicked != null)
                {
                    ItemClicked.Invoke(this, Items[index]);
                }

                if (Tour.EditMode)
                {
                    if (hitType == HitPosition.EditTime)
                    {
                        int   item = GetItemIndexFromCursor(e.Location);
                        Point pnt  = GetTimeEditLocation(e.Location);
                        if (timeEditor != null)
                        {
                            timeEditor.Close();
                            timeEditor.Dispose();
                            timeEditor = null;
                        }
                        timeEditor        = new DurrationEditor();
                        timeEditor.target = Items[index];
                        timeEditor.Show();
                        timeEditor.Focus();

                        pnt    = PointToScreen(pnt);
                        pnt.X += 4;
                        pnt.Y += 65;
                        timeEditor.Location = pnt;
                    }

                    if (hitType == HitPosition.EditName)
                    {
                        int   item = GetItemIndexFromCursor(e.Location);
                        Point pnt  = GetTimeEditLocation(e.Location);
                        if (textEditor != null)
                        {
                            textEditor.Close();
                            textEditor.Dispose();
                            textEditor = null;
                        }
                        textEditor        = new PopupTextEditor();
                        textEditor.target = Items[index];
                        textEditor.Show();
                        textEditor.Focus();

                        pnt    = PointToScreen(pnt);
                        pnt.X += 15;
                        pnt.Y += 49;
                        textEditor.Location = pnt;
                    }

                    if (hitType == HitPosition.StartPosition)
                    {
                        if (ShowStartPosition != null)
                        {
                            ShowStartPosition.Invoke(this, Items[index]);
                        }
                    }
                    if (hitType == HitPosition.EndPosition)
                    {
                        if (ShowStartPosition != null)
                        {
                            ShowEndPosition.Invoke(this, Items[index]);
                        }
                    }

                    if (hitType == HitPosition.Transition)
                    {
                        TransitionsPopup transPopup = new TransitionsPopup();
                        transPopup.Target            = Items[index];
                        transPopup.TargetWasChanged += new EventHandler(transPopup_TargetWasChanged);
                        Point pnt = new Point((int)((int)(e.X / horzMultiple) * horzMultiple), Height);

                        transPopup.Show();
                        transPopup.Focus();
                        pnt    = PointToScreen(pnt);
                        pnt.X -= 10;
                        pnt.Y -= 18;
                        transPopup.Location = pnt;
                    }
                }
            }
            else if (addButtonHover)
            {
                if (e.Button != System.Windows.Forms.MouseButtons.Right)
                {
                    if (Tour.EditMode && showAddButton)
                    {
                        if (AddNewSlide != null)
                        {
                            AddNewSlide.Invoke(this, null);
                        }
                    }
                }
                else
                {
                    SelectedItems.Clear();
                    SelectedItem = -1;
                }
            }
            else if (index == -2)
            {
                SelectedItems.Clear();
                SelectedItem = -1;
                if (ItemClicked != null)
                {
                    ItemClicked.Invoke(this, null);
                }
            }
        }