Esempio n. 1
0
 public ItemStats(Poe.Entity item)
 {
     this.item = item;
     if (ItemStats.translate == null)
     {
         ItemStats.translate = new ItemStats.StatTranslator();
     }
     this.stats = new float[Enum.GetValues(typeof(ItemStat)).Length];
     this.ParseSockets();
     this.ParseExplicitMods();
     if (item.HasComponent<Weapon>())
     {
         this.ParseWeaponStats();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Returns the nearby regions that surround this one as well as this region itself.
        /// </summary>
        public IEnumerable <IRegion> GetNearbyInclusive()
        {
            return(_nearbyRegions ?? (_nearbyRegions = new[]
            {
                Poe.GetRegionByRegionCoordinate(X + 1, Y),
                Poe.GetRegionByRegionCoordinate(X + 1, Y + 1),
                Poe.GetRegionByRegionCoordinate(X + 1, Y - 1),

                Poe.GetRegionByRegionCoordinate(X - 1, Y),
                Poe.GetRegionByRegionCoordinate(X - 1, Y + 1),
                Poe.GetRegionByRegionCoordinate(X - 1, Y - 1),

                this,
                Poe.GetRegionByRegionCoordinate(X, Y + 1),
                Poe.GetRegionByRegionCoordinate(X, Y - 1)
            }));
        }
Esempio n. 3
0
 public Inventory(PathOfExile Poe, Poe.Inventory InternalInventory)
 {
     this.Poe = Poe;
     this.InternalInventory = InternalInventory;
 }
Esempio n. 4
0
		public LegacyInventory(GameController poe, Poe.RemoteMemoryObjects.Inventory internalInventory)
		{
			Poe = poe;
			InternalInventory = internalInventory;
		}
Esempio n. 5
0
        private void RenderHealthBar(RenderingContext rc, Poe.Camera camera, Healthbar current, float clientWidth, float clientHeight)
        {
            Vec3 worldCoords = current.entity.Pos;
            Vec2 mobScreenCoords = camera.WorldToScreen(worldCoords.Translate(0f, 0f, -170f));
            // System.Diagnostics.Debug.WriteLine("{0} is at {1} => {2} on screen", current.entity.Path, worldCoords, mobScreenCoords);
            if (mobScreenCoords == Vec2.Empty) return;

            int scaledWidth = (int) (current.settings.Width*clientWidth);
            int scaledHeight = (int) (current.settings.Height*clientHeight);
            Color color = current.settings.Color;
            Color color2 = current.settings.Outline;
            Color percentsTextColor = current.settings.PercentTextColor;
            float hpPercent = current.entity.GetComponent<Life>().HPPercentage;
            float esPercent = current.entity.GetComponent<Life>().ESPercentage;
            float hpWidth = hpPercent*scaledWidth;
            float esWidth = esPercent*scaledWidth;
            Rect bg = new Rect(mobScreenCoords.X - scaledWidth/2, mobScreenCoords.Y - scaledHeight/2, scaledWidth,
                scaledHeight);
            if (current.entity.IsHostile && hpPercent <= 0.1)
                // Set healthbar color to configured in settings.txt for hostiles when hp is <=10%
            {
                color = current.settings.Under10Percent;
            }
            // Draw healthbar
            this.DrawEntityHealthbar(color, color2, bg, hpWidth, esWidth, rc);

            // Draw percents or health text for hostiles. Configurable in settings.txt
            if (current.entity.IsHostile)
            {
                int curHp = current.entity.GetComponent<Life>().CurHP;
                int maxHp = current.entity.GetComponent<Life>().MaxHP;
                string monsterHpCorrectString = this.GetCorrectMonsterHealthString(curHp, maxHp);
                string hppercentAsString = ((int) (hpPercent*100)).ToString();
                Color monsterHpTextColor = (hpPercent <= 0.1)
                    ? current.settings.HealthTextColorUnder10Percent
                    : current.settings.HealthTextColor;

                if (current.settings.PrintPercents)
                    this.DrawEntityHealthPercents(percentsTextColor, hppercentAsString, bg, rc);
                if (current.settings.PrintHealthText)
                    this.DrawEntityHealthbarText(monsterHpTextColor, monsterHpCorrectString, bg, rc);
            }
        }
Esempio n. 6
0
 public Inventory(GameController Poe, Poe.Inventory InternalInventory)
 {
     this.Poe = Poe;
     this.InternalInventory = InternalInventory;
 }