Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 void Start()
 {
     ps = GetComponent<ParticleSystem>();
     audioSource = (AudioSource)GameObject.FindWithTag("GameManager").GetComponent(typeof(AudioSource)); ;
     parentStats = GetComponent<Stats> ();
     gm = (GameManagement)GameObject.FindWithTag("GameManager").GetComponent(typeof(GameManagement));
 }
 void Start()
 {
     target = GameObject.FindGameObjectWithTag("Player");
     m_spriteRenderer = GetComponent<SpriteRenderer>();
     m_playerStats = target.GetComponent<Stats> ();
     m_life = m_playerStats.m_life;
 }
Ejemplo n.º 3
0
        public INVCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheHelpCommandHandler = MyHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheInventory = MyInventory;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats = MyStats;

            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                if (Settings.IsTradeBot == true)
                {
                    TheHelpCommandHandler.AddCommand("#inventory / #inv / #i - show what I am selling");
                    TheHelpCommandHandler.AddCommand("#invmembers / #im - member rates");
                    TheHelpCommandHandler.AddCommand("#inv - null");
                    TheHelpCommandHandler.AddCommand("#i - null");
                    TheHelpCommandHandler.AddCommand("#inb - null");
                    TheHelpCommandHandler.AddCommand("#sell - null");
                    TheHelpCommandHandler.AddCommand("#selling - null");
                    TheHelpCommandHandler.AddCommand("#im - null");
                    TheHelpCommandHandler.AddCommand("#invmember - null");
                    TheHelpCommandHandler.AddCommand("#invmemver - null");
                    TheHelpCommandHandler.AddCommand("#invmemvers - null");
                }
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
            }
        }
Ejemplo n.º 4
0
 public override void skillLogic(Entity mob, Stats stats)
 {
     Vector2 targetLocation = mob.headTransform.up * maxDistance + mob.headTransform.position;
     Vector2 startLocation = mob.headTransform.position + mob.headTransform.up;
     foreach (RaycastHit2D linecast in Physics2D.LinecastAll(startLocation, targetLocation)) {
         if (linecast.collider.CompareTag("Wall")) {
             targetLocation = linecast.point;
             break;
         }
     }
     GameObject powershot = new GameObject();
     SpriteRenderer spriteRenderer = powershot.AddComponent<SpriteRenderer>();
     spriteRenderer.sprite = Resources.Load<Sprite>("Skills/Powershot/PowershotLaser");
     spriteRenderer.sortingOrder = 4;
     powershot.transform.position = new Vector2(startLocation.x + (targetLocation.x - startLocation.x)/2, startLocation.y + (targetLocation.y - startLocation.y)/2);
     powershot.transform.rotation = mob.headTransform.rotation;
     powershot.transform.localScale = new Vector3(1f * properties["areaOfEffect"], Vector2.Distance(startLocation, targetLocation), 1f);
     BoxCollider2D collider = powershot.AddComponent<BoxCollider2D>();
     collider.isTrigger = true;
     collider.size = new Vector2(0.5f, 1f);
     PowershotEffect p = powershot.AddComponent<PowershotEffect>();
     p.mob = mob.gameObject.GetComponent<Mob>();
     AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Skills/Powershot/sniperShot"), mob.headTransform.position);
     for (int i = 0; i < Vector3.Distance(startLocation, targetLocation); i++) {
         GameObject arrowGlow = MonoBehaviour.Instantiate(Resources.Load("ShotGlow")) as GameObject;
         arrowGlow.GetComponent<Light>().intensity = 3;
         arrowGlow.transform.SetParent(powershot.transform);
         Vector3 position = startLocation + ((targetLocation - startLocation).normalized * i);
         arrowGlow.transform.position = new Vector3(position.x, position.y, -2);
     }
 }
        public RogueRotationCalculatorCombat(Character character, Stats stats, BossOptions bossOpts, CalculationOptionsRogue calcOpts, float hasteBonus, float mainHandSpeed, float offHandSpeed, float mainHandSpeedNorm,
            float offHandSpeedNorm, float avoidedWhiteMHAttacks, float avoidedWhiteOHAttacks, float avoidedMHAttacks, float avoidedOHAttacks, float avoidedFinisherAttacks,
            float avoidedPoisonAttacks, float chanceExtraCPPerHit, RogueAbilityStats mainHandStats, RogueAbilityStats offHandStats, RogueAbilityStats mainGaucheStats,
            RogueAbilityStats sStrikeStats, RogueAbilityStats rStrikeStats, RogueAbilityStats ruptStats, RogueAbilityStats evisStats, RogueAbilityStats snDStats, RogueAbilityStats exposeStats,
            RogueAbilityStats iPStats, RogueAbilityStats dPStats, RogueAbilityStats wPStats) : base(character, stats, bossOpts, calcOpts, hasteBonus, mainHandSpeed, offHandSpeed, mainHandSpeedNorm,
            offHandSpeedNorm, avoidedWhiteMHAttacks, avoidedWhiteOHAttacks, avoidedMHAttacks, avoidedOHAttacks, avoidedFinisherAttacks, avoidedPoisonAttacks, chanceExtraCPPerHit, mainHandStats,
            offHandStats, ruptStats, snDStats, exposeStats, iPStats, dPStats, wPStats)
        {
            SStrikeStats = sStrikeStats;
            RStrikeStats = rStrikeStats;
            EvisStats = evisStats;
            MainGaucheStats = mainGaucheStats;

            ChanceOnMGAttackOnMHAttack = RV.Mastery.MainGauche + RV.Mastery.MainGauchePerMast * StatConversion.GetMasteryFromRating(stats.MasteryRating);
            EnergyRegenMultiplier = (1f + RV.Mastery.VitalityRegenMult) * (1f + (RV.AR.Duration + (Talents.GlyphOfAdrenalineRush ? RV.Glyph.ARDurationBonus : 0f)) / RV.AR.CD * Talents.AdrenalineRush) * (1f + HasteBonus) - 1f;

            #region Probability tables
            float c = ChanceExtraCPPerHit, h = (1f - c), f = CPOnFinisher, nf = (1f - f);
            _averageNormalCP[1] = 1 * (f + nf * h) + 2 * (nf * c);
            _averageNormalCP[2] = 2 * (f * h + nf * c + nf * h * h) + 3 * (f * c);
            _averageNormalCP[3] = 3 * (f * c + f * h * h + 2 * nf * c * h + nf * h * h * h) + 4 * (f * h * c + nf * c * c + nf * h * h * c);
            _averageNormalCP[4] = 4 * (2 * f * c * h + f * h * h * h + nf * c * c + 3 * nf * c * h * h + nf * h * h * h * h) + 5 * (f * c * c + f * h * h * c + 2 * nf * c * h * c + nf * h * h * h * c);
            _averageNormalCP[5] = 5 * (f * c * c + 3 * f * c * h * h + f * h * h * h * h + 3 * nf * c * c * h + 4 * nf * c * h * h * h + nf * h * h * h * h * h) + 6 * (2 * f * c * h * c + f * h * h * h * c + nf * c * c * c + 3 * nf * c * h * h * c + nf * h * h * h * h * c);

            c = ChanceExtraCPPerHit + ChanceOnCPOnSSCrit * SStrikeStats.CritChance; h = (1f - c);
            _averageSStrikeCP[1] = 1 * (f + nf * h) + 2 * (nf * c);
            _averageSStrikeCP[2] = 2 * (f * h + nf * c + nf * h * h) + 3 * (f * c + nf * h * c);
            _averageSStrikeCP[3] = 3 * (f * c + f * h * h + 2 * nf * c * h + nf * h * h * h) + 4 * (f * h * c + nf * c * c + nf * h * h * c);
            _averageSStrikeCP[4] = 4 * (2 * f * c * h + f * h * h * h + nf * c * c + 3 * nf * c * h * h + nf * h * h * h * h) + 5 * (f * c * c + f * h * h * c + 2 * nf * c * h * c + nf * h * h * h * c);
            _averageSStrikeCP[5] = 5 * (f * c * c + 3 * f * c * h * h + f * h * h * h * h + 3 * nf * c * c * h + 4 * nf * c * h * h * h + nf * h * h * h * h * h) + 6 * (2 * f * c * h * c + f * h * h * h * c + nf * c * c * c + 3 * nf * c * h * h * c + nf * h * h * h * h * c);
            #endregion
        }
Ejemplo n.º 6
0
	public static Enemy createEnemy(string type, int round, Transform currSpawn, int firstGrid) {	
		 
		//cuando reinicio el juego, las variables estaticas se rompen, aca checkeo que no sean null, y si lo son, les asigno un valor 
		if (dieParticles == null) {
			dieParticles = (GameObject) Resources.Load("Prefabs/Particles/EnemyDieParticles");
		}
		if (enemyContainer == null) {
			enemyContainer = GameObject.Find("Enemies");
		}
		if (flubberTrisMat == null) {
			flubberTrisMat  = (Material) Resources.Load("Materials/Glow_OrangeAlt1");
		}
		if (player == null) {
			player = GameObject.FindGameObjectWithTag("Player");	
		}


		GameObject enemyGameObject;
		Enemy enemyInstance;
		
		Stats enemyStats = new Stats(type);
		
		enemyGameObject = (GameObject)Instantiate(enemyStats.prefab, currSpawn.position, enemyStats.prefab.transform.rotation);
		enemyGameObject.AddComponent<Enemy>();
		enemyInstance = (Enemy) enemyGameObject.GetComponent<Enemy>();

		enemyInstance.type = type;
		enemyInstance.damage = enemyStats.damage;	
		enemyInstance.GetComponent<HealthSystem>().calcHp(enemyStats.baseHP);
		enemyInstance.moveSpeed = enemyStats.moveSpeed;
		enemyInstance.baseAttInterval = enemyStats.interval;
		enemyInstance.id = Enemy.numerator;
		enemyInstance.name = enemyInstance.type + "-" + enemyInstance.id + "-" + Round.number;
		enemyInstance.anim = enemyGameObject.transform.FindChild("Model").GetComponent<Animation>();
		Enemy.numerator++;	
		enemyInstance.GetComponent<AIPathfinding>().originalGrid = firstGrid;
		
		if(enemyInstance.type=="spider") {
			dieParticles = (GameObject) Resources.Load("Prefabs/Particles/EnemyDieParticles2");
		}
		
		/*if (type=="flubber") {
			int a = Mathf.RoundToInt(Random.Range(0,1));
			Material mat;
			switch (a) {
				case 0:
					mat = (Material) Resources.Load("Materials/Glow_Orange");
					enemyGameObject.renderer.material = mat;
				break;
				case 1:
					mat = (Material) Resources.Load("Materials/Glow_OrangeAlt1");
					enemyGameObject.renderer.material = mat;
				break;
			}
			
		}*/
		
		
		return enemyInstance;	
	}
Ejemplo n.º 7
0
 public Defenses(Stats stats)
 {
     if (stats == null) {
         throw new ArgumentNullException("stats");
     }
     this.stats = stats;
 }
Ejemplo n.º 8
0
        //Simulate the activation and execution of each stage of the rocket,
        //and return stats for each stage
        public Stats[] SimulateAllStages(float throttle, double staticPressureKpa, double atmDensity, double machNumber)
        {
            Stats[] stages = new Stats[simStage];

            int maxStages = simStage - 1;

            double staticPressure = staticPressureKpa * KpaToAtmospheres;

            //print("SimulateAllStages starting from stage " + simStage + "; ticks from start = " + (Environment.TickCount - startTick));
            SimulateStageActivation();

            while (simStage >= 0)
            {
                //print("Simulating stage " + simStage + "(vessel mass = " + VesselMass() + ")");
                stages[simStage] = SimulateStage(throttle, staticPressure, atmDensity, machNumber);
                if (simStage != maxStages)
                    stages[simStage].stagedMass = stages[simStage + 1].endMass - stages[simStage].startMass;
                //print("Staging at t = " + t);
                SimulateStageActivation();
            }

            //print("SimulateAllStages ended");

            return stages;
        }
Ejemplo n.º 9
0
 public AbilityScores(Stats stats)
 {
     if (stats == null) {
         throw new ArgumentNullException("stats");
     }
     this.stats = stats;
 }
Ejemplo n.º 10
0
 void Awake()
 {
     _fsm = new FSM<CSTATES>();
     AddStates();
     AddTransitions();
     Instance = this;
 }
        public TreeStats(Character character, Stats stats, KeyValuePair<double, SpecialEffect>[] hasteProcs, double treeOfLifeUptime)
        {
            CalculationOptionsTree opts = character.CalculationOptions as CalculationOptionsTree;

            bool Restoration = (opts != null) ? opts.Restoration : true;

            Haste = new HasteStats(stats, hasteProcs);

            SpellCrit = StatConversion.GetSpellCritFromIntellect(stats.Intellect) + StatConversion.GetSpellCritFromRating(stats.CritRating) + stats.SpellCrit;

            SpellPower = (float)(stats.SpellPower + Math.Max(0f, stats.Intellect - 10));
            // TODO: does nurturing instinct actually work like this?
            SpellPower += character.DruidTalents.NurturingInstinct * 0.5 * stats.Agility;
            SpellPower *= (1 + stats.BonusSpellPowerMultiplier);

            TreeOfLifeUptime = treeOfLifeUptime;
            double mastery = 8.0f + StatConversion.GetMasteryFromRating(stats.MasteryRating);
            if(Restoration)
                Harmony = mastery * 0.0125f;

            SpellsManaCostReduction = stats.SpellsManaCostReduction + stats.NatureSpellsManaCostReduction;
            BonusCritHealMultiplier = stats.BonusCritHealMultiplier;

            PassiveDirectHealBonus = (Restoration ? 1.25f : 1.0f) + Harmony;
            PassivePeriodicHealBonus = (Restoration ? 1.25f : 1.0f) + opts.HarmonyPeriodicRate * Harmony + 0.02f * character.DruidTalents.Genesis;
            DirectHealMultiplier = (1 + stats.BonusHealingDoneMultiplier) * (1.0f + character.DruidTalents.MasterShapeshifter * 0.04f) * (1 + TreeOfLifeUptime * 0.15f);
            PeriodicHealMultiplier = DirectHealMultiplier * (1 + stats.BonusPeriodicHealingMultiplier);
            SpellsManaCostMultiplier = 1 - stats.ManaCostReductionMultiplier;

            Healed = stats.Healed + stats.HealedPerSP * SpellPower;
        }
Ejemplo n.º 12
0
    public static void Main(string[] args)
    {
        int simCount = 5000;
        if (args.Length == 1)
            simCount = int.Parse(args[0]);

        Deck d = new Deck();
        PokerHand hand = new PokerHand(d);

        Stats stats = new Stats();
        stats.simCount = simCount;
        for (int i=0;i<simCount;i++)
        {
            // worry counter
            if ((i%1000)==0)
                Console.Write("*");
            d.shuffle();
            hand.pullCards();
            hand.Sort();
            POKERSCORE ps = PokerLogic.score(hand);
            stats.Append(ps);
        }
        Console.WriteLine();
        stats.Report();
    }
Ejemplo n.º 13
0
	// Use this for initialization
	void Start () {
        //stat = new Stats(100f,1f,1f,1f,1f,1f,1f);
        stat = new Stats();

        currentDivinity = stat.playerDivinity;
	
	}
 void OnStatsHPChange(Stats stat, float delta) {
     if(mEnt.gameObject.activeInHierarchy) {
         if(stat.curHP > 0.0f && delta < 0.0f) {
             mEnt.Blink(blinkDelay);
         }
     }
 }
Ejemplo n.º 15
0
        public Client(ClientIdentifier id)
        {
            Id = id;

            var stats = new Stats { Atk = 10, Def = 10, HP = 30, SpAtk = 10, SpDef = 10, Speed = 10 };
            var data = new PokemonData { Id = 0, Type1 = PokemonType.Normal, BaseStats = stats };

            var moveData = new MoveData
            {
                Name = "Move",
                Accuracy = 100,
                Damage = 120,
                DamageType = DamageCategory.Physical,
                PokemonType = PokemonType.Normal,
                PP = 20
            };

            for (int i = 0; i < 6; i++)
            {
                var pkmn = new Pokemon(data, stats) { Name = Id.Name + "_Pkmn" + i, Level = i + 20};
                for (int j = 0; j < 2; j++)
                    pkmn.SetMove(j, new Move(moveData));
                pkmn.Stats.HP = 30;
                pkmn.HP = 30;

                pokemons.Add(pkmn);
            }
        }
Ejemplo n.º 16
0
        public DKTANK()
        {
            // TODO: Add constructor logic here

            weap = new Stats();
            weap.Strength = 10;
            weapon = new Item("test", ItemQuality.Common, ItemType.OneHandSword, 10101, "icon.bmp", ItemSlot.OneHand, "", false,
                weap, weap, ItemSlot.None, ItemSlot.None, ItemSlot.None, 100, 200, ItemDamageType.Physical, 3.8f, "Death Knight");

            m_char = new Character();
            string szXML = System.IO.File.ReadAllText("..\\..\\..\\..\\Rawr\\Rawr.UnitTests\\testdata\\~Test_Rawr4_Blood2h.xml");
            m_char = Character.LoadFromXml(szXML);
            if (m_char.Class == CharacterClass.Druid)
            {
                // This means it didn't load properly.
                m_char.Class = CharacterClass.DeathKnight;
                // So a weapon, so we have values in weapon specific abilities.
                m_char.MainHand = new ItemInstance(weapon, 0, null, null, null, new Enchant(), new Reforging(), new Tinkering());
                // Some talents.
                // Blood Talents.
                m_char.DeathKnightTalents = new DeathKnightTalents("03322203130022011321000000000000000000000000000000000000000.00000000000000000000000000000");
            }
            m_char.CurrentModel = "TankDK";
            if (m_char.BossOptions == null || m_char.BossOptions.Attacks.Count <= 0)
            {
                BossList list = new BossList();
                BossHandler testboss = new BossHandler();
                testboss = list.GetBossFromName("Pit Lord Argaloth");

                m_char.BossOptions = new BossOptions();
                m_char.BossOptions.CloneThis(testboss);
            }
        }
Ejemplo n.º 17
0
    public void UpdateStats(Stats NewStats)
    {
        CharacterStats = NewStats;

        Health = MaxHealth = CalculateMaxHeatlh(CharacterStats.Strength, CharacterStats.Dexterity);
        Mana = MaxMana = CalculateMaxMana(CharacterStats.Wisdom);
    }
Ejemplo n.º 18
0
	// Use this for initialization
	void Start () {
        stats = gameObject.GetComponent<Stats>();
        stats.health = 80;
        stats.strength = 80;
        stats.defense = 20;
        stats.magic = 0;
	}
Ejemplo n.º 19
0
        public PRIZECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Logger MyLogger, ActorHandler MyActorHandler)
        {
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheMessageParser = MyMessageParser;
            this.TheHelpCommandHandler = MyHelpCommandHandler;
            this.TheMySqlManager = MyMySqlManager;
            this.TheInventory = MyInventory;
            this.TheTradeHandler = MyTradeHandler;
            this.TheStats = MyStats;
            this.TheActorHandler = MyActorHandler;
            this.TheLogger = MyLogger;
            this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);

            //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid);

            //if (CommandIsDisabled == false)
            {
                if (Settings.IsTradeBot == true && TheMySqlManager.IGamble())
                {
                    TheHelpCommandHandler.AddCommand("#prize - show my prize list");
                    TheHelpCommandHandler.AddCommand("#prizes - null");
                }
                TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
                this.TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(OnGotNewInventoryList);
                this.TheMessageParser.Got_AbortTrade += new BasicCommunication.MessageParser.Got_AbortTrade_EventHandler(OnGotAbortTrade);
            }
        }
Ejemplo n.º 20
0
 public Stats GetStats()
 {
     if (stats == null){
         stats = gameObject.GetComponentInParent<Stats>();
     }
     return stats;
 }
		public virtual Stats Ping(string endpoint, int timeout, Dictionary<string, string> parameters = null)
		{
			IHttpWebRequestWrapper request = GetRequestWrapper(endpoint, timeout, parameters);

			Stats stats = new Stats { EndPoint = endpoint };
			DateTime before = DateTime.Now;

			try
			{
				using (IHttpWebResponseWrapper response = request.GetHttpResponse())
				{
					stats.Success = IsRequestSuccess(response);
				}
			}
			catch (WebException ex)
			{
				stats.Success = false;
				stats.Exception = ex;
				stats.OperationTimedOut = (ex.Status == WebExceptionStatus.Timeout);
			}
			finally
			{
				DateTime after = DateTime.Now;
				stats.Speed = after - before;

				stats.Message = stats.Success
					? "ok"
					: stats.OperationTimedOut
						? "timed out"
						: "failed";
			}
			
			return stats;
		}
Ejemplo n.º 22
0
 protected void Start()
 {
     if (mutationName != "" && this.gameObject.GetComponent<Mutations>() != null) { //If you levae a mutationName empty it will not account for it, so use this if you want non-tranferable mutations
         if (!this.gameObject.GetComponent<Mutations>().mutations.Contains(mutationName)) {
             this.gameObject.GetComponent<Mutations>().mutations.Add(mutationName); //adds mutation to this bacteria's current list of mutations
         }
         List<string> wedge;
     }
     stats = this.gameObject.GetComponent<Stats> ();
     MutationInstance = null;
     if (MutationObject != null) {
         MutationInstance =(GameObject)Instantiate (MutationObject);
         Vector3 ang = transform.eulerAngles; //holds current rotation for simple no-math solution
         Vector3 scale = transform.localScale;
         transform.localScale = Vector3.one;
         transform.eulerAngles = Vector3.zero;
         MutationInstance.transform.position = new Vector3(transform.position.x + MutationInstance.transform.position.x,transform.position.y + MutationInstance.transform.position.y,transform.position.z + MutationInstance.transform.position.z);
         MutationInstance.transform.SetParent(this.gameObject.transform); //attaches the new mutation to its owner
         transform.eulerAngles = ang;
         transform.localScale = scale;
     }
     //all set changes for mutations from public input are made onto the cell's stats
     stats.maxHealth += maxHealth;
     stats.metabolism += metabolism;
     stats.maturation += maturation;
     stats.reproductionEfficiency += reproductionEfficiency;
     stats.aggression += aggression;
     stats.herbivorism += herbivorism;
     stats.carnivoreism += carnivoreism;
     stats.sightRadius += sightRadius;
     stats.damage += damage;
     stats.speed += speed;
     stats.healing += healing;
     stats.notifyInitialized(this);
 }
        /// <param name="stats">
        /// This should already have buffStats factored in.
        /// </param>
        public CharacterCalculationsWarlock(Character character, Stats stats, Stats petBuffs)
        {
            Character = character;
            CalcOpts = character.CalculationOptions as CalculationOptionsWarlock;
            BossOpts = character.BossOptions;
            Talents = character.WarlockTalents;
            Stats = stats;
            PreProcStats = Stats.Clone();
            PetBuffs = petBuffs;
            BaseMana = BaseStats.GetBaseStats(character).Mana;
            BaseIntellect = BaseStats.GetBaseStats(character).Intellect;
            Spells = new Dictionary<string, Spell>();
            CastSpells = new Dictionary<string, Spell>();
            HitChance = Math.Min(1f, CalcOpts.GetBaseHitRate() / 100f + CalcSpellHit());

            int temp;
            if (character.SetBonusCount.TryGetValue("Shadowflame Regalia", out temp))
            {
                Warlock_T11_2P = (temp >= 2);
                Warlock_T11_4P = (temp >= 4);
            }

            if (!CalcOpts.Pet.Equals("None") && (Demonology || !CalcOpts.Pet.Equals("Felguard")))
            {
                Type type = Type.GetType("Rawr.Warlock." + CalcOpts.Pet);
                Pet = (Pet)Activator.CreateInstance(type, new object[] { this });
            }

            float personalDps = CalcPersonalDps();
            float petDps = CalcPetDps();
            SubPoints = new float[] { personalDps, petDps };
            OverallPoints = personalDps + petDps;
        }
Ejemplo n.º 24
0
    public void OnTriggerEnter(Collider col)
    {
        if(col.gameObject.GetComponent(typeof(Movement_Controller)) as Movement_Controller != null)
        {
            playerItemPickUp = col.transform.FindChild("ItemPickUp").transform;
            control = col.gameObject.GetComponent(typeof(Movement_Controller)) as Movement_Controller;

            if(type == ItemType.Gun)
                control.usingGun = true;

            if(type == ItemType.Useable)
            {
                //The useable item script should be attached to this Object.
                this.gameObject.transform.parent = control.transform;
                control.SpacebarItem = GetComponent(typeof(UseableItem)) as UseableItem;
                control.SpacebarItem.controller = control;
            }
            playerStats = col.gameObject.GetComponent(typeof(Stats)) as Stats;

            if(playerStats.GetHealth() == playerStats.Health && type == ItemType.HealthPotion)
            {
                direction = control.preMovement;
                rigidbody.AddForce(direction * 1000f);
                return;
            }
            player = control.player;	//Bone animation reference
            pItem = col.gameObject.GetComponent(typeof(PlayerItems)) as PlayerItems;
            iEvent.ItemEvent(playerStats);
            myItem.SetActiveRecursively(false);
            StartCoroutine(GrabItem() );
        }
    }
Ejemplo n.º 25
0
        public CombatFactors(Character character, Stats stats) {
            _stats = stats;
			_mainHand = character.MainHand == null ? new Knuckles() : character.MainHand.Item;
			_offHand = character.OffHand == null ? new Knuckles() : character.OffHand.Item;
            _calcOpts = character.CalculationOptions as CalculationOptionsRogue;
            _character = character;
        }
Ejemplo n.º 26
0
 void Start()
 {
     characterArgs = null;
     foreach (Character character in Characters)
     {
         character.Parent = CharacterObject;
     }
     //TODO: Do Characters and Enemies need to be used as IList<Battler>?
     battleBox.AllCharacters = Characters;
     battleBox.AllEnemies = Enemies;
     foreach (Enemy enemy in Enemies)
     {
         enemy.Parent = EnemyObject;
     }
     if (Characters.Count == 0)
     {
         Debug.Log("Error: No ememies");
     }
     foreach (IBattler c in Characters)
     {
         playerStats = c.Stats;
     }
     battleEnd = false;
     wait = false;
     if (InitializeUI != null)
     {
         InitializeUI(playerStats);
     }
     StartCoroutine(Run());
 }
Ejemplo n.º 27
0
 void InitializeUI(Stats stats)
 {
     name.text = stats.characterName;
     maxHP.text = '/' + stats.maxHP.ToString();
     maxSP.text = '/' + stats.maxSP.ToString();
     UpdateLifebar(stats);
 }
Ejemplo n.º 28
0
 void OnEnable()
 {
     myStats = GetComponentInParent<Stats> ();
     if (myStats)
         this.AddObserver (OnCounterWillChange, Stats.WillChangeNotification (StatTypes.CTR), myStats);
     this.AddObserver (OnAutomaticHitCheck, HitRate.AutomaticHitCheckNotification);
 }
Ejemplo n.º 29
0
 public void OnEnable()
 {
     stat_templates.Add("Default", new Stats("Default"));
     Stats defr = new Stats("DefaultR");
     defr.can_range = true;
     stat_templates.Add("DefaultR", defr);
 }
Ejemplo n.º 30
0
        public DKDPS()
        {
            // TODO: Add constructor logic here

            weap = new Stats();
            weap.Strength = 10;
            weap.CritRating = 500;
            weapon = new Item("test", ItemQuality.Common, ItemType.OneHandSword, 10101, "icon.bmp", ItemSlot.OneHand, "", false,
                weap, weap, ItemSlot.None, ItemSlot.None, ItemSlot.None, 100, 200, ItemDamageType.Physical, 3.8f, "Death Knight");

            m_char = new Character();
            string szXML = System.IO.File.ReadAllText("..\\..\\..\\..\\Rawr\\Rawr.UnitTests\\testdata\\~Test_Rawr4_Unholy2h.xml");
//            string szXML = System.IO.File.ReadAllText("..\\..\\..\\..\\Rawr\\Rawr.UnitTests\\testdata\\~Test_Rawr4_Frost2h.xml");
            m_char = Character.LoadFromXml(szXML);
            if (m_char.Class == CharacterClass.Druid)
            {
                // This means it didn't load properly.
                m_char.Class = CharacterClass.DeathKnight;
                // So a weapon, so we have values in weapon specific abilities.
                m_char.MainHand = new ItemInstance(weapon, 0, null, null, null, new Enchant(), new Reforging(), new Tinkering());
                // Unholy DK
                m_char.DeathKnightTalents = new DeathKnightTalents("203200000000000000002000000000000000000003310321231031021231.010000001010100000010010000111");
            }
            m_char.CurrentModel = "DPSDK";

        }
Ejemplo n.º 31
0
        public BloodCycle(Character c, CombatTable t, Stats s, CalculationOptionsDPSDK opts, AbilityHandler a)
        {
            BP          = 0;
            FF          = 0;
            currentTime = 0;
            GCDTime     = 0;
            occurence   = new Rotation();
            //occurence.presence = calcOpts.rotation.presence;
            occurence.setRotation(Rotation.Type.Custom);
            occurence.NumDisease        = 0f;
            occurence.DiseaseUptime     = 100f;
            occurence.DeathCoil         = 0f;
            occurence.IcyTouch          = 0f;
            occurence.PlagueStrike      = 0f;
            occurence.ScourgeStrike     = 0f;
            occurence.ManagedRP         = false;
            occurence.FrostStrike       = 0f;
            occurence.HowlingBlast      = 0f;
            occurence.Obliterate        = 0f;
            occurence.BloodStrike       = 0f;
            occurence.HeartStrike       = 0f;
            occurence.DancingRuneWeapon = 0f;
            occurence.Horn                = 0f;
            occurence.GargoyleDuration    = 30f;
            occurence.DeathStrike         = 0f;
            occurence.GhoulFrenzy         = 0f;
            occurence.Pestilence          = 0f;
            occurence.CurRotationDuration = 60f;

            RP               = 0;
            FrostRune1       = 0;
            FrostRune2       = 0;
            UnholyRune1      = 0;
            UnholyRune2      = 0;
            BloodRune1       = 0;
            BloodRune2       = 0;
            DeathUnholyRune1 = 100 * 60 * 1000 * 100;
            DeathUnholyRune2 = 100 * 60 * 1000 * 100;
            DeathFrostRune1  = 100 * 60 * 1000 * 100;
            DeathFrostRune2  = 100 * 60 * 1000 * 100;
            horn             = 0;
            character        = c;
            combatTable      = t;
            stats            = s;
            talents          = c.DeathKnightTalents;
            calcOpts         = opts;
            if (opts.CurrentPresence == CalculationOptionsDPSDK.Presence.Unholy)
            {
                meleeGCD = 1000;
                spellGCD = 1000;
            }
            else
            {
                meleeGCD = 1500;
                spellGCD = (int)(1500 / ((1 + (StatConversion.GetHasteFromRating(stats.HasteRating, CharacterClass.DeathKnight))) * (1d + stats.SpellHaste)));
                if (spellGCD < 1000)
                {
                    spellGCD = 1000;
                }
            }

            PhysicalGCDMultiplier = (1 / (1 - (combatTable.dodgedSpecial + combatTable.missedSpecial)));
            SpellGCDMultiplier    = (1 / (1 - (combatTable.spellResist)));

            MHFrequency = (int)(combatTable.MH.hastedSpeed * 1000);
        }
Ejemplo n.º 32
0
    /// <summary>
    /// Enemy boss's tertiary attack
    /// </summary>
    public override void TertiaryAttack()
    {
        if (AttackCooldown > 0f)
        {
            return;
        }

        Anim.SetTrigger("TertiaryAttack");
        // audio
        StartCoroutine(AudioHelper.PlayAudioOverlap(WeaponAudio, tertiaryAttackSFX));

        StartCoroutine(VfxHelper.CreateVFX(tertiaryAttackVFX, gameObject.transform.position + new Vector3(0, 1f, 0), gameObject.transform.rotation,
                                           PlayerManager.colours.GetColour(Stats.characterColour), tertiaryAttackDelay * 0.5f));

        // Attack any enemies within the attack sweep and range
        foreach (GameObject player in Players.Where(player => CanDamageTarget(player.transform.position, attackRadius, attackAngle)))
        {
            // Calculate and perform damage
            StartCoroutine(PerformDamage(player.GetComponent <EntityStatsController>(), Stats.ComputeDamageModifer(), tertiaryAttackDelay * 0.5f));
        }
        AttackCooldown = tertiaryAttackCooldown;
    }
Ejemplo n.º 33
0
    /// <summary>
    /// Enemy boss's secondary attack
    /// </summary>
    public override void SecondaryAttack()
    {
        if (AttackCooldown > 0f)
        {
            return;
        }

        Anim.SetTrigger("SecondaryAttack");
        // audio
        StartCoroutine(AudioHelper.PlayAudioOverlap(WeaponAudio, secondaryAttackSFX));

        // Attack any enemies within the attack sweep and range
        foreach (GameObject player in Players.Where(player => CanDamageTarget(player.transform.position, attackRadius, attackAngle)))
        {
            // Calculate and perform damage
            StartCoroutine(PerformDamage(player.GetComponent <EntityStatsController>(), Stats.ComputeDamageModifer(), secondaryAttackDelay));
        }
        AttackCooldown = secondaryAttackCooldown;
    }
Ejemplo n.º 34
0
 void Start()
 {
     stats = GetComponent <Stats>();
     UpdateValues();
 }
Ejemplo n.º 35
0
 // Start is called before the first frame update
 void Start()
 {
     stats     = (Stats)GameObject.Find("Stats").GetComponent("Stats");
     skillTree = (SkillTree)GameObject.Find("SkillTree").GetComponent("SkillTree");
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Procesa un directorio particular
        /// </summary>
        public static void ProcessSimpleDir()
        {
            string DestinationDirectory = Globals.GetDestinationDirectory;

            if (string.IsNullOrWhiteSpace(DestinationDirectory))
            {
                DestinationDirectory = null;
            }
            Resize(Globals.GetSourceDirectory, DestinationDirectory);
            Log.LogConsoleDebugWriteLine(string.Format("Se ha terminado el proceso. Se han reducido {0} ficheros ahorrando {1} MB", Stats.FicherosReducidos, Stats.GetEspacioGanadoMB()));
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Comprime los ficheros de un directorio en particular
        /// </summary>
        public static void Resize(string sourcePath, string destinationPath = null)
        {
            if (string.IsNullOrWhiteSpace(destinationPath))
            {
                destinationPath = sourcePath;
            }
            var      Ficheros   = Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories);
            int      TotalCount = Ficheros.Count();
            int      Index      = 0;
            DateTime FlushDttm  = DateTime.MinValue;
            int      FlushCount = 0;

            foreach (string file in Ficheros)
            {
                Index++;


                //System.Diagnostics.Debug.WriteLine(string.Format("Procesando ficheros en tasación: {0}/{1}", Index, TotalCount));
                //string destinationFile = Path.Combine(destinationPath, Path.GetFileName(file));

                //Para no saturar la consola... La está saturando el itextsharp
                if (FlushDttm < DateTime.Now)
                {
                    FlushCount++;
                    FlushDttm = DateTime.Now.AddSeconds(10);
                    Log.LogConsoleDebugWriteLine(string.Format("Procesando ficheros: {0}/{1}. {2}", Index, TotalCount, file));
                    if (FlushCount > (6 * 5))//Cada 5 minutos
                    {
                        Log.LogConsoleDebugWriteLine(string.Format("Hasta el momento se han reducido {0} ficheros ahorrando {1} MB", Stats.FicherosReducidos, Stats.GetEspacioGanadoMB()));
                        FlushCount = 0;
                    }
                }


                string destinationFile = Path.Combine(destinationPath, file.Replace(sourcePath, string.Empty).TrimStart('\\'));

                try
                {
                    string extension = Path.GetExtension(file).ToLower();
                    switch (extension)
                    {
                    case ".pdf":
                    {
                        Globals.CheckSmaller(PdfHelper.Resize(file), file, destinationFile);
                        break;
                    }

                    case ".jpg":
                    case ".jpeg":
                    case ".png":
                    case ".tiff":
                    {
                        Globals.CheckSmaller(ImageHelper.Resize(file), file, destinationFile);
                        break;
                    }

                    case ".zip":
                    {
                        Globals.CheckSmaller(ZipHelper.Resize(file), file, destinationFile);
                        break;
                    }

                    default:
                    {
                        if (sourcePath != destinationPath)
                        {
                            File.Copy(file, destinationFile, true);
                        }
                        break;
                    }
                    }
                }
                catch (Exception ex)
                {
                    if (sourcePath != destinationPath)
                    {
                        File.Copy(file, destinationFile, true);
                    }
                }
            }
        }
Ejemplo n.º 38
0
 public static void GetNetDamages(Stats player, Stats enemy, out int playerNetDamage, out int enemyNetDamage)
 {
     playerNetDamage = Mathf.Max(0, player.Power - enemy.Defense);
     enemyNetDamage  = Mathf.Max(0, enemy.Power - player.Defense);
 }
Ejemplo n.º 39
0
 void Awake()
 {
     _mainTarget = GameObject.FindGameObjectWithTag("Castle");
     _controller = GetComponent <EnemyController>();
     _stats      = GetComponent <Stats>();
 }
Ejemplo n.º 40
0
        public override CharacterCalculationsBase GetCharacterCalculations(Character character, Item additionalItem)
        {
            Stats stats     = GetCharacterStats(character, additionalItem);
            Stats statsRace = GetRaceStats(character);
            CharacterCalculationsHolyPriest calculatedStats    = new CharacterCalculationsHolyPriest();
            CalculationOptionsPriest        calculationOptions = character.CalculationOptions as CalculationOptionsPriest;

            if (calculationOptions == null)
            {
                return(null);
            }

            calculatedStats.Race       = character.Race;
            calculatedStats.BasicStats = stats;
            calculatedStats.Talents    = character.Talents;

            calculatedStats.BasicStats.Health = (float)Math.Floor(calculatedStats.BasicStats.Health * (1 + character.Talents.GetTalent("Enlightenment").PointsInvested * 0.01f));
            calculatedStats.BasicStats.Spirit = (float)Math.Floor(calculatedStats.BasicStats.Spirit * (1 + character.Talents.GetTalent("Spirit of Redemption").PointsInvested * 0.05f));

            calculatedStats.SpiritRegen = (float)Math.Floor(5 * 0.0093271 * calculatedStats.BasicStats.Spirit * Math.Sqrt(calculatedStats.BasicStats.Intellect));

            calculatedStats.RegenInFSR = (float)Math.Floor((calculatedStats.BasicStats.Mp5 + character.Talents.GetTalent("Meditation").PointsInvested * 0.1f *
                                                            calculatedStats.SpiritRegen * (1 + calculatedStats.BasicStats.SpellCombatManaRegeneration)));
            calculatedStats.RegenOutFSR = calculatedStats.BasicStats.Mp5 + calculatedStats.SpiritRegen;

            calculatedStats.BasicStats.SpellCrit = (float)Math.Round((calculatedStats.BasicStats.Intellect / 80) +
                                                                     (calculatedStats.BasicStats.SpellCritRating / 22.08) + 1.24 + character.Talents.GetTalent("Holy Specialization").PointsInvested, 2);

            calculatedStats.BasicStats.Healing += calculatedStats.BasicStats.Spirit * character.Talents.GetTalent("Spiritual Guidance").PointsInvested * 0.05f;

            calculatedStats.HealPoints = calculatedStats.BasicStats.Healing
                                         + (calculatedStats.BasicStats.HealingDoneFor15SecOnUse2Min * 15f / 120f)
                                         + (calculatedStats.BasicStats.HealingDoneFor15SecOnUse90Sec * 15f / 90f)
                                         + (calculatedStats.BasicStats.HealingDoneFor20SecOnUse2Min * 20f / 120f)
                                         + (calculatedStats.BasicStats.SpiritFor20SecOnUse2Min * character.Talents.GetTalent("Spiritual Guidance").PointsInvested * 0.05f * 20f / 120f);

            float procSpiritRegen = 0;

            if (calculatedStats.BasicStats.SpiritFor20SecOnUse2Min > 0)
            {
                procSpiritRegen = ((float)Math.Floor(5 * 0.0093271 * calculatedStats.BasicStats.SpiritFor20SecOnUse2Min * Math.Sqrt(calculatedStats.BasicStats.Intellect)) * 20f / 120f);
                procSpiritRegen = procSpiritRegen * (100 - calculationOptions.TimeInFSR) * 0.01f +
                                  character.Talents.GetTalent("Meditation").PointsInvested * 0.1f * procSpiritRegen * (1 + calculatedStats.BasicStats.SpellCombatManaRegeneration) * calculationOptions.TimeInFSR * 0.01f;
            }

            float procSpiritRegen2 = 0;

            if (calculatedStats.BasicStats.BangleProc > 0)
            {
                procSpiritRegen2 = ((float)Math.Floor(5 * 0.0093271 * 130f * Math.Sqrt(calculatedStats.BasicStats.Intellect)) * 20f / 120f);
                procSpiritRegen2 = procSpiritRegen2 * (100 - calculationOptions.TimeInFSR) * 0.01f +
                                   character.Talents.GetTalent("Meditation").PointsInvested * 0.1f * procSpiritRegen2 * (1 + calculatedStats.BasicStats.SpellCombatManaRegeneration) * calculationOptions.TimeInFSR * 0.01f;
            }

            calculatedStats.RegenPoints = (calculatedStats.RegenInFSR * calculationOptions.TimeInFSR * 0.01f +
                                           calculatedStats.RegenOutFSR * (100 - calculationOptions.TimeInFSR) * 0.01f)
                                          + calculatedStats.BasicStats.MementoProc * 3f * 5f / (45f + 9.5f * 2f)
                                          + calculatedStats.BasicStats.ManaregenFor8SecOnUse5Min * 5f * (8f * (1 - calculatedStats.BasicStats.SpellHasteRating / 15.7f / 100f)) / (60f * 5f)
                                          + (calculatedStats.BasicStats.BonusManaPotion * 2400f * 5f / 120f)
                                          + procSpiritRegen + procSpiritRegen2
                                          + (calculatedStats.BasicStats.Mp5OnCastFor20SecOnUse2Min > 0 ? 588f * 5f / 120f : 0)
                                          + (calculatedStats.BasicStats.ManaregenOver20SecOnUse3Min * 5f / 180f)
                                          + (calculatedStats.BasicStats.ManaregenOver20SecOnUse5Min * 5f / 300f)
                                          + (calculatedStats.BasicStats.ManacostReduceWithin15OnHealingCast / (2.0f * 50f)) * 5f
                                          + (calculatedStats.BasicStats.FullManaRegenFor15SecOnSpellcast > 0?(((calculatedStats.RegenOutFSR - calculatedStats.RegenInFSR) / 5f) * 15f / 125f) * 5f: 0)
                                          + (calculatedStats.BasicStats.BangleProc > 0 ? (((calculatedStats.RegenOutFSR - calculatedStats.RegenInFSR) / 5f) * 0.25f * 15f / 125f) * 5f : 0);

            calculatedStats.HastePoints = calculatedStats.BasicStats.SpellHasteRating / 2f
                                          + calculatedStats.BasicStats.SpellHasteFor20SecOnUse2Min * 20f / 120f / 2f;

            calculatedStats.OverallPoints = calculatedStats.HealPoints + calculatedStats.RegenPoints + calculatedStats.HastePoints;

            return(calculatedStats);
        }
Ejemplo n.º 41
0
 private static void CMSave()
 {
     Stats.Export();
 }
Ejemplo n.º 42
0
 public void Init(Stats s)
 {
     m_Stats = s;
 }
Ejemplo n.º 43
0
 public void UpdateStats(Stats stats, string stationfaction)
 {
     stats.CommitCrime(Faction);
 }
Ejemplo n.º 44
0
 private static void CMLoad()
 {
     Stats.Import();
 }
Ejemplo n.º 45
0
 public void Use_When_Ware(FightStats fightStats, Stats stats, Item item)
 {
 }
Ejemplo n.º 46
0
 public void UpdateStats(Stats stats, string stationfaction)
 {
     stats.KillBond(AwardingFaction, VictimFaction, Reward);
 }
Ejemplo n.º 47
0
 public void Use_To_Open(Stats stats, Item item)
 {
 }
Ejemplo n.º 48
0
 public void UpdateStats(Stats stats, string stationfaction)
 {
     stats.CapShipAward(AwardingFaction, VictimFaction, Reward);
 }
Ejemplo n.º 49
0
 public void Use_In_Hands(Stats stats, Item item)
 {
 }
Ejemplo n.º 50
0
 public void Use_To_TakeOff(FightStats fightStats, Stats stats, Item item)
 {
 }
Ejemplo n.º 51
0
 public ConvesationStatisticsDTO GetConversationStatistics(Guid captureId, Guid investigationId)
 {
     return(Stats.GetStats(captureId, investigationId));
 }
Ejemplo n.º 52
0
 public void Use_On_Player(Stats stats, Item item)
 {
 }
Ejemplo n.º 53
0
 private void Start()
 {
     characterScript = GetComponent <CharacterScript>();
     stats           = GetComponent <Stats>();
 }
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     this.UpdateUi(MainWindow.UiStates.progress);
     Stats.SendMiscellaneousStatsAsync("DiskCompactionStats", "DiskCompaction Started", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, App.sOpt.vmname, App.sOpt.relaunch.ToString(), App.sOpt.s.ToString(), (string)null, "Android", 0);
     DiskCompactionHelper.Instance.StartCompaction();
 }
Ejemplo n.º 55
0
 public override void Initialize(CharacterStats player, Stats enemy)
 {
     upgrade(player, enemy);
     base.Initialize(player, enemy);
 }
Ejemplo n.º 56
0
 public IEnumerable <CaptureDTO> GetCaptureList(Guid investigationId)
 {
     return(Stats.GetCaptureList(investigationId));
 }
Ejemplo n.º 57
0
 public Stats getSpecialEffects(CalculationOptionsTankDK calcOpts, SpecialEffect effect)
 {
     Stats statsAverage = new Stats();
     Rotation rRotation = calcOpts.m_Rotation;
     if (effect.Trigger == Trigger.Use)
     {
         if (calcOpts.bUseOnUseAbilities == true)
             statsAverage.Accumulate(effect.GetAverageStats());
     }
     else
     {
         float trigger = 0f;
         float chance = effect.Chance;
         float duration = effect.Duration;
         float unhastedAttackSpeed = 2f;
         switch (effect.Trigger)
         {
             case Trigger.MeleeCrit:
             case Trigger.PhysicalCrit:
                 trigger = (1f / rRotation.getMeleeSpecialsPerSecond()) + (combatTable.combinedSwingTime != 0 ? 1f / combatTable.combinedSwingTime : 0.5f);
                 chance = combatTable.physCrits * effect.Chance;
                 unhastedAttackSpeed = (combatTable.MH != null ? combatTable.MH.baseSpeed : 2.0f);
                 break;
             case Trigger.MeleeHit:
             case Trigger.PhysicalHit:
                 trigger = (1f / (rRotation.getMeleeSpecialsPerSecond() * (combatTable.m_bDW ? 2 : 1))) + (combatTable.combinedSwingTime != 0 ? 1f / combatTable.combinedSwingTime : 0.5f);
                 chance = effect.Chance * (1f - (combatTable.missedSpecial + combatTable.dodgedSpecial));
                 unhastedAttackSpeed = (combatTable.MH != null ? combatTable.MH.baseSpeed : 2.0f);
                 break;
             case Trigger.CurrentHandHit:
             case Trigger.MainHandHit:
                 trigger = (1f / rRotation.getMeleeSpecialsPerSecond()) + (combatTable.MH.hastedSpeed != 0 ? 1f / combatTable.MH.hastedSpeed : 0.5f);
                 chance = effect.Chance * (1f - (combatTable.missedSpecial + combatTable.dodgedSpecial));
                 unhastedAttackSpeed = (combatTable.MH != null ? combatTable.MH.baseSpeed : 2.0f);
                 break;
             case Trigger.OffHandHit:
                 trigger = (1f / rRotation.getMeleeSpecialsPerSecond()) + (combatTable.OH.hastedSpeed != 0 ? 1f / combatTable.OH.hastedSpeed : 0.5f);
                 chance = effect.Chance * (1f - (combatTable.missedSpecial + combatTable.dodgedSpecial));
                 unhastedAttackSpeed = (combatTable.MH != null ? combatTable.MH.baseSpeed : 2.0f);
                 break;
             case Trigger.DamageDone:
             case Trigger.DamageOrHealingDone:
                 trigger = (1f / rRotation.getMeleeSpecialsPerSecond()) + (combatTable.combinedSwingTime != 0 ? 1f / combatTable.combinedSwingTime : 0.5f);
                 unhastedAttackSpeed = (combatTable.MH != null ? combatTable.MH.baseSpeed : 2.0f);
                 chance = effect.Chance * (1f - (combatTable.missedSpecial + combatTable.dodgedSpecial));
                 break;
             case Trigger.DamageSpellCast:
             case Trigger.SpellCast:
             case Trigger.DamageSpellHit:
             case Trigger.SpellHit:
                 trigger = 1f / rRotation.getSpellSpecialsPerSecond();
                 chance = 1f - combatTable.spellResist;
                 break;
             case Trigger.DamageSpellCrit:
             case Trigger.SpellCrit:
                 trigger = 1f / rRotation.getSpellSpecialsPerSecond();
                 chance = combatTable.spellCrits * effect.Chance;
                 break;
             case Trigger.DoTTick:
                 trigger = (rRotation.BloodPlague + rRotation.FrostFever) / 3;
                 break;
             case Trigger.DamageTaken:
             case Trigger.DamageTakenPhysical:
                 trigger = calcOpts.BossAttackSpeed;
                 chance *= 1f - (stats.Dodge + stats.Parry + stats.Miss);
                 unhastedAttackSpeed = calcOpts.BossAttackSpeed;
                 break;
             case Trigger.DamageTakenMagical:
                 trigger = calcOpts.IncomingFromMagicFrequency;
                 break;
             //////////////////////////////////
             // DK specific triggers:
             case Trigger.BloodStrikeHit:
             case Trigger.HeartStrikeHit:
                 trigger = rRotation.curRotationDuration / (rRotation.BloodStrike + rRotation.HeartStrike);
                 break;
             case Trigger.PlagueStrikeHit:
                 trigger = rRotation.curRotationDuration / rRotation.PlagueStrike;
                 break;
             case Trigger.RuneStrikeHit:
                 trigger = rRotation.curRotationDuration / rRotation.RuneStrike;
                 break;
             case Trigger.IcyTouchHit:
                 trigger = rRotation.curRotationDuration / rRotation.IcyTouch;
                 break;
             case Trigger.DeathStrikeHit:
                 trigger = rRotation.curRotationDuration / rRotation.DeathStrike;
                 break;
             case Trigger.ObliterateHit:
                 trigger = rRotation.curRotationDuration / rRotation.Obliterate;
                 break;
             case Trigger.ScourgeStrikeHit:
                 trigger = rRotation.curRotationDuration / rRotation.ScourgeStrike;
                 break;
             case Trigger.FrostFeverHit:
                 // Icy Talons triggers off this.
                 trigger = rRotation.curRotationDuration / rRotation.IcyTouch;
                 if (character.DeathKnightTalents.GlyphofHowlingBlast)
                     trigger += rRotation.curRotationDuration / rRotation.HowlingBlast;
                 break;
         }
         if (!float.IsInfinity(trigger) && !float.IsNaN(trigger))
         {
             if (effect.UsesPPM())
             {
                 // If effect.chance < 0 , then it's using PPM.
                 // Let's get the duration * how many times it procs per min:
                 float UptimePerMin = 0;
                 float fWeight = 0; 
                 if (duration == 0) // Duration of 0 means that it's a 1 time effect that procs every time the proc comes up.
                 {
                     fWeight = Math.Abs(effect.Chance) / 60 ;
                 }
                 else
                 {
                     UptimePerMin = duration * Math.Abs(effect.Chance);
                     fWeight = UptimePerMin / 60;
                 }
                 statsAverage.Accumulate(effect.Stats, fWeight);
             }
             else
             {
                 effect.AccumulateAverageStats(statsAverage, trigger, chance, unhastedAttackSpeed, calcOpts.FightLength * 60);
             }
         }
     }
     return statsAverage;
 }
Ejemplo n.º 58
0
 protected override void EndTurn(CharacterStats player, Stats self)
 {
     base.EndTurn(player, self);
     upgrade(player, self);
 }
Ejemplo n.º 59
0
 private void OnDisable()
 {
     this.RemoveObserver(OnExpWillChange, Stats.WillChangeNotification(StatTypes.EXP), stats);
     this.RemoveObserver(OnExpDidChange, Stats.DidChangeNotification(StatTypes.EXP), stats);
 }
Ejemplo n.º 60
0
 public void UnregisterFromLifespanManager()
 {
     Stats.UnregisterItem();
 }