public Mod(StatType stat, ModifierType type, double value)
     : this()
 {
     Stat = stat;
     Type = type;
     Value = value;
 }
Exemplo n.º 2
0
 public Modifier(StatType stat, bool percent, float percentValue, short value)
 {
     Percent = percent;
     PercentValue = percentValue;
     Stat = stat;
     Value = value;
 }
Exemplo n.º 3
0
    public int GetLevelByType( StatType type )
    {
        int returnInt = 0;
        switch ( type )
        {
            case ( StatType.ShotPower ):
                returnInt = shotPowerLevel;
            break;

            case ( StatType.ShieldLevel ):
                returnInt = shieldLevel;
            break;

            case ( StatType.SpeedThrust ):
                returnInt = speedThrustLevel;
            break;

            case ( StatType.ThrustDuration ):
                returnInt = thrustDurationLevel;
            break;

            case ( StatType.LightRadius ):
                returnInt = lightRadiusLevel;
            break;
        }

        return returnInt + 1;
    }
Exemplo n.º 4
0
 public Stat(StatType type, double startingValue = 0.0, double mod = 0.0, double dep = 0.0)
 {
     this.Type = type;
     modifier = mod;
     depletion = dep;
     basevalue = startingValue;
 }
Exemplo n.º 5
0
 public Stat this[StatType type]
 {
     get
     {
         return stats[type];
     }
 }
Exemplo n.º 6
0
        public Item(GraphicsDeviceManager g, ContentManager c, int weapon, Vector2 startLoc, Vector2 playerDim)
        {
            graphics = g;
            content = c;

            dimensions = new Vector2(90, 120);
            loc = new Vector2(startLoc.X - playerDim.X / 2, startLoc.Y - playerDim.Y / 3);

            random = new Random();

            if (weapon == 0)
            {
                LoadContent("Textures/ShortSwordWalk");

                vitality = 0;
                dexterity = 0;
                intelligence = 0;
                strength = 0;

                critBonus = 0;
                critChance = 0;

                minDmg = 1f;
                maxDmg = 5f;

                statType = StatType.str;
                weaponType = WeaponType.slash;

                atkSpd = 1f;
            }

            animation = new SpriteAnimation(8, itemSpriteSheet, .45, new Rectangle((int)loc.X, (int)loc.Y,
                                                                      (int)dimensions.X, (int)dimensions.Y));
        }
Exemplo n.º 7
0
 public static Stat Create(StatType type)
 {
     GameObject obj = (GameObject) Instantiate(Resources.Load("GUI/StatsPanel/Stat"));
     Stat stat = obj.GetComponent<Stat>();
     stat.Init(type);
     return stat;
 }
Exemplo n.º 8
0
		public int GetMeleeAPModByStat(StatType stat)
		{
			if (m_MeleeAPModByStat == null)
			{
				return 0;
			}
			return m_MeleeAPModByStat[(int)stat];
		}
Exemplo n.º 9
0
		public int GetRangedAPModByStat(StatType stat)
		{
			if (m_RangedAPModByStat == null)
			{
				return 0;
			}
			return m_RangedAPModByStat[(int)stat];
		}
Exemplo n.º 10
0
		public void SetMeleeAPModByStat(StatType stat, int value)
		{
			if (m_MeleeAPModByStat == null)
			{
				m_MeleeAPModByStat = new int[(int)StatType.End];
			}
			m_baseStats[(int)stat] = value;
			this.UpdateMeleeAttackPower();
		}
Exemplo n.º 11
0
        public int[] GetDateStatistics(StatType statType, string subject)
        {
            List<StatType> stats = new List<StatType>();
            stats.Add(statType);

            Dictionary<StatType, int[]> retVal = GetDateStatistics(stats, subject);

            return retVal[statType];
        }
Exemplo n.º 12
0
 public BlessEffect( StatType stat, int sound, int eid, int speed, int duraction, int eff, EffectLayer layer )
 {
     m_Stat = stat;
     m_Snd = sound;
     m_EffIID = eid;
     m_EffSpd = speed;
     m_Dur = duraction;
     m_Eff = eff;
     m_ELayer = layer;
 }
Exemplo n.º 13
0
 public PercentageStat(
     string shortName,
     string name,
     string description,
     string category,
     string container,
     StatType type,
     Action<Stat> pullAction,
     StatVerbosity verbosity)
     : base(shortName, name, description, "%", category, container, type, pullAction, verbosity) {}
Exemplo n.º 14
0
 // more fields can be added (see in visualGGPK)
 public StatRecord(Memory m, int addr)
 {
     Key = m.ReadStringU(m.ReadInt(addr + 0), 255);
     Unknown4 = m.ReadByte(addr + 4) != 0;
     Unknown5 = m.ReadByte(addr + 5) != 0;
     Unknown6 = m.ReadByte(addr + 6) != 0;
     Type = (StatType) m.ReadInt(addr + 7);
     UnknownB = m.ReadByte(addr + 0xB) != 0;
     UserFriendlyName = m.ReadStringU(m.ReadInt(addr + 0xC), 255);
 }
        public void updateStats(StatType statType, int count)
        {
            int tmpCount = 0;

            switch (statType)
            {
                case StatType.Input:
                    if (this.InvokeRequired)
                    {
                        this.submittedJobsLabel.Invoke(new Action<StatType, int>(updateStats), new object[] { statType, count });
                    }
                    lock (stateLock)
                    {
                        tmpCount = count;
                    }
                    this.submittedJobsLabel.Text = tmpCount.ToString();
                    break;

                case StatType.Inprocess:
                    if (this.InvokeRequired)
                    {
                        this.inProcessJobsLabel.Invoke(new Action<StatType, int>(updateStats), new object[] { statType, count });
                    }
                    lock (stateLock)
                    {
                        tmpCount = count;
                    }
                    this.inProcessJobsLabel.Text = tmpCount.ToString();
                    break;

                case StatType.Success:
                    if (this.InvokeRequired)
                    {
                        this.successJobsLabel.Invoke(new Action<StatType, int>(updateStats), new object[] { statType, count });
                    }
                    lock (stateLock)
                    {
                        tmpCount = count;
                    }
                    this.successJobsLabel.Text = tmpCount.ToString();
                    break;

                case StatType.Failure:
                    if (this.InvokeRequired)
                    {
                        this.failedJobsLabel.Invoke(new Action<StatType, int>(updateStats), new object[] { statType, count });
                    }
                    lock (stateLock)
                    {
                        tmpCount = count;
                    }
                    this.failedJobsLabel.Text = count.ToString();
                    break;
            }
        }
Exemplo n.º 16
0
 public bool HasOnly(StatType type)
 {
     if ((type != StatType.Health && Health > 0)
         || (type != StatType.Attack && Attack > 0)
         || (type != StatType.Defence && Defence > 0)
         || (type != StatType.SpAttack && SpAttack > 0)
         || (type != StatType.SpDefence && SpDefence > 0)
         || (type != StatType.Speed && Speed > 0))
     {
         return false;
     }
     return true;
 }
Exemplo n.º 17
0
        public Damage(DamageType type, StatType damageTo, int value, bool trigger = true, bool penetrate=false)
        {
            Type = type;

            if (damageTo == StatType.CUR_ENERGY ||
                damageTo == StatType.CUR_STAMINA)
                DamageTo = damageTo;
            else DamageTo = StatType.CUR_LIFE;

            Value = value;
            Trigger = trigger;
            Penetrate = penetrate;
        }
Exemplo n.º 18
0
        public Stat Add(StatType type, float baseValue, bool isDynamic)
        {
            Stat stat = null;

            if (isDynamic)
                stat = new DynamicStat(type, baseValue);
            else
                stat = new Stat(type, baseValue);

            stats.Add(stat.Type, stat);

            return stat;
        }
Exemplo n.º 19
0
		public static bool TryConvert(this StatFlags flags, out StatType stats)
		{
			stats = StatType.All;

			var f = (byte)flags;

			if (f < 0x1 || f > 0x7)
			{
				return false;
			}

			stats = (StatType)flags;
			return true;
		}
Exemplo n.º 20
0
 private void SetEnemyModifire(StatType statType)
 {
     if(statType == StatType.ICE){
         statModifier = enemyICEModifier;
     }
     if(statType == StatType.RAM){
         statModifier = enemyRAMModifier;
     }
     if(statType == StatType.STRENGTH){
         statModifier = enemyStrengthModifier;
     }
     if(statType == StatType.DEXTERITY){
         statModifier = enemyDexterityModifier;
     }
     if(statType == StatType.INTELLECT){
         statModifier = enemyIntellectModifier;
     }
 }
Exemplo n.º 21
0
		public StatOffsetSetMod(
			string uid = null,
			string name = "Stat Mod",
			int partsReq = 1,
			bool display = true,
			StatType stat = StatType.All,
			int offset = 1,
			TimeSpan? duration = null)
			: base(name, null, partsReq, display)
		{
			UID = uid ?? Name + TimeStamp.UtcNow;

			_Stat = stat;
			_Offset = offset;
			_Duration = duration ?? TimeSpan.Zero;

			InvalidateDesc();
		}
Exemplo n.º 22
0
 public int GetStat(StatType stat)
 {
     switch (stat)
     {
         case StatType.Health:
             return Health;
         case StatType.Attack:
             return Attack;
         case StatType.Defence:
             return Defence;
         case StatType.SpAttack:
             return SpAttack;
         case StatType.SpDefence:
             return SpDefence;
         case StatType.Speed:
             return Speed;
     }
     return 0;
 }
Exemplo n.º 23
0
        public static bool AddStatBonus( Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration )
        {
            int offset = bonus;
            string name = String.Format( "[Magic] {0} Offset", type );

            StatMod mod = target.GetStatMod( name );

            if ( mod != null && mod.Offset < 0 )
            {
                target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
                return true;
            }
            else if ( mod == null || mod.Offset < offset )
            {
                target.AddStatMod( new StatMod( type, name, offset, duration ) );
                return true;
            }

            return false;
        }
Exemplo n.º 24
0
		protected internal virtual void UpdateStat(StatType stat)
		{
			switch (stat)
			{
				case StatType.Strength:
					UpdateStrength();
					break;
				case StatType.Agility:
					UpdateAgility();
					break;
				case StatType.Stamina:
					UpdateStamina();
					break;
				case StatType.Intellect:
					UpdateIntellect();
					break;
				case StatType.Spirit:
					UpdateSpirit();
					break;
			}
		}
Exemplo n.º 25
0
    public int GetStat(StatType stat)
    {
        switch (stat)
        {
        case StatType.Agility:
            return agility;

        case StatType.Health:
            return health;

        case StatType.Mind:
            return mind;

        case StatType.Strength:
            return strength;

        case StatType.Swagger:
            return swagger;
        }
        return 0;
    }
Exemplo n.º 26
0
    public static string StatInfo(StatType statType)
    {
        switch (statType) {
        case StatType.Agility:
            return "This statistic represents a character's speed and nimbleness. A high agility score lets you move further and faster in combat, dodge attacs and use lighter weapons effectively.";

        case StatType.Health:
            return "This is a representation of a character's overall physical state. A healthy body does not tire easily and has a greater resistance to injury and afflictions.";

        case StatType.Mind:
            return "This statistic represents a character's mental capacities, primarily force of will. A strong mind is important to cast and resist spells.";

        case StatType.Strength:
            return "This statistic represents raw, physical strength. A high strength value is necessary to use heavy weapons in combat.";

        case StatType.Swagger:
            return "This statistic represents a characters general <i>awesomeness</i>. A high swagger value will stun friend and foe alike with awe!";

        default:
            return "";
        }
    }
Exemplo n.º 27
0
 public Stat(
     string shortName,
     string name,
     string description,
     string unitName,
     string category,
     string container,
     StatType type,
     Action<Stat> pullAction,
     StatVerbosity verbosity)
     : this(shortName, 
             name, 
             description, 
             unitName, 
             category, 
             container, 
             type, 
             MeasuresOfInterest.None, 
             pullAction, 
             verbosity)
 {
 }
Exemplo n.º 28
0
    public Effect(ActionComponent actionComponent, Character _sourceUnit, Character _targetUnit)
    {
        hitType = actionComponent.hitType;
        elementalType = actionComponent.elementalType;
        effectType = actionComponent.effectType;
        basePower = actionComponent.basePower;
        baseToHit = actionComponent.baseToHit;
        duration = actionComponent.duration;

        priPowerStat = actionComponent.priPowerStat;
        priPowerWeight = actionComponent.priPowerWeight;
        secPowerStat = actionComponent.secPowerStat;
        secPowerWeight = actionComponent.secPowerWeight;

        priResistStat = actionComponent.priResistStat;
        priResistWeight = actionComponent.priResistWeight;
        secResistStat = actionComponent.secResistStat;
        secResistWeight = actionComponent.secResistWeight;

        sourceUnit = _sourceUnit;
        targetUnit = _targetUnit;

        sourcePowerStat = GetStatPower(_sourceUnit);
    }
Exemplo n.º 29
0
 		protected override int GetStatValue(StatType stat)
		{
			var val = Owner.GetBaseStatValue(stat);

			var chr = Owner as Character;
			if(chr != null)
			{
				var items = chr.Inventory.Equipment.Items; //All equipped items
				for(int i = 0; i < items.Length; i++)
				{
					if(items[i] != null)
					{
						var itemMods = items[i].Template.Mods; //All mods of the item
						for(int j = 0; j < itemMods.Length; j++)
						{
							var mod = itemMods[j];
							if (mod.Type == StatTypeToItemModType[(int)stat]) //Mod with given stat
								val += mod.Value;
						}
					}
				}
			}
			return val;
		}
Exemplo n.º 30
0
 public SirenSong(StatType type, string buffName)
     : base(DURATION, type, -STAT_REDUCTION_PERCENT, buffName, Util.GetSprite("g-clef"))
 {
 }
Exemplo n.º 31
0
 /// <summary>
 /// Gets the modifier value for the given <paramref name="statType"/>, where a positive value adds to the
 /// mod stat value, a negative value subtracts from the mod stat value, and a value of 0 does not modify
 /// the mod stat value.
 /// </summary>
 /// <param name="statType">The <see cref="StatType"/> to get the modifier value for.</param>
 /// <returns>The modifier value for the given <paramref name="statType"/>.</returns>
 public int GetStatModBonus(StatType statType)
 {
     return(_modStats[statType]);
 }
Exemplo n.º 32
0
        private static bool TeamSubscribesForThisEvent(GameweekLeagueContext context, StatType statType)
        {
            var subscriptionType = statType.GetSubscriptionType();

            return(subscriptionType.HasValue && context.SlackTeam.Subscriptions.ContainsSubscriptionFor(subscriptionType.Value));
        }
Exemplo n.º 33
0
 public StatRegen(StatType type, int amountPerTurn)
     : base(type.Sprite, string.Format("Restore {0}", type.Name), String.Format("Regenerate {0} {1} each turn.", amountPerTurn, type.ColoredName), false)
 {
     this.amountPerTurn = amountPerTurn;
     this.type          = type;
 }
Exemplo n.º 34
0
    public object getStatResult(StatType statName)
    {
        StatMgr mgr = getSys <StatMgr>(SysType.sysTypeStat);

        return(mgr.getStatResult(statName));
    }
Exemplo n.º 35
0
    public OpRes doStat(object param, StatType statName)
    {
        StatMgr mgr = getSys <StatMgr>(SysType.sysTypeStat);

        return(mgr.doStat(param, statName, this));
    }
Exemplo n.º 36
0
 public static bool AddStatBonus(Mobile caster, Mobile target, StatType type)
 {
     return(AddStatBonus(caster, target, type, GetOffset(caster, target, type, false), GetDuration(caster, target)));
 }
 public void UnspendSkillPoint(StatType skill)
 {
     this.RemoveAction <SpendSkillPoint>((SpendSkillPoint a) => a.Skill == skill);
     this.UpdatePreview();
 }
 // Add the specified value to a modifier for the specified stat and update any dependants
 public void modStat(StatType type, float value)
 {
     // set the stat mod relative to its current mod value
     this.setStatMod(type, this.getStatMod(type) + value);
 }
Exemplo n.º 39
0
 public int GetModifiedAmount(StatType statType)
 {
     return(StatTotals[statType].Amount);
 }
Exemplo n.º 40
0
 public StatTypeBl(StatType type)
 {
     Type = type;
 }
Exemplo n.º 41
0
 protected T GetStat <T>(StatType type) where T : Stat
 {
     return(stats.GetStat <T>(type));
 }
Exemplo n.º 42
0
 public MysteryEngine(BlueprintCharacterClass[] mystery_classes, StatType scaling_stat)
 {
     stat    = scaling_stat;
     classes = mystery_classes;
 }
    // return the base stat if it exists, otherwise return 0
    public float getBaseStatOrZero(StatType type)
    {
        StatValue thisStat = this.getStatValue(type);

        return(thisStat.baseValue);
    }
    // get the effective stat, with all modifiers applied.
    public float getStat(StatType type)
    {
        StatValue thisStat = this.getStatValue(type);

        return(thisStat.baseValue + thisStat.modifier);
    }
Exemplo n.º 45
0
 public float GetModifiedPercentage(StatType statType)
 {
     return(StatTotals[statType].Percentage);
 }
 public bool SelectRaceStat(StatType attribute)
 {
     this.RemoveAction <SelectRaceStat>(null);
     return(this.AddAction(new SelectRaceStat(attribute), false));
 }
Exemplo n.º 47
0
 public static bool AddStatCurse(Mobile caster, Mobile target, StatType type)
 {
     return(AddStatCurse(caster, target, type, GetOffset(caster, target, type, true), GetDuration(caster, target)));
 }
 public void UnspendAttributePoint(StatType attribute)
 {
     this.RemoveAction <SpendAttributePoint>((SpendAttributePoint a) => a.Attribute == attribute);
     this.UpdatePreview();
 }
 public bool SpendSkillPoint(StatType skill)
 {
     return(this.AddAction(new SpendSkillPoint(skill), false));
 }
Exemplo n.º 50
0
 public ImplementsEngine(string name_prefix, BlueprintAbilityResource ability_resource, BlueprintCharacterClass[] scaling_classes, StatType scaling_stat, bool check_focus_investment = true, BlueprintArchetype scaling_archetype = null)
 {
     stat                 = scaling_stat;
     classes              = scaling_classes;
     archetype            = scaling_archetype;
     resource             = ability_resource;
     prefix               = name_prefix + "Implement";
     check_invested_focus = check_focus_investment;
 }
Exemplo n.º 51
0
 public T GetStat <T>(StatType type) where T : Stat
 {
     return(GetStat(type) as T);
 }
Exemplo n.º 52
0
 public void ModifyStat(StatType type, int turnsLeft, int value, bool applyImmidiately = false)
 {
     StatManager.Instance.ModifyStat(ActiveStatsList, type, turnsLeft, value, _healthBar, applyImmidiately);
 }
 // check if this stat's base stat can be 0 or less.
 public static bool needsPositiveBase(this StatType stat)
 {
     // bitwise AND operation to determine if the flag is in the defined stat set.
     return((positiveBaseStats & stat) == stat ? true : false);
 }
Exemplo n.º 54
0
 public Stat(StatType type, int baseStat)
 {
     this.Type      = type;
     this.BaseValue = baseStat;
 }
 public StatValueChangingEffect(StatType affectStatType, float amount, float duration,
                                EffectDuration durationType, EffectType effectType, Sprite icon) : base(affectStatType, amount, duration, durationType,
                                                                                                        effectType, icon)
 {
     extraValue = new ExtraValue(amount);
 }
 public bool SpendAttributePoint(StatType attribute)
 {
     return(this.AddAction(new SpendAttributePoint(attribute), false));
 }
Exemplo n.º 57
0
 public static IKey Serialize(this StatType statType) =>
 new Binary(BitConverter.GetBytes((int)statType));
Exemplo n.º 58
0
 public bool Contains(StatType statType)
 {
     return(_statDict.ContainsKey(statType));
 }
Exemplo n.º 59
0
		public int ComputeStatBonus( StatType type )
		{
			if ( type == StatType.Str )
				return BaseStrBonus + Attributes.BonusStr;
			else if ( type == StatType.Dex )
				return BaseDexBonus + Attributes.BonusDex;
			else
				return BaseIntBonus + Attributes.BonusInt;
		}
Exemplo n.º 60
0
 public Stat(float start, StatType type)
 {
     _StartValue = Mathf.Clamp(start, 0f, 1f);
     _Value      = _StartValue;
     _Type       = type;
 }