Inheritance: MonoBehaviour
Beispiel #1
0
        public void FullListAndItemGeneratesContent()
        {
            var list = new SkillList
            {
                ListId  = "test",
                Name    = "name",
                State   = SkillListState.Active,
                Version = 7,
                Items   = new List <SkillListItem>
                {
                    new SkillListItem {
                        Id          = "testitem",
                        Version     = 3,
                        Value       = "test",
                        Status      = SkillListItemStatus.Completed,
                        CreatedTime = new DateTime(2017, 07, 19, 23, 24, 10, DateTimeKind.Utc),
                        UpdatedTime = new DateTime(2017, 07, 19, 23, 24, 10, DateTimeKind.Utc),
                        Href        = "url"
                    }
                },
                Links = new Dictionary <string, string>
                {
                    { "next", "v2/householdlists/{listId}/{status}?nextToken={nextToken}" }
                }
            };

            Assert.True(Utility.CompareJson(list, "ListSingleList.json"));
        }
Beispiel #2
0
    public void AddPassiveSkill(uint _id)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupPassiveSkill(_id);
        SkillList.Add(_newSkill);
    }
Beispiel #3
0
        /// <summary>
        /// 初始化 卡牌-技能 关系列表
        /// </summary>
        public void CardData_InitSkillRelationLists()
        {
            //  1   卡牌所有技能列表
            foreach (var card in CardList)
            {
                var list = new List <ParsedSkillData>();
                list.AddRange(card.Skill.Select(m => SkillList.FirstOrDefault(n => n.SkillId == m)).Where(m => m != null));
                list.AddRange(card.LockSkill1.Select(m => SkillList.FirstOrDefault(n => n.SkillId == m)).Where(m => m != null));
                list.AddRange(card.LockSkill2.Select(m => SkillList.FirstOrDefault(n => n.SkillId == m)).Where(m => m != null));
                CardData_AllSkills.TryAdd(card, list.ToArray());
            }

            //  1.1 卡牌所有技能展开形式列表(展开卡牌所有技能列表)
            foreach (var card in CardList)
            {
                var list = new List <ParsedSkillData>();
                foreach (var i in CardData_GetAllSkills(card))
                {
                    list.AddRange(SkillData_GetExpandSkills(i));
                }
                CardData_AllExpandSkills.TryAdd(card, list.ToArray());
            }

            //  1.2 战斗性卡牌列表(检查卡牌所有技能列表)
            foreach (var card in CardList)
            {
                var allskills = CardData_GetAllSkills(card);

                //  所有技能都不是战斗技能,则卡牌不是战斗卡牌。没有技能的卡牌算作战斗卡牌(如双子座幻影、九命猫神幻影)
                var isBattleCard = !(allskills.Length > 0 && allskills.All(m => !m.IsBattleSkill));

                CardData_IsBattleCard.Add(card, isBattleCard);
            }
        }
Beispiel #4
0
    public void AddLeaderSkill(uint _id)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLeaderSkill(_id);
        SkillList.Add(_newSkill);
    }
Beispiel #5
0
    public void AddLimitBreakSkill(uint _id, int level)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLimitBreakSkill(_id, (uint)level);
        SkillList.Add(_newSkill);
    }
Beispiel #6
0
    public void Input1(Button actionChoice)//Action Panel
    {
        HeroChoice.Attacker           = HeroesToManage[0].name;
        HeroChoice.AttackerGameObject = HeroesToManage[0];
        HeroChoice.Type = "Hero";

        if (actionChoice.name == "Attack Button")
        {
            SkillPanel.SetActive(false);
            EnemySelectPanel.SetActive(true);
            HeroChoice.choosenAttack = SkillList.NormalAttack();
        }
        else if (actionChoice.name == "Skills Button")
        {
            SkillPanel.SetActive(true);
            EnemySelectPanel.SetActive(false);
        }
        else if (actionChoice.name == "Item Button")
        {
            SkillPanel.SetActive(false);
            EnemySelectPanel.SetActive(false);
        }
        else if (actionChoice.name == "Defend Button")
        {
            SkillPanel.SetActive(false);
            EnemySelectPanel.SetActive(false);
        }
    }
        public string Serialize()
        {
            var data = Enumerable.Repeat(mSkillPoints.ToString(), 1)
                       .Concat(SkillList.Select(entry => (int)entry.Key + "/" + entry.Value.GetLevel()));

            return(string.Join(" ", data));
        }
Beispiel #8
0
    public P_ZhangFei() : base("张飞")
    {
        Sex   = PSex.Male;
        Age   = PAge.Medieval;
        Index = 14;
        Cost  = 10;
        Tips  = "定位:攻击\n" +
                "难度:简单\n" +
                "史实:三国时期蜀汉名将,“五虎上将”之一,曾在长坂坡负责断后,曹军无人敢逼近。\n" +
                "攻略:\n张飞是一个使用起来很简单的武将,为新手推荐。\n" +
                "张飞可以很容易制造出很高等级的房屋,如果人数较多而地图较小,高级房屋可以造成相当巨大的优势。但反之,如果人数少而地图大,滥用【咆哮】会导致张飞在前期现金数量迅速减少,而陷入发展不平衡的困境。由于张飞几乎可以完全控制地图上各片地的发展情况,所以集中力量发展还是分散建设到不同土地上,是张飞面临的首要问题。一般而言,张飞每片地应当保持至少2座房屋,以形成对【反客为主】的完全防御。";

        PSkill PaoXiao = new PSkill("咆哮")
        {
            Lock = true
        };

        SkillList.Add(PaoXiao
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(PaoXiao.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PPeriod.SettleStage.Start,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer);
                },
                Effect = (PGame Game) => {
                    Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName).Limit += 3;
                }
            });
        }));
    }
Beispiel #9
0
    public P_BaiQi() : base("白起")
    {
        Sex   = PSex.Male;
        Age   = PAge.Classic;
        Index = 9;
        Cost  = 25;
        Tips  = "定位:爆发\n" +
                "难度:简单\n" +
                "史实:战国时期秦国名将,“战国四大名将”之一,曾在伊阙之战、长平之战中大败三晋军队,歼敌数十万,功封武安君。\n" +
                "攻略:\n白起是一个强制命中系武将,白起的存在使得对方无法通过【李代桃僵】、【指桑骂槐】一类的牌免除伤害,或通过【八卦阵】、【龙胆】等方式减少伤害,而必须硬吃下伤害的100%(通常这个数字比伤害值高)。随之带来的损失则是收费地的地价永久性减少,很多时候这是不值的,但在必杀一击上,白起一点都不会含糊。";

        PSkill CanSha = new PSkill("残杀");

        SkillList.Add(CanSha
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(CanSha.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Injure.EmitInjure,
                AIPriority = 100,
                Condition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return InjureTag.Injure > 0 && InjureTag.ToPlayer != null && Player.Equals(InjureTag.FromPlayer) &&
                    InjureTag.InjureSource is PBlock && ((PBlock)InjureTag.InjureSource).Price >= 1000;
                },
                AICondition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    if (InjureTag.ToPlayer.TeamIndex != Player.TeamIndex)
                    {
                        int Benefit = PMath.Percent(InjureTag.Injure, 100);
                        if (Benefit + InjureTag.Injure >= InjureTag.ToPlayer.Money)
                        {
                            // 一击必杀
                            return true;
                        }
                        if (Benefit >= 2000)
                        {
                            PBlock Source = (PBlock)InjureTag.InjureSource;
                            int Cost = 1000 + PAiMapAnalyzer.HouseValue(Game, Player, Source) * Source.HouseNumber * 1000 / Source.Price;
                            if (Cost < Benefit)
                            {
                                return true;
                            }
                        }
                    }
                    return false;
                },
                Effect = (PGame Game) => {
                    CanSha.AnnouceUseSkill(Player);
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PBlock Source = (PBlock)InjureTag.InjureSource;
                    Source.Price -= 1000;
                    PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Source));
                    Game.LoseMoney(InjureTag.ToPlayer, PMath.Percent(InjureTag.Injure, 100));
                }
            });
        }));
    }
Beispiel #10
0
    public void SaveData(int userID, int roleID, SkillList data)
    {
        List <UnityAction <Transform, string> > tmpList = new List <UnityAction <Transform, string> >();

        for (int i = 0; i < data.skillList.Count; i++)
        {
            tmpList.Add(data.skillList[i].DelegateFunc);
            data.skillList[i].DelegateFunc = null;
        }

        string skillPath = AllPath.Instance.accountDirectoryPath + userID + AllPath.Instance.accountSkillDirectoryPath;

        File.WriteAllText(skillPath + userID + "_" + roleID, Tool.Instance.ObjToJson(data));

        for (int i = 0; i < data.skillList.Count; i++)
        {
            data.skillList[i].DelegateFunc = tmpList[i];
        }

        Dictionary <int, SkillData> dic = new Dictionary <int, SkillData>();

        for (int i = 0; i < data.skillList.Count; i++)
        {
            dic.Add(data.skillList[i].ID, data.skillList[i]);
            data.skillList[i].DelegateFunc = SkillInfoManager.Instance.GetSkill(data.skillList[i].ID).DelegateFunc;
        }
        Bind(dic);
    }
Beispiel #11
0
    public void InitData(int userID, int roleID, RoleData data)
    {
        string    skillPath = AllPath.Instance.accountDirectoryPath + userID + AllPath.Instance.accountSkillDirectoryPath;
        SkillList skillList = new SkillList(SkillInfoManager.Instance.GetSkillList(data.StrSkillList));

        File.WriteAllText(skillPath + userID + "_" + roleID, Tool.Instance.ObjToJson(skillList));
    }
Beispiel #12
0
 public Monster()
 {
     for (int i = 0; i < 2; ++i)
     {
         SkillList.Add(Skill.Bite);
     }
 }
Beispiel #13
0
    public void WorkOnActiveContract()
    {
        if (ActiveContract == null)
        {
            return;
        }

        var work_sums = new SkillList();

        foreach (Office office in CompanyOffices)
        {
            var office_work_sum = new SkillList();
            foreach (Employee emp in office.Employees)
            {
                office_work_sum += emp.Skills;
            }
            office_work_sum = office.ApplyQualityBonus(office_work_sum);
            work_sums      += office_work_sum;
        }

        if (ActiveContract.ApplyWork(work_sums))
        {
            Contract.SetCompanyActiveContract(null);
        }
    }
    public void CreateSkillList(MasterDataHero master)
    {
        UnitSkillContext unit = new UnitSkillContext();

        unit.setupHeroSkill((uint)master.default_skill_id, 0, 0, true);
        SkillList.Add(unit);
    }
Beispiel #15
0
    //Function called from CheckCharacterSkillForNewAbility to return the list of SkillLevelRewards for a given skill
    private int getCharacterSkillLevel(Character charThatLeveled_, SkillList skillToCheck_)
    {
        //Switch statement to return the correct list
        switch (skillToCheck_)
        {
        //Combat skills
        case SkillList.Unarmed:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Unarmed));

        case SkillList.Daggers:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Daggers));

        case SkillList.Swords:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Swords));

        case SkillList.Mauls:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Mauls));

        case SkillList.Poles:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Poles));

        case SkillList.Bows:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Bows));

        case SkillList.Shields:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.Shields));


        //Magic skills
        case SkillList.ArcaneMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.ArcaneMagic));

        case SkillList.EnchantMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.EnchantMagic));

        case SkillList.HolyMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.HolyMagic));

        case SkillList.DarkMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.DarkMagic));

        case SkillList.FireMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.FireMagic));

        case SkillList.WaterMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.WaterMagic));

        case SkillList.WindMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.WindMagic));

        case SkillList.ElectricMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.ElectricMagic));

        case SkillList.StoneMagic:
            return(charThatLeveled_.charSkills.GetSkillLevelValue(SkillList.StoneMagic));

        default:
            return(0);
        }
    }
Beispiel #16
0
    //Function called from CheckCharacterSkillForNewAbility to return the list of SkillLevelRewards for a given skill
    private List <SkillAbilityReward> getSkillRewardList(SkillList skillToCheck_)
    {
        //Switch statement to return the correct list
        switch (skillToCheck_)
        {
        //Combat skills
        case SkillList.Unarmed:
            return(this.unarmedAbilities);

        case SkillList.Daggers:
            return(this.daggerAbilities);

        case SkillList.Swords:
            return(this.swordAbilities);

        case SkillList.Mauls:
            return(this.maulAbilities);

        case SkillList.Poles:
            return(this.poleAbilities);

        case SkillList.Bows:
            return(this.bowAbilities);

        case SkillList.Shields:
            return(this.shieldAbilities);


        //Magic skills
        case SkillList.ArcaneMagic:
            return(this.arcaneAbilities);

        case SkillList.EnchantMagic:
            return(this.enchantAbilities);

        case SkillList.HolyMagic:
            return(this.holyAbilities);

        case SkillList.DarkMagic:
            return(this.darkAbilities);

        case SkillList.FireMagic:
            return(this.fireAbilities);

        case SkillList.WaterMagic:
            return(this.waterAbilities);

        case SkillList.WindMagic:
            return(this.windAbilities);

        case SkillList.ElectricMagic:
            return(this.electricAbilities);

        case SkillList.StoneMagic:
            return(this.stoneAbilities);

        default:
            return(null);
        }
    }
Beispiel #17
0
        private void LoadSkillList()
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter           = "Skilllist (*.xml)|*.xml";
            dlg.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + @"Skills\";
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            mSkilllist = SkillList.Load(dlg.FileName);
            listSkills.Items.Clear();
            for (int i = 0; i < mSkilllist.Count; i++)
            {
                int key = iconList.Images.IndexOfKey(mSkilllist[i].IconName.CleanIcon());
                listSkills.Items.Add(new ListViewItem(mSkilllist[i].Name, key));
            }

            btnSaveSkill.Enabled         = true;
            MenuSkillsSave.Enabled       = true;
            MenuSkillsAdd.Visible        = true;
            MenuSkillsDelete.Visible     = true;
            MenuSkillsSeperator1.Visible = true;
            SetStatus("SkillList '" + Path.GetFileNameWithoutExtension(dlg.FileName) + "' successfull loaded to GUI!", Color.ForestGreen);
        }
        public int DefensivePoints(Player player, Player target)
        {
            var defensivePoints = (player.ArmorRating.Armour / 4) + 1;


            var levelDif = player.Level - target.Level <= 0 ? 0 : player.Level - target.Level;

            var       weapon         = player.Equipped.Wielded;
            SkillList getWeaponSkill = null;

            if (weapon != null && !player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase))
            {
                // urgh this is ugly
                getWeaponSkill = player.Skills.FirstOrDefault(x =>
                                                              x.SkillName.Replace(" ", string.Empty)
                                                              .Equals(Enum.GetName(typeof(Item.Item.WeaponTypes), weapon.WeaponType)));
            }

            if (weapon == null && !player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase))
            {
                getWeaponSkill = player.Skills.FirstOrDefault(x =>
                                                              x.SkillName.Equals("Hand To Hand", StringComparison.CurrentCultureIgnoreCase));
            }

            // mob always have 100% skills
            var weaponSkill = player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase) ? 75 : getWeaponSkill?.Proficiency ?? 1; //weapon types are hardcoded so make hardcoded skills for weapon types

            defensivePoints += weaponSkill + (player.Attributes.Attribute[EffectLocation.Dexterity] / 2) + levelDif;

            return(defensivePoints);
        }
        public int OffensivePoints(Player player, bool useDualWield = false)
        {
            var strengthMod   = Math.Round((double)(player.Attributes.Attribute[EffectLocation.Strength] - 20) / 2, MidpointRounding.ToEven);
            var offensePoints = strengthMod + player.Attributes.Attribute[EffectLocation.Dexterity] / 2;
            var maxWeaponDam  = 0;
            var weapon        = useDualWield ? player.Equipped.Secondary : player.Equipped.Wielded;

            SkillList getWeaponSkill = null;

            if (weapon != null && !player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase))
            {
                // urgh this is ugly
                getWeaponSkill = player.Skills.FirstOrDefault(x =>
                                                              x.SkillName.Replace(" ", string.Empty)
                                                              .Equals(Enum.GetName(typeof(Item.Item.WeaponTypes), weapon.WeaponType)));

                maxWeaponDam = player.Equipped.Wielded.Damage.Maximum;
            }

            if (weapon == null && !player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase))
            {
                getWeaponSkill = player.Skills.FirstOrDefault(x =>
                                                              x.SkillName.Equals("Hand To Hand", StringComparison.CurrentCultureIgnoreCase));
            }

            // mob always have 100% skills
            var weaponSkill = player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase) ? 75 : getWeaponSkill?.Proficiency ?? 1; //weapon types are hardcoded so make hardcoded skills for weapon types

            return((int)offensePoints + weaponSkill + maxWeaponDam);
        }
    //Function called from CheckForInvalidIDs to loop through the given action list
    private void CheckList(List <IDTag> listToCheck_, string nameOfList_, SkillList skillUsed_)
    {
        //Looping through all of the actions in our list
        for (int w1 = 0; w1 < listToCheck_.Count; ++w1)
        {
            //If this slot in the list is empty, we throw a debug
            if (listToCheck_[w1] == null)
            {
                Debug.LogError(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ERROR: ActionIDList.CheckList " + nameOfList_ + ": Empty slot in weapon list at index " + w1);
            }
            //If this ID has the wrong enum tag, we throw a debug
            else if (listToCheck_[w1].objType != IDTag.ObjectType.Action)
            {
                Debug.LogError(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ERROR: ActionIDList.CheckList " + nameOfList_ + ": Invalid ID type at index " + w1);
            }
            //If this object doesn't have the Action component, we throw a debug
            else if (listToCheck_[w1].GetComponent <Action>() == null)
            {
                Debug.LogError(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ERROR: ActionIDList.CheckList " + nameOfList_ + ": Object at index " + w1 + " doesn't have the Action component.");
            }
        }

        //Looping through the list again with nested for loops to check each ID against all other ID numbers
        for (int x = 0; x < listToCheck_.Count - 1; ++x)
        {
            for (int y = x + 1; y < listToCheck_.Count; ++y)
            {
                //If the ID numbers are the same we need to throw a debug
                if (listToCheck_[x].numberID == listToCheck_[y].numberID)
                {
                    Debug.LogError(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ERROR: ActionIDList.CheckList " + nameOfList_ + ": Duplicate ID numbers on index " + x + " and " + y);
                }
            }
        }
    }
Beispiel #21
0
 private void launchBullets(SkillList sk)
 {
     // Launch bullets
     Instantiate(bull, new Vector3(0,0,0), Quaternion.identity);
     // do side effects
     // Add sound
 }
        public IHttpActionResult PutSkillList(int id, SkillList skillList)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != skillList.id)
            {
                return(BadRequest());
            }

            db.Entry(skillList).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SkillListExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
    //Function called externally to check a given character's skills to see if they get any new abilities
    public void CheckCharacterSkillForNewAbility(Character charThatLeveled_, SkillList skillToCheck_, int startingLevel_, int newLevel_)
    {
        //Getting the reference the correct skill ability reward lists
        List <SkillAbilityReward> skillRewards = this.getSkillRewardList(skillToCheck_);

        //Looping through all of the skill rewards to see if the character has them
        for (int r = 0; r < skillRewards.Count; ++r)
        {
            //If the current skill reward's level is between the starting and new skill levels, we see if the character already has it
            if (skillRewards[r].levelReached > startingLevel_ && skillRewards[r].levelReached <= newLevel_)
            {
                //If the ability reward isn't null
                if (skillRewards[r].learnedAction != null)
                {
                    //Giving the character the learned action
                    charThatLeveled_.charActionList.defaultActions.Add(skillRewards[r].learnedAction);
                    //Refreshing the character's action list to make the added action appear
                    charThatLeveled_.charActionList.RefreshActionLists();
                }

                //If the perk reward isn't null
                if (skillRewards[r].gainedPerk != null)
                {
                    //If the character's perk list doesn't have the learned perk, we give them the new learned perk
                    if (!charThatLeveled_.charPerks.allPerks.Contains(skillRewards[r].gainedPerk))
                    {
                        charThatLeveled_.charPerks.allPerks.Add(skillRewards[r].gainedPerk);
                    }
                }
            }
        }
    }
Beispiel #24
0
        public int OffensivePoints(Player player)
        {
            var offensePoints = player.Attributes.Attribute[EffectLocation.Strength] / 5
                                + player.Attributes.Attribute[EffectLocation.Dexterity] / 10
                                + player.Attributes.Attribute[EffectLocation.HitRoll];

            var weapon = player.Equipped.Wielded;

            SkillList getWeaponSkill = null;

            if (weapon != null && !player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase))
            {
                // urgh this is ugly
                getWeaponSkill = player.Skills.FirstOrDefault(x =>
                                                              x.SkillName.Replace(" ", string.Empty)
                                                              .Equals(Enum.GetName(typeof(Item.Item.WeaponTypes), weapon.WeaponType)));
            }

            if (weapon == null && !player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase))
            {
                getWeaponSkill = player.Skills.FirstOrDefault(x =>
                                                              x.SkillName.Equals("Hand To Hand", StringComparison.CurrentCultureIgnoreCase));
            }

            // mob always have 100% skills
            var weaponSkill = player.ConnectionId.Equals("mob", StringComparison.CurrentCultureIgnoreCase) ? 100 : getWeaponSkill?.Proficiency ?? 1; //weapon types are hardcoded so make hardcoded skills for weapon types

            return(offensePoints + offensePoints * weaponSkill / 100);
        }
    //Function called externally to de-allocate a point from a skill
    public void DeallocateSkillPoint(string skillToDecrease_)
    {
        //Converting the given string for the skill name to the enum so we can find it in our dictionary
        SkillList parsedEnum = (SkillList)System.Enum.Parse(typeof(SkillList), skillToDecrease_);

        //Making sure we're able to convert the string to the enum
        int s;

        if (this.allocatedSkillPoints.TryGetValue(parsedEnum, out s))
        {
            //Making sure the skill that we're removing a point from has points to remove
            if (this.allocatedSkillPoints[parsedEnum] < 1)
            {
                return;
            }

            //Removing a point from the given skill
            this.allocatedSkillPoints[parsedEnum] -= 1;

            //Adding a point to the remaining pool
            this.currentPoints += 1;

            //Updating all of our text to show the points
            this.UpdateText();
        }
    }
Beispiel #26
0
        public void ResetCache(int profession)
        {
            SkillList.Clear();
            CarryList.Clear();

            var skillConfig = new ShareCacheStruct <Config_Skill>();
            var list        = skillConfig.FindAll(t => (
                                                      t.SkillGroup == profession /* && (t.SkillID % 10000 == 0 || t.SkillID % 10000 == 1)*/)
                                                  );

            foreach (var v in list)
            {
                AddSkill(v.SkillID);
            }

            if (list.Count > 3)
            {
                Random random = new Random();
                while (CarryList.Count < 3)
                {
                    int index      = random.Next(list.Count);
                    int addSkillId = list[index].SkillID;
                    if (addSkillId == 10000 || addSkillId == 20000)
                    {
                        continue;
                    }
                    if (CarryList.Find(t => t == addSkillId) == 0)
                    {
                        CarryList.Add(addSkillId);
                    }
                }
            }
        }
Beispiel #27
0
    private const int Stop = -1;    //위동일

    // Use this for initialization
    void Awake()
    {
        if (ins == null)
        {
            ins = this;
        }
    }
Beispiel #28
0
        protected override void Initialize()
        {
            Stats     stats1  = new Stats(20, 20, 2, 1243, 1, 2, 3, 2, 2);
            SkillList skills1 = new SkillList(4);

            skills1.add(new MagicSkill("Whipshot", new SpCost(3), new SkillEffect(1), 4));
            PlayerCharacter p1 = new PlayerCharacter("James", stats1, skills1);


            Stats     stats2  = new Stats(20, 20, 2, 1243, 1, 2, 3, 2, 2);
            SkillList skills2 = new SkillList(4);

            skills2.add(new MagicSkill("Flail", new SpCost(3), new SkillEffect(1), 4));
            PlayerCharacter p2 = new PlayerCharacter("Jordan", stats2, skills2);


            List <Character> allies = new List <Character>();

            allies.Add(p1);

            List <Character> enemies = new List <Character>();

            enemies.Add(p2);

            Battle b = new Battle(allies, enemies);

            Console.Write(b.ToString());

            b.UseSkill(p1.SkillList.GetSkillAt(0), p1, p2);
            Console.Write(b.ToString());

            base.Initialize();
        }
Beispiel #29
0
        public static List <int> WriteSkillListToFile()
        {
            FileStream fcreate = File.Open(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
                                           + "/Content/SkillList.json", FileMode.Create);

            fcreate.Close();


            Console.WriteLine("Getting API");
            //Get list from API
            GetAPIClient();

            _listOfSkills = new SkillList();
            HttpResponseMessage response = APIClient.GetAsync(new Uri("/v2/skills", UriKind.Relative)).Result;
            var failedList = new List <int>();

            if (response.IsSuccessStatusCode)
            {
                // Get Skill ID list
                _listOfSkills.Items.AddRange(GetListGW2APISkills());
                var writer = new StreamWriter(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
                                              + "/Content/SkillList.json");
                var serializer = new JsonSerializer
                {
                    NullValueHandling    = NullValueHandling.Ignore,
                    Formatting           = Formatting.None,
                    DefaultValueHandling = DefaultValueHandling.Ignore,
                    ContractResolver     = GeneralHelper.ContractResolver
                };
                serializer.Serialize(writer, _listOfSkills.Items);
                writer.Close();
            }
            return(failedList);
        }
Beispiel #30
0
        public static SkillList UnselectedSkillList(Contractor contractor)
        {
            string storedProcedureName = "usp_getContractorUnselectedSkills";

            MySqlParameter[] parameterList = new MySqlParameter[]
            {
                new MySqlParameter("contractorIDIn", contractor.ContractorID)
            };

            MySqlDataReader result = ExecuteReader(storedProcedureName, parameterList);

            SkillList skillList = new SkillList();

            while (result.Read())
            {
                skillList.Add(new Skill(
                                  result.GetString("skillName"),
                                  result.GetString("skillDescription")
                                  ));
            }

            result.Close();

            return(skillList);
        }
Beispiel #31
0
        // Constructor
        public SkillViewModel()
        {
            PlayerSkillList = new ObservableCollection <ActiveListedSkill>();
            SkillList       = new SkillList();

            AddSkillCommand    = new DelegateCommand(x => AddSkillExecute(), x => AddSkillCanExecute());
            RemoveSkillCommand = new DelegateCommand(x => RemoveSkillExecute(), x => RemoveSkillCanExecute());
        }
 // Use this for initialization
 void Start()
 {
     skills = GameObject.FindGameObjectWithTag("Controller").GetComponent<SkillList>();
     magic = GameObject.FindGameObjectWithTag("Controller").GetComponent<MagicList>();
     Items = GameObject.FindGameObjectWithTag("Controller").GetComponent<AllItemsList>();
     Equipment = GetComponent<CharacterEquipment>();
     skillsKnown = new Dictionary<string, int>();
     magicKnown = new Dictionary<string, int>();
     skillsKnown.Add("Attack", 100);
     skillsKnown.Add("Block", 100);
 }
Beispiel #33
0
 public SkillInfo(int _number)
 {
     SkillList asg = new SkillList();
     skillName = asg.SkillArray[_number].retSkillName();
     number = _number;
     damage = asg.SkillArray[_number].retDamage();
     type = asg.SkillArray[_number].retType();
     AtkType = asg.SkillArray[_number].retAtkType();
     effect = asg.SkillArray[_number].retEffect();
     giveStatus = asg.SkillArray[_number].retGiveStatus();
     maxChance = asg.SkillArray[_number].retMaxChance();
     nowChance = asg.SkillArray[_number].retNowChance();
 }
Beispiel #34
0
 //create Hero on stage
 private void GetHero(int type)
 {
     switch(type){
     case 1: {
         _player = (GameObject) GameObject.Instantiate(archer);
         _temp = _player.GetComponent<ArcherSkills>();
         _temp.setSkills(PlayerPrefs.GetInt("Hero1Skill1"),
                         PlayerPrefs.GetInt("Hero1Skill2"),
                         PlayerPrefs.GetInt("Hero1Skill3"),
                         PlayerPrefs.GetInt("Hero1Skill4"));
         break;
         }
     case 2: {
         _player = (GameObject) GameObject.Instantiate(wizard);
          break;
         }
     }
 }
Beispiel #35
0
 public void useSkill(SkillList sk)
 {
     if (sk == SkillList.Knife && canCast == true)
     {
         launchBullets(sk);
         gfxFb(sk);
         sfxFB(sk);
     }
     else if (sk == SkillList.Axe && canCast == true)
     {
         launchBullets(sk);
         gfxFb(sk);
     }
     else if (sk == SkillList.Shield && canCast == true)
     {
         launchShield(sk);
         gfxFb(sk);
     }
     StartCoroutine( waitUntilCD(cooldown) );
     canCast = false;
 }
Beispiel #36
0
 public void gfxFb(SkillList sk)
 {
     // Instantiate( skill_fb, new Vector3(0,0,0), Quaternion.identity);
 }
Beispiel #37
0
 void launchShield(SkillList sk)
 {
     Instantiate(bull, new Vector3(0,0,0), Quaternion.identity);
     Owner.hasShield = true;
     Owner.shieldDef = damages;
 }
Beispiel #38
0
    void sfxFB(SkillList sk)
    {
        if (sk == SkillList.Knife)
        {
            MasterAudio.PlaySound("Player_knife_1");
        }
        else if (sk == SkillList.Axe)
        {

        }
        else if (sk == SkillList.Shield)
        {

        }
    }
    //ADD: Magic
    void Awake()
    {
        //initialize all component variables
        Stats = GetComponent<AttributesScript>();
        KnownAbilities = GetComponent<CharacterKnownAbilities>();
        Status = GetComponent<CharacterStatus>();
        Equipment = GetComponent<CharacterEquipment>();

        Move = GameObject.FindGameObjectWithTag("Controller").GetComponent<MovementScript>();
        pathFind = GameObject.FindGameObjectWithTag("Controller").GetComponent<PathfindingScript>();
        findValid = GameObject.FindGameObjectWithTag("Controller").GetComponent<FindValidPoints>();
        Draw = GameObject.FindGameObjectWithTag("Controller").GetComponent<DrawSquaresScript>();
        Controller = GameObject.FindGameObjectWithTag("Controller").GetComponent<TurnController>();
        Magic = GameObject.FindGameObjectWithTag("Controller").GetComponent<MagicList>();
        Skills = GameObject.FindGameObjectWithTag("Controller").GetComponent<SkillList>();

        Items = GameObject.FindGameObjectWithTag("ItemManager").GetComponent<AllItemsList>();
        if(GetComponent<MouseControlScript>()){
            Mouse = GetComponent<MouseControlScript>();
            isPlayer = true;
        }

        skillSelected = "";
    }
        /// <summary>
        /// Constructor
        /// </summary>
        public DataController()
        {          
            // create lists
            roomObjects = new RoomObjectList(300);
            roomObjectsFiltered = new RoomObjectListFiltered(roomObjects);
            projectiles = new ProjectileList(50);
            onlinePlayers = new OnlinePlayerList(200);
            inventoryObjects = new InventoryObjectList(100);
            avatarCondition = new StatNumericList(5);
            avatarAttributes = new StatNumericList(10);
            avatarSkills = new SkillList(100);
            avatarSpells = new SkillList(100);
            avatarQuests = new SkillList(100);
            roomBuffs = new ObjectBaseList<ObjectBase>(30);
            avatarBuffs = new ObjectBaseList<ObjectBase>(30);
            spellObjects = new SpellObjectList(100);
            backgroundOverlays = new BackgroundOverlayList(5);
            playerOverlays = new ObjectBaseList<PlayerOverlay>(10);            
            chatMessages = new BaseList<ServerString>(101);
            gameMessageLog = new BaseList<GameMessage>(100);
            visitedTargets = new List<RoomObject>(50);
            clickedTargets = new List<uint>(50);
            actionButtons = new ActionButtonList();
            ignoreList = new List<string>(20);
            chatCommandHistory = new List<string>(20);

            // attach some listeners
            RoomObjects.ListChanged += OnRoomObjectsListChanged;
            Projectiles.ListChanged += OnProjectilesListChanged;
            ChatMessages.ListChanged += OnChatMessagesListChanged;

            // make some lists sorted
            OnlinePlayers.SortByName();
            AvatarSkills.SortByResourceName();
            AvatarSpells.SortByResourceName();
            SpellObjects.SortByName();
            
            // create single data objects
            roomInformation = new RoomInfo();
            lightShading = new LightShading(0, new SpherePosition(0, 0));
            backgroundMusic = new PlayMusic();
            guildInfo = new GuildInfo();
            guildShieldInfo = new GuildShieldInfo();
            guildAskData = new GuildAskData();
            diplomacyInfo = new DiplomacyInfo();
            adminInfo = new AdminInfo();
            tradeInfo = new TradeInfo();
            buyInfo = new BuyInfo();
            welcomeInfo = new WelcomeInfo();
            charCreationInfo = new CharCreationInfo();
            statChangeInfo = new StatChangeInfo();
            newsGroup = new NewsGroup();
            objectContents = new ObjectContents();
            effects = new Effects();
            lookPlayer = new PlayerInfo();
            lookObject = new ObjectInfo();
            clientPreferences = new PreferencesFlags();

            // some values
            ChatMessagesMaximum = 100;
            ChatCommandHistoryMaximum = 20;
            ChatCommandHistoryIndex = -1;
            AvatarObject = null;
            IsResting = false;
            SelfTarget = false;
            IsNextAttackApplyCastOnHighlightedObject = false;
            AvatarID = UInt32.MaxValue;
            TargetID = UInt32.MaxValue;
            ViewerPosition = V3.ZERO;
            UIMode = UIMode.None;
        }
Beispiel #41
0
 private void InitializeProperties()
 {
     Classes = new Dictionary<ClassType, IClass>();
     Attacks = new AttackList(this);
     Saves = new SavesList(this);
     Hitpoints = new Hitpoints();
     Equipment = new Equipment(this);
     Features = new FeatureList();
     Skills = new SkillList(this);
     Experience = new Experience(this);
 }