Пример #1
0
 public Skill(Position pos, SkillType type, int power)
     : base(pos)
 {
     this.Position = pos;
     this.Type = type;
     this.Power = power;
 }
Пример #2
0
    public static string GetSkillName(SkillType type)
    {
        switch(type)
        {
        case SkillType.DamageUp:
            return "GS_DamageUp";
        case SkillType.ReloadUp:
            return "GS_ReloadUp";
        case SkillType.AutoHeal:
            return "PS_AutoHeal";
        case SkillType.JumpUp:
            return "PS_JumpUp";
        case SkillType.ExitUp:
            return "PS_ExitUp";
        case SkillType.SpeedUp:
            return "PS_SpeedUp";
        case SkillType.Absorb:
            return "GS_Absorb";
        case SkillType.Accuracy:
            return "GS_Accuracy";
        case SkillType.Pakorepu:
            return "PS_Pakorepu";
        case SkillType.FastInterval:
            return "GS_FastInterval";
        case SkillType.Accelerate:
            return "GS_Accelerate";
        case SkillType.Decelerate:
            return "GS_Decelerate";
        default:
            break;
        }

        return "";
    }
Пример #3
0
        public static void AddSkill(this CharacterBase character, SkillType type)
        {
            var skill = character.GetSkill(type);
            if (skill != null) throw new Exception("Skill is already set.");

            character.Skills.Add(new Skill(type, GetAbilityModifier(type), 0));
        }
Пример #4
0
 public DangerousSpells(string spellName, string championName, SpellSlot spellSlot, SkillType type)
 {
     SpellName = spellName;
     ChampionName = championName;
     SpellSlot = spellSlot;
     Type = type;
 }
 public void setSkill(SkillType skill)
 {
     skills [currentSkill].GetComponent<skillPanelPosition> ().text.text = skill.ToString ();
     currentSkill++;
     backButton.GetComponent<Button> ().interactable = true;
     PlayerPrefs.SetInt ("Player" + playerId + "Skill" + currentSkill,(int)skill);
     string description = "";
     switch (skill)
     {
     case SkillType.AttaqueRapide:
         description = "inflige 4pts de dégats, charge=2s";
         break;
     case SkillType.AttaquePuissante:
         description = "inflige 18pts de dégats, charge=7s";
         break;
     case SkillType.BouclierBasique:
         description = "protège de 3pts de dégats, dure 5s, charge=1s";
         break;
     case SkillType.BouclierFort:
         description = "protège de 12pts de dégats, dure 8 secondes, charge=4s";
         break;
     case SkillType.BouleDeFeu:
         description = "inflige 6pts de dégats, pénètre les protections, charge=6s";
         break;
     case SkillType.LanceDeFoudre:
         description = "inflige 3pts de dégats et bloque une compétence aléatoire pendant 2s, pénètre les protections, charge=6s";
         break;
     case SkillType.EclairDeGlace:
         description = "inflige 1,5pts de dégats, ralentit l'adversaire de 50% pendant 6s, pénètre les protections, charge=6s";
         break;
     case SkillType.CoupDeGriffe:
         description = "inflige 2pts de dégats, plus 5pts sur 10s, charge=2s";
         break;
     case SkillType.Esquive:
         description = "esquive toutes les attaques physiques pendant 2s, charge=3s";
         break;
     case SkillType.ContreAttaque:
         description = "protège de 1pt de dégat et en renvoie 3 pendant 2s, charge=1s";
         break;
     case SkillType.CoupDeGrace:
         description = "inflige 3pts de dégat, dommages x2 si l'ennemi est ralenti/sonné, charge=2s";
         break;
     case SkillType.ToileProtectrice:
         description = "protège 3pts de dégats, ralentit de 50% pendant 3s l'adversaire si il attaque, durée=6s, charge=3s";
         break;
     case SkillType.PoisonParalysant:
         description = "paralyse l'adversaire pendant 6s, charge=6s";
         break;
     }
     skills [currentSkill-1].GetComponent<skillPanelPosition> ().description.text = description;
     skills [currentSkill-1].GetComponent<skillPanelPosition> ().description.gameObject.GetComponent<RectTransform>().sizeDelta = new Vector2(skills [currentSkill-1].GetComponent<RectTransform> ().sizeDelta.x,150f);
     skills [currentSkill-1].GetComponent<skillPanelPosition> ().skill = skill;
     if(currentSkill == 5)
     {
      	if(Application.loadedLevelName == "DeckSelection1")
             Application.LoadLevel ("DeckSelection2");
         else
             Application.LoadLevel("Main");
     }
 }
Пример #6
0
        /// <summary>
        /// Get Player Skills list
        /// </summary>
        /// <param name="playerId"></param>
        /// <returns></returns>
        public static Skills GetPlayerSkill(int playerId, SkillType skillType)
        {
            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                Skills skills = new Skills();

                using (MySqlCommand command = connection.CreateCommand())
                {
                    command.CommandText = "GAME_PLAYER_SKILL_GET";
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@in_PlayerId", playerId);
                    command.Parameters.AddWithValue("@in_SkillType", skillType);

                    var reader = command.ExecuteReader();

                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            int skillId = reader.GetInt32(1);
                            int skillLevel = reader.GetInt32(2);

                            skills.AddSkill(skillId, skillLevel);
                        }
                    }
                }
                connection.Close();
                return skills;
            }
        }
Пример #7
0
        /// <summary>
        /// Get Player Abilities list
        /// </summary>
        /// <param name="playerId"></param>
        /// <returns></returns>
        public static Abilities GetPlayerAbility(int playerId, SkillType skillType)
        {
            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                Abilities abilities = new Abilities();

                using (MySqlCommand command = connection.CreateCommand())
                {
                    command.CommandText = "GAME_PLAYER_ABILITY_GET";
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@in_PlayerId", playerId);
                    command.Parameters.AddWithValue("@in_AbilityType", skillType);

                    var reader = command.ExecuteReader();

                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            int abilityId = reader.GetInt32(1);
                            int abilityLevel = reader.GetInt32(2);

                            abilities.AddAbility(abilityId, abilityLevel);
                        }
                    }
                }
                connection.Close();
                return abilities;
            }
        }
Пример #8
0
 private void SetAbilityModifierType(SkillType type)
 {
     var ability = type.GetAttribute<AbilityModifierAttribute>();
     if (ability != null) {
         AbilityModifierType = ability.Type;
     }
 }
Пример #9
0
	public void PlaySealBreak (SkillType type)
	{
		gameObject.SetActive (true);

		SkillData sealData = SkillControl.Me.skillMap [type];
		name.text = sealData.skillName;
		simp.animatorHelper.Play ("SealBreak", 1, true);
	}
Пример #10
0
 public static Order Create(FieldIndex ind, SkillType skill, bool endTurn)
 {
     Order ret = new Order();
     ret.endTurn = endTurn;
     ret.skill = skill;
     ret.position = ind;
     return ret;
 }
Пример #11
0
        public static int GetSkillScore(this CharacterBase character, SkillType skillType)
        {
            var skill = character.GetSkill(skillType);
            if (skill == null) return 0;

            var abilityRule = character.GetAbilityScore(skill.SkillModifier);
            return skill.Value + abilityRule.Modifier;
        }
Пример #12
0
 public static void AddSkill(this CharacterBase character, SkillType type, int value)
 {
     if ( !character.SkillExists(type) )
     {
         character.AddSkill(type);
         character.SetSkillValue(type, value);
     }
 }
Пример #13
0
 public ReadOnlySkill(SkillType type, string subSkill = null)
 {
     Type = type;
     Ranks = 0;
     MiscModifier = 0;
     SetAbilityModifierType(type);
     SetSynergyFromTypes(type);
     SubSkill = subSkill;
 }
Пример #14
0
 public Skill(string name, SkillType type, string parentAtt, string desc)
 {
     Name = name;
     Value = 0;
     Type = type;
     ParentAttribute = parentAtt;
     Specializations = new Dictionary<string, Skill>();
     Desc = desc;
 }
Пример #15
0
        public Skill(long id, string name, string desc, SkillType type)
        {
            Id = id;
            Name = name;
            Description = desc;
            Type = type;

            All.Add(this);
        }
Пример #16
0
        public static void SetSkillValue(this CharacterBase character, SkillType type, int value)
        {
            foreach (var skill in character.Skills)
            {
                if (skill.Type != type) continue;

                skill.Value = value;
                break;
            }
        }
Пример #17
0
        void CreateSkillEntry(Vector2 position, SkillType skillType)
        {
            var skillInfo = SkillInfoManager.Instance[skillType];

            PictureBox pb = new SkillPictureBox(this, skillInfo, position);
            pb.Clicked += SkillPicture_Clicked;

            var skillLabel = new SkillLabel(this, skillInfo, position + new Vector2(_iconSize.X + 4, 0));
            skillLabel.Clicked += SkillLabel_Clicked;
        }
Пример #18
0
 public Skill(uint id, string name, uint ability, uint type, uint cost, uint aoe, uint range, float cooldown) {
     skillID = id;
     skillName = name;
     skillAbility = (AbilityType)ability;
     skillType = (SkillType)type;
     skillCost = cost;
     skillAoe = aoe;
     skillRange = range;
     skillCooldown = cooldown;
 }
Пример #19
0
 public bool isPerformingSkill(SkillType skillType)
 {
     foreach (ExecuteSkill executeSkill in _executingSkills)
     {
         if (executeSkill.skill.type == skillType)
         {
             return true;
         }
     }
     return false;
 }
Пример #20
0
 public FightSkill(int code, int skillLevel, int nextLevel, float range, float freshTime, string name, string info, SkillTarget target, SkillType type)
 {
     Code = code;
     SkillLevel = skillLevel;
     NextLevel = nextLevel;
     Range = range;
     FreshTime = freshTime;
     Name = name;
     Info = info;
     Target = target;
     Type = type;
 }
Пример #21
0
 private static void AddSkill(CharacterBase character, SkillType type, int value)
 {
     if (character.SkillExists(type))
     {
         var skill = character.GetSkill(type);
         character.SetSkillValue(type, skill.Value + value);
     }
     else
     {
         character.AddSkill(type, value);
     }
 }
Пример #22
0
 private Hero(Position pos, float speed, float hp, float att, float def, float range, float mp, SkillType skillType, int skillPower)
     : base(pos, speed, range)
 {
     this.Health = hp;
     this.MaxHP = hp;
     this.Attack = att;
     this.Defence = def;
     this.mana = mp;
     this.maxMP = mp;
     this.Level = 1;
     this.Skill = new Skill(pos, skillType, skillPower);
 }
Пример #23
0
 public Skill(string digimonId, SkillType type, string nameRus, string nameEng, string descriptionRus, 
     string descriptionEng, int mp,decimal ap, SkillSource skillSource = SkillSource.Native)
 {
     DigimonId = digimonId;
     Type = type;
     NameRus = nameRus;
     NameEng = nameEng;
     DescriptionRus = descriptionRus;
     DescriptionEng = descriptionEng;
     MP = mp;
     AP = ap;
     SkillSource = skillSource;
 }
Пример #24
0
        /// <summary>
        /// Starts the display of a skill being casted.
        /// </summary>
        /// <param name="skillType">Type of the skill.</param>
        /// <param name="castTime">The time it will take for the skill to be casted.</param>
        public void StartCasting(SkillType skillType, TickCount castTime)
        {
            _currentCastTime = castTime;
            _castStartTime = TickCount.Now;
            _skillType = skillType;

            Text = GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.CombatCastingBegin, skillType.ToString());

            var textSize = Font.MeasureString(Text);
            _textOffset = (Size / 2f) - (textSize / 2f);

            IsVisible = true;
        }
Пример #25
0
        /// <summary>
        /// Starts the display of a skill being casted.
        /// </summary>
        /// <param name="skillType">Type of the skill.</param>
        /// <param name="castTime">The time it will take for the skill to be casted.</param>
        public void StartCasting(SkillType skillType, TickCount castTime)
        {
            _currentCastTime = castTime;
            _castStartTime = TickCount.Now;
            _skillType = skillType;

            Text = "Casting " + skillType;

            var textSize = Font.MeasureString(Text);
            _textOffset = (Size / 2f) - (textSize / 2f);

            IsVisible = true;
        }
Пример #26
0
        /// <summary>
        /// Add or Update player abilities 
        /// </summary>
        /// <param name="player"></param>
        public static void SavePlayerAbility(Player player, SkillType skillType, bool update = true)
        {
            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                Abilities Abilities = new Abilities();
                switch (skillType)
                {
                    case SkillType.Ascension:
                        Abilities = player.AscensionAbilities;
                        break;
                    case SkillType.Basic:
                        Abilities = player.Abilities;
                        break;
                }

                if (!update)
                {
                    foreach (var ability in Abilities.Values)
                    {
                        using (MySqlCommand command = connection.CreateCommand())
                        {
                            command.CommandText = "GAME_PLAYER_ABILITY_ADD";
                            command.CommandType = System.Data.CommandType.StoredProcedure;
                            command.Parameters.AddWithValue("@in_PlayerId", player.PlayerId);
                            command.Parameters.AddWithValue("@in_AbilityId", ability.Key);
                            command.Parameters.AddWithValue("@in_AbilityLevel", ability.Value);
                            command.Parameters.AddWithValue("@in_AbilityType", skillType);
                            command.ExecuteNonQuery();
                        }
                    }
                }
                else
                {
                    foreach (var ability in Abilities.Values)
                    {
                        using (MySqlCommand command = connection.CreateCommand())
                        {
                            command.CommandText = "GAME_PLAYER_ABILITY_UPDATE";
                            command.CommandType = System.Data.CommandType.StoredProcedure;
                            command.Parameters.AddWithValue("@in_PlayerId", player.PlayerId);
                            command.Parameters.AddWithValue("@in_AbilityId", ability.Key);
                            command.Parameters.AddWithValue("@in_AbilityLevel", ability.Value);
                            command.Parameters.AddWithValue("@in_AbilityType", skillType);
                            command.ExecuteNonQuery();
                        }
                    }
                }
                connection.Close();
            }
        }
Пример #27
0
    public void LoadSkillInfo()
    {
        typeIndex = returnTypeNum(Variables.skillType);
        int skillIndex;

        for (skillIndex = 0; skillIndex < 6; skillIndex++)
        {
            infoButton[skillIndex].GetComponent<Image>().sprite = skilldata[(int)typeIndex * 6 + skillIndex].sprite;
        }

        for (skillIndex = 0; skillIndex < 4; skillIndex++)
        {
            equipSlotButton[skillIndex].GetComponent<Image>().sprite = skilldata[(int)typeIndex * 6 + skillIndex].sprite;
        }
    }
Пример #28
0
 public static SkillSelectError CanUseSkill(SkillType skill)
 {
     switch(skill){
     case SkillType.noSkill:
         return SkillSelectError.NO_ERROR;
     case SkillType.place:
         return SkillSelectError.NO_ERROR;
     case SkillType.shoot:
         return CanUseShoot();
     case SkillType.build:
         return CanUseBuild();
     case SkillType.silence:
         return CanUseSilence();
     }
     return SkillSelectError.UNKNOWN_ERROR;
 }
        public bool CreateSkillType(SkillType skillType)
        {
            if (skillType.ID != 0)
                return false;

            foreach (var type in context.SkillTypes)
            {
                if (type.Name == skillType.Name)
                    return false;
            }

            context.SkillTypes.Add(skillType);
            context.SaveChanges();

            return true;
        }
Пример #30
0
 public static bool GetType(SkillType type)
 {
     switch (type)
     {
         case SkillType.MOVE:             return    !anim.GetCurrentAnimatorStateInfo(0).IsName("Cat1_Squat");
         case SkillType.JUMP:             return    Input.GetButtonDown("Jump") && move.grounded;
         case SkillType.SQUAT:            return    Input.GetButtonDown("Squat")
                                                    && !anim.GetCurrentAnimatorStateInfo(0).IsName("Cat1_Squat");
         case SkillType.SPRING:           return    Input.GetButtonDown("Spring")
                                                    && !anim.GetCurrentAnimatorStateInfo(0).IsName("Cat1_Spring");
         case SkillType.BASICATTACK:      return    Input.GetButton("BasicAttack");
         case SkillType.COUNTERATTACK:    return    Input.GetButton("CounterAttack")
                                                    && anim.GetCurrentAnimatorStateInfo(0).IsName("Cat1_Squat") ;
     }
     return false;
 }
Пример #31
0
        //当更改基础技能时,比如随从技能改变
        private void SetBaseSkillType(SkillType skillType, int skillId)
        {
            BaseSkillIdDic[skillType] = skillId;

            //暂时屏蔽随从技能升级
            if (skillType == SkillType.SKILL_TYPEABSORB1 || skillType == SkillType.SKILL_TYPEABSORB2)
            {
                SkillIdDic[skillType] = skillId;
                return;
            }
            SkillManagerConfig info = ConfigReader.GetSkillManagerCfg(skillId);

            if (skillId != 0 && info != null)
            {
                SetSkillUpdate(skillType, Level);
            }
            else if (skillId == 0)
            {
                SkillIdDic[skillType] = skillId;
            }
        }
Пример #32
0
        public override int GetSkillIdBySkillType(SkillType type)
        {
            switch (type)
            {
            case SkillType.SKILL_TYPE1:
                return(ConfigReader.GetHeroInfo(NpcGUIDType).HeroSkillType1);

            case SkillType.SKILL_TYPE2:
                return(ConfigReader.GetHeroInfo(NpcGUIDType).HeroSkillType2);

            case SkillType.SKILL_TYPE3:
                return(ConfigReader.GetHeroInfo(NpcGUIDType).HeroSkillType3);

            case SkillType.SKILL_TYPE4:
                return(ConfigReader.GetHeroInfo(NpcGUIDType).HeroSkillType4);

            case SkillType.SKILL_TYPE5:
                return(ConfigReader.GetHeroInfo(NpcGUIDType).HeroSkillType5);
            }
            return(-1);
        }
Пример #33
0
        public virtual int GetSkillIdBySkillType(SkillType type)
        {
            switch (type)
            {
            case SkillType.SKILL_TYPE1:
                return(ConfigReader.GetNpcInfo(NpcGUIDType).NpcSkillType1);

            case SkillType.SKILL_TYPE2:
                return(ConfigReader.GetNpcInfo(NpcGUIDType).NpcSkillType2);

            case SkillType.SKILL_TYPE3:
                return(ConfigReader.GetNpcInfo(NpcGUIDType).NpcSkillType3);

            case SkillType.SKILL_TYPE4:
                return(ConfigReader.GetNpcInfo(NpcGUIDType).NpcSkillType4);

            case SkillType.SKILL_TYPE5:
                return(ConfigReader.GetNpcInfo(NpcGUIDType).NpcSkillType5);
            }
            return(-1);
        }
Пример #34
0
        public Skill GetSkillByPKID(int pkid)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_PKID, SqlDbType.Int).Value = pkid;

            using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetSkillByPkid", cmd))
            {
                while (sdr.Read())
                {
                    int       skillId     = (Int32)sdr[_DBPKID];
                    int       skillTypeID = (Int32)sdr[_DBTypeID];
                    string    name        = sdr[_DBName].ToString();
                    string    typeName    = sdr[_DBTypeName].ToString();
                    SkillType type        = new SkillType(skillTypeID, typeName);
                    Skill     skill       = new Skill(skillId, name, type);
                    return(skill);
                }
            }
            return(null);
        }
Пример #35
0
    public SkillType GetSkillRequirement(SkillType skillType)
    {
        switch (skillType)
        {
        //Blue Skills Requirements
        case SkillType.TripleJump: return(SkillType.Sprint);

        case SkillType.Dash: return(SkillType.TripleJump);

        //Red Skills Requirements
        case SkillType.Bullet: return(SkillType.IncreaseDMG);

        case SkillType.Explode: return(SkillType.Bullet);

        //Green Skills Requirements
        case SkillType.RegenerationHP: return(SkillType.ExtraHP);

        case SkillType.Immortality: return(SkillType.RegenerationHP);
        }
        return(SkillType.None);
    }
Пример #36
0
 public static SkillFeat GetSkillFeat(FeatType feat, SkillType skill)
 {
     Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "GetSkillFeat");
     Internal.NativeFunctions.nwnxPushInt(feat.InternalValue);
     Internal.NativeFunctions.nwnxPushInt(skill.InternalValue);
     Internal.NativeFunctions.nwnxCallFunction();
     return(new SkillFeat
     {
         skill = skill.InternalValue,
         feat = feat.InternalValue,
         modifier = Internal.NativeFunctions.nwnxPopInt(),
         focusFeat = Internal.NativeFunctions.nwnxPopInt(),
         classes = Internal.NativeFunctions.nwnxPopString(),
         classLevelMod = Internal.NativeFunctions.nwnxPopFloat(),
         areaFlagsRequired = Internal.NativeFunctions.nwnxPopInt(),
         areaFlagsForbidden = Internal.NativeFunctions.nwnxPopInt(),
         dayOrNight = Internal.NativeFunctions.nwnxPopInt(),
         bypassArmorCheckPenalty = Internal.NativeFunctions.nwnxPopInt(),
         keyAbilityMask = Internal.NativeFunctions.nwnxPopInt()
     });
 }
Пример #37
0
        private bool BuySkill(SkillType type, int price, string message)
        {
            if (_player.Money <= price + AppCore.BotvaSettings.AccountantSettings.MinMoney)
            {
                return(false);
            }

            _player.PrepareForAction(PlayerAction.BySkill);
            if (!_controller.BuySkill(type))
            {
                return(false);
            }


            var skillName = type.GetDescription();

            Accountant.RegisterPurchase(BalanceCategory.Skills, skillName, Price.Gold(price));
            AppCore.LogAccountant.Debug(message + " " + skillName);
            InitializeSkillsPrices();
            return(true);
        }
Пример #38
0
        /// <summary>
        /// Gets the value of the target of the check
        /// </summary>
        private IComparable GetValueOfTarget()
        {
            CharacterModel player = GameState.Instance.PlayerRpgState;

            switch (TargetType)
            {
            case SkillCheckTarget.Skill:
                SkillType skill = (SkillType)Enum.Parse(typeof(SkillType), Target, true);
                return(player.DerivedStats.Skills[skill] * ConfigState.Instance.GetGameplayConfig().Difficulty.PlayerSkill);

            case SkillCheckTarget.Stat:
                StatType stat = (StatType)Enum.Parse(typeof(StatType), Target, true);
                return(player.DerivedStats.Stats[stat] * ConfigState.Instance.GetGameplayConfig().Difficulty.PlayerSkill);

            case SkillCheckTarget.ActorValue:
                return((IComparable)player.GetAV(Target));

            default:
                throw new NotImplementedException();
            }
        }
Пример #39
0
        public void RegisterPCToAllCombatTargetsForSkill(NWPlayer player, SkillType skillType, NWCreature target)
        {
            int skillID = (int)skillType;

            if (!player.IsPlayer)
            {
                return;
            }
            if (skillID <= 0)
            {
                return;
            }

            List <NWPlayer> members = player.PartyMembers.ToList();

            int        nth      = 1;
            NWCreature creature = _.GetNearestCreature(CREATURE_TYPE_IS_ALIVE, 1, player.Object, nth, CREATURE_TYPE_PLAYER_CHAR, 0);

            while (creature.IsValid)
            {
                if (_.GetDistanceBetween(player.Object, creature.Object) > 20.0f)
                {
                    break;
                }

                // Check NPC's enmity table
                EnmityTable enmityTable = _enmity.GetEnmityTable(creature);
                foreach (var member in members)
                {
                    if (enmityTable.ContainsKey(member.GlobalID) || (target != null && target.IsValid && target == creature))
                    {
                        RegisterPCToNPCForSkill(player, creature, skillID);
                        break;
                    }
                }

                nth++;
                creature = _.GetNearestCreature(CREATURE_TYPE_IS_ALIVE, 1, player.Object, nth, CREATURE_TYPE_PLAYER_CHAR, 0);
            }
        }
Пример #40
0
        private ImmobileResult IsImmobile(
            Obj_AI_Base unit,
            float delay,
            float radius,
            float speed,
            Vector3 from,
            SkillType spellType)
        {
            if (this.TargetsImmobile.ContainsKey(unit.NetworkId))
            {
                var extraDelay = Math.Abs(speed - float.MaxValue) < float.Epsilon ? 0 : Vector3.Distance(from, unit.Position) / speed;

                if (this.TargetsImmobile[unit.NetworkId] > GetTime() + delay + extraDelay &&
                    spellType == SkillType.Circle)
                {
                    return(new ImmobileResult()
                    {
                        Immobile = true,
                        UnitPosition = unit.Position,
                        CastPosition = unit.Position + radius / 3f * Vector3.Normalize(from - unit.Position)
                    });
                }

                if (this.TargetsImmobile[unit.NetworkId] + radius / unit.MoveSpeed
                    > GetTime() + delay + extraDelay)
                {
                    return(new ImmobileResult()
                    {
                        Immobile = true,
                        UnitPosition = unit.Position,
                        CastPosition = unit.Position
                    });
                }
            }

            return(new ImmobileResult()
            {
                Immobile = false, UnitPosition = unit.Position, CastPosition = unit.Position
            });
        }
Пример #41
0
        public override void OnSkillInfoChange(int skillID, float time, float maxTime, int slot)
        {
            SkillType skillType = SkillType.SKILL_NULL;

            if (skillID == SkillIdDic[SkillType.SKILL_TYPE1])
            {
                skillType = SkillType.SKILL_TYPE1;
            }
            else if (skillID == SkillIdDic[SkillType.SKILL_TYPE3])
            {
                skillType = SkillType.SKILL_TYPE3;
            }
            else if (skillID == SkillIdDic[SkillType.SKILL_TYPE2])
            {
                skillType = SkillType.SKILL_TYPE2;
            }
            else if (skillID == SkillIdDic[SkillType.SKILL_TYPE4])
            {
                skillType = SkillType.SKILL_TYPE4;
            }
            else if (skillID == SkillIdDic[SkillType.SKILL_TYPEABSORB1])
            {
                skillType = SkillType.SKILL_TYPEABSORB1;
            }
            else if (skillID == SkillIdDic[SkillType.SKILL_TYPEABSORB2])
            {
                skillType = SkillType.SKILL_TYPEABSORB2;
            }
            else
            {
                return;
            }
            SetBaseSkillType(skillType, skillID);
            if (time > 0)
            {
                bPlaySkill = false;
            }

            EventCenter.Broadcast <SkillType, float, float>(EGameEvent.eGameEvent_LocalPlayerSkillCD, skillType, maxTime, time);
        }
Пример #42
0
    // 0 : HP, 1 : power, 2 : shield, 3 : playerType, 4 : buff, 5 : debuff
    void ConfigStatus(int code, SkillType type, int delta)
    {
        switch (code)
        {
        case 0:
            HP += delta;
            break;

        case 1:
            power[type] += delta;
            if (power[type] < 0)
            {
                power[type] = 0;
            }
            break;

        case 2:
            shield[type] += delta;
            if (shield[type] < 0)
            {
                shield[type] = 0;
            }
            break;

        case 3:
            playerType = type;
            break;

        case 4:
            buff[type] += delta;
            break;

        case 5:
            debuff[type] += delta;
            break;

        default:
            break;
        }
    }
Пример #43
0
    bool SkillActivate(SkillType skillID)
    {
        bool isUsed = false;

        switch (skillID)
        {
        case SkillType.NONE:
            break;

        case SkillType.HIGH_JUMP:
            if (this.foot.stayGround)
            {
                //ジャンプ力を上げたジャンプ処理
                skill.HighJump(ref JumpPower, this.isJumping);
                this.jumpSe.volume = 1.0f;
                this.jumpSe.clip   = this.highJumpClip;
                jumpSe.Play();
                this.isJumping    = true;
                this.vertVelosity = this.JumpPower;
                this.JumpPower    = 1;
                isUsed            = true;
            }
            break;

        case SkillType.PUNCH:
            break;

        case SkillType.SLASH:
            Vector3 pos = new Vector3(
                this.transform.position.x + summonX,
                this.transform.position.y,
                this.transform.position.z);
            skill.Slash(pos, new Vector3(0, direction, 0));
            isUsed = true;
            break;
        }

        //スキルの残数を返す
        return(isUsed);
    }
Пример #44
0
    public void Set(SkillType skillType, int value)
    {
        switch (skillType)
        {
        case SkillType.None:
            break;

        case SkillType.Basher:
            bashers = value;
            break;

        case SkillType.Blocker:
            blockers = value;
            break;

        case SkillType.Builder:
            builders = value;
            break;

        case SkillType.Climber:
            climbers = value;
            break;

        case SkillType.Digger:
            diggers = value;
            break;

        case SkillType.Exploder:
            exploders = value;
            break;

        case SkillType.Floater:
            floaters = value;
            break;

        default:
            break;
        }
    }
Пример #45
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            SkillType skillType = GetSkillType(item);
            int       tech      = item.GetLocalInt("TECH_LEVEL");
            float     maxDurabilityReductionPenalty = item.GetLocalFloat("MAX_DURABILITY_REDUCTION_PENALTY");
            int       repairAmount = tech * 2;

            if (skillType == SkillType.Armorsmith)
            {
                repairAmount += item.CraftBonusArmorsmith;
            }
            else if (skillType == SkillType.Weaponsmith)
            {
                repairAmount += item.CraftBonusWeaponsmith;
            }

            float minReduction    = 0.05f * tech;
            float maxReduction    = 0.15f * tech;
            float reductionAmount = _random.RandomFloat(minReduction, maxReduction);

            _durability.RunItemRepair(user.Object, target.Object, repairAmount, reductionAmount + maxDurabilityReductionPenalty);
        }
Пример #46
0
        private SkillPanel CreateSkillPanel(SkillType type, SkillPanel prefab, string name, long value = 0, float percent = 0, Color?color = null, Sprite icon = null)
        {
            if (_skillPanels.ContainsKey(type))
            {
                _skillPanels.Remove(type);
            }

            var skillPanel = Instantiate(prefab, _skillScrollRect.content);

            skillPanel.name = string.Format("Skill_{0}", name);
            skillPanel.SetText(name);
            skillPanel.SetValue(value, percent);
            skillPanel.SetIcon(icon);

            if (color != null)
            {
                skillPanel.SetProgressColor(color.Value);
            }

            _skillPanels.Add(type, skillPanel);
            return(skillPanel);
        }
Пример #47
0
        public float getGenericModifierForPerkType(PerkType perkType)
        {
            float num = 0f;

            for (int i = 0; i < this.SelectedRunestones.Count; i++)
            {
                if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Player)
                {
                    string    id = this.SelectedRunestones[i].Id;
                    SkillType skillTypeForRunestone = ConfigRunestones.GetSkillTypeForRunestone(id);
                    if ((skillTypeForRunestone != SkillType.NONE) && this.Player.ActiveCharacter.isSkillActive(skillTypeForRunestone))
                    {
                        ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(id);
                        if (runestoneData.PerkInstance != null)
                        {
                            num += runestoneData.PerkInstance.getGenericModifierForPerkType(perkType);
                        }
                    }
                }
            }
            return(num);
        }
Пример #48
0
 public FightSkill(
     int code,
     int level,
     int nextLevel,
     int time,
     string name,
     float range,
     string info,
     SkillTarget target,
     SkillType type
     )
 {
     this.code      = code;
     this.level     = level;
     this.nextLevel = nextLevel;
     this.time      = time;
     this.name      = name;
     this.range     = range;
     this.info      = info;
     this.target    = target;
     this.type      = type;
 }
Пример #49
0
    protected void checkPlayerPassives(SkillType skillType)
    {
        SkillManager skillManager = targetPlayer.GetComponent <SkillManager>();

        foreach (Skill _skill in skillManager.getKnownSkills())
        {
            if (_skill.Name.Equals("Ignite") && skillType == SkillType.Fire)
            {
                if (tryToAddPassive(_skill) && transform.Find("Ignite(Clone)") == null)
                {
                    applyIgnite();
                }
            }
            else if (_skill.Name.Equals("Frost") && skillType == SkillType.Ice)
            {
                if (tryToAddPassive(_skill) && transform.Find("Frost(Clone)") == null)
                {
                    applyFrost();
                }
            }
        }
    }
Пример #50
0
    public void SetBodSpriteForSkill(SkillType skillType)
    {
        Debug.Log("Setting Skill Type Sprite: " + skillType);
        switch (skillType)
        {
        case SkillType.Burst:
            spritePackage.SetBurst();
            break;

        case SkillType.Rise:
            spritePackage.SetRise();
            break;

        case SkillType.Trance:
            spritePackage.SetTrance();
            break;

        default:
            // Debug.LogError("Cannot set");
            break;
        }
    }
Пример #51
0
            public GaugeEffect(SkillType skill, Vector2DF position)
            {
                switch (skill)
                {
                case SkillType.Attack: Effect = Attack; break;

                case SkillType.Heal: Effect = Heal; break;

                case SkillType.Boost: Effect = Boost; break;

                case SkillType.Guard: Effect = Guard; break;

                case SkillType.Support: Effect = Support; break;

                case SkillType.Edge: Effect = Edge; break;

                case SkillType.Damage: Effect = Damage; break;
                }

                Scale    = new Vector2DF(10, 10);
                Position = position;
            }
Пример #52
0
        private void OnSkillChange(Creature creature, SkillType skillType, Skill skill)
        {
            var player = creature as Player;

            if (!player || (skillType != SkillType.Health && skillType != SkillType.Mana))
            {
                return;
            }

            RawImage imageComponent;

            TMPro.TextMeshProUGUI textComponent;
            if (skillType == SkillType.Health)
            {
                imageComponent = _healthBarImageComponent;
                textComponent  = _healthValueText;
            }
            else
            {
                imageComponent = _manaBarImageComponent;
                textComponent  = _manaValueText;
            }

            var rectTransform = imageComponent.GetComponent <RectTransform>();

            // setting new width
            var percent = skill.Level / (float)skill.BaseLevel;
            var rect    = new Rect(imageComponent.uvRect);

            rect.width            = percent;
            imageComponent.uvRect = rect;

            rect       = new Rect(rectTransform.rect);
            rect.width = BarWidth * percent;
            rectTransform.sizeDelta = new Vector2(BarWidth * percent, rectTransform.sizeDelta.y);

            // setting text
            textComponent.text = skill.Level.ToString();
        }
Пример #53
0
 public void SetSkill(SkillBaseInfo baseInfo)
 {
     Serial              = baseInfo.Pos;
     MaxCoolDown         = baseInfo.CoolDown;
     DefaultImage.sprite = baseInfo.SkillImage;
     EffectImage.sprite  = baseInfo.SkillImage;
     _type = baseInfo.SkillType;
     if (_type.Equals(SkillType.AutoTarget))
     {
         Drag.enabled = false;
         Owner.gameObject.GetComponentInChildren <LineRenderer>().enabled   = false;
         Owner.gameObject.GetComponentInChildren <SpriteRenderer>().enabled = false;
     }
     else
     {
         Debug.Log("是指向性技能");
         Click.enabled = false;
         Drag.Init(Owner, baseInfo.SkillType.Equals(SkillType.LineTarget));
         Owner.gameObject.GetComponentInChildren <LineRenderer>().enabled   = false;
         Owner.gameObject.GetComponentInChildren <SpriteRenderer>().enabled = false;
     }
 }
Пример #54
0
        private void RemoveWeaponPenalties(NWItem oItem)
        {
            SkillType skillType = _item.GetSkillTypeForItem(oItem);

            if (skillType == SkillType.Unknown ||
                skillType == SkillType.HeavyArmor ||
                skillType == SkillType.LightArmor ||
                skillType == SkillType.ForceArmor ||
                skillType == SkillType.Shields)
            {
                return;
            }

            foreach (ItemProperty ip in oItem.ItemProperties)
            {
                string tag = _.GetItemPropertyTag(ip);
                if (tag == IPWeaponPenaltyTag)
                {
                    _.RemoveItemProperty(oItem.Object, ip);
                }
            }
        }
Пример #55
0
 private void SetSkill(SkillType type, string text)
 {
     if (string.IsNullOrEmpty(text))
     {
         skills.SetSkill(type, 0);
         return;
     }
     text = text.Trim();
     if (string.IsNullOrEmpty(text))
     {
         skills.SetSkill(type, 0);
     }
     else if (text.Contains("+"))
     {
         var parts = text.Split(new char[] { '+' });
         skills.SetSkill(type, GetInteger(parts[0]), GetInteger(parts[1]));
     }
     else
     {
         skills.SetSkill(type, GetInteger(text));
     }
 }
Пример #56
0
    public void SetModel(UnitModel unit, SkillType type)
    {
        _unit = unit;

        RemoveAllChildren(Container);
        for (int i = 0; i < _skillConfig.Count; i++)
        {
            _skill = _skillConfig[i];
            if (_skill.Type == type)
            {
                GameObject go = Instantiate(SkillUnlockPrefab, Container);
                if (_unit.Skills.ContainsKey(_skill.Index))
                {
                    go.GetComponent <SkillUnlockView>().Setup(_unit.Skills[_skill.Index], EffectPrefab);
                }
                else
                {
                    go.GetComponent <SkillUnlockView>().Setup(_skill, EffectPrefab);
                }
            }
        }
    }
Пример #57
0
        public static string GetName(SkillType language)
        {
            switch (language)
            {
            case SkillType.Bothese: return("Bothese");

            case SkillType.Catharese: return("Catharese");

            case SkillType.Cheunh: return("Cheunh");

            case SkillType.Dosh: return("Dosh");

            case SkillType.Droidspeak: return("Droidspeak");

            case SkillType.Huttese: return("Huttese");

            case SkillType.Mandoa: return("Mandoa");

            case SkillType.Shyriiwook: return("Shyriiwook");

            case SkillType.Twileki: return("Twi'leki");

            case SkillType.Zabraki: return("Zabraki");

            case SkillType.Mirialan: return("Mirialan");

            case SkillType.MonCalamarian: return("Mon Calamarian");

            case SkillType.Ugnaught: return("Ugnaught");

            case SkillType.Togruti: return("Togruti");

            case SkillType.Rodese: return("Rodese");

            case SkillType.KelDor: return("KelDor");
            }

            return("Basic");
        }
Пример #58
0
        private float CalculateEquipmentBonus(NWPlayer player, SkillType skillType)
        {
            int equipmentBonus = 0;
            var effectiveStats = _playerStat.GetPlayerItemEffectiveStats(player);

            switch (skillType)
            {
            case SkillType.Armorsmith: equipmentBonus = effectiveStats.Armorsmith; break;

            case SkillType.Weaponsmith: equipmentBonus = effectiveStats.Weaponsmith; break;

            case SkillType.Cooking: equipmentBonus = effectiveStats.Cooking; break;

            case SkillType.Engineering: equipmentBonus = effectiveStats.Engineering; break;

            case SkillType.Fabrication: equipmentBonus = effectiveStats.Fabrication; break;

            case SkillType.Medicine: equipmentBonus = effectiveStats.Medicine; break;
            }

            return(equipmentBonus * 0.5f); // +0.5% per equipment bonus
        }
Пример #59
0
    public SingleEffectResponse(SingleEffectResponse a)
    {
        type           = a.type;
        self_hp_change = a.self_hp_change;
        //self_hp = a.self_hp;
        self_mp_change = a.self_mp_change;
        //self_mp = a.self_mp;

        opponent_hp_change = a.opponent_hp_change;
        //opponent_hp = a.opponent_hp;
        opponent_mp_change = a.opponent_mp_change;
        //opponent_mp = a.opponent_mp;

        self_buff_on      = a.self_buff_on;
        self_buff_off     = a.self_buff_off;
        opponent_buff_on  = a.opponent_buff_on;
        opponent_buff_off = a.opponent_buff_off;
        total             = a.total;
        stage             = a.stage + 1;
        delay             = a.delay;
        prefabPath        = a.prefabPath;
    }
Пример #60
0
        public Skill FindSkill(BattleContext context, SkillType type)
        {
            Skill cancast = null;

            foreach (var skill in this.SkillMgr.Skills)
            {
                if ((skill.Define.Type & type) != skill.Define.Type)
                {
                    continue;
                }
                var result = skill.CanCast(context);
                if (result == SkillResult.Casting)
                {
                    return(null);
                }
                if (result == SkillResult.Ok)
                {
                    cancast = skill;
                }
            }
            return(cancast);
        }