示例#1
0
 public static void __RenderSpellslot(SpriteBatch spriteBatch, Vector2 v2Pos, Equipment.SpellSlot xSpellslot, PlayerView xView)
 {
     SpellDescription xSpellDesc = SpellCodex.GetSpellDescription(xSpellslot.enSpellType);
     ISpellActivation.PrereqConditionsMet enPrereqResult = xSpellDesc.GetActivation().ComparePrerequisites(xView);
     if (enPrereqResult == ISpellActivation.PrereqConditionsMet.Eligible)
     {
         if (xSpellslot.enPrereqMetLastFrame == ISpellActivation.PrereqConditionsMet.NotEnoughMana)
         {
             xSpellslot.iSpellReadyCounter = 1;
         }
         if (xSpellslot.iSpellReadyCounter > 0)
         {
             spriteBatch.End();
             SpriteEffectWrapper xEffectWrapper = Program.GetTheGame().dsxEffects["FlashWhite"];
             float fWhiteGrade = 1f;
             if (xSpellslot.iSpellReadyCounter < 6)
             {
                 fWhiteGrade = (float)xSpellslot.iSpellReadyCounter / 6f;
             }
             else if (xSpellslot.iSpellReadyCounter > 10)
             {
                 fWhiteGrade = 1f - (float)(xSpellslot.iSpellReadyCounter - 10) / 4f;
             }
             xEffectWrapper.xEffect.Parameters["WhiteGrade"].SetValue(fWhiteGrade);
             spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null, xEffectWrapper.xEffect);
         }
         Texture2D txX = xSpellDesc.txSmallIcon;
         spriteBatch.Draw(txX, v2Pos * 1f, null, Color.White, 0f, Utility.Vector2_ToInts(new Vector2((float)txX.Width, (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
         if (xSpellslot.iSpellReadyCounter > 0)
         {
             spriteBatch.End();
             spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null);
             xSpellslot.iSpellReadyCounter++;
             if (xSpellslot.iSpellReadyCounter >= 14)
             {
                 xSpellslot.iSpellReadyCounter = 0;
             }
         }
     }
     else if (enPrereqResult == ISpellActivation.PrereqConditionsMet.NotEnoughMana)
     {
         spriteBatch.End();
         SpriteEffectWrapper xEffectWrapper2 = Program.GetTheGame().dsxEffects["Desaturate"];
         Program.GetTheGame().dsxEffects["Desaturate"].xEffect.Parameters["Desaturation"].SetValue(0.9f);
         spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null, xEffectWrapper2.xEffect);
         Texture2D txX = xSpellDesc.txSmallIcon;
         spriteBatch.Draw(txX, v2Pos * 1f, null, Color.White, 0f, Utility.Vector2_ToInts(new Vector2((float)txX.Width, (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
         spriteBatch.End();
         spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null);
     }
     else if (enPrereqResult == ISpellActivation.PrereqConditionsMet.NotEligible_NeedTwoHand)
     {
         Texture2D txX = xSpellDesc.txSmallIcon;
         spriteBatch.Draw(txX, v2Pos, null, Color.White * 0.6f, 0f, Utility.Vector2_ToInts(new Vector2((float)txX.Width, (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
         txX = HudRenderComponent.tx2HPreReq;
         spriteBatch.Draw(txX, v2Pos, null, Color.White * 1f, 0f, Utility.Vector2_ToInts(new Vector2((float)(txX.Width - 4), (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
     }
     else if (enPrereqResult == ISpellActivation.PrereqConditionsMet.NotEligible_NeedOneHand)
     {
         Texture2D txX = xSpellDesc.txSmallIcon;
         spriteBatch.Draw(txX, v2Pos, null, Color.White * 0.6f, 0f, Utility.Vector2_ToInts(new Vector2((float)txX.Width, (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
         txX = HudRenderComponent.tx1HPreReq;
         spriteBatch.Draw(txX, v2Pos, null, Color.White * 1f, 0f, Utility.Vector2_ToInts(new Vector2((float)(txX.Width - 4), (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
     }
     if (xSpellslot.enSpellType == SpellCodex.SpellTypes._Magic_Ice_FrostyFriend && xView.xViewStats.denfHPOfSummons.ContainsKey(SpellCodex.SpellTypes._Magic_Ice_FrostyFriend) && xView.xViewStats.denfHPOfSummons[SpellCodex.SpellTypes._Magic_Ice_FrostyFriend] < 1f)
     {
         Vector2 v2BarPos = v2Pos + new Vector2(-10f, -10f);
         int iHPLength = (int)(15f * xView.xViewStats.denfHPOfSummons[SpellCodex.SpellTypes._Magic_Ice_FrostyFriend]);
         spriteBatch.Draw(HudRenderComponent.txShieldBar, v2BarPos, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
         spriteBatch.Draw(RenderMaster.txNoTex, v2BarPos + new Vector2(1f, 5f), new Rectangle?(new Rectangle(0, 0, 17, 1)), Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
         spriteBatch.Draw(RenderMaster.txNoTex, v2BarPos + new Vector2(2f, 2f), new Rectangle?(new Rectangle(0, 0, iHPLength, 1)), Color.Red, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
     }
     xSpellslot.enPrereqMetLastFrame = enPrereqResult;
 }
示例#2
0
 public void SetAutoEquippedNotice(ItemCodex.ItemTypes enEquipment, Equipment.EquipSlot enSlot)
 {
     if (this.bNewEquipmentWasAutoEquipped && this.lenNewEquips.Count > 0)
     {
         this.lenNewEquips.RemoveAt(0);
     }
     this.lenNewEquips.Insert(0, enEquipment);
     this.iNewEquipmentCounter = 140;
     this.iNewEquipmentEquippedNotice = 1;
     this.iNewEquipmentEquippedNoticeWhichSlot = 0;
     this.bNewEquipmentWasAutoEquipped = true;
     if (enSlot == Equipment.EquipSlot.AccessoryB)
     {
         this.iNewEquipmentEquippedNoticeWhichSlot = 1;
     }
 }
示例#3
0
 public static void __RenderItemslot(SpriteBatch spriteBatch, Vector2 v2Pos, Equipment.ItemSlot xItemslot, PlayerView xView)
 {
     bool bFlash = false;
     if (xItemslot.iFlashCycle > 0 && xItemslot.iFlashCycle / 5 % 2 == 0)
     {
         bFlash = true;
     }
     if (bFlash)
     {
         spriteBatch.End();
         spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, Program.GetTheGame().dsxEffects["ShieldFlash"].xEffect);
     }
     float fIconAlpha;
     if (!xView.xInventory.denxInventory.ContainsKey(xItemslot.enItemType))
     {
         fIconAlpha = 0.25f;
     }
     else
     {
         fIconAlpha = 1f;
     }
     Texture2D txX = xItemslot.xDescription.txDisplayImage;
     spriteBatch.Draw(txX, v2Pos, null, Color.White * fIconAlpha, 0f, Utility.Vector2_ToInts(new Vector2((float)txX.Width, (float)txX.Height) / 2f), 1f, SpriteEffects.None, 0f);
     if (xItemslot.xDescription.lenCategory.Contains(ItemCodex.ItemCategories.Usable) && !xItemslot.xDescription.lenCategory.Contains(ItemCodex.ItemCategories.DontShowUsesLeft) && xView.xInventory.denxInventory.ContainsKey(xItemslot.xDescription.enType))
     {
         Program.GetTheGame()._RenderMaster_RenderTextWithOutline(HudRenderComponent.fontHPMP, "x" + xView.xInventory.denxInventory[xItemslot.xDescription.enType].iAmount, v2Pos + new Vector2(9f, 11f), Utility.Vector2_ToInts(HudRenderComponent.fontHPMP.MeasureString("x" + xView.xInventory.denxInventory[xItemslot.xDescription.enType].iAmount) / 2f), 1f, Color.White, Color.Black * 0.7f);
     }
     if (bFlash)
     {
         spriteBatch.End();
         spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);
     }
 }
示例#4
0
 public static void RenderQuickSlot(SpriteBatch spriteBatch, Vector2 v2Pos, Equipment.QuickSlot xQuickslot, PlayerView xView)
 {
     if (xQuickslot.enType == Equipment.QuickSlot.Type.Null)
     {
         return;
     }
     if (xQuickslot.enType == Equipment.QuickSlot.Type.Item)
     {
         HudRenderComponent.__RenderItemslot(spriteBatch, v2Pos, xQuickslot as Equipment.ItemSlot, xView);
         return;
     }
     HudRenderComponent.__RenderSpellslot(spriteBatch, v2Pos, xQuickslot as Equipment.SpellSlot, xView);
 }
示例#5
0
 public void SetQuickSlotByNumber(Equipment.QuickSlot xSlot, int iNum)
 {
     switch (iNum)
     {
     case 1:
         this.xQuickSlot1 = xSlot;
         return;
     case 2:
         this.xQuickSlot2 = xSlot;
         return;
     case 3:
         this.xQuickSlot3 = xSlot;
         return;
     case 4:
         this.xQuickSlot4 = xSlot;
         return;
     case 5:
         this.xQuickSlot5 = xSlot;
         return;
     case 6:
         this.xQuickSlot6 = xSlot;
         return;
     case 7:
         this.xQuickSlot7 = xSlot;
         return;
     case 8:
         this.xQuickSlot8 = xSlot;
         return;
     case 9:
         this.xQuickSlot9 = xSlot;
         return;
     default:
         this.xQuickSlot10 = xSlot;
         return;
     }
 }
示例#6
0
 public ItemDescription GetItemDescriptionBySlot(Equipment.EquipSlot enSlot)
 {
     if (enSlot == Equipment.EquipSlot.Weapon)
     {
         if (this.xBufferWeapon == null)
         {
             return null;
         }
         return this.xBufferWeapon.xItemDescription;
     }
     else if (enSlot == Equipment.EquipSlot.Shield)
     {
         if (this.xShield == null)
         {
             return null;
         }
         return this.xShield.xItemDescription;
     }
     else if (enSlot == Equipment.EquipSlot.Shoes)
     {
         if (this.xShoes == null)
         {
             return null;
         }
         return this.xShoes.xItemDescription;
     }
     else if (enSlot == Equipment.EquipSlot.AccessoryA)
     {
         if (this.xAccessoryA == null)
         {
             return null;
         }
         return this.xAccessoryA.xItemDescription;
     }
     else if (enSlot == Equipment.EquipSlot.AccessoryB)
     {
         if (this.xAccessoryB == null)
         {
             return null;
         }
         return this.xAccessoryB.xItemDescription;
     }
     else if (enSlot == Equipment.EquipSlot.Armor)
     {
         if (this.xArmor == null)
         {
             return null;
         }
         return this.xArmor.xItemDescription;
     }
     else if (enSlot == Equipment.EquipSlot.Hat)
     {
         if (this.xHat == null)
         {
             return null;
         }
         return this.xHat.xItemDescription;
     }
     else
     {
         if (enSlot != Equipment.EquipSlot.Facegear)
         {
             return null;
         }
         if (this.xFacegear == null)
         {
             return null;
         }
         return this.xFacegear.xItemDescription;
     }
 }
示例#7
0
 public PreviewPair(PlayerView xOwner, ItemDescription xSelected, Equipment.EquipSlot enSlot = Equipment.EquipSlot.Auto, bool bAlreadEquipped = false)
 {
     if (enSlot == Equipment.EquipSlot.Auto)
     {
         if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Weapon))
         {
             enSlot = Equipment.EquipSlot.Weapon;
         }
         else if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Shield))
         {
             enSlot = Equipment.EquipSlot.Shield;
         }
         else if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Hat))
         {
             enSlot = Equipment.EquipSlot.Hat;
         }
         else if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Facegear))
         {
             enSlot = Equipment.EquipSlot.Facegear;
         }
         else if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Accessory))
         {
             enSlot = Equipment.EquipSlot.AccessoryA;
         }
         else if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Armor))
         {
             enSlot = Equipment.EquipSlot.Armor;
         }
         else if (xSelected.lenCategory.Contains(ItemCodex.ItemCategories.Shoes))
         {
             enSlot = Equipment.EquipSlot.Shoes;
         }
     }
     this.SetInfo(xOwner.xGUIStuff.bNewEquipmentWasAutoEquipped ? null : xOwner.xEquipment.GetItemDescriptionBySlot(enSlot), xSelected, bAlreadEquipped);
 }