/// <summary> /// Initializes a new instance of the StatChangeEvent class. /// </summary> /// <param name="activeThing">The active thing.</param> /// <param name="senseMessage">The sensory message.</param> /// <param name="stat">The applicable stat.</param> /// <param name="modifier">The stat modifier.</param> /// <param name="oldValue">The old stat value.</param> public StatChangeEvent(Thing activeThing, SensoryMessage senseMessage, BaseStat stat, int modifier, int oldValue) : base(activeThing, senseMessage) { this.Stat = stat; this.OldValue = oldValue; this.Modifier = modifier; }
public FormIncrement() { InitializeComponent(); pData = new Classe(); IncrementTab = new Increment(); //muda o modo de edição para incremento BasicTab = new Basic(); BasicTab.IsClasseMode = false; StatTab = new BaseStat(); VitalTab = new Vital(); PhysicalTab = new Physical(); MagicTab = new Magic(); ExtraTab = new Extra(); ElementalTab = new Elemental(); ResistTab = new Resist(); DockPanel.AddContent(BasicTab); DockPanel.AddContent(StatTab); DockPanel.AddContent(VitalTab); DockPanel.AddContent(PhysicalTab); DockPanel.AddContent(MagicTab); DockPanel.AddContent(ElementalTab); DockPanel.AddContent(ResistTab); DockPanel.AddContent(ExtraTab); DockPanel.ContentRemoved += DockPanel_ContentRemoved; }
public void CreateInitialStats(int con, int str, int dex, int intel, int mnd, int slt) { level = 1; totalEXP = 0; currentEXP = totalEXP; expTillNextLevel = 100; constitution = new Attribute(AttributeName.CON, con); strength = new Attribute(AttributeName.STR, str); dexterity = new Attribute(AttributeName.DEX, dex); intelligence = new Attribute(AttributeName.INT, intel); mind = new Attribute(AttributeName.MND, mnd); attack = new BaseStat(); magicAttack = new BaseStat(); defense = new BaseStat(); magicDefense = new BaseStat(); speed = new BaseStat(); acc = new BaseStat(); crit = new BaseStat(); dodge = new BaseStat(); setMaxHealth(); setMaxMana(); currentHealth = maxHealth; currentMana = maxMana; updateStats(); skillList = new Skill[Enum.GetValues(typeof(SkillName)).Length]; setupSkills(); slot = slt; }
public GradientStatusPanel(BaseStat bs, int width, int height, Color colorOne, Color colorTwo) : base(width, height) { this.colorOne = colorOne; this.colorTwo = colorTwo; editor = new SurfaceEditor(this); stat = bs; }
public FormClasses() { InitializeComponent(); pData = new Classe(); IncrementTab = new Increment(); BasicTab = new Basic(); StatTab = new BaseStat(); VitalTab = new Vital(); PhysicalTab = new Physical(); MagicTab = new Magic(); ExtraTab = new Extra(); ElementalTab = new Elemental(); ResistTab = new Resist(); DockPanel.AddContent(BasicTab); DockPanel.AddContent(StatTab); DockPanel.AddContent(VitalTab); DockPanel.AddContent(PhysicalTab); DockPanel.AddContent(MagicTab); DockPanel.AddContent(ElementalTab); DockPanel.AddContent(ResistTab); DockPanel.AddContent(ExtraTab); DockPanel.ContentRemoved += DockPanel_ContentRemoved; }
public void ResetStat(StatType type, params StatModifierOption[] statOptions) { List <StatModifierOption> options = ConvertStatOptionsToList(statOptions); BaseStat targetStat = GetStat(type); if (targetStat == null) { Debug.Log("Stat: " + type + " not found"); return; } if (options.Contains(StatModifierOption.Cap)) { CappedStat capped = TryConvertToCappedStat(targetStat); if (capped != null) { capped.ResetCap(); OnStatChanged(type, null); } } if ((options.Count < 1 || options.Contains(StatModifierOption.Base))) { targetStat.Reset(); OnStatChanged(type, null); } }
public void ApplyPermanentMod(StatType type, float value, StatModificationType modType, GameObject cause, params StatModifierOption[] statOptions) { List <StatModifierOption> options = ConvertStatOptionsToList(statOptions); BaseStat targetStat = GetStat(type); if (targetStat == null) { Debug.LogError("Stat: " + type + " not found"); return; } if (options.Contains(StatModifierOption.Cap)) { CappedStat capped = TryConvertToCappedStat(targetStat); if (capped != null) { capped.ModifyCapPermanently(value, modType); OnStatChanged(type, cause); } } if ((options.Count < 1 || options.Contains(StatModifierOption.Base))) { targetStat.ModifyStatPermanently(value, modType); OnStatChanged(type, cause); } }
public void RemoveTrackedMod(StatType type, StatModifier mod, GameObject cause, params StatModifierOption[] statOptions) { List <StatModifierOption> options = ConvertStatOptionsToList(statOptions); BaseStat targetStat = GetStat(type); if (targetStat == null) { Debug.Log("Stat: " + type + " not found"); return; } if (options.Contains(StatModifierOption.Cap)) { CappedStat capped = TryConvertToCappedStat(targetStat); if (capped != null) { capped.RemoveCapModifier(mod); OnStatChanged(type, cause); } } if ((options.Count < 1 || options.Contains(StatModifierOption.Base))) { targetStat.RemoveModifier(mod); OnStatChanged(type, cause); } }
//Experience gain and level up method // Pre: an enemy has died and the player gains exp. enemyLvl > 0 and baseExp > 0 // Post: exp has been added and enemy levels up if reached the requirement public void gainExp(float baseExp, int enemyLevel) { curExp += BaseStat.expGainCalc(baseExp, level, enemyLevel); //Level up method if (curExp >= maxExp) { if (level % 2 == 1) //Health growth { int prevHealth = baseStats[BaseStat.HEALTH]; baseStats[BaseStat.HEALTH] = BaseStat.healthGrowth(statUpgradesUsed[BaseStat.HEALTH], baseStats[BaseStat.HEALTH]); curStats[BaseStat.HEALTH] += (baseStats[BaseStat.HEALTH] - prevHealth); statUpgradesUsed[BaseStat.HEALTH]++; } else { curStats[BaseStat.HEALTH] += HEALTH_GAIN_PERCENT * baseStats[BaseStat.HEALTH]; if (curStats[BaseStat.HEALTH] > baseStats[BaseStat.HEALTH]) { curStats[BaseStat.HEALTH] = baseStats[BaseStat.HEALTH]; } } //Experience management numOpenStatBoosts++; curExp -= maxExp; maxExp += MAX_EXP_GROWTH; level++; } }
public float GetCappedStatRatio(StatType type) { BaseStat targetStat = GetStat(type); //Debug.Log("trying to get the stat ratio for " + type); CappedStat cap = TryConvertToCappedStat(targetStat); if (cap != null) { //Debug.Log(type + " has a ratio of " + cap.Ratio); return(cap.Ratio); } //if (targetStat != null && targetStat is CappedStat) { // CappedStat capped = targetStat as CappedStat; // return capped.Ratio; //} Debug.LogError("The ratio value was reqested for a stat with no max. Returning 0"); return(0f); }
public void TestGCharacterHasAgility() { GenericCharacter GC = GenericCharacter.GCFactory(); BaseStat testStat = GC.GetBaseStat("Agility"); Assert.IsInstanceOfType(testStat, typeof(BaseStat)); }
public int GetBaseStatBonus(BaseStat stat) { switch (stat) { case BaseStat.Strength: return(StrengthBonus); case BaseStat.Dexterity: return(DexterityBonus); case BaseStat.Constitution: return(ConstitutionBonus); case BaseStat.Intelligence: return(IntelligenceBonus); case BaseStat.Wisdom: return(WisdomBonus); case BaseStat.Charisma: return(CharismaBonus); default: return(0); } }
/// <summary>Initializes a new instance of the StatChangeEvent class.</summary> /// <param name="activeThing">The active thing.</param> /// <param name="senseMessage">The sensory message.</param> /// <param name="stat">The applicable stat.</param> /// <param name="modifier">The stat modifier.</param> /// <param name="oldValue">The old stat value.</param> public StatChangeEvent(Thing activeThing, SensoryMessage senseMessage, BaseStat stat, int modifier, int oldValue) : base(activeThing, senseMessage) { Stat = stat; OldValue = oldValue; Modifier = modifier; }
public Stat(BaseStat Base) { this.Base = Base; this.Flat = 0; this.Percent = 0; CalcActual(); }
public BaseChar(string charName, int level, int exp, Class charClass, Texture2D image) : this() { this.charName = charName; this.level = level; this.exp = exp; this.charClass = charClass; this.image = image; attributes = new BaseStat[Enum.GetValues(typeof(AttrNames)).Length]; secondaryAttr = new ModifiedStat[Enum. GetValues(typeof(SecondaryAttrNames)).Length]; for (int i = 0; i < attributes.Length; i++) { attributes[i] = new BaseStat(((AttrNames)i).ToString()); } setAttributeDescriptions(); for (int i = 0; i < secondaryAttr.Length; i++) { secondaryAttr[i] = new ModifiedStat(((SecondaryAttrNames)i).ToString(), this); } setSecondaryAttributeDescriptions(); setupModifiers(); CalcSecondaryAttr(); }
public double GetTotalStat(BaseStat stat) { var s = this[stat]; switch (stat) { case BaseStat.HP: return((s.BasePlusGrowth() * _currentLevel) * ((s.Multiplier() + 0.03d * _currentLevel) + s.ItemModifiers())); case BaseStat.MP: return(200d); case BaseStat.EVA: { var multiplier = s.Multiplier() + 0.02d * _currentLevel; return(((s.BasePlusGrowth() * _currentLevel) * (Math.Min(multiplier, 3d) + s.ItemModifiers())) * s.BattleMod()); } case BaseStat.SPD: return(100d + (s.Multiplier() + 0.000645d * _currentLevel) * _currentLevel * s.Growth()); default: return(((s.BasePlusGrowth() * _currentLevel) * ((s.Multiplier() + 0.02d * _currentLevel) + s.ItemModifiers())) * s.BattleMod()); } }
public BaseChar() { charName = "Joe Doe"; charClass = Classes.Stormer; level = 1; exp = 0; weight = 70; height = 180; image = new Texture2D(0, 0); Items = new Inventory(new Item[0]); attributes = new BaseStat[Enum.GetValues(typeof(AttrNames)).Length]; secondaryAttr = new ModifiedStat[Enum. GetValues(typeof(SecondaryAttrNames)).Length]; for (int i = 0; i < attributes.Length; i++) { attributes[i] = new BaseStat(((AttrNames)i).ToString()); } for (int i = 0; i < secondaryAttr.Length; i++) { secondaryAttr[i] = new ModifiedStat(((SecondaryAttrNames)i).ToString(), this); } setupModifiers(); CalcSecondaryAttr(); }
public void Init() { destroyShipSound = new DestroyShipSound(); rigidbody = GetComponent <Rigidbody2D>(); BaseStat = Data.BaseStatsData.baseStats.Find(x => x.name == BaseStatName); statMultiplier = Data.StatMultiplierData.statMultipliers.Find(x => x.name == StatMultiplierName); // Установка всех current полей CurrentShootingSpeed = BaseStat.BaseShootingSpeed * statMultiplier.ShootingSpeedMultiplier; CurrentMoveingSpeed = BaseStat.BaseMovingSpeed * statMultiplier.MovingSpeedMultiplier; CurrentMobility = BaseStat.BaseMobility * statMultiplier.MobilityMultiplier; CurrentHealth = BaseStat.BaseHealth * statMultiplier.HealthMultiplier; destroyExplosionGameObject = Resources.Load(destroyExplosionPath) as GameObject; if (ShowHealthBar) { healthBarPrefab = Resources.Load(healthBarPath) as GameObject; healthBarGameObject = PoolManager.SpawnObject(healthBarPrefab, PoolManager.Type.UI); healthBar = healthBarGameObject.GetComponent <HealthBar>(); healthBar.objectTransform = transform; healthBar.StartHealth = CurrentHealth; healthBar.UpdateBar(CurrentHealth); healthBar.Init(); } CurrentWeapon.Init(shootPoins); isInit = true; }
public BaseChar(string charName, int level, int exp, Class charClass, Texture2D image): this() { this.charName = charName; this.level = level; this.exp = exp; this.charClass = charClass; this.image = image; attributes = new BaseStat[Enum.GetValues(typeof(AttrNames)).Length]; secondaryAttr = new ModifiedStat[Enum. GetValues(typeof(SecondaryAttrNames)).Length]; for (int i = 0; i < attributes.Length; i++) attributes[i] = new BaseStat(((AttrNames)i).ToString()); setAttributeDescriptions(); for (int i = 0; i < secondaryAttr.Length; i++) secondaryAttr[i] = new ModifiedStat(((SecondaryAttrNames)i).ToString(), this); setSecondaryAttributeDescriptions(); setupModifiers(); CalcSecondaryAttr(); }
public void TestACharacterAgilityIsThree() { GenericCharacter GC = GenericCharacter.GCFactory(); BaseStat testStat = GC.GetBaseStat("Agility"); Assert.AreEqual(3, testStat.Value); }
public ActivePokemon(List <BaseStat> baseStatList) { baseStat = baseStatList[0]; Random random = new Random(); IVHP = random.Next(0, 31); IVAttack = random.Next(0, 31); IVDefense = random.Next(0, 31); IVSPAtk = random.Next(0, 31); IVSPDef = random.Next(0, 31); IVSpeed = random.Next(0, 31); nature = (NatureType)random.Next(0, 24); EVHP = 0; EVAttack = 0; EVDefense = 0; EVSPAtk = 0; EVSPDef = 0; EVSpeed = 0; status = MajorStatus.None; isNamed = false; nickname = baseStat.Name; level = 1; currentHP = HP; move = new ActiveMove[4]; move[0] = null; move[1] = null; move[2] = null; move[3] = null; }
private void RemoveStat(BaseStat stat) { if (stats.Contains(stat)) { stats.Remove(stat); } }
public int GetBaseStat(BaseStat stat) { switch (stat) { case BaseStat.Strength: return(Strength); case BaseStat.Dexterity: return(Dexterity); case BaseStat.Constitution: return(Constitution); case BaseStat.Intelligence: return(Intelligence); case BaseStat.Wisdom: return(Wisdom); case BaseStat.Charisma: return(Charisma); default: return(0); } }
public Statistic(int str, int dex, int vit, int inte) { stats = new List <BaseStat>(); health = new BaseStat("Health", 1, 100); stats.Add(health); energy = new BaseStat("Energy", 0, 100); stats.Add(energy); strenght = new BaseStat("Strenght", 0, 0); stats.Add(strenght); dexterity = new BaseStat("Dexterity", 0, 0); stats.Add(dexterity); vitality = new BaseStat("Vitality", 0, 0); stats.Add(vitality); intelligence = new BaseStat("Intelligence", 0, 0); stats.Add(intelligence); speed = new BaseStat("Speed", 0, 0); stats.Add(speed); awareness = new BaseStat("Awareness", 0, 0); stats.Add(awareness); attack = new BaseStat("Attack", 0, 0); stats.Add(attack); defence = new BaseStat("Defence", 0, 0); stats.Add(defence); Strenght = str; Dexterity = dex; Vitality = vit; Intelligence = inte; if (!calculated) { Calculate(); } }
void AddStats(ExperienceStat stat) { Debug.Log("Here in callback"); BaseStat baseStat = new BaseStat("Experience", StatType.ExperienceStat, deathExperience); playerStats.ExperienceStat.AddStat(baseStat); playerStats.OnEnemyDeath -= AddStats; }
public void AddBuff(BaseStat stat, int mod) { try { buffs.Add (stat.Name, mod); } catch (Exception e) { Debug.LogWarning (e.ToString ()); } }
/// <summary> /// Changes the basepokemon for this pokemon /// used for evolution /// </summary> /// <param name="name">name of pokemon to change to</param> public void changeBasePokemon(String name) { baseStat = BaseStatsList.GetBaseStats(name); if (!isNamed) //if the pokemon has no nickname { nickname = baseStat.Name; //change the pokemon's name to the new species' name } }
public void AddBuff(BaseStat stat, int mod) { try{ buffs.Add(stat.Name, mod); }catch (Exception e) { Debug.LogWarning(e.ToString()); } }
public BaseChar(string charName, int level, int exp, BaseStat[] attributes, Class charClass, Texture2D image): this(charName, level, exp, charClass, image) { this.attributes = attributes; setAttributeDescriptions(); setSecondaryAttributeDescriptions(); CalcSecondaryAttr(); }
private void InitializeDefaultStats() { for (int i = 0; i < statTemplate.stats.Count; i++) { BaseStat newStat = new BaseStat(statTemplate.stats[i].stat, statTemplate.stats[i].maxValue, statTemplate.stats[i].maxValue); //Debug.Log("Adding " + newStat.statType.ToString() + " with a value of " + newStat.MaxValue); baseStats.Add(newStat); } }
public void SetUp() { baseStat = GetComponent <BaseStat>(); rb = GetComponent <Rigidbody>(); rb.velocity = Vector3.zero; ResetPosition(); initialYPos = transform.position.y; }
public void TestACharacterAgilityIsFourAfterIncrement() { GenericCharacter GC = GenericCharacter.GCFactory(); GC.myStats.Agility.Value++; BaseStat testStat = GC.GetBaseStat("Agility"); Assert.AreEqual(4, testStat.Value); }
public Character() { Id = -1; AccountId = -1; SoulId = -1; Created = DateTime.Now; MapId = -1; X = 0; Y = 0; Z = 0; Slot = 0; Name = null; Level = 0; ////// WeaponType = 8; AdventureBagGold = 80706050; eventSelectExecCode = -1; Hp = new BaseStat(1000, 1000); Mp = new BaseStat(450, 500); Od = new BaseStat(150, 200); shortcutBar0Id = -1; shortcutBar1Id = -1; shortcutBar2Id = -1; shortcutBar3Id = -1; shortcutBar4Id = -1; takeover = false; skillStartCast = 0; battleAnim = 0; hadDied = false; _state = (int)CharacterState.NormalForm; inventoryItems = new List <InventoryItem>(); inventoryBags = new List <Bag>(); Bag bag = new Bag(); bag.StorageId = 0; bag.NumSlots = 24; inventoryBags.Add(bag); helperText = true; helperTextBlacksmith = true; helperTextDonkey = true; helperTextCloakRoom = true; beginnerProtection = 1; currentEvent = null; secondInnAccess = false; _characterActive = true; killerInstanceId = 0; secondInnAccess = false; partyId = 0; InstanceId = 0; Name = ""; ClassId = 0; unionId = 0; criminalState = 0; helperTextAbdul = true; mapChange = false; }
public void AddStat(BaseStat stat) { if (IsStatAlreadyPresent(stat.Type)) { Debug.LogError("Duplicate Stat"); return; } stats.Add(stat); }
private static BaseStat[] setupThomsStat() { BaseStat[] attr; attr = new BaseStat[Enum.GetValues(typeof(AttrNames)).Length]; for (int i = 0; i < attr.Length; i++) attr[i] = new BaseStat(((AttrNames)i).ToString()); attr[(int)AttrNames.Strength].baseValue = 20; attr[(int)AttrNames.Dexterity].baseValue = 30; attr[(int)AttrNames.Vitality].baseValue = 20; attr[(int)AttrNames.Soulpower].baseValue = 10; attr[(int)AttrNames.Technique].baseValue = 20; return attr; }
public BaseChar() { charName = "Joe Doe"; charClass = Classes.Stormer; level = 1; exp = 0; weight = 70; height = 180; image = new Texture2D(0, 0); Items = new Inventory(new Item[0]); attributes = new BaseStat[Enum.GetValues(typeof(AttrNames)).Length]; secondaryAttr = new ModifiedStat[Enum. GetValues(typeof(SecondaryAttrNames)).Length]; for (int i = 0; i < attributes.Length; i++) attributes[i] = new BaseStat(((AttrNames)i).ToString()); for (int i = 0; i < secondaryAttr.Length; i++) secondaryAttr[i] = new ModifiedStat(((SecondaryAttrNames)i).ToString(), this); setupModifiers(); CalcSecondaryAttr(); }
public BaseChar(string charName, int level, int exp, BaseStat[] attributes, Class charClass, Texture2D image, Item[] items): this(charName, level, exp, attributes, charClass, image) { this.Items = new Inventory(items); }
protected bool Equals(BaseStat other) { return BaseValue.Equals(other.BaseValue) && BaseMultiplier.Equals(other.BaseMultiplier); }
public void RemoveBuff(BaseStat stat) { buffs.Remove(stat.Name); }
public void AddBuff(BaseStat stat, int mod) { buffs.Add(stat.Name, mod); }
public RatioLinker(BaseStat stat, float ratio) : base(stat) { this.ratio = ratio; }
public void SetDefaults() { if (StatsList.Count == 0) { StatsList = new List<BaseStat> (); BaseStat NewHealthStat = new BaseStat (); NewHealthStat.Name = "Health"; NewHealthStat.SetDefaults (); //NewHealthStat.Regeneration = BaseRegen; StatsList.Add (NewHealthStat); BaseStat NewManaStat = new BaseStat (); NewManaStat.Name = "Mana"; NewManaStat.SetDefaults (); //NewManaStat.Regeneration = BaseRegen; StatsList.Add (NewManaStat); BaseStat NewEnergy = new BaseStat (); NewEnergy.Name = "Energy"; NewEnergy.SetDefaults (); //NewEnergy.Regeneration = BaseRegen; StatsList.Add (NewEnergy); { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Strength"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Vitality"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Intelligence"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Wisdom"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Agility"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Dexterity"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Luck"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } { Attribute NewAttribute = new Attribute (); NewAttribute.Name = "Charisma"; NewAttribute.SetDefaults (); AttributeList.Add (NewAttribute); } UpdateAllBaseStats (); } }
public void RemoveBuff( BaseStat bs ) { buffs.Remove( bs.Name ); }
public void AddBuff( BaseStat bs, int modifier) { buffs[bs.Name] = modifier; }
protected static bool IsNull(BaseStat obj) { return ReferenceEquals(obj, null); }
public StatLinker(BaseStat stat) { LinkedStat = stat; ModifiableStat s = LinkedStat as ModifiableStat; s.OnValueChange += OnLinkedStatValueChange; }