Пример #1
0
    override public bool Init(ObjectInitParam param)
    {
        if (!base.Init(param))
        {
            return(false);
        }

        mHomePosition.x = mPosition.x;
        mHomePosition.y = mPosition.y;
        mHomePosition.z = mPosition.z;

        mProperty = new RoleProperty();

        mActionCenter         = new BattleUnitActionCenter(this);
        mSkillContainer       = new BattleUnitSkillContainer();
        mSkillEffectManager   = new SkillEffectManager(this);
        mActiveFlagsContainer = new ActiveFlagsContainer();
        mRandEventContainer   = new BattleUnitRandEventContainer();

        mHitMaterialEffectCdContainer = new HitMaterialEffectCdContainer();

        // 默认透明度为100.
        SetBaseProperty((int)PropertyTypeEnum.PropertyTypeAlpha, 100);

        // 默认硬直抗性为100.
        SetBaseProperty((int)PropertyTypeEnum.PropertyTypeSpasticityResistance, 100);

        SetBaseProperty((int)PropertyTypeEnum.PropertyTypeScale_Rate, 100);

        return(true);
    }
Пример #2
0
        //=====================================================================

        /// <summary>
        /// This is overridden to allow cloning of a PDI object
        /// </summary>
        /// <returns>A clone of the object</returns>
        public override object Clone()
        {
            RoleProperty o = new RoleProperty();

            o.Clone(this);
            return(o);
        }
Пример #3
0
    public void UpdateDataShow()
    {
        object[]      list = (object[])data;
        RoundProperty p    = (RoundProperty)list[0];

        Label_Level.SetText(StrOpe.i + "关卡:" + p.id.ToString());
        Label_Goal.SetText(StrOpe.i + "目标:" + p.TargetDes);
        Label_RoundNum.SetText(StrOpe.i + "剩余回合数:" + (int)list[3]);
        Label_Des.SetText(p.Des);
        Label_title0.SetText(p.title);
        Label_title1.SetText(p.title0);
        Label_title2.SetText(p.title1);
        Label_title3.SetText(p.title0);
        Label_title4.SetText(p.title1);
        Label_Profit00.SetText(p.Profit[0].ToString());
        Label_Profit01.SetText(p.Profit[1].ToString());
        Label_Profit10.SetText(p.Profit[2].ToString());
        Label_Profit11.SetText(p.Profit[3].ToString());

        RoleProperty player = (RoleProperty)list[1];

        Player_Money.SetText(StrOpe.i + "金钱:" + player.Money.ToString());
        Player_Hornor.SetText(StrOpe.i + "荣誉:" + player.Honor.ToString());
        Player_Amity.SetText(StrOpe.i + "友好度:" + player.Amity.ToString());

        RoleProperty npc = (RoleProperty)list[2];

        NPC_Money.SetText(StrOpe.i + "金钱:" + npc.Money.ToString());
        NPC_Hornor.SetText(StrOpe.i + "荣誉:" + npc.Honor.ToString());
        NPC_Amity.SetText(StrOpe.i + "友好度:" + npc.Amity.ToString());
    }
Пример #4
0
 public bool AmityMost(ref RoleProperty role, ref RoleProperty Npc, int Values)
 {
     if (role.Amity >= Npc.Amity)
     {
         return(true);
     }
     return(false);
 }
Пример #5
0
 public bool HornorMost(ref RoleProperty role, ref RoleProperty Npc, int Values)
 {
     if (role.Honor >= Npc.Honor)
     {
         return(true);
     }
     return(false);
 }
Пример #6
0
 public bool MoneyMost(ref RoleProperty role, ref RoleProperty Npc, int Values)
 {
     if (role.Money >= Npc.Money)
     {
         return(true);
     }
     return(false);
 }
Пример #7
0
 public bool MoneyMoreThan(ref RoleProperty role, ref RoleProperty Np, int Values)
 {
     if (role.Money >= Values)
     {
         return(true);
     }
     return(false);
 }
Пример #8
0
    public override void init(Animator _animator)
    {
        switch (m_roletype)
        {
        case ns_predefine.ModelEnum.Enemy_Bat:
            m_animcontroler = new EMBat();
            break;

        case ns_predefine.ModelEnum.Enemy_Cactus:
            m_animcontroler = new EMCactus();
            break;

        case ns_predefine.ModelEnum.Enemy_DeadKnight:
            m_animcontroler = new EMDeadKnight();
            break;

        case ns_predefine.ModelEnum.Enemy_Dragon:
            m_animcontroler = new EMDragon();
            break;

        case ns_predefine.ModelEnum.Enemy_Dragon_Fly:
            m_animcontroler = new EMDragonFly();
            break;

        case ns_predefine.ModelEnum.Enemy_Ghost:
            m_animcontroler = new EMGhost();
            break;

        case ns_predefine.ModelEnum.Enemy_Plant:
            m_animcontroler = new EMPlant();
            break;

        case ns_predefine.ModelEnum.Enemy_Rock:
            m_animcontroler = new EMRock();
            break;

        case ns_predefine.ModelEnum.Enemy_SKArcher:
            m_animcontroler = new EMSKArcher();
            break;

        case ns_predefine.ModelEnum.Enemy_SKKnight:
            m_animcontroler = new EMSKKnight();
            break;

        case ns_predefine.ModelEnum.Enemy_SKMage:
            m_animcontroler = new EMSKMage();
            break;
        }
        _ObjRole = GameObject.Instantiate(GameResources.loadGameObject((int)m_roletype + 1)) as GameObject;
        _ObjRole.transform.position = GameResources.Instance()._GameMgr._MapMgr.getspwanpoint();
        m_animcontroler.init(_ObjRole.GetComponent <Animator>());

        m_property           = new RoleProperty();
        m_property.SName     = m_roletype.ToString();
        _EnemyBloodBar       = new UIBloodBar();
        _EnemyBloodBar.NAME  = m_property.SName.Replace("Enemy_", "");
        _EnemyBloodBar.BLOOD = (float)m_property.NHp / (float)m_property.NMaxHp;
    }
Пример #9
0
    public void Caculate(CardType type, CardFunc func, ref RoleProperty role, int[] Values)
    {
        int n = (int)type; int m = (int)func;

        if (FuncDict[n, m] == null)
        {
            Debug.LogError("方法没有注册");
            return;
        }
        FuncDict[n, m](ref role, Values);
    }
Пример #10
0
    private static void CreateRoleData()
    {
        RoleProperty role = new RoleProperty();
        string       path = EditorUtility.SaveFilePanel("", Application.dataPath + "/", "", "asset");

        if (path.Length != 0)
        {
            path = "Assets" + path.Replace(Application.dataPath, "");
            AssetDatabase.CreateAsset(role, path);
        }
    }
Пример #11
0
    public object Clone()
    {
        RoleProperty outdata = new RoleProperty
        {
            id     = id,
            Money  = Money,
            Honor  = Honor,
            Amity  = Amity,
            DeckId = DeckId
        };

        return(outdata);
    }
Пример #12
0
    public override void init(Animator _animator)
    {
        base.init(_animator);

        m_property  = new RoleProperty();
        m_equipment = new RoleEquipment();
        m_equipment.init(GameResources.Instance()._ObjPlayer.transform);

        m_skillcontroler = new PlayerSkillController();
        m_skillcontroler.init();

        m_animcontroler = new PlayerAnimController();
        m_animcontroler.init(_animator);

        InventoryImpl.Instance().init();
    }
Пример #13
0
    private static void ReadExcelRoles()
    {
        DataRowCollection collect = ExcelAccess.ReadExcel("Res/Excel/GameData.xlsx", "roles");

        for (int i = 2; i < collect.Count; i++)
        {
            RoleProperty role = new RoleProperty
            {
                id     = int.Parse(collect[i][0].ToString()),
                Money  = int.Parse(collect[i][1].ToString()),
                Honor  = int.Parse(collect[i][2].ToString()),
                Amity  = int.Parse(collect[i][3].ToString()),
                DeckId = int.Parse(collect[i][4].ToString())
            };
            AssetDatabase.CreateAsset(role, "Assets/Res/DataAsset/role/role" + role.id + ".asset");
        }
    }
Пример #14
0
    override public void Destroy()
    {
        if (mBattleUintAI != null)
        {
            mBattleUintAI.Destory();
            mBattleUintAI = null;
        }

        if (mActionCenter != null)
        {
            mActionCenter.Destroy();
            mActionCenter = null;
        }

        if (mSkillEffectManager != null)
        {
            SkillDetails.OnSkillEffectOwnerEvent(mSkillEffectManager, SkillEffectOwnerEventDef.OwnerLeaveScene);
            mSkillEffectManager.Destroy();
            mSkillEffectManager = null;
        }

        mActiveFlagsContainer = null;
        mRandEventContainer   = null;

        mHitMaterialEffectCdContainer = null;

        mProperty = null;

        mUIShield = null;

        base.Destroy();



        for (int i = 0; i < mAttachMents.Length; ++i)
        {
            AttachMent attach = mAttachMents[i];
            if (attach != null && attach.visual != null)
            {
                attach.visual.Destroy();
            }
            mAttachMents[i] = null;
        }
    }
Пример #15
0
    //玩家使用卡牌
    public bool UseCard(CardDataObj card, int role)
    {
        if (role == 1 && state != RoundState.PlayerRurn)
        {
            return(false);
        }
        if (role == 2 && state != RoundState.NpcTurn)
        {
            return(false);
        }
        RoleProperty self  = null;
        RoleProperty enemy = null;

        if (state == RoundState.PlayerRurn)
        {
            self  = PlayerAtt.property;
            enemy = NPCAtt.property;
        }
        else if (state == RoundState.NpcTurn)
        {
            self  = NPCAtt.property;
            enemy = PlayerAtt.property;
        }
        Debug.Log(card.data.CardName);
        for (int i = 0; i < card.data.functions.Length; i++)
        {
            FunctionData data = card.data.functions[i];
            if (data.target == EnumProperty.TargetType.Self || data.target == EnumProperty.TargetType.All)
            {
                CaculateSystem.Instance.Caculate(data.type, data.func, ref self, data.Values);
            }
            if (data.target == EnumProperty.TargetType.Enemy || data.target == EnumProperty.TargetType.All)
            {
                CaculateSystem.Instance.Caculate(data.type, data.func, ref enemy, data.Values);
            }
        }

        EntityCenter.Instance.ReleaseCard(card.gameObject);
        UIRound round = (UIRound)UIPage.GetPageInstatnce <UIRound>();

        UIRoundData[3] = RemainRound;
        round.UpdateDataShow();
        return(true);
    }
Пример #16
0
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            VCard o = (VCard)p;

            this.ClearProperties();

            groupName = o.Group;

            fn     = (FormattedNameProperty)o.FormattedName.Clone();
            name   = (NameProperty)o.Name.Clone();
            title  = (TitleProperty)o.Title.Clone();
            role   = (RoleProperty)o.Role.Clone();
            mailer = (MailerProperty)o.Mailer.Clone();
            url    = (UrlProperty)o.Url.Clone();
            org    = (OrganizationProperty)o.Organization.Clone();
            uid    = (UniqueIdProperty)o.UniqueId.Clone();
            bday   = (BirthDateProperty)o.BirthDate.Clone();
            rev    = (LastRevisionProperty)o.LastRevision.Clone();
            tz     = (TimeZoneProperty)o.TimeZone.Clone();
            geo    = (GeographicPositionProperty)o.GeographicPosition.Clone();
            key    = (PublicKeyProperty)o.PublicKey.Clone();
            photo  = (PhotoProperty)o.Photo.Clone();
            logo   = (LogoProperty)o.Logo.Clone();
            sound  = (SoundProperty)o.Sound.Clone();

            this.Notes.CloneRange(o.Notes);
            this.Addresses.CloneRange(o.Addresses);
            this.Labels.CloneRange(o.Labels);
            this.Telephones.CloneRange(o.Telephones);
            this.EMailAddresses.CloneRange(o.EMailAddresses);
            this.Agents.CloneRange(o.Agents);
            this.CustomProperties.CloneRange(o.CustomProperties);

            addProfile     = o.AddProfile;
            mimeName       = (MimeNameProperty)o.MimeName.Clone();
            mimeSource     = (MimeSourceProperty)o.MimeSource.Clone();
            prodId         = (ProductIdProperty)o.ProductId.Clone();
            nickname       = (NicknameProperty)o.Nickname.Clone();
            sortString     = (SortStringProperty)o.SortString.Clone();
            classification = (ClassificationProperty)o.Classification.Clone();
            categories     = (CategoriesProperty)o.Categories.Clone();
        }
Пример #17
0
 public void OnPress(bool isPress)
 {
     if (isPress == false)
     {
         //获取角色组件中的RoleProperty
         rp = this.GetComponent <RoleProperty>();
         StartMenuController.selectedRoleName = transform.Find("name-label").GetComponent <UILabel>().text;
         if (characterGrid.currentSprite == null)
         {
             characterGrid.currentSprite = sprite;
         }
         else
         {
             characterGrid.formerSprite  = characterGrid.currentSprite;
             characterGrid.currentSprite = sprite;
         }
         //在PhotonEngine中保存当前选择角色的信息
         //PhotonEngine.Instance.role.Name = StartMenuController.selectedRoleName;
         PhotonEngine.Instance.role.ID          = rp.Id;
         PhotonEngine.Instance.role.Name        = rp.Name;
         PhotonEngine.Instance.role.IsMan       = rp.IsMan;
         PhotonEngine.Instance.role.Exp         = rp.Exp;
         PhotonEngine.Instance.role.Coin        = rp.Coin;
         PhotonEngine.Instance.role.Diamond     = rp.Diamond;
         PhotonEngine.Instance.role.Energy      = rp.Energy;
         PhotonEngine.Instance.role.Toughen     = rp.Toughen;
         PhotonEngine.Instance.role.CharacterId = rp.CharacterId;
         PhotonEngine.Instance.role.Level       = rp.Level;
         Debug.Log("characterid=" + rp.CharacterId + ",name=" + rp.Name);
     }
     if (characterGrid.formerSprite != null)
     {
         characterGrid.formerSprite.spriteName = StartMenuController.originSprite;
     }
     if (characterGrid.currentSprite != null)
     {
         characterGrid.currentSprite.spriteName = StartMenuController.characterSelectedSprite;
     }
 }
Пример #18
0
        /// <summary>
        /// The method can be called to clear all current property values from the vCard.  The version is left
        /// unchanged.
        /// </summary>
        public void ClearProperties()
        {
            groupName = null;

            fn     = null;
            name   = null;
            title  = null;
            role   = null;
            mailer = null;
            url    = null;
            org    = null;
            uid    = null;
            bday   = null;
            rev    = null;
            tz     = null;
            geo    = null;
            key    = null;
            photo  = null;
            logo   = null;
            sound  = null;

            notes       = null;
            addrs       = null;
            labels      = null;
            phones      = null;
            email       = null;
            agents      = null;
            customProps = null;

            addProfile     = false;
            mimeName       = null;
            mimeSource     = null;
            prodId         = null;
            nickname       = null;
            sortString     = null;
            classification = null;
            categories     = null;
        }
Пример #19
0
    //初始化数据
    public void InitData()
    {
        for (int i = 0; i < roundData.Rules.Length; i++)
        {
            PerseRule(ref allPerseItem, roundData.Rules[i]);
            FillProfit(ref roundData.Profit, ref allPerseItem);
        }
        RoleProperty player     = GameData.Instance.SystemData.AllRoles[roundData.playerId];
        DeckProperty playerDeck = GameData.Instance.SystemData.AllDecks[player.DeckId];

        PlayerAtt = new RoleSystem
        {
            property = (RoleProperty)player.Clone(),
            Deck     = new List <int>(playerDeck.Deck),
        };
        RoleProperty npc     = GameData.Instance.SystemData.AllRoles[roundData.npcId];
        DeckProperty npcdeck = GameData.Instance.SystemData.AllDecks[npc.DeckId];

        NPCAtt = new RoleSystem
        {
            property = (RoleProperty)npc.Clone(),
            Deck     = new List <int>(npcdeck.Deck),
        };
    }
Пример #20
0
    //在Unity客户端展示角色信息
    public void DisplayRoles(List <Role> roleList)
    {
        GameObject go = null;

        foreach (Role role in roleList)
        {
            if (role.CharacterId == 1)//暂时写死
            {
                go = NGUITools.AddChild(this.characterGrid.gameObject,
                                        this.characterBoyGo);
            }
            else if (role.CharacterId == 2)
            {
                go = NGUITools.AddChild(this.characterGrid.gameObject,
                                        this.characterGrilGo);
            }
            //给go中的RoleProperty赋值
            RoleProperty rp = go.GetComponent <RoleProperty>();
            rp.Id          = role.ID;
            rp.Name        = role.Name;
            rp.IsMan       = role.IsMan;
            rp.Level       = role.Level;
            rp.Exp         = role.Exp;
            rp.Diamond     = role.Diamond;
            rp.Coin        = role.Coin;
            rp.Toughen     = role.Toughen;
            rp.CharacterId = role.CharacterId;

            UILabel nameLabel = go.transform.Find("name-label").GetComponent <UILabel>();
            UILabel LVLabel   = go.transform.Find("LV-label").GetComponent <UILabel>();
            nameLabel.text = role.Name;
            LVLabel.text   = "LV:" + role.Level.ToString();
            //如果不加这个代码,Grid中的元素会叠在一起不排序.
            StartMenuController.Instance.characterGrid.AddChild(go.transform);
        }
    }
Пример #21
0
 public void GainMoney(ref RoleProperty role, int[] Values)
 {
     role.Money += Values[0];
 }
Пример #22
0
 public void GainHornor(ref RoleProperty role, int[] Values)
 {
     role.Honor += Values[0];
 }
 set => SetValue(RoleProperty, value);
Пример #24
0
    private void InitFittingsItemInfo()
    {
        WeaponModule wmodule = ModuleManager.Instance.FindModule <WeaponModule>();

        if (wmodule == null)
        {
            return;
        }

        PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (module == null)
        {
            return;
        }
        FittingsTableItem fres = DataManager.FittingsTable[uiparam.itemid] as FittingsTableItem;

        if (fres == null)
        {
            GameDebug.LogError("资源ID为" + uiparam.itemid + "不存在表格fittings.txt中 ");
            return;
        }
        ConfigTableItem configitem = DataManager.ConfigTable[fres.grade] as ConfigTableItem;

        if (null == configitem)
        {
            return;
        }
        mFitName.text   = "[" + configitem.value + "]" + fres.name;
        mFitType.text   = "物品类型";
        mFitUseLv.text  = fres.itemtype;
        mFitDesc.text   = fres.itemdesc;
        mFitAbtain.text = fres.itemabtain;

        SetIcon(mFitPic, fres.bmp);
        SetIcon(mItemPic1, null);
        mItemLb.text = "";

        FittingsData fdata = module.GetFittingsData((uint)uiparam.packpos);

        if (fdata == null)
        {
            for (int i = 0; i < (int)FittingsType.MAX_PROPERTY; ++i)
            {
                mFitProNameList[i].text  = "";
                mFitproValueList[i].text = "";
            }
            mFitProNameList[0].text = "配件未洗练!";
            return;
        }

        for (int i = 0; i < (int)FittingsType.MAX_PROPERTY; ++i)
        {
            int  proid  = -1;
            int  value  = -1;
            bool forbid = false;
            if (!fdata.GetProValue((uint)i, ref proid, ref value, ref forbid))
            {
                continue;
            }

            string pname = RoleProperty.GetPropertyName(proid);
            if ("error".Equals(pname))
            {
                pname = "属性名称";
            }
            mFitProNameList[i].text = pname;

            int min = 0;
            int max = 1;
            if (!wmodule.GetFittMinMax(uiparam.itemid, proid, ref min, ref max))
            {
                mFitproValueList[i].text = "该条属性尚未洗炼!";
                continue;
            }

            mFitproValueList[i].text = value.ToString();

            /*int proindex = FittingsProperty.GetResId(proid);
             * string colorss = "000000";
             * Hashtable map = DataManager.FittcolorTable;
             * foreach (FittcolorTableItem fcres in map.Values)
             * {
             *  if (fcres.qualityid == fres.grade && value > System.Convert.ToInt32(fcres["max_" + proindex]))
             *      continue;
             *
             *  colorss = fcres.color;
             *  break;
             * }*/
        }
    }
Пример #25
0
 public void ReduceHornor(ref RoleProperty role, int[] Values)
 {
     role.Honor -= Values[0];
 }
Пример #26
0
        //=====================================================================

        /// <summary>
        /// This is overridden to allow cloning of a PDI object
        /// </summary>
        /// <returns>A clone of the object</returns>
        public override object Clone()
        {
            RoleProperty o = new RoleProperty();
            o.Clone(this);
            return o;
        }
Пример #27
0
 public void GainAmity(ref RoleProperty role, int[] Values)
 {
     role.Amity += Values[0];
 }
Пример #28
0
 public void ReduceAmity(ref RoleProperty role, int[] Values)
 {
     role.Amity -= Values[0];
 }
Пример #29
0
    public bool CheckGoal(TargetType target, RoundGoalType type, RoundGoalCondition func, ref RoleProperty role, ref RoleProperty Npc, int Values)
    {
        int n = (int)type; int m = (int)func;

        if (GoalCheckFuncDict[n, m] == null)
        {
            Debug.LogError("方法没有注册");
            return(false);
        }

        if (target == TargetType.Self)
        {
            return(GoalCheckFuncDict[n, m](ref role, ref Npc, Values));
        }

        if (target == TargetType.Enemy)
        {
            return(GoalCheckFuncDict[n, m](ref Npc, ref role, Values));
        }
        if (target == TargetType.All)
        {
            bool va = GoalCheckFuncDict[n, m](ref role, ref Npc, Values);
            bool vb = GoalCheckFuncDict[n, m](ref Npc, ref role, Values);
            return(va && vb);
        }
        return(false);
    }
Пример #30
0
 public void ReduceMoney(ref RoleProperty role, int[] Values)
 {
     role.Money -= Values[0];
 }