Beispiel #1
0
 // Token: 0x060004A5 RID: 1189 RVA: 0x00019E98 File Offset: 0x00018098
 public void Update(UpdatePacket update)
 {
     if (this._lootQuest != -1 && update.Drops.Contains(this._lootQuest))
     {
         this._lootQuest = -1;
         if (this._lastQuest != -1)
         {
             QuestObjIdPacket questObjIdPacket = (QuestObjIdPacket)Packet.Create(PacketType.QUESTOBJID);
             questObjIdPacket.ObjectId = this._lastQuest;
             this._lastQuest           = -1;
             this.client.SendToClient(questObjIdPacket);
         }
     }
     if (Settings.Default.AutoLootBigBags)
     {
         foreach (Entity entity in update.NewObjs)
         {
             if (Enum.IsDefined(typeof(Bags), entity.ObjectType))
             {
                 foreach (StatData stat in entity.Status.Data)
                 {
                     if (StatsType.Id(stat.Id, StatsType.Size))
                     {
                         stat.IntValue = 175;
                     }
                 }
             }
         }
     }
 }
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.SellablePrice) Price = (int)val;
     else if (stats == StatsType.SellablePriceCurrency) Currency = (CurrencyType)(int)val;
     else if (stats == StatsType.SellableRankRequirement) RankReq = (int)val;
     base.ImportStats(stats, val);
 }
        private void DrawStats()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Statistics", EditorStyles.boldLabel, GUILayout.ExpandWidth(false));
            statsType = (StatsType)EditorGUILayout.EnumPopup(statsType, GUILayout.ExpandWidth(false));
            var calulateStatistics = GUILayout.Button("Calculate", GUILayout.ExpandWidth(false));

            GUILayout.EndHorizontal();

            if (calulateStatistics)
            {
                var statsCalculator = StatsCalculatorProvider.GetStatsCalculator(statsType);
                var stats           = statsCalculator.CalculateStats(ColumnsToShow);
                functionStats = stats.Select <FunctionData, string[]>(f => ColumnsToShow.Select <ProfilerColumn, string>(f.GetValue).ToArray()).ToArray();
            }

            if (functionStatsTableState == null)
            {
                functionStatsTableState = new FunctionTableState(ColumnsToShow, ColumnHeaders);
            }

            if (functionStats != null)
            {
                TableGUILayout.BeginTable(functionStatsTableState, GUI.skin.GetStyle("OL Box"), GUILayout.MinHeight(100f), GUILayout.MaxHeight(500f));
                for (var i = 0; i < functionStats.Length; ++i)
                {
                    var functionData = functionStats[i];
                    TableGUILayout.AddRow(functionStatsTableState, i, functionData);
                }
                TableGUILayout.EndTable();
            }
        }
Beispiel #4
0
    private int GetCost(CharacterSettings character, StatsType statsType)
    {
        int statsAmount = 0;

        switch (statsType)
        {
        case StatsType.AGILITY:
            statsAmount = character.agility;
            break;

        case StatsType.STAMINA:
            statsAmount = character.stamina;
            break;

        case StatsType.BREATH:
            statsAmount = character.breath;
            break;
        }
        if (statsAmount < CharacterSettings.MAX_STAT && statsAmount >= 0)
        {
            return(CharacterSettings.STATS_COST[statsAmount]);
        }
        else
        {
            return(-1);
        }
    }
 private int ValidateStat(StatsType stat, int magnitude)
 {
     if(!HasStat(stat))
         throw new ArgumentException("Stats does not contain stat: " + stat);
     switch (stat)
     {
         case (StatsType.CurHp):
             if (magnitude > _stats[StatsType.MaxHp])
             {
                 magnitude = _stats[StatsType.MaxHp];
             }
             break;
         case (StatsType.CurResources):
             if (magnitude > _stats[StatsType.MaxResources])
             {
                 magnitude = _stats[StatsType.MaxResources];
             }
             break;
         case (StatsType.MaxResources):
             if (magnitude < _stats[StatsType.CurResources])
             {
                 _stats[StatsType.CurResources] = magnitude;
             }
             break;
         case (StatsType.MaxHp):
             if (magnitude < _stats[StatsType.CurHp])
             {
                 _stats[StatsType.CurHp] = magnitude;
             }
             break;
     }
     if (magnitude < 0)
         magnitude = 0;
     return magnitude;
 }
        protected override string RequestUrl()
        {
            string sUrl = "/common/arenaDetails.asp?outputType=XML&actionType=view";

            if (ArenaId != 0)
            {
                sUrl += "&arenaID=" + ArenaId;
            }
            if (StatsType != ArenaDetailsRequest.StatsTypeEnum.MyArena)
            {
                sUrl += "&StatsType=" + StatsType.ToString();
            }
            if (MatchType != ArenaDetailsRequest.MatchTypeEnum.All)
            {
                sUrl += "&MatchType=" + MatchType.ToString();
            }
            if (FirstDate != DateTime.MinValue)
            {
                sUrl += "&FirstDate=" + FirstDate.ToString("yyyy-MM-dd HH:mm:ss");
            }
            if (LastDate != DateTime.MinValue)
            {
                sUrl += "&LastDate=" + LastDate.ToString("yyyy-MM-dd HH:mm:ss");
            }
            if (StatsLeagueID != 0)
            {
                sUrl += "&StatsLeagueID=" + StatsLeagueID;
            }

            return(sUrl);
        }
Beispiel #7
0
        private string CsvUrlFromType(StatsType statsType)
        {
            switch (statsType)
            {
            case StatsType.BlockedDomains:
                return("blockeddomains");

            case StatsType.RequestTypes:
                return("requesttypes");

            case StatsType.TopDomains:
                return("topdomains");

            case StatsType.TotalReuests:
                return("totalrequests");

            case StatsType.UniqueDomains:
                return("uniquedomains");

            case StatsType.UniqueIps:
                return("uniqueips");

            default:
                throw new NotImplementedException(string.Format("StatsType '{0}' not supported.", statsType));
            }
        }
    protected void UpgradeWorldObject(string woName, StatsType upgradeStat, int statArrayIndex)
    {
        float upgradeAmount = 0f;

        if (upgradeStat != StatsType.Defense)
        {
            upgradeAmount = GameManager.baseStatsDick[woName][upgradeStat][statArrayIndex] * RankIncrease(rank, rewardVariablesDickList[mainArrayIndex][upgradeStat][0], rewardVariablesDickList [mainArrayIndex][upgradeStat][1], rewardVariablesDickList[mainArrayIndex][upgradeStat][2], rewardVariablesDickList[mainArrayIndex][upgradeStat][3], rewardVariablesDickList[mainArrayIndex][upgradeStat][4]);
        }
        else
        {
            upgradeAmount = RankIncrease(rank, rewardVariablesDickList[mainArrayIndex][upgradeStat][0], rewardVariablesDickList [mainArrayIndex][upgradeStat][1], rewardVariablesDickList[mainArrayIndex][upgradeStat][2], rewardVariablesDickList[mainArrayIndex][upgradeStat][3], rewardVariablesDickList[mainArrayIndex][upgradeStat][4]);
        }
        GameManager.playersDick [species].upgradedStatsDick [woName] [upgradeStat] [statArrayIndex] += upgradeAmount;
        List <WorldObject> currWOList = GameManager.playersDick[species].currWorldObjectsDick[woName];

        for (int i = 0; i < currWOList.Count; i++)
        {
            currWOList[i].statsDick[upgradeStat][statArrayIndex] += upgradeAmount;
            if (upgradeStat == StatsType.Health)
            {
                currWOList[i].statsDick[upgradeStat][0] = currWOList[i].healthArray[0] / (currWOList[i].healthArray[1] - upgradeAmount) * currWOList[i].healthArray[1];
                if (currWOList[i].healthBar)
                {
                    currWOList[i].healthBar.ResetBar();
                }
            }
        }
    }
Beispiel #9
0
        protected override void ImportStats(StatsType stats, object val)
        {
            switch (stats)
            {
            case StatsType.Inventory0: Inventory[0] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory1: Inventory[1] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory2: Inventory[2] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory3: Inventory[3] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory4: Inventory[4] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory5: Inventory[5] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory6: Inventory[6] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory7: Inventory[7] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory8: Inventory[8] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory9: Inventory[9] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory10: Inventory[10] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.Inventory11: Inventory[11] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

            case StatsType.OwnerAccountId: BagOwner = (int)val == -1 ? (int?)null : (int)val; break;
            }
            base.ImportStats(stats, val);
        }
Beispiel #10
0
        public void SaveStats(StatsType stats)
        {
            int currentStats = GetStats(stats);

            currentStats++;
            PlayerPrefs.SetInt(stats.ToString(), currentStats);
        }
Beispiel #11
0
 public StatsCommand(long chatId, StatsType type)
 {
     ChatId           = chatId.ToString("D");
     _timeZoneManager = new TimeZoneManager();
     InitDates(DateTimeOffset.UtcNow, type);
     Type = type;
 }
Beispiel #12
0
        private void InitDates(DateTimeOffset now, StatsType type)
        {
            var today = _timeZoneManager.GetMoscowDate(now);

            switch (type)
            {
            case StatsType.Today:
                From = today;
                To   = today;
                break;

            case StatsType.Yesterday:
                From = today.AddDays(-1);
                To   = today.AddDays(-1);
                break;

            case StatsType.Week:
                From = today.AddDays(-7);
                To   = today;
                break;

            case StatsType.Month:
                From = today.AddMonths(-1);
                To   = today;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Beispiel #13
0
    // Token: 0x060004E0 RID: 1248 RVA: 0x0001C37C File Offset: 0x0001A57C
    private void HandleStatus(Status status)
    {
        if (status.ObjectId == this.client.PlayerId)
        {
            foreach (StatData statData in status.Data)
            {
                if (StatsType.Id(statData.Id, StatsType.MP))
                {
                    this._realMpValue = statData.IntValue;
                    break;
                }
            }
        }
        if (!this.client.Enemies.ContainsKey(status.ObjectId))
        {
            return;
        }
        if (!Settings.Default.EnableFameTools)
        {
            this.ApplyOriginalConditionStatdata(status.Data, status.ObjectId);
            return;
        }
        if (!Settings.Default.FameDontHitCubes && !Settings.Default.FameOnlyHitGods && !Settings.Default.FameDontHitIgnores)
        {
            this.ApplyOriginalConditionStatdata(status.Data, status.ObjectId);
            return;
        }
        GameObject gameObject = this.client.Enemies[status.ObjectId];

        if ((Settings.Default.FameDontHitCubes && gameObject.Cube) || (Settings.Default.FameOnlyHitGods && !gameObject.God) || (Settings.Default.FameDontHitIgnores && Settings.Default.FameIngoredEnemies.Contains((int)gameObject.ObjectType)))
        {
            this._conditionModified[gameObject.ObjectId] = true;
            this.AddPauseToStatdata(status.Data);
        }
    }
Beispiel #14
0
        private void DrawStats()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Statistics", EditorStyles.boldLabel, GUILayout.ExpandWidth(false));
            statsType = (StatsType)EditorGUILayout.EnumPopup(statsType, GUILayout.ExpandWidth(false));
            var calulateStatistics = GUILayout.Button("Calculate", GUILayout.ExpandWidth(false));

            GUILayout.EndHorizontal();

            if (calulateStatistics)
            {
                //using (Profiler.AddSample(Profiler.SamplerType.CalculateStatsTotal))
                {
                    var statsCalculator = StatsCalculatorProvider.GetStatsCalculator(statsType);
                    var stats           = statsCalculator.CalculateStats(ColumnsToShow);
                    UpdateFunctionStats(stats);
                }
            }

            if (functionStatsTableState == null)
            {
                functionStatsTableState = new FunctionTableState(ColumnsToShow, ColumnHeaders);
            }

            if (functionStats != null)
            {
                TableGUILayout.BeginTable(functionStatsTableState, GUI.skin.GetStyle("OL Box"), GUILayout.MinHeight(100f), GUILayout.MaxHeight(500f));
                for (var i = 0; i < functionStats.Count; ++i)
                {
                    var functionData = functionStats[i];
                    TableGUILayout.AddRow(functionStatsTableState, i, functionData);
                }
                TableGUILayout.EndTable();
            }
        }
Beispiel #15
0
 /// <inheritdoc />
 public void RemoveStats(StatsType statsType, string componentName)
 {
     lock (this.locker)
     {
         this.stats.Remove(this.stats.Where(s => s.StatsType == statsType && s.ComponentName == componentName).FirstOrDefault());
     }
 }
Beispiel #16
0
 public StatData(string xmlName, string statName, StatsType statType, StatsType boostType)
 {
     XMLName       = xmlName;
     StatName      = statName;
     StatType      = statType;
     StatBoostType = boostType;
 }
Beispiel #17
0
 public bool HasStat(StatsType stat)
 {
     lock (this)
     {
         return _stats.ContainsKey(stat);
     }
 }
Beispiel #18
0
 public StatsRequest(Session session, int challengeToken, StatsType statsType)
 {
     Type           = QueryPacketType.Stat;
     Session        = session;
     ChallengeToken = challengeToken;
     StatsType      = statsType;
 }
Beispiel #19
0
    public List <string> GetLevelStats(int _levelUrlNum, StatsType _statName)
    {
        List <string> _tempStrings = new List <string>();

        if (!CheckXML(FileUrls[_levelUrlNum]))
        {
            return(_tempStrings);
        }

        XmlReader reader = XmlReader.Create(FileUrls[_levelUrlNum]);

        while (reader.Read())
        {
            if (reader.Name == _statName.ToString())
            {
                if (reader.GetAttribute("A") == null)
                {
                    Debug.LogError("MenuXML found no A Attribute on given stat in lsGetLevelStats");
                    break;
                }

                _tempStrings.Add(reader.GetAttribute("A"));
                _tempStrings.Add(reader.GetAttribute("B"));
                _tempStrings.Add(reader.GetAttribute("C"));
                _tempStrings.Add(reader.GetAttribute("D"));
                _tempStrings.Add(reader.GetAttribute("E"));
                _tempStrings.Add(reader.GetAttribute("F"));
            }
        }
        reader.Close();

        return(_tempStrings);
    }
Beispiel #20
0
 private void Awake()
 {
     menuButtons = GetComponentsInChildren <LocalUpgradesMenuButton> ();
     for (int i = 0; i < menuButtons.Length; i++)
     {
         menuButtons[i].Initiate(i);
     }
     remainingText   = GetComponentInChildren <Text> ();
     statSpritesDick = new Dictionary <StatsType, Sprite> ();
     StatsType[] statsArray = new StatsType[] {
         StatsType.Health,
         StatsType.Attack,
         StatsType.Defense,
         StatsType.MobileStats,
         StatsType.RangedStats,
         StatsType.CaravanStats,
         StatsType.CapitalStats,
         StatsType.TimeStats
     };
     for (int i = 0; i < statsArray.Length; i++)
     {
         statSpritesDick.Add(statsArray[i], statSpritesArray[i]);
     }
     gameObject.SetActive(false);
 }
Beispiel #21
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.ObjectConnection)
     {
         Connection = ConnectionInfo.Infos[(uint)(int)val];
     }
     base.ImportStats(stats, val);
 }
Beispiel #22
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.AltTextureIndex)
     {
         AltTextureIndex = (int)val;
     }
     base.ImportStats(stats, val);
 }
Beispiel #23
0
 protected override void ImportStats(StatsType stats, object val)
 {
     base.ImportStats(stats, val);
     switch (stats)
     {
         case StatsType.Stars: Stars = (int)val; break;
     }
 }
Beispiel #24
0
    public static LocalUpgrade MakeLocalUpgrade(StatsType newStatsType, int newStatsIndex, float newChange, string newDescription, float[] newCostArray, float newCostIncrease)
    {
        LocalUpgrade newLocalUpGrade = MakeLocalUpgrade(newStatsType, newStatsIndex, newChange, newDescription);

        newLocalUpGrade.costArray    = newCostArray;
        newLocalUpGrade.costIncrease = newCostIncrease;
        return(newLocalUpGrade);
    }
Beispiel #25
0
        public static StatData SetStatData(StatData data, StatsType id, int ival, string sval)
        {
            data.Id          = id;
            data.IntValue    = ival;
            data.StringValue = sval;

            return(data);
        }
Beispiel #26
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.HP)
     {
         HP = (int)val;
     }
     base.ImportStats(stats, val);
 }
 internal override void ImportStats(StatsType stat, object val)
 {
     if (stat == StatsType.HP)
     {
         HP = (int)val;
     }
     base.ImportStats(stat, val);
 }
Beispiel #28
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.PortalUsable)
     {
         Usable = (int)val != 0;
     }
     base.ImportStats(stats, val);
 }
Beispiel #29
0
 void UpdateStatsUI()
 {
     Stats.text = "Lvl " + MPC.Getlvl() + " : " + MPC.GetExp() + "/" + MPC.GetNextLvlExp();//Just for now
     for (int i = 0; i < Values.Length; i++)
     {
         Values[i].text = MPC.GetCurrStats((STATSTYPE)i) + StatsType.GetStatsTypeString(i).S;
     }
 }
Beispiel #30
0
 // Token: 0x060002B0 RID: 688 RVA: 0x00012970 File Offset: 0x00010B70
 public static bool _cdabW7ae4EGEYdLXJ4tAOcCD3GUA(StatsType type, int id)
 {
     if (id > 255)
     {
         throw new Exception("Not a valid StatData number.");
     }
     return(type.m_type != (byte)id);
 }
    protected void UpgradeWorldObjectType(WorldObjectType wot, StatsType upgradeStat, int statarrayIndex)
    {
        List <string> woNames = GameManager.GetSpeciesWOTList(species, wot);

        foreach (string woName in woNames)
        {
            UpgradeWorldObject(woName, upgradeStat, statarrayIndex);
        }
    }
Beispiel #32
0
        public Stat(StatsType type)
        {
            //TODO: CONFIG file
            Current = 50;
            Min     = 0;
            Max     = 100;

            Type = type;
        }
Beispiel #33
0
    public void Iniaite()
    {
        text = GetComponent <Text> ();
        if (name.Contains("Increase"))
        {
            indexArray = 1;
        }
        else
        {
            indexArray = 0;
        }
        if (name.Contains("Health"))
        {
            statsType = StatsType.Health;
            units     = " hp";
        }
        else if (name.Contains("Attack"))
        {
            statsType = StatsType.Attack;
            units     = " dps";
        }
        else if (name.Contains("Ranged"))
        {
            statsType = StatsType.RangedStats;
            units     = " m";
        }
        else if (name.Contains("Movement"))
        {
            statsType = StatsType.MobileStats;
            units     = " m/s";
        }
        else if (name.Contains("Defense"))
        {
            statsType = StatsType.Defense;
            units     = " %";
            string defenseIndex = name.Substring(name.Length - 1);
            switch (defenseIndex)
            {
            case "2":
                indexArray = 2 + indexArray;
                break;

            case "3":
                indexArray = 4 + indexArray;
                break;

            case "4":
                indexArray = 6 + indexArray;
                break;

            case "5":
                indexArray = 8 + indexArray;
                break;
            }
        }
    }
 private PitchingStats GetPitchingStats(StatsType statsType)
 {
     if (!PitchingStats.Any(s => s.StatsType == statsType))
     {
         PitchingStats.Add(new PitchingStats {
             StatsType = statsType
         });
     }
     return(PitchingStats.FirstOrDefault(s => s.StatsType == statsType));
 }
Beispiel #35
0
 public void AddStat(StatsType stat, int value)
 {
     if(HasStat(stat))
         throw new ArgumentException("Already Contains the stat: " + stat);
     _stats.Add(stat,value);
     if(stat == StatsType.MaxHp)
         AddStat(StatsType.CurHp,value);
     if(stat == StatsType.MaxResources)
         AddStat(StatsType.CurResources, value);
 }
Beispiel #36
0
 public void AugmentStat(StatsType stat, int magnitude)
 {
     lock (this)
     {
         int moddingStat = _stats[stat];
         moddingStat += magnitude;
         moddingStat = ValidateStat(stat, moddingStat);
         _stats[stat] = moddingStat;
     }
 }
Beispiel #37
0
        protected override void ImportStats(StatsType stats, object val)
        {
            base.ImportStats(stats, val);
            switch (stats)
            {
                case StatsType.AccountId: AccountId = (int)val; break;

                case StatsType.Experience: Experience = (int)val; break;
                case StatsType.ExperienceGoal: ExperienceGoal = (int)val; break;
                case StatsType.Level: Level = (int)val; break;

                case StatsType.Fame: CurrentFame = (int)val; break;
                case StatsType.CurrentFame: Fame = (int)val; break;
                case StatsType.FameGoal: FameGoal = (int)val; break;
                case StatsType.Stars: Stars = (int)val; break;

                case StatsType.Guild: Guild = (string)val; break;
                case StatsType.GuildRank: GuildRank = (int)val; break;

                case StatsType.Credits: Credits = (int)val; break;
                case StatsType.NameChosen: NameChosen = (int)val != 0 ? true : false; break;
                case StatsType.Texture1: Texture1 = (int)val; break;
                case StatsType.Texture2: Texture2 = (int)val; break;

                case StatsType.Glowing: Glowing = (int)val != 0 ? true : false; break;
                case StatsType.HP: HP = (int)val; break;
                case StatsType.MP: MP = (int)val; break;

                case StatsType.Inventory0: Inventory[0] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory1: Inventory[1] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory2: Inventory[2] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory3: Inventory[3] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory4: Inventory[4] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory5: Inventory[5] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory6: Inventory[6] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory7: Inventory[7] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory8: Inventory[8] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory9: Inventory[9] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory10: Inventory[10] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;
                case StatsType.Inventory11: Inventory[11] = (int)val == -1 ? null : XmlDatas.ItemDescs[(short)(int)val]; break;

                case StatsType.MaximumHP: Stats[0] = (int)val; break;
                case StatsType.MaximumMP: Stats[1] = (int)val; break;
                case StatsType.Attack: Stats[2] = (int)val; break;
                case StatsType.Defense: Stats[3] = (int)val; break;
                case StatsType.Speed: Stats[4] = (int)val; break;
                case StatsType.Vitality: Stats[5] = (int)val; break;
                case StatsType.Wisdom: Stats[6] = (int)val; break;
                case StatsType.Dexterity: Stats[7] = (int)val; break;
            }
        }
 protected override void ImportStats(StatsType stats, object val)
 {
     switch (stats)
     {
         case StatsType.Inventory0:
             Inventory[0] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory1:
             Inventory[1] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory2:
             Inventory[2] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory3:
             Inventory[3] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory4:
             Inventory[4] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory5:
             Inventory[5] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory6:
             Inventory[6] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory7:
             Inventory[7] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory8:
             Inventory[8] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory9:
             Inventory[9] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory10:
             Inventory[10] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.Inventory11:
             Inventory[11] = (int)val == -1 ? null : XmlData.Items[(short)(int)val];
             break;
         case StatsType.OwnerAccountId:
             BagOwner = (int)val == -1 ? (int?)null : (int)val;
             break;
     }
     base.ImportStats(stats, val);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Stats"></param>
 public void UnMerge(StatsType type, GenericStats Stats)
 {
     foreach (var effect in Stats.Effects.Except(Stats.WeaponEffects))
     {
         if (!m_effects.ContainsKey(effect.Key))
             m_effects.Add(effect.Key, new GenericEffect(effect.Key));
         m_effects[effect.Key].UnMerge(type, effect.Value);
     }
 }
 private static string GetPotName(StatsType whatStat)
 {
     switch (whatStat)
     {
         case StatsType.CurHp:
             return "Health Potion";
         case StatsType.CurResources:
             return "Mana Potion";
         case StatsType.Defense:
             return "Potion of Defence";
         case StatsType.Agility:
             return "Potion of Agility";
         case StatsType.Strength:
             return "Potion of Strength";
         case StatsType.Intelegence:
             return "Potion of Intellect";
         default:
             return "ERROR";
     }
 }
Beispiel #41
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.PortalUsable)
         val = (int)val != 0;
     base.ImportStats(stats, val);
 }
Beispiel #42
0
 public int GetStat(StatsType stat)
 {
     if (!HasStat(stat))
         throw new ArgumentException("Stats does not contain stat: " + stat);
     return _stats[stat];
 }
Beispiel #43
0
 public int this[StatsType stat] { get { return stats[(int)stat]; } }
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.HP) HP = (int)val;
     base.ImportStats(stats, val);
 }
Beispiel #45
0
 public void DecreaseStat(StatsType stat, int value)
 {
     stats[(int)stat] = Math.Max(0, stats[(int)stat] - value);
 }
        public void NotifyStat(StatsType stat, int value)
        {
            var col = ((int)stat) % 2;
            var row = ((int)stat) / 2;

            var rowTbl = (TableLayoutPanel)tblStats.GetControlFromPosition(0, row);
            var col2 = 2 * col;
            var lblNameStat = rowTbl.GetControlFromPosition(col2, 0);
            var lblValueStat = rowTbl.GetControlFromPosition(col2 + 1, 0);
            setTextAndRefresh(  lblNameStat, 
                                String.Format(  "{0}", 
                                                stat.ToString()));
            setTextAndRefresh(  lblValueStat,
                                String.Format("{0, 3} ({1})",
                                                value,
                                                value.ModifierOfStat().ToString("+#;-#;0")));
        }
Beispiel #47
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.MerchantMerchandiseType) mType = (int)val;
     else if (stats == StatsType.MerchantRemainingCount) mRemaining = (int)val;
     else if (stats == StatsType.MerchantRemainingMinute) mTime = (int)val;
     base.ImportStats(stats, val);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="effect"></param>
        public void UnMerge(StatsType type, GenericEffect effect)
        {
            switch (type)
            {
                case StatsType.TYPE_BASE:
                    Base -= effect.Value1;
                    break;

                case StatsType.TYPE_BOOST:
                    Boosts -= effect.Value1;
                    break;

                case StatsType.TYPE_DON:
                    Dons -= effect.Value1;
                    break;

                case StatsType.TYPE_ITEM:
                    Items -= effect.Value1;
                    break;
            }
        }
Beispiel #49
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.ObjectConnection)
         Connection = ConnectionInfo.Infos[(uint)(int)val];
     base.ImportStats(stats, val);
 }
Beispiel #50
0
 public void IncreaseStat(StatsType stat, int value)
 {
     stats[(int)stat] += value;
 }
Beispiel #51
0
 public Prerequisite(StatsType statsType, int value)
 {
     minimumStats.IncreaseStat(statsType, value);
 }
Beispiel #52
0
 protected override void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.AltTextureIndex)
         AltTextureIndex = (int)val;
     base.ImportStats(stats, val);
 }
        public EffectInformation GetProperty(StatsType type)
        {
            EffectInformation temp = new EffectInformation(type, 0);
            int index = Properties.IndexOf(temp);

            return Properties.ElementAt<EffectInformation>(index);
        }
 protected override void ImportStats(StatsType stats, object val)
 {
     switch (stats)
     {
         case StatsType.MerchantMerchandiseType:
             mType = (int)val;
             break;
         case StatsType.MerchantRemainingCount:
             mRemaining = (int)val;
             break;
         case StatsType.MerchantRemainingMinute:
             mTime = (int)val;
             break;
     }
     base.ImportStats(stats, val);
 }
 public static EffectInformation ModifyStatBy(StatsType stat, DungeonCharacter target, double percent, int duration)
 {
     return new EffectInformation(stat, (int)(target.DCStats.GetStat(stat) * percent), 0, duration);
 }