コード例 #1
0
        private void OnReliveCountdownComplete()
        {
            GComponent com = this._root["relive_countdown"].asCom;

            com.visible = false;
            FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.Relive));
        }
コード例 #2
0
        public override void OnEnter(params object[] param)
        {
            this._skill = ( Skill )param[0];

            UIEvent.PickSkill(this._skill);

            VPlayer player = VPlayer.instance;

            if (this._skill.castType != CastType.Immediately)
            {
                Vector3 position = player.direction * this._skill.distance + player.position;
                position.y           = 0.02f;
                this._decal          = this.owner.battle.CreateEffect("e151");
                this._decal.position = position;
            }
            else
            {
                player.SetTracingTarget(null);
                if (player.CanUseSkill(this._skill))
                {
                    FrameActionManager.SetFrameAction(new _DTO_action_info(player.rid, ( byte )FrameActionType.UseSkill,
                                                                           this._skill.id,
                                                                           player.rid,
                                                                           this._skill.rangeType == RangeType.Single
                                                                                                                                                                 ? player.rid
                                                                                                                                                                 : string.Empty, player.position.x, player.position.y,
                                                                           player.position.z));
                }
                this.owner.DropSkill();
            }
        }
コード例 #3
0
ファイル: SkillPanel.cs プロジェクト: niuniuzhu/Lockstep
        private void OnSkillUpgradeBtnClick(EventContext context)
        {
            GComponent skillGrid     = (( GButton )context.sender).parent;
            Skill      selectedSkill = VPlayer.instance.GetSkill(( string )skillGrid.data);

            FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.UpgradeSkill, selectedSkill.id));
        }
コード例 #4
0
        protected void MovePlayer(Vector3 targetPoint)
        {
            if (!VPlayer.instance.CanMove())
            {
                return;
            }

            FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.Move, targetPoint.x, targetPoint.y, targetPoint.z));
        }
コード例 #5
0
        public override void HandlerPointerUp(IInteractive interactive, InputData data)
        {
            VPlayer player = VPlayer.instance;

            player.SetTracingTarget(null);

            if (interactive is VBattle)
            {
                Vector3 point;
                if (this.GetGroundHitPoint(out point))
                {
                    if (this._decal != null)
                    {
                        this._decal.markToDestroy = true;
                        this._decal = null;
                    }

                    Effect e = this.owner.battle.CreateEffect("e152");
                    point.y    = 0.02f;
                    e.position = point;

                    this.MovePlayer(point);
                }
            }
            else
            {
                if (interactive is VBio bio && !bio.isDead)
                {
                    if (VEntityUtils.IsAllied(player, bio) &&
                        bio != player &&
                        player.CanMove())
                    {
                        FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.Track, bio.rid));
                    }
                    else
                    {
                        Vector3 position = data.currentRaycast.point;
                        position.y = 0f;
                        Skill skill = player.commonSkill;
                        if (player.CanUseSkill(skill) &&
                            VEntityUtils.CanAttack(player, bio, skill.campType, skill.targetFlag))
                        {
                            player.SetTracingTarget(bio);
                            //普攻
                            FrameActionManager.SetFrameAction(new _DTO_action_info(player.rid, ( byte )FrameActionType.UseSkill, skill.id,
                                                                                   player.rid, bio.rid, position.x, position.y, position.z));
                        }
                        else
                        {
                            UIEvent.SkillUseFailed(player, skill, bio);
                        }
                    }
                }
コード例 #6
0
        public override void HandlerPointerUp(IInteractive interactive, InputData data)
        {
            bool hitGround = this.GetGroundHitPoint(out Vector3 point);

            if (this._skill.castType == CastType.Point ||
                this._skill.castType == CastType.Dash)
            {
                if (!hitGround)
                {
                    return;
                }

                VPlayer.instance.SetTracingTarget(null);
                if (VPlayer.instance.CanUseSkill(this._skill))
                {
                    FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.UseSkill,
                                                                           this._skill.id,
                                                                           VPlayer.instance.rid, null, point.x, point.y, point.z));
                    this.owner.DropSkill();
                }
            }
            else if (this._skill.castType == CastType.Target)
            {
                if (interactive is VBio entity &&
                    !entity.isDead &&
                    VPlayer.instance.CanUseSkill(this._skill) &&
                    VEntityUtils.CanAttack(VPlayer.instance, entity, this._skill.campType, this._skill.targetFlag))
                {
                    VPlayer.instance.SetTracingTarget(entity);
                    if (VPlayer.instance.CanUseSkill(this._skill))
                    {
                        FrameActionManager.SetFrameAction(new _DTO_action_info(VPlayer.instance.rid, ( byte )FrameActionType.UseSkill,
                                                                               this._skill.id,
                                                                               VPlayer.instance.rid, entity.rid, 0, 0, 0));
                        this.owner.DropSkill();
                    }
                }
                else
                {
                    //当点击了地面但技能的施放类型不是目标点,则移动角色
                    if (hitGround)
                    {
                        VPlayer.instance.SetTracingTarget(null);
                        this.MovePlayer(point);

                        Effect e = this.owner.battle.CreateEffect("e152");
                        point.y    = 0.02f;
                        e.position = point;
                    }
                }
            }
コード例 #7
0
ファイル: UIBattle.cs プロジェクト: niuniuzhu/AnimalRunning
 private void OnUseItemBtnClick(EventContext context)
 {
     if (CPlayer.instance == null ||
         CPlayer.instance.mazeResult != Champion.MazeResult.Nan)
     {
         return;
     }
     this._useItemBtn.onClick.Remove(this.OnUseItemBtnClick);
     if (Env.useNetwork)
     {
         FrameActionManager.SetFrameAction(ProtocolManager.DTO_action_info(CPlayer.instance.rid, ( byte )FrameActionType.UseItem, string.Empty));
     }
     else
     {
         BattleManager.lBattle.HandleUseItem(CPlayer.instance.rid);
     }
 }
コード例 #8
0
ファイル: UIBattle.cs プロジェクト: niuniuzhu/AnimalRunning
 public void HandleAxisInput(Vector2 axis)
 {
     if (CPlayer.instance == null ||
         CPlayer.instance.mazeResult != Champion.MazeResult.Nan)
     {
         return;
     }
     axis.x = ( int )(axis.x * 100f) * 0.01f;
     axis.y = ( int )(axis.y * 100f) * 0.01f;
     if (Env.useNetwork)
     {
         _DTO_action_info dto = ProtocolManager.DTO_action_info(CPlayer.instance.rid, ( byte )FrameActionType.Move, axis.x, 0f, axis.y);
         FrameActionManager.SetFrameAction(dto);
     }
     else
     {
         BattleManager.lBattle.HandleBeginMove(CPlayer.instance.rid, new FVec3(axis.x, 0, axis.y));
     }
 }