Example #1
0
    private void UpdateHook()
    {
        if (!this.m_Hook)
        {
            return;
        }
        bool flag = FishingController.Get().m_State != FishingController.State.Cast;

        if (this.m_Hook.gameObject.activeSelf != flag)
        {
            this.m_Hook.gameObject.SetActive(flag);
        }
        this.m_Hook.m_BaitSlot.gameObject.SetActive((Inventory3DManager.Get() && Inventory3DManager.Get().IsActive()) || this.m_Hook.m_Bait);
        if (this.m_Hook.m_BaitSlot.gameObject.activeSelf && !this.m_Hook.m_BaitSlot.m_Active)
        {
            this.m_Hook.m_BaitSlot.Activate();
        }
        if (!flag)
        {
            return;
        }
        if (this.m_State == FishingRod.State.Fishing || this.m_State == FishingRod.State.Strike || this.m_State == FishingRod.State.Cancel)
        {
            this.m_Hook.transform.rotation = this.m_Float.transform.rotation;
            this.m_Hook.transform.position = this.m_HookInWaterPos;
            return;
        }
        this.m_Hook.transform.localRotation = Quaternion.identity;
        this.m_Hook.transform.localPosition = Vector3.zero;
    }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        m_playerControls    = GetComponent <PlayerController>().PlayerControls;
        m_eventManager      = EventManager.Instance;
        m_playerInput       = GetComponent <PlayerInput>();
        m_playerMovement    = GetComponent <PlayerMovement>();
        m_fishingController = FishingController.Instance;
        m_uiManager         = UIManager.Instance;
        m_caughFish         = new HashSet <CollectibleItem.ItemID>();
        m_variableStorage   = FindObjectOfType <InMemoryVariableStorage>();

        m_playerControls.Player.Interact.started     += SwitchToFishing;
        m_playerControls.Fishing.Interact.started    += FishingInteract;
        m_playerControls.Fishing.Cancel.started      += FishingCancel;
        m_playerControls.Fishing.Vertical.started    += AimFishingReticleVert;
        m_playerControls.Fishing.Vertical.canceled   += AimFishingReticleVert;
        m_playerControls.Fishing.Horizontal.started  += AimFishingReticleHori;
        m_playerControls.Fishing.Horizontal.canceled += AimFishingReticleHori;

        m_playerControls.Fishing.Disable();
        m_fishingReticle.SetActive(false);
        m_fishingRod.SetActive(false);

        m_eventManager.AddFishReelStartListener(FishReelStarted);
        m_eventManager.AddFishReelEndedListener(FishReelEnded);
        m_eventManager.AddSkillUnlockedListener(UpdateFishingCapability);
    }
Example #3
0
 private void Jump()
 {
     if (!this.CanJump())
     {
         return;
     }
     this.m_WantedSpeed.target.y = (this.m_WantedSpeed.current.y = this.m_JumpSpeed);
     this.m_Player.DecreaseStamina(StaminaDecreaseReason.Jump);
     EventsManager.OnEvent(Enums.Event.Jump, 1);
     this.m_AudioModule.PlayFeetJumpSound(1f, false);
     this.m_AudioModule.PlayJumpSound();
     if (FishingController.Get().IsActive())
     {
         FishingController.Get().OnJump();
     }
     if (WeaponSpearController.Get().IsActive())
     {
         WeaponSpearController.Get().Jump();
     }
     else
     {
         this.m_Animator.SetTrigger(this.m_TJump);
     }
     this.m_JumpInProgress = true;
 }
Example #4
0
    public bool Fish(FishingController fishingSpot)
    {
        actionTimer = fishingAnimationTime;
        InCombat    = false;
        Lock();

        Equipment.ShowFishingRod();

        if (lastTrainedSkill != Skill.Fishing)
        {
            lastTrainedSkill = Skill.Fishing;
            playerAnimations.StartFishing();
            return(true);
        }

        playerAnimations.Fish();

        LookAt(fishingSpot.transform);

        if (fishingSpot.Fish(this))
        {
            AddExp(fishingSpot.Experience, Skill.Fishing);
            var amount = fishingSpot.Resource * Mathf.FloorToInt(Stats.Fishing.CurrentValue / 10f);
            Statistics.TotalFishCollected += (int)amount;
            AddResource(Resource.Fishing, amount);
        }

        return(true);
    }
Example #5
0
 private void OnDestroy()
 {
     if (!Player.Get())
     {
         return;
     }
     if (FishingController.Get() && FishingController.Get().IsActive() && FishingController.Get().m_FishingRod == this)
     {
         Player.Get().SetCurrentItem(Hand.Right, null);
         Player.Get().SetWantedItem(Hand.Right, null, true);
         Player.Get().StopController(PlayerControllerType.Fishing);
     }
 }
Example #6
0
        public void ExecuteFishing()
        {
            FishingController fishingController = new FishingController(this.ProcessName, "1", "j");

            if (!fishingController.ThreadIsAlive)
            {
                Color = "Red";
                fishingController.StartProces();
            }
            else
            {
                fishingController.AportProcess();
            }
        }
Example #7
0
    private void UpdateVein()
    {
        switch (FishingController.Get().m_State)
        {
        case FishingController.State.Waiting:
        case FishingController.State.Fail:
        case FishingController.State.Presentation:
            this.m_Vein.transform.position = this.m_Float.transform.position;
            this.m_VeinElement.SetActive(false);
            return;

        case FishingController.State.Reel:
        case FishingController.State.Strike:
            this.m_Vein.transform.position = (this.m_HideVein ? this.m_Top.transform.position : this.m_Float.transform.position);
            this.m_VeinElement.SetActive(false);
            return;
        }
        this.m_Vein.transform.position = this.m_Top.transform.position;
        this.m_VeinElement.SetActive(true);
    }
Example #8
0
 private void UpdateHook()
 {
     if (FishingController.Get().m_State == FishingController.State.Cast || FishingController.Get().m_State == FishingController.State.Aim)
     {
         if (this.m_Hook.gameObject.activeSelf)
         {
             this.m_Hook.gameObject.SetActive(false);
         }
     }
     else if (!this.m_Hook.gameObject.activeSelf)
     {
         this.m_Hook.gameObject.SetActive(true);
     }
     if (this.m_State == FishingRod.State.None && this.m_Hook.gameObject.activeSelf)
     {
         Vector3 vector = this.m_Top.transform.position + Vector3.down * 1f;
         vector.y = Mathf.Max(vector.y, MainLevel.GetTerrainY(vector) + 0.2f);
         this.m_Hook.transform.position = vector;
     }
 }
Example #9
0
    private void UpdateVein()
    {
        FishingController fishingController = FishingController.Get();

        switch (fishingController.m_State)
        {
        case FishingController.State.None:
        case FishingController.State.Waiting:
        case FishingController.State.Strike:
        case FishingController.State.Reel:
        case FishingController.State.Fish:
            this.m_Vein.transform.position = this.m_Hook.transform.position;
            break;

        case FishingController.State.Aim:
        case FishingController.State.Cast:
            this.m_Vein.transform.position = this.m_Top.transform.position;
            break;
        }
    }
Example #10
0
 void Awake()
 {
     this.fishingController = this.gameObject.GetComponent <FishingController>();
 }
        public void StatisticalScoreTestTwoRound_大小分相同重量也相同()
        {
            #region Round 1



            IList <RoundScorePostViewModel> round1Scores = new List <RoundScorePostViewModel>()
            {
                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "洪天然", Result = 8.72f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "礼斌", Result = 9.53f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "连顺义", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "陈嘉璋", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "邱运财", Result = 14.58f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "郑福钓", Result = 8.62f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "傅寿南", Result = 14.45f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "罗道炳", Result = 6.73f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "朱典尧", Result = 7.51f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "周建平", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "魏奕泰", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "游克仁", Result = 5.4f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "唐兆光", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "谢成宝", Result = 6.95f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林源", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "林炳通", Result = 5.08f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑坤海", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "张木华", Result = 13.15f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "俞关贵", Result = 10.99f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "潘金生", Result = 0f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林鸣国", Result = 0f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "赖凯文", Result = 8.36f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑汉聪", Result = 11.22f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "李占源", Result = 6.73f
                },
            };

            #endregion


            #region Round 2

            IList <RoundScorePostViewModel> round2Scores = new List <RoundScorePostViewModel>()
            {
                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "洪天然", Result = 20.87f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "礼斌", Result = 9.03f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "连顺义", Result = 10.23f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "陈嘉璋", Result = 6.27f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "邱运财", Result = 18.89f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "郑福钓", Result = 27.93f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "傅寿南", Result = 0f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "罗道炳", Result = 12.76f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "朱典尧", Result = 9.02f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "周建平", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "魏奕泰", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "游克仁", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "唐兆光", Result = 8.23f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "谢成宝", Result = 10.79f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林源", Result = 6.16f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "林炳通", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑坤海", Result = 14.24f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "张木华", Result = 10.27f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "俞关贵", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "潘金生", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林鸣国", Result = 5.85f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "赖凯文", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑汉聪", Result = 13.8f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "李占源", Result = 12.76f
                },
            };

            #endregion

            var result1 = FishingController.StatisticalScore(round1Scores);
            result1 = FishingController.AverageEqualScores(result1);

            var result2 = FishingController.StatisticalScore(round2Scores);
            result2 = FishingController.AverageEqualScores(result2);

            var k = from t1 in result1
                    join t2 in result2 on t1.Id equals t2.Id
                    select new ContestantCompetitionScore(t1, t2);

            var ls = FishingController.Order(k.ToList());

            foreach (var score in ls)
            {
                Console.WriteLine($"{score.Order} ~~ {score.Name}: {score.TotalScore} - {score.TotalResult}");
            }
        }
        public void StatisticalScoreRound2ChangeTest相同成绩()
        {
            #region Round 2

            IList <RoundScorePostViewModel> round2Scores = new List <RoundScorePostViewModel>()
            {
                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "洪天然", Result = 20.87f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "礼斌", Result = 9.03f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "连顺义", Result = 10.23f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "陈嘉璋", Result = 6.27f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "邱运财", Result = 18.89f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "郑福钓", Result = 27.93f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "傅寿南", Result = 1.1f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "罗道炳", Result = 5.43f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "朱典尧", Result = 9.02f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "周建平", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "魏奕泰", Result = 1.1f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "游克仁", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "唐兆光", Result = 8.23f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "谢成宝", Result = 10.79f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林源", Result = 6.16f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "林炳通", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑坤海", Result = 14.24f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "张木华", Result = 10.27f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "俞关贵", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "潘金生", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林鸣国", Result = 5.85f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "赖凯文", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑汉聪", Result = 13.8f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "李占源", Result = 12.76f
                },
            };

            #endregion

            var result = FishingController.StatisticalScore(round2Scores);
            result = FishingController.AverageEqualScores(result);
            foreach (var roundScore in result)
            {
                Console.WriteLine($"{roundScore.Id}: {roundScore.Score}");
            }
        }
        public void StatisticalScoreTest()
        {
            IList <RoundScorePostViewModel> scores = new List <RoundScorePostViewModel>()
            {
                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "洪天然", Result = 8.72f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "礼斌", Result = 9.53f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "连顺义", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "陈嘉璋", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "邱运财", Result = 14.58f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "郑福钓", Result = 8.62f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "傅寿南", Result = 14.45f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "罗道炳", Result = 11.55f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "朱典尧", Result = 7.51f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "周建平", Result = 0
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "魏奕泰", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "游克仁", Result = 5.4f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "唐兆光", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "谢成宝", Result = 6.95f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林源", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "林炳通", Result = 5.08f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑坤海", Result = 0
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "张木华", Result = 13.15f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "俞关贵", Result = 10.99f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "潘金生", Result = 0f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "林鸣国", Result = 0f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "赖凯文", Result = 8.36f
                },

                new RoundScorePostViewModel()
                {
                    GroupNum = "1", Id = "郑汉聪", Result = 11.22f
                },
                new RoundScorePostViewModel()
                {
                    GroupNum = "2", Id = "李占源", Result = 6.73f
                },
            };
            var result = FishingController.StatisticalScore(scores);

            foreach (var roundScore in result)
            {
                Console.WriteLine($"{roundScore.Id}: {roundScore.Score}");
            }
        }
Example #14
0
 private void Awake()
 {
     inst = this;
 }