void DoSkill1028(MapGrid pos, SoldierSkill skill)
    {
        if (pos == null)
        {
            return;
        }
        GameObject posgo     = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos);
        Transform  fireplace = posgo.transform;

        if (fireplace != null)
        {
            string bulletname = "1003051";

            GameObject go = GameObjectLoader.LoadPath("effect/prefab/", bulletname, BattleEnvironmentM.GetLifeMBornNode(true));
            go.transform.position = fireplace.position;
            if (m_LifePrent.WalkDir == WalkDir.WALKRIGHT)
            {
                go.transform.localScale = new Vector3(-go.transform.localScale.x, go.transform.localScale.y, go.transform.localScale.z);
            }
            Bullet bullet = go.AddComponent <Bullet>();
            if (bullet != null)
            {
                Bullet.BulletType t = Bullet.BulletType.bomb1028;

                Vector3 vpos = pos.pos;
                vpos.y = go.transform.localPosition.y;
                bullet.SetInfo(vpos, m_DoAttack, 10f, m_LifePrent.WalkDir, t, skill);
            }
        }
    }
Beispiel #2
0
    /// <summary>
    /// 播放特效
    /// </summary>
    public void PlayTrapEffect(string effectName, float deadtime)
    {
        if (m_building == null)
        {
            return;
        }
        if (m_building.m_roomType == RoomType.ResRoom)
        {
            return;
        }
        Vector3 Pos = GetWorldPos();

        if (effectName == "2000651")
        {
            Pos.z -= 10;
            Pos.x -= MapGrid.m_width / 2;
            Pos.y  = Pos.y - MapGrid.m_heigth / 2 + 0.3f;
        }
        else
        {
            Pos.z -= 1;
        }

        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", effectName,
                                                        Pos, BattleEnvironmentM.GetLifeMBornNode(true));

        if (gae != null)
        {
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(deadtime);
            gae.AddAction(ndEffect);
        }
    }
Beispiel #3
0
    void BtnReturn_OnClickEventHandler(UIButton sender)
    {
        U3DUtil.DestroyAllChild(BattleEnvironmentM.GetLifeMBornNode(true).gameObject);
        WndManager.DestroyAllDialogs();
        BoatObj.SendGetPlanData();

        TreasureScene.OutTreasureScene();
    }
Beispiel #4
0
 public void StartInit()
 {
     name     = transform.name;
     m_tStart = BattleEnvironmentM.GetLifeMBornNode(true);
     m_ani    = GetComponent <Animation>();
     if (m_Core.m_type != ShipBuildType.BuildStair)
     {
         InitTrapRoomUI();
     }
 }
Beispiel #5
0
    public void SetData(CounterBubblePromtInfo info)
    {
        Transform tStart = BattleEnvironmentM.GetLifeMBornNode(true);

        if (tStart != null)
        {
            NGUIUtil.Set3DUIPos(gameObject, new Vector3(info.x + tStart.position.x, info.y + tStart.position.y, 0f));
        }
        NGUIUtil.SetLableText(LblText, info.text);
    }
Beispiel #6
0
    //播放区块中心爆炸效果
    private void PlayStep3(string effectName, float deadtime)
    {
        Vector3 pos = Vector3.zero;

        foreach (BombPoint B in m_start)
        {
            if (B != null)
            {
                pos += B.GetWorldPos();
            }
        }
        foreach (BombPoint B in m_linkPoint)
        {
            if (B != null)
            {
                pos += B.GetWorldPos();
            }
        }
        int total = m_start.Count + m_linkPoint.Count;

        if (total != 0)
        {
            pos = pos / total;
            GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", effectName,
                                                            pos, BattleEnvironmentM.GetLifeMBornNode(true));
            if (gae != null)
            {
                GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(deadtime);
                gae.AddAction(ndEffect);
            }
        }
        //房间爆炸掉
        DestroyRoom();

        if (ProcessType == BombProcessType.End)
        {
            //if(m_linkCenterPoint == null || m_linkCenterPoint.Count == 0)
            {
                List <Life> l = new List <Life>();
                CM.SearchLifeMListInBoat(ref l, LifeMType.BUILD, LifeMCamp.DEFENSE);
                foreach (Life b in l)
                {
                    if (b == null)
                    {
                        continue;
                    }
                    if (b is Building && (b as Building).m_roomType == RoomType.NormalTrap)
                    {
                        (b as Building).KillSelf(0);
                    }
                }
            }
        }
    }
Beispiel #7
0
    /// <summary>
    /// 出生构造函数
    /// </summary>
    /// <param name="Parent">出生角色</param>
    /// <param name="JumpTarget">跳跃的位置</param>
    /// <param name="JumpDir">朝向</param>
    /// <param name="dcb">完成回调</param>
    public BornActionCmd(Life Parent, Vector3 JumpTarget, WalkDir JumpDir, DoneCallBack dcb, float duration, AnimatorState state, bool bFallSmooth, string strBornEffect)
    {
        SetTarget(Parent);
        Transform t = m_Skin.tRoot;

        t.parent        = BattleEnvironmentM.GetLifeMBornNode(true);
        m_Start         = t.localPosition;
        m_PauseRotation = t.localRotation;
        m_End           = JumpTarget;
        if (Parent.m_Attr.AttrType == 102003 || Parent.m_Attr.AttrType == 200009)
        {
            if (Parent.Anger <= 0)
            {
                t.localPosition = m_End;
                (Parent as Role).TurnsInto(false);
                m_Skin = Parent.GetSkin();
                Vector3 pos = m_Skin.tRoot.position;
                pos.z -= 2f;
                GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, Parent.m_Attr.AttrType == 102003 ? "1103111_01":"1401111_01", pos, BattleEnvironmentM.GetLifeMBornNode(true));
                GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.0f);
                gae.AddAction(ndEffect);
            }
        }
        else if (Parent.m_Attr.AttrType == 101004)
        {
            Vector3 pos = m_Skin.tRoot.position;
            GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1055021", pos, BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.0f);
            gae.AddAction(ndEffect);
        }
        m_doneCallBack = dcb;
        m_Dir          = JumpDir;
        m_Duration     = duration;
        m_state        = state;
        m_fPauseTime   = 0f;
        //RolePlayAnimation(AnimatorState.Stand);
        //SetBornActionCmd();
        if (!bFallSmooth)
        {
            m_Start = JumpTarget;
        }
        m_Skin.tRoot.rotation = Quaternion.identity;

        GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos);

        if (posgo != null && strBornEffect.Length > 0)
        {
            Vector3 pos = posgo.transform.position;
            GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, strBornEffect, pos, BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(duration);
            gae.AddAction(ndEffect);
        }
    }
Beispiel #8
0
    /// <summary>
    /// 防御战 战前警报 “感叹号”敌方飞入点提示
    /// </summary>
    private void PlayEnemyFlyHitPoint(Vector3 pos)
    {
        pos = U3DUtil.SetZ(pos, -1f);        //保证特效在炮弹兵前
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000501_02",
                                                        pos, BattleEnvironmentM.GetLifeMBornNode(true));

        if (gae != null)
        {
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f);
            gae.AddAction(ndEffect);
        }
    }
Beispiel #9
0
    public void DoReturnMainTown()
    {
        U3DUtil.DestroyAllChild(BattleEnvironmentM.GetLifeMBornNode(true).gameObject);
        WndManager.DestroyAllDialogs();
        BoatObj.SendGetPlanData();


        MainCameraM.s_Instance.EnableOthOn(false);
        MainCameraM.s_Instance.ResetCameraDataByHaven();
        MainCameraM.s_Instance.SetCameraLimitParam(MainCameraM.s_reaLimitPyramidHavenView);
        MainTownScene.RevertFrCamPosTemp();
    }
Beispiel #10
0
    /// <summary>
    /// 设置位置动画表现
    /// </summary>
    public void ExchangeAnimation(Int2 grid)
    {
        //LeaveRoom ();
        MoveWithRoom(MyCore());
        Vector3   posWold = RoomMap.GetShipBuildLocalPos(grid, m_Core.m_type);
        Transform tStart  = BattleEnvironmentM.GetLifeMBornNode(true);

        if (null != tStart)
        {
            posWold = tStart.TransformPoint(posWold);
        }
        m_tTarget.DOMove(posWold, 0.3f);
    }
Beispiel #11
0
    /// <summary>
    /// 向点燃位置移动
    /// </summary>
    void ToFirePos()
    {
        //NGUIUtil.DebugLog("向点燃位置移动", "red");
        m_bGotoFirePos = true;
        m_Owner.m_Skin.tRoot.transform.parent = BattleEnvironmentM.GetLifeMBornNode(true);
        Vector3    start = m_Owner.m_Parent.GetSkin().tRoot.localPosition;
        GameObject posgo = m_Owner.m_Parent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.PetPos);
        Vector3    end   = posgo.transform.position;

        end             = BattleEnvironmentM.World2LocalPos(end);
        m_CurrentAction = new GridActionCmdWalk(start, end, 0.5f, m_Owner.m_Parent.WalkDir, 0);
        m_CurrentAction.SetTarget(m_Owner);
    }
Beispiel #12
0
    /// <summary>
    /// 生成水花特效
    /// </summary>
    void SpawnWaterEffect(Vector3 pos, WalkDir Dir, bool IsRotate = true)
    {
        Vector3 start = Vector3.zero;
        Vector3 end   = Vector3.zero;

        if (BattleEnvironmentM.GetDolphineLine(Dir, ref start, ref end) == false)
        {
            return;
        }
        Transform FlyNode       = BattleEnvironmentM.GetLifeMBornNode(false);
        Vector3   LeftPos       = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, -Camera.main.transform.position.z - 10));
        Vector3   LeftRotation  = new Vector3(0, 0, -15);
        Vector3   RightRotation = new Vector3(0, 0, 15);
        Vector3   RightPos      = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, -Camera.main.transform.position.z - 10));
        Vector3   effectPos     = Vector3.zero;

        if (Dir == WalkDir.WALKLEFT)
        {
            effectPos = LeftPos;
        }
        else
        {
            effectPos = RightPos;
        }
        if (m_flyOutDir == FlyDir.Bottom)
        {
            effectPos = pos;
            IsRotate  = false;
        }
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000791", effectPos, null);

        if (gae != null)
        {
            if (IsRotate)
            {
                if (Dir == WalkDir.WALKLEFT)
                {
                    gae.transform.Rotate(LeftRotation);
                }
                else
                {
                    gae.transform.Rotate(RightRotation);
                }
            }
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
            gae.AddAction(ndEffect);
        }
    }
Beispiel #13
0
    public override void RangeTarget(List <Life> llist)
    {
        if (!bEffect)
        {
            bEffect = true;
            base.RangeTarget(llist);
            Transform tBoat = BattleEnvironmentM.GetLifeMBornNode(true);

            foreach (Life life in llist)
            {
                GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1055081", life.GetPos(), tBoat);
                GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2f);
                gae.AddAction(ndEffect);
            }
        }
    }
Beispiel #14
0
    public override void ColliderProc(Collision collision)
    {
        if (m_bBeKicked)
        {
            return;
        }
        LifeProperty lp = collision.gameObject.GetComponent <LifeProperty>();

        if (lp == null)
        {
            return;
        }
        IggFloor floor = collision.gameObject.GetComponent <LifeProperty>().GetLife() as IggFloor;

        if (floor != null)
        {
            m_fLiveCounter = 0;
            if (floor.isDead)
            {
                return;
            }

            if (m_Owner.m_Skill != null)
            {
                Life             lifeM = m_Owner.GetCollisionGo(collision);
                FlyCollisionInfo Info  = new FlyCollisionInfo();
                (m_Owner.m_Skill as FireSkill).FlyInfo = Info;
                Info = (m_Owner.m_Skill as FireSkill).FireTrigger(collision, lifeM, m_Owner, true, true, m_Owner.m_listCollisionGoID.Count, FlyDir.Bottom);
                if (!floor.isDead && lifeM != null)
                {
                    m_fFallSpeed = 0;
                    m_Owner.m_Skin.tRoot.parent        = BattleEnvironmentM.GetLifeMBornNode(true);
                    m_Owner.m_Skin.tRoot.localPosition = U3DUtil.SetZ(m_Owner.m_Skin.tRoot.localPosition, 0.2f);
                    //设置蹦蹦的Y位置
                    m_Owner.m_Skin.tRoot.position = U3DUtil.SetY(m_Owner.m_Skin.tRoot.position, floor.GetMapGrid().WorldPos.y);
                    m_bHitFloor = true;
                    m_petState  = Pet1002State.waitKick;
                    m_flyState  = AnimatorState.FlyAttack01100;
                }
            }
        }
    }
    void CreatePet()
    {
        HideHandPet();
        Pet pet = new Pet();

        pet.CreateSkin(BattleEnvironmentM.GetLifeMBornNode(true), 1002, "1002", AnimatorState.FlyClick00300, m_LifePrent.m_Core.m_IsPlayer);
        //IGameRole i = GameRoleFactory.Create(BattleEnvironmentM.GetLifeMBornNode(true), 1002, "1002", AnimatorState.FlyClick00300);
        GameObject goPet = pet.PetSkinCom.tRoot.gameObject;

        goPet.transform.position = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.petFollowPos).transform.position;
        LifeObj lo     = goPet.AddComponent <LifeObj>();
        Int2    toGrid = m_LifePrent.GetMapPos();

        pet.SetBorn(m_LifePrent, 1002001, 1002, toGrid, m_LifePrent.WalkDir);
        pet.SetSkin();
        if (m_LifePrent is Role)
        {
            (m_LifePrent as Role).CurPet = pet;
            //pet.SetMoveState(MoveState.Walk);
            // pet.m_petState = Pet1002State.Follow;
        }
        lo.SetLife(pet, pet.PetSkinCom.ProPerty);
    }
Beispiel #16
0
    void ShipBomb(bool win)
    {
        bool      isDelayPlaySound = false;
        Transform t = BattleEnvironmentM.GetLifeMBornNode(true);

        if (CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE) == false && win == true)
        {
            ShipBombAction action = t.gameObject.AddComponent <ShipBombAction>();
            action.SetFinishFun(ShowEndTalk, win);
            isDelayPlaySound = true;
        }
        else if (CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE) == true && win == false)
        {
            ShipBombAction action = t.gameObject.AddComponent <ShipBombAction>();
            action.SetFinishFun(ShowEndTalk, win);
            isDelayPlaySound = true;
        }
        else if (CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE) && win)
        {
            DefenseEndAction action = t.gameObject.AddComponent <DefenseEndAction>();
            action.SetFinishFun(ShowEndTalk, win);
            isDelayPlaySound = true;
        }
        else
        {
            ShowEndTalk(win);
        }

        if (win)
        {
            SoundPlay.Play("battle_win", false, false, isDelayPlaySound ? 5f : 0f);
        }
        else
        {
            SoundPlay.Play("battle_lose", false, false, isDelayPlaySound ? 5f : 0f);
        }
    }
Beispiel #17
0
    /// <summary>
    /// 查找金库
    /// </summary>
    private void FindGoldBuilding()
    {
        m_goldTransform = null;
        Transform t = BattleEnvironmentM.GetLifeMBornNode(true);

        if (t == null)
        {
            return;
        }

        foreach (LifeObj obj in t.GetComponentsInChildren <LifeObj>())
        {
            if (obj == null)
            {
                continue;
            }
            Life l = obj.GetLife();
            if (l != null && l is Building1300)
            {
                m_goldTransform = obj.transform;
                return;
            }
        }
    }
Beispiel #18
0
    /// <summary>
    /// 创建宠物
    /// </summary>
    private SummonPet CreatePet(int PetDataID, MapGrid StartGrid)
    {
        SummonpetInfo info = SummonM.GetSummonPetInfo(PetDataID);
        SummonPet     pet  = new SummonPet();

        pet.CreateSkin(BattleEnvironmentM.GetLifeMBornNode(true), info.m_modeltype, info.m_modeltype.ToString(), AnimatorState.Empty, true);
        //IGameRole i = GameRoleFactory.Create(BattleEnvironmentM.GetLifeMBornNode(true), info.m_modeltype, info.m_modeltype.ToString(), AnimatorState.Empty);
        GameObject go      = pet.RoleSkinCom.tRoot.gameObject;
        Vector3    pos     = Vector3.zero;
        string     posname = "";
        LifeObj    lo      = go.AddComponent <LifeObj>();

        pet.SetSummonPetLife(info, pet.RoleSkinCom.ProPerty, LifeEnvironment.Combat);
        pet.SetLifeCore(new LifeMCore(PetDataID, true, LifeMType.SUMMONPET, Camp, MoveState.Walk));
        pet.SetSkin();
        pet.SetBornPos(StartGrid.GridPos, 0);
        lo.SetLife(pet, pet.RoleSkinCom.ProPerty);
        go.transform.parent = BattleEnvironmentM.GetLifeMBornNode(true);
        Vector3 start = StartGrid.WorldPos;

        start.z = Camera.main.transform.position.z;
        go.transform.position = start;
        return(pet);
    }
Beispiel #19
0
    public void StartWithTarget(Life Parent)
    {
        m_StartTime = Time.time;
        Vector3 scale = new Vector3(1.25f, 1.25f, 1.25f);

        base.StartWithTarget(Parent, null);

        GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos);

        if (posgo != null)
        {
            //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1000011",posgo.transform.position,1.5f);
            GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1000011", posgo.transform.position, BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f);
            gae.AddAction(ndEffect);
            m_effectgo = gae.gameObject;
        }
        Role.RefreshSkin();
        //PlayAction(AnimatorState.Skill01,m_Start);

        (m_LifePrent as Role).SavePosZ();
        if (m_lifeMCore != null)
        {
            if (m_lifeMCore.m_IsPlayer)
            {
                //Debug.Log(" 己方释放大招!!!");
                List <Life> listRAW = new List <Life>();
                m_LifePrent.SetDark(false);
                //CM.SearchLifeMListInBoat(ref listRAW, LifeMType.ALL);
                CM.SearchLifeMList(ref listRAW, null, LifeMType.ALL, LifeMCamp.ALL, MapSearchStlye.AllWorld, null, 0);
                List <Role> rs      = new List <Role>();
                bool        ispause = false;
                foreach (Life item in listRAW)
                {
                    if (item != m_LifePrent)
                    {
                        if (item is Role)
                        {
                            Role r = item as Role;
                            if (r.CurrentAction != null && r.CurrentAction is GridActionCmdActiveSkill)
                            {
                                float starttime = (r.CurrentAction as GridActionCmdActiveSkill).m_StartTime;
                                if (starttime >= 0)
                                {
                                    if ((m_StartTime - starttime) > ConfigM.GetBigSkillDelatime())
                                    {
                                        ispause = true;
                                    }
                                    rs.Add(r);
                                }
                                else
                                {
                                    item.Pause();
                                    item.SetDark(true);
                                }
                            }
                            else
                            {
                                item.Pause();
                                item.SetDark(true);
                            }
                        }
                        else
                        {
                            item.Pause();
                            item.SetDark(true);
                        }
                    }
                }
                foreach (Role r in rs)
                {
                    if (ispause)
                    {
                        r.Pause();
                        r.SetDark(true);
                        (r.CurrentAction as GridActionCmdActiveSkill).m_StartTime = -1f;
                    }
                }
                MaterialM.DarkBattleEnv();
                m_Skin.Scale(scale);
                ParticleEffect.StaticPlay(false);
                Bullet.PauseAll();
            }
        }
        ActiiveStart();
        if (m_skillinfo.m_LifeTarget != null)
        {
            m_skillinfo.m_LifeTarget.SetDark(false);
        }
        else
        {
        }
    }
    public override void DoAttack(int count)
    {
        Life    target = m_skillinfo.m_LifeTarget;    //m_ConditionSkillTarget[PropSkillInfo.m_type];
        MapGrid pos    = m_skillinfo.m_TargetPos;     //m_ConditionSkillTargetPos[PropSkillInfo.m_type];

        if (m_skillinfo.m_target != 2 && target != null)
        {
            pos = target.GetMapGrid();
        }
        //if (PropSkillInfo.m_type == 1009 || PropSkillInfo.m_type == 1028)
        //	NGUIUtil.DebugLog( "doskill " + PropSkillInfo.m_type  + "," +  m_ConditionSkillTarget[PropSkillInfo.m_type] + "," + PropSkillInfo.m_name,"red");
        //播放攻击动画
        //受击掉血
        m_LifePrent.m_Attr.Attacked = true;

        if (m_skillinfo.m_skilleffectinfo != null)        //RoleModelsM.GetSkillResourcesData(PropSkillInfo.m_type,"HasBullet") == 1)
        {
            GameObject posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos);

            if (m_skillinfo.m_type == 1041)
            {
                posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.LeftHandPos);
            }
            else if (m_skillinfo.m_type == 1044)
            {
                posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.bagPos);
            }
            Transform fireplace = posgo.transform;
            if (fireplace != null)
            {
                string bulletname  = m_skillinfo.m_skilleffectinfo.m_targeteffect;
                string bulletLeft  = "1202071";
                string bulletRight = "1202071";

                if (BattleEnvironmentM.GetLifeMBornNode(true) == null)
                {
                    return;
                }
                GameObject go = null;
                if (m_LifePrent.WalkDir == WalkDir.WALKLEFT)
                {
                    go = GameObjectLoader.LoadPath("effect/prefab/", bulletLeft, fireplace.position, BattleEnvironmentM.GetLifeMBornNode(true));
                }
                else
                {
                    go = GameObjectLoader.LoadPath("effect/prefab/", bulletRight, fireplace.position, BattleEnvironmentM.GetLifeMBornNode(true));
                }


                if (m_LifePrent.WalkDir == WalkDir.WALKLEFT)
                {
                    go.transform.localScale = new Vector3(-go.transform.localScale.x, go.transform.localScale.y, go.transform.localScale.z);
                }
                Bullet bullet = go.AddComponent <Bullet>();
                if (bullet != null)
                {
                    Bullet.BulletType t    = Bullet.BulletType.Bullet;
                    Vector3           vpos = pos.pos;
                    if (m_skillinfo.m_skilleffectinfo.m_postion == 0)
                    {
                        vpos.y = go.transform.localPosition.y;
                    }
                    else
                    {
                        vpos.y += 0.2f;
                    }
                    bullet.SetInfo(vpos, m_DoAttack, 10f, m_LifePrent.WalkDir, t, (m_skillinfo as SoldierSkill), true);
                    //vpos,m_DoAttack,10f,m_LifePrent.WalkDir,t,m_skillinfo as SoldierSkill);
                }
            }
        }
        else
        {
            m_DoAttack(m_skillinfo as SoldierSkill, count);
        }
    }
Beispiel #21
0
 public void GoldCoinEffect(int num, int count)
 {
     for (int i = 0; i < num; i++)
     {
         Vector3 pos = MapGrid.GetMG(m_Attr.Pos).pos;            //+new Vector3(Random.Range(1,m_Attr.Size*0.5f-2),-0.5f,1f);
         pos += new Vector3(0, 0.25f, 1.2f);
         pos  = BattleEnvironmentM.Local2WorldPos(pos);
         int n = (int)count / num;
         if (i == 0)
         {
             n += count - num * ((int)count / num);
         }
         GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000041", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
         //EffectCamera.AddFollowList(gae.transform,pos);
         if (gae != null)
         {
             GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0));
             gae.AddAction(gaw);
             GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
             gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, ResourceType.Gold);
             gae.AddAction(gar);
             GameObject coin = U3DUtil.FindChild(gae.gameObject, "coin");
             if (coin != null)
             {
                 coin.GetComponent <ParticleSystem>().startDelay = Random.Range(1f, 1.5f);
             }
         }
     }
 }
Beispiel #22
0
 /// <summary>
 /// 清空方案下的现有船只
 /// </summary>
 void ClearFangAn()
 {
     U3DUtil.DestroyAllChild(BattleEnvironmentM.GetLifeMBornNode(true).gameObject);
 }
Beispiel #23
0
    public void ReleaseGodSkill(MapGrid g, Vector3 pos)
    {
        m_ReleaseTimes++;
        m_targetg   = g;
        m_targetpos = pos;

        if (m_godskill.m_type == 9000)
        {
            GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1000041_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            EffectCamera.AddFollowList(gae.transform, pos);
            //gae.gameObject.transform.localPosition = new Vector3(gae.gameObject.transform.localPosition.x,gae.gameObject.transform.localPosition.y,gae.gameObject.transform.localPosition.z-1f);
            GameObjectActionGodSkill9000 ndEffect = new GameObjectActionGodSkill9000();
            ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime);
            //ndEffect.m_complete = DoGodSkill;
            SoundPlay.Play("apocalypse_missile_01", false, false);
            SoundPlay.JoinPlayQueue("apocalypse_missile_02", 0f);
            SoundPlay.JoinPlayQueue("apocalypse_missile_03", 0.0f);
            gae.AddAction(ndEffect);
        }
        else if (m_godskill.m_type == 9001)
        {
            //NGUIUtil.DebugLog("使命召唤表现");


            GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1000051_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionGodSkill9001 ndEffect = new GameObjectActionGodSkill9001();
            ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime);
            if (m_listSkillTarget.Count > 0)
            {
                Life lifeTarget = m_listSkillTarget[0];
                ndEffect.SkillTarget = lifeTarget;
            }
            SoundPlay.Play("call_of_duty", false, false);
            gae.AddAction(ndEffect);
        }
        else if (m_godskill.m_type == 9002)
        {
            DoGodSkill();
        }
    }
Beispiel #24
0
    /// <summary>
    /// 撞击处理
    /// </summary>
    /// <param name="Damage">撞击伤害</param>
    /// <param name="dir">撞击方向</param>
    /// <param name="Info">返回撞击信息</param>
    /// <returns></returns>
    public override void CollisionProcByFire(Collision collision, int Damage /*,Vector2 dir*/, ref FlyCollisionInfo Info, FlyDir flydir)
    {
        Role.WakeEnemy(this);
        Info.bVertical           = true;
        Info.bLeft               = true;
        Info.FlyfallSTandGridPos = new Int2(StartUnit, Layer);
        Info.lifemCollision      = this;
        SkillReleaseInfo sInfo = new SkillReleaseInfo();

        sInfo.m_InterruptSkill = false;
        sInfo.m_MakeStatus     = new List <StatusType> ();
        sInfo.m_bImmunity      = false;
        sInfo.m_Damage         = Damage;
        sInfo.Result           = AttackResult.Fire;
        ApplyDamage(sInfo, null);
        if (isDead)   //破了
        //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1003021", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, 1f);
        {
            GameObjectActionExcute     gae        = EffectM.LoadEffect(EffectM.sPath, "2000291", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit();
            effectinit.SetRotation(new Vector3(0, 0, 90));
            gae.AddAction(effectinit);
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f);
            gae.AddAction(ndEffect);
            //go.transform.Rotate(new Vector3(0,0,90),Space.Self);
            Info.flyCollisionAction = FlyCollisionAction.PauseContinueFlyDirectional;
            Info.bApplyDamage       = true;
            //EffectM.LoadEffect(EffectM.sPath, "zamen_02", transform.position, null);
        }
        else          //没破
        {
            shake();
            //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1003011", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, 1f);
            GameObjectActionExcute     gae        = EffectM.LoadEffect(EffectM.sPath, "2000281", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit();
            effectinit.SetRotation(new Vector3(0, 0, 90));
            gae.AddAction(effectinit);
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f);
            gae.AddAction(ndEffect);
            //go.transform.Rotate(new Vector3(0,0,90),Space.Self);

            /*if (flydir == FlyDir.Left || flydir == FlyDir.LeftTop || flydir == FlyDir.LeftBottom)
             * {
             *  Info.flyCollisionAction = FlyCollisionAction.DropOutBoat;
             *  //设置左右板信息,并非移动方向
             *  Info.HitDir = WalkDir.WALKLEFT;
             *  Info.bApplyDamage = false;
             *
             * }
             * else if (flydir == FlyDir.Right || flydir == FlyDir.RightTop || flydir == FlyDir.RightBottom || flydir == FlyDir.Top || flydir == FlyDir.Bottom)
             * {
             *  Info.flyCollisionAction = FlyCollisionAction.DropInBoat;
             *  Info.bApplyDamage = false;
             * }
             * else
             * {
             *  if(m_DefenceColider.IsInRightCollider(collision.collider))
             *  {
             *          Info.flyCollisionAction = FlyCollisionAction.DropInBoat;
             *          Info.bApplyDamage = false;
             *  }
             *  else if(m_DefenceColider.IsInLeftCollider(collision.collider))
             *  {
             *          Info.flyCollisionAction = FlyCollisionAction.DropOutBoat;
             *          //设置左右板信息,并非移动方向
             *          Info.HitDir = WalkDir.WALKLEFT;
             *          Info.bApplyDamage = false;
             *  }
             * }*/

            Info.flyCollisionAction = FlyCollisionAction.DropOutBoat;
            for (int i = Layer; i >= 0; i--)
            {
                MapGrid g = MapGrid.GetMG(i, StartUnit);
                if (g != null && (g.Type != GridType.GRID_HOLE && g.Type != GridType.GRID_HOLESTAIR))
                {
                    Info.flyCollisionAction = FlyCollisionAction.DropInBoat;
                    break;
                }
            }

            Info.droppos = new Vector3(-1f, 0, 0);
            GameObjectActionExcute       gae1      = EffectM.LoadEffect(EffectM.sPath, "zamen_01", m_thisT.position, null);
            GameObjectActionDelayDestory ndEffect1 = new GameObjectActionDelayDestory(1f);
            gae1.AddAction(ndEffect1);
        }
    }
    public override void DoEvent()
    {
        base.DoEvent();

        if (m_LifePrent.m_Attr.IsHide)
        {
            if ((m_LifePrent as Role).Target is Role)
            {
                GameObject posgo = (m_LifePrent as Role).Target.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos);
                if (posgo != null)
                {
                    //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1051151",posgo.transform.position,1f,true);
                    GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1051061", posgo.transform.position, BattleEnvironmentM.GetLifeMBornNode(true));
                    GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.6f);
                    gae.AddAction(ndEffect);
                }
            }
        }
        SoundPlay.Play("act_yidao", false, false);
    }
Beispiel #26
0
    Transform SetEffect(StageClickType type, int ID)
    {
        string path = "";

        if (type == StageClickType.Room)
        {
            path = "Textures/room/";
        }
        else if (type == StageClickType.Role || type == StageClickType.Captain)
        {
            path = "Textures/role/";
        }
        else if (type == StageClickType.Item)
        {
            path = "Textures/item/";
        }
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "DropReward", m_target.transform.position + m_EndPos, BattleEnvironmentM.GetLifeMBornNode(true));

        if (gae != null)
        {
            gae.transform.localScale = m_StartScale;
            Sprite s = GameObjectLoader.LoadSprite(path, ID.ToString());
            if (s != null)
            {
                foreach (SpriteRenderer r in gae.gameObject.GetComponentsInChildren <SpriteRenderer>())
                {
                    r.sprite = s;
                }
            }
            GameObjectActionWait gaw = new GameObjectActionWait(1.0f);
            gae.AddAction(gaw);
            GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
            gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), 1, ResourceType.Box);
            gae.AddAction(gar);
            return(gae.transform);
        }
        return(null);
    }
Beispiel #27
0
    static void DropResourceBoxEffect(string name, sdata.s_itemtypeInfo item, Vector3 pos)
    {
        pos    = BattleEnvironmentM.Local2WorldPos(pos);
        pos.x += 0.5f;
        pos.z  = 0;
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));

        EffectCamera.AddFollowList(gae.transform, pos);
        if (gae != null)
        {
            //先等待
            GameObjectActionBoxWait gaw = new GameObjectActionBoxWait(2f);
            gae.AddAction(gaw);
            //open box
            GameObjectActionOpenBox gaopen = new GameObjectActionOpenBox(2.0f, item);
            gae.AddAction(gaopen);

            Animator ani = gae.gameObject.GetComponent <Animator>();
            if (null != ani)
            {
                int nValue = (int)Random.value % 2;
                if (nValue == 0)
                {
                    nValue = 2;
                }
                ani.SetInteger("iState", nValue);
            }
        }
    }
Beispiel #28
0
    static void DropResourceEffect(string name, ResourceType t, int num, int count, Vector3 pos)
    {
        pos    = BattleEnvironmentM.Local2WorldPos(pos);
        pos.x -= num / 2f;
        for (int i = 0; i < num; i++)
        {
            int n = (int)count / num;
            if (i == 0)
            {
                n += count - num * ((int)count / num);
            }
            pos.x += 1;            //Random.Range(0,2) == 0 ? - Random.Range(0,0.5f*num):Random.Range(0,0.5f*num);
            pos.z  = 0;
            GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            //EffectCamera.AddFollowList(gae.transform,pos);
            if (gae != null)
            {
                Random.seed++;
                GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0));
                gae.AddAction(gaw);
                GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
                gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, t);
                gae.AddAction(gar);

                Animator ani = gae.gameObject.GetComponent <Animator>();
                if (null != ani)
                {
                    int nValue = (int)Random.value % 2;
                    if (nValue == 0)
                    {
                        nValue = 2;
                    }
                    ani.SetInteger("iState", nValue);
                }
            }
        }
    }
Beispiel #29
0
    public override void DeadEffect()
    {
        RoleSkin skin = m_Skin as RoleSkin;

        GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos);
        Vector3    pos   = posgo.transform.position;

        pos.z = 1.5f;
        GameObject                   go       = null;
        GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "2000811", pos, BattleEnvironmentM.GetLifeMBornNode(true));
        GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2f);

        gae.AddAction(ndEffect);
        go = gae.gameObject;
    }
    public override void UpdateHitByBuild()
    {
        if (m_TimeCount < m_walktime)
        {
            Vector3 topos = m_End;
            topos.z = m_Start.z;
            Vector3 pos = Vector3.Lerp(m_Start, topos, m_TimeCount / m_walktime);
            //m_AniSpeed = 2f;
            PlayAction(AnimatorState.Walk, pos, true);
        }
        else if (m_TimeCount < m_JumpTime)
        {
            Vector3 topos = m_End;
            topos.z = m_Start.z;
            Vector3 pos = Vector3.Lerp(topos, m_End, (m_TimeCount - m_walktime) / (m_JumpTime - m_walktime));
            PlayAction(AnimatorState.SanNa, pos, true);
            if ((m_TimeCount - m_Delatime) < (m_walktime + 0.3f) && m_TimeCount > (m_walktime + 0.3f))
            {
                Vector3 effectpos = m_Skin.tRoot.position;
                effectpos.y += 0.8f;
                //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1906031",effectpos,0.75f);
                GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1906031", effectpos, BattleEnvironmentM.GetLifeMBornNode(true));
                GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.75f);
                gae.AddAction(ndEffect);
                m_effectgo = gae.gameObject;

                SoundPlay.Play("Trap/trap_sauna", false, false);
            }
        }
        else if (m_TimeCount < m_statusTime)
        {
            Transform t = m_Skin.tRoot;

            Vector3 topos = m_des;
            topos.z         = m_End.z;
            t.localPosition = topos;
            if ((m_TimeCount - m_Delatime) < m_JumpTime)
            {
                (m_Skin as RoleSkin).HitByBuildingEffect(HitbyBuilding.HitByBuild1504, true, 0, HitEffectMode.CoverBody, null);
                PlayAction(AnimatorState.Stand, m_Start);
            }
        }
        else if (m_TimeCount < m_jumpouttime)
        {
            Vector3 frompos = m_des;
            frompos.z = m_End.z;
            Vector3 topos = frompos;
            topos.y += 1f;
            Vector3 pos = Vector3.Lerp(frompos, topos, (m_TimeCount - m_statusTime) / (m_jumpouttime - m_statusTime));
            PlayAction(AnimatorState.Stand, pos, true);
        }
        else if (m_TimeCount < m_Duration)
        {
            (m_Skin as RoleSkin).HitByBuildingEffect(HitbyBuilding.HitByBuild1504, false, 0, HitEffectMode.CoverBody, null);
            m_Skin.tBody.localScale = new Vector3(1, 1, -1);
            Vector3 topos = m_des;
            topos.z = m_End.z;
            Vector3 pos = Vector3.Lerp(topos, m_des, (m_TimeCount - m_jumpouttime) / (m_Duration - m_jumpouttime));
            PlayAction(AnimatorState.SanNa, pos, true);
            if ((m_TimeCount - m_Delatime) < (m_jumpouttime) && m_TimeCount > (m_jumpouttime))
            {
                Vector3 effectpos = m_Skin.tRoot.position;
                effectpos.y += 0.8f;
                //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1906031",effectpos,0.75f);
                GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1906031", effectpos, BattleEnvironmentM.GetLifeMBornNode(true));
                GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.75f);
                gae.AddAction(ndEffect);
                m_effectgo = gae.gameObject;
            }
        }
        else if (m_TimeCount >= m_Duration)
        {
            m_Skin.tBody.localScale = new Vector3(1, 1, 1);
            m_LifePrent.InBoat      = true;
        }
    }