public Mod(StatType stat, ModifierType type, double value) : this() { Stat = stat; Type = type; Value = value; }
public Modifier(StatType stat, bool percent, float percentValue, short value) { Percent = percent; PercentValue = percentValue; Stat = stat; Value = value; }
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; }
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; }
public Stat this[StatType type] { get { return stats[type]; } }
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)); }
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; }
public int GetMeleeAPModByStat(StatType stat) { if (m_MeleeAPModByStat == null) { return 0; } return m_MeleeAPModByStat[(int)stat]; }
public int GetRangedAPModByStat(StatType stat) { if (m_RangedAPModByStat == null) { return 0; } return m_RangedAPModByStat[(int)stat]; }
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(); }
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]; }
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; }
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) {}
// 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; } }
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; }
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; }
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; }
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; }
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; } }
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(); }
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; }
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; }
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; } }
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; }
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 ""; } }
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) { }
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); }
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; }
public SirenSong(StatType type, string buffName) : base(DURATION, type, -STAT_REDUCTION_PERCENT, buffName, Util.GetSprite("g-clef")) { }
/// <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]); }
private static bool TeamSubscribesForThisEvent(GameweekLeagueContext context, StatType statType) { var subscriptionType = statType.GetSubscriptionType(); return(subscriptionType.HasValue && context.SlackTeam.Subscriptions.ContainsSubscriptionFor(subscriptionType.Value)); }
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; }
public object getStatResult(StatType statName) { StatMgr mgr = getSys <StatMgr>(SysType.sysTypeStat); return(mgr.getStatResult(statName)); }
public OpRes doStat(object param, StatType statName) { StatMgr mgr = getSys <StatMgr>(SysType.sysTypeStat); return(mgr.doStat(param, statName, this)); }
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); }
public int GetModifiedAmount(StatType statType) { return(StatTotals[statType].Amount); }
public StatTypeBl(StatType type) { Type = type; }
protected T GetStat <T>(StatType type) where T : Stat { return(stats.GetStat <T>(type)); }
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); }
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)); }
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)); }
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; }
public T GetStat <T>(StatType type) where T : Stat { return(GetStat(type) as T); }
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); }
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)); }
public static IKey Serialize(this StatType statType) => new Binary(BitConverter.GetBytes((int)statType));
public bool Contains(StatType statType) { return(_statDict.ContainsKey(statType)); }
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; }
public Stat(float start, StatType type) { _StartValue = Mathf.Clamp(start, 0f, 1f); _Value = _StartValue; _Type = type; }