mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-22 20:55:52 +12:00
Fix ordering and fully implement "View Companion"
This commit is contained in:
parent
bd149e4ecf
commit
7bf0f37427
7 changed files with 91 additions and 43 deletions
|
@ -40,6 +40,14 @@ namespace HISP.Game.Items
|
|||
|
||||
public SpawnRules SpawnParamaters;
|
||||
|
||||
public int GetMiscFlag(int no)
|
||||
{
|
||||
if(MiscFlags.Length <= no)
|
||||
return 0;
|
||||
else
|
||||
return MiscFlags[no];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public struct ThrowableItem
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace HISP.Game.Items
|
|||
{
|
||||
foreach(Item.ItemInformation tackItem in TackItems)
|
||||
{
|
||||
if(tackItem.MiscFlags[0] == 1) // Saddle
|
||||
if(tackItem.GetMiscFlag(0) == 1) // Saddle
|
||||
return tackItem;
|
||||
}
|
||||
throw new KeyNotFoundException("Saddle not found.");
|
||||
|
@ -46,7 +46,7 @@ namespace HISP.Game.Items
|
|||
{
|
||||
foreach(Item.ItemInformation tackItem in TackItems)
|
||||
{
|
||||
if(tackItem.MiscFlags[0] == 2) // SaddlePad
|
||||
if(tackItem.GetMiscFlag(0) == 2) // SaddlePad
|
||||
return tackItem;
|
||||
}
|
||||
throw new KeyNotFoundException("SaddlePad not found.");
|
||||
|
@ -56,7 +56,7 @@ namespace HISP.Game.Items
|
|||
{
|
||||
foreach(Item.ItemInformation tackItem in TackItems)
|
||||
{
|
||||
if(tackItem.MiscFlags[0] == 3) // Bridle
|
||||
if(tackItem.GetMiscFlag(0) == 3) // Bridle
|
||||
return tackItem;
|
||||
}
|
||||
throw new KeyNotFoundException("GetBridle not found.");
|
||||
|
@ -79,6 +79,18 @@ namespace HISP.Game.Items
|
|||
return tackItems.ToArray();
|
||||
}
|
||||
}
|
||||
public int SortPosition()
|
||||
{
|
||||
int pos = 0;
|
||||
foreach(Item.ItemInformation tackitem in TackItems)
|
||||
{
|
||||
foreach(Item.Effects effect in tackitem.Effects)
|
||||
{
|
||||
pos += effect.EffectAmount;
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
private static string capitalizeFirstLetter(string str)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue