Ejemplo n.º 1
0
    public virtual void Init(int id, int lv, int EquipAtk, int EquipMtk, int EquipDef, int EquipMef) //計算機中的玩家
    {
        JobData = global::JobData.GetData(id);

        IsAI         = false;
        IsTeamMember = true;
        Lv           = lv;
        Name         = JobData.GetName();
        MaxHP        = Mathf.RoundToInt(JobData.HP * (1 + (lv - 1) * 0.1f));
        CurrentHP    = MaxHP;
        _atk         = Mathf.RoundToInt(JobData.ATK * (1 + (lv - 1) * 0.1f));
        _def         = Mathf.RoundToInt(JobData.DEF * (1 + (lv - 1) * 0.1f));
        _mtk         = Mathf.RoundToInt(JobData.MTK * (1 + (lv - 1) * 0.1f));
        _mef         = Mathf.RoundToInt(JobData.MEF * (1 + (lv - 1) * 0.1f));
        _agi         = Mathf.RoundToInt(JobData.AGI * (1 + (lv - 1) * 0.1f));
        _sen         = Mathf.RoundToInt(JobData.SEN * (1 + (lv - 1) * 0.1f));
        _mov         = JobData.MOV;
        EquipATK     = EquipAtk;
        EquipDEF     = EquipDef;
        EquipMTK     = EquipMtk;
        EquipMEF     = EquipMef;
        Camp         = CampEnum.Partner;

        SkillData.RootObject skillData;
        for (int i = 0; i < JobData.SkillList.Count; i++)
        {
            skillData = SkillData.GetData(JobData.SkillList[i]);
        }
    }
Ejemplo n.º 2
0
        private void Awake()
        {
            if (gameObject.layer == 8)
            {
                camp         = CampEnum.Alliance;
                gameCampData = GameDataManager.Instance.AllianceCampData;
                enemy_Camp   = CampEnum.Empire;
            }
            else
            {
                camp         = CampEnum.Empire;
                gameCampData = GameDataManager.Instance.EmpireCampData;
                enemy_Camp   = CampEnum.Alliance;
            }
            enemy_CampName = enemy_Camp.ToString();
            campName       = camp.ToString();
            Collider[] colliders = Physics.OverlapSphere(transform.position, 500, 1 << LayerMask.NameToLayer("Mine"));
            MinePos = new Vector3[colliders.Length];
            for (int i = 0; i < colliders.Length; ++i)
            {
                MinePos[i] = colliders[i].transform.position;
            }
            GameDataManager.Instance.Production_Judgment += Production_Judgment;
            productUnit_Next = UnitTypeEnum.Harvester.ToString();
            StartCoroutine(Enumerable());

            EventManager.Instance.Subscribe(GameEventEnum.AI_BattleUnitToGenerate, CommandArmy);
        }
Ejemplo n.º 3
0
 bool IsStart;      //是否开始采矿
 public MiningState(Vector3 centerPosition, CampEnum camp, bool isPlayerCamp)
 {
     State_ID       = StateID.Mining;
     CenterPosition = centerPosition;
     IsPickedMine   = false;
     IsStart        = false;
     _camp          = camp;
     IsPlayerCamp   = isPlayerCamp;
 }
 public void ChangeGoldCount(int value, CampEnum campEnum, bool IsPlayerCamp)
 {
     if (campEnum == CampEnum.Alliance)
     {
         AllianceCampData.Gold_Count += value;
     }
     else
     {
         EmpireCampData.Gold_Count += value;
     }
 }
 public void ChangeCampScore(int value, CampEnum campEnum)
 {
     if (campEnum == CampEnum.Alliance)
     {
         AllianceCampData.Camp_Score += value;
     }
     else
     {
         EmpireCampData.Camp_Score += value;
     }
 }
 public void ChangeMineCount(int value, CampEnum campEnum, bool IsPlayerCamp)
 {
     if (campEnum == CampEnum.Alliance)
     {
         AllianceCampData.Mine_Count += value;
     }
     else
     {
         EmpireCampData.Mine_Count += value;
     }
     if (IsPlayerCamp)
     {
         mineNumChange(playerCampData.Mine_Count);
     }
     else
     {
         Production_Judgment();
     }
 }
        protected override void Init()
        {
            base.Init();
            if (null != GetComponent <TrollDrawLine>())
            {
                trollDrawLine = GetComponent <TrollDrawLine>();
            }
            GameMapManager.UnitData UnitData = GameMapManager.Instance.GetUnitData(gameObject.tag);
            if (UnitData.object_UnitName != "")
            {
                Object_UnitName = EnumChange <GameUnitName> .StringToEnum(UnitData.object_UnitName);

                Object_Camp = EnumChange <CampEnum> .StringToEnum(UnitData.object_Camp);

                Object_UnitType = EnumChange <UnitTypeEnum> .StringToEnum(UnitData.object_UnitType);

                Object_HP     = UnitData.object_HP;
                Max_HP        = UnitData.object_HP;
                Object_Radius = UnitData.unit_Radius;
                if (Object_Camp == GameMapManager.Instance.PlayerCamp)
                {
                    IsPlayerCamp = true;
                }
                else
                {
                    IsPlayerCamp = false;
                }
            }
            if (IsPlayerCamp)
            {
                gameObject.AddComponent <HighlightableObject>();
                highlightable = GetComponent <HighlightableObject>();
            }
            else
            {
                StartCoroutine(StartAI());
            }
            Is_AI = !IsPlayerCamp;
        }
Ejemplo n.º 8
0
    public virtual void Init(int id, int lv) //for enemy
    {
        EnemyData = global::EnemyData.GetData(id);

        IsAI         = true;
        IsTeamMember = false;
        Lv           = lv;
        Name         = EnemyData.Name;
        HPQueue      = new Queue <int>(EnemyData.HPList);
        MaxHP        = Mathf.RoundToInt(HPQueue.Dequeue() * (1 + (lv - 1) * 0.1f));
        CurrentHP    = MaxHP;
        _atk         = Mathf.RoundToInt(EnemyData.ATK * (1 + (lv - 1) * 0.1f));
        _def         = Mathf.RoundToInt(EnemyData.DEF * (1 + (lv - 1) * 0.1f));
        _mtk         = Mathf.RoundToInt(EnemyData.MTK * (1 + (lv - 1) * 0.1f));
        _mef         = Mathf.RoundToInt(EnemyData.MEF * (1 + (lv - 1) * 0.1f));
        _agi         = Mathf.RoundToInt(EnemyData.AGI * (1 + (lv - 1) * 0.1f));
        _sen         = Mathf.RoundToInt(EnemyData.SEN * (1 + (lv - 1) * 0.1f));
        _mov         = EnemyData.MOV;
        EquipATK     = EnemyData.Equip_ATK;
        EquipDEF     = EnemyData.Equip_DEF;
        EquipMTK     = EnemyData.Equip_MTK;
        EquipMEF     = EnemyData.Equip_MEF;
        Camp         = CampEnum.Enemy;
    }
Ejemplo n.º 9
0
    public void Init(TeamMember member, int lv) //for player
    {
        IsAI         = false;
        IsTeamMember = true;
        Lv           = lv;
        Name         = member.Data.GetName();
        MaxHP        = member.MaxHP;
        CurrentHP    = member.CurrentHP;
        MaxMP        = member.MaxMP;
        CurrentMP    = member.CurrentMP;
        _atk         = member.ATK;
        _def         = member.DEF;
        _mtk         = member.MTK;
        _mef         = member.MEF;
        _agi         = member.AGI;
        _sen         = member.SEN;
        _mov         = member.MOV;
        EquipATK     = member.Weapon.ATK;
        EquipDEF     = member.Armor.DEF;
        EquipMTK     = member.Weapon.MTK;
        EquipMEF     = member.Armor.MEF;
        Camp         = CampEnum.Partner;
        JobData      = member.Data;
        if (!member.FoodBuff.IsEmpty)
        {
            FoodBuff = member.FoodBuff;
        }

        int id;

        SkillData.RootObject skillData;
        Skill skill;

        foreach (KeyValuePair <int, int> item in member.SkillDic)
        {
            id        = item.Key;
            skillData = SkillData.GetData(id);
            skill     = SkillFactory.GetNewSkill(skillData, this, item.Value);

            //if (!PriorityList.Contains(skill.Data.Priority))
            //{
            //    PriorityList.Add(skill.Data.Priority);
            //}

            SkillList.Add(skill);
        }

        foreach (KeyValuePair <int, int> item in member.SpellCardDic)
        {
            id        = item.Key;
            skillData = SkillData.GetData(id);
            skill     = SkillFactory.GetNewSkill(skillData, this, item.Value);

            //if (!PriorityList.Contains(skill.Data.Priority))
            //{
            //    PriorityList.Add(skill.Data.Priority);
            //}

            SpellCardList.Add(skill);
        }
    }