Skip to content

Commit

Permalink
Belt slot & HealthCount perfections
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilcooldoode authored and ryantaplin committed Nov 16, 2019
1 parent f0b3a8c commit 44b48cb
Show file tree
Hide file tree
Showing 15 changed files with 200 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Client/Controls/DXItemCell.cs
Expand Up @@ -1535,6 +1535,9 @@ public bool UseItem()
case ItemType.Shoes:
GameScene.Game.CharacterBox.Grid[(int)EquipmentSlot.Shoes].ToEquipment(this);
break;
case ItemType.Belt:
GameScene.Game.CharacterBox.Grid[(int)EquipmentSlot.Belt].ToEquipment(this);
break;
case ItemType.Poison:
GameScene.Game.CharacterBox.Grid[(int)EquipmentSlot.Poison].ToEquipment(this);
break;
Expand Down Expand Up @@ -1704,6 +1707,7 @@ private void PlayItemSound()
DXSoundManager.Play(SoundIndex.ItemRing);
break;
case ItemType.Shoes:
case ItemType.Belt:
DXSoundManager.Play(SoundIndex.ItemShoes);
break;
case ItemType.Consumable:
Expand Down
2 changes: 1 addition & 1 deletion Client/Envir/CConnection.cs
Expand Up @@ -4083,7 +4083,7 @@ public void Process(S.DataObjectMonster p)
MonsterInfo = p.MonsterInfo,

Health = p.Health,
MaxHealth = (long)p.Stats[Stat.Health] + p.Stats[Stat.HealthCount] * int.MaxValue,
MaxHealth = p.MaximumHealth,
Stats = p.Stats,
Dead = p.Dead,

Expand Down
3 changes: 2 additions & 1 deletion Client/Scenes/GameScene.cs
Expand Up @@ -1531,6 +1531,7 @@ private void CreateItemLabel()
case ItemType.Bracelet:
case ItemType.Ring:
case ItemType.Shoes:
case ItemType.Belt:
case ItemType.Poison:
case ItemType.Amulet:
if (User.WearWeight - (Equipment[(int)EquipmentSlot.Armour]?.Info.Weight ?? 0) + MouseItem.Info.Weight > User.Stats[Stat.WearWeight])
Expand Down Expand Up @@ -2002,7 +2003,7 @@ private void CreateItemLabel()
str += "-Weapon" + Environment.NewLine + "-Necklace" + Environment.NewLine + "-Bracelet" + Environment.NewLine + "-Ring";
break;
case 2:
str += "-Armour" + Environment.NewLine + "-Shield" + Environment.NewLine + "-Helmet" + Environment.NewLine + "-Bracelet" + Environment.NewLine + "-Ring" + Environment.NewLine + "-Shoes";
str += "-Armour" + Environment.NewLine + "-Shield" + Environment.NewLine + "-Helmet" + Environment.NewLine + "-Bracelet" + Environment.NewLine + "-Ring" + Environment.NewLine + "-Shoes" + Environment.NewLine + "-Belt";
break;
default:
str += "-All Items";
Expand Down
14 changes: 13 additions & 1 deletion Client/Scenes/Views/CharacterDialog.cs
Expand Up @@ -281,7 +281,7 @@ public CharacterDialog()

Grid[(int)EquipmentSlot.Wings] = cell = new DXItemCell
{
Location = new Point(15, 300),
Location = new Point(15, 180),
Parent = CharacterTab,
FixedBorder = true,
Border = true,
Expand All @@ -291,6 +291,18 @@ public CharacterDialog()
};
//cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 104);

Grid[(int)EquipmentSlot.Belt] = cell = new DXItemCell
{
Location = new Point(15, 300),
Parent = CharacterTab,
FixedBorder = true,
Border = true,
ItemGrid = GameScene.Game.Equipment,
Slot = (int)EquipmentSlot.Belt,
GridType = GridType.Equipment,
};
//cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 36);


Grid[(int)EquipmentSlot.Shoes] = cell = new DXItemCell
{
Expand Down
15 changes: 14 additions & 1 deletion Client/Scenes/Views/InspectDialog.cs
Expand Up @@ -281,7 +281,7 @@ public InspectDialog()

Grid[(int)EquipmentSlot.Wings] = cell = new DXItemCell
{
Location = new Point(15, 300),
Location = new Point(15, 180),
Parent = CharacterTab,
FixedBorder = true,
Border = true,
Expand All @@ -292,6 +292,19 @@ public InspectDialog()
};
//cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 104);

Grid[(int)EquipmentSlot.Belt] = cell = new DXItemCell
{
Location = new Point(15, 300),
Parent = CharacterTab,
FixedBorder = true,
Border = true,
Slot = (int)EquipmentSlot.Belt,
ItemGrid = Equipment,
GridType = GridType.Inspect,
ReadOnly = true,
};
//cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 36);

Grid[(int)EquipmentSlot.Shoes] = cell = new DXItemCell
{
Location = new Point(95, 300),
Expand Down
3 changes: 3 additions & 0 deletions Client/Scenes/Views/NPCDialog.cs
Expand Up @@ -868,6 +868,7 @@ public void OnGoodChanged(NPCGood oValue, NPCGood nValue)
case ItemType.Ring:
case ItemType.Shoes:
case ItemType.Book:
case ItemType.Belt:
ItemCell.Item.Flags |= UserItemFlags.NonRefinable;
break;
}
Expand Down Expand Up @@ -904,6 +905,7 @@ public void OnGoodChanged(NPCGood oValue, NPCGood nValue)
case ItemType.Poison:
case ItemType.Amulet:
case ItemType.DarkStone:
case ItemType.Belt:

if (GameScene.Game.CanUseItem(ItemCell.Item))
{
Expand Down Expand Up @@ -1036,6 +1038,7 @@ public void UpdateColours()
case ItemType.Poison:
case ItemType.Amulet:
case ItemType.DarkStone:
case ItemType.Belt:
RequirementLabel.ForeColour = GameScene.Game.CanUseItem(ItemCell.Item) ? Color.Aquamarine : Color.Red;
break;
}
Expand Down
2 changes: 2 additions & 0 deletions Library/Enum.cs
Expand Up @@ -109,6 +109,7 @@ public enum EquipmentSlot
Emblem = 14,
Shield = 15,
Wings = 16,
Belt = 17,
}

public enum CompanionSlot
Expand Down Expand Up @@ -340,6 +341,7 @@ public enum ItemType : byte
Wings,
Gem,
Orb,
Belt,
}

public enum MirAction : byte
Expand Down
2 changes: 2 additions & 0 deletions Library/Functions.cs
Expand Up @@ -458,6 +458,8 @@ public static bool CorrectSlot(ItemType type, EquipmentSlot slot)
return type == ItemType.Shield;
case EquipmentSlot.Wings:
return type == ItemType.Wings;
case EquipmentSlot.Belt:
return type == ItemType.Belt;
default:
return false;
}
Expand Down
9 changes: 8 additions & 1 deletion Library/Globals.cs
Expand Up @@ -404,7 +404,7 @@ public static long


public const int InventorySize = 196,
EquipmentSize = 17,
EquipmentSize = 18,
CompanionInventorySize = 40,
CompanionEquipmentSize = 4,
PartsStorageOffset = 2000,
Expand Down Expand Up @@ -714,6 +714,7 @@ public bool CanFragment()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
break;
default:
return false;
Expand All @@ -737,6 +738,7 @@ public int FragmentCost()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Info.RequiredAmount * 10000 / 9;
/* case ItemType.Helmet:
case ItemType.Necklace:
Expand All @@ -759,6 +761,7 @@ public int FragmentCost()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Info.RequiredAmount * 10000 / 2;
/* case ItemType.Helmet:
case ItemType.Necklace:
Expand All @@ -784,6 +787,7 @@ public int FragmentCost()
case ItemType.Emblem:
return 150000;
case ItemType.Shoes:
case ItemType.Belt:
return 30000;
default:
return 0;
Expand All @@ -808,6 +812,7 @@ public int FragmentCount()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Math.Max(1, Info.RequiredAmount / 2 + 5);
/* case ItemType.Helmet:
return Math.Max(1, (Info.RequiredAmount - 30) / 6);
Expand All @@ -834,6 +839,7 @@ public int FragmentCount()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Math.Max(1, Info.RequiredAmount / 2 + 5);
/* case ItemType.Helmet:
return Math.Max(1, (Info.RequiredAmount - 30) / 6);
Expand Down Expand Up @@ -863,6 +869,7 @@ public int FragmentCount()
case ItemType.Emblem:
return 10;
case ItemType.Shoes:
case ItemType.Belt:
return 3;
default:
return 0;
Expand Down
1 change: 1 addition & 0 deletions Library/Network/ServerPackets.cs
Expand Up @@ -1202,6 +1202,7 @@ public sealed class DataObjectMonster : Packet
public string PetOwner { get; set; }

public long Health { get; set; }
public long MaximumHealth { get; set; }
public Stats Stats { get; set; }
public bool Dead { get; set; }

Expand Down
7 changes: 7 additions & 0 deletions Server/DBModels/UserItem.cs
Expand Up @@ -594,6 +594,7 @@ public bool CanFragment()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
break;
default:
return false;
Expand All @@ -617,6 +618,7 @@ public int FragmentCost()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Info.RequiredAmount * 10000 / 9;
/* case ItemType.Helmet:
case ItemType.Necklace:
Expand All @@ -639,6 +641,7 @@ public int FragmentCost()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Info.RequiredAmount * 10000 / 2;
/* case ItemType.Helmet:
case ItemType.Necklace:
Expand All @@ -664,6 +667,7 @@ public int FragmentCost()
case ItemType.Emblem:
return 150000;
case ItemType.Shoes:
case ItemType.Belt:
return 30000;
default:
return 0;
Expand All @@ -688,6 +692,7 @@ public int FragmentCount()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Math.Max(1, Info.RequiredAmount / 2 + 5);
/* case ItemType.Helmet:
return Math.Max(1, (Info.RequiredAmount - 30) / 6);
Expand All @@ -714,6 +719,7 @@ public int FragmentCount()
case ItemType.Shoes:
case ItemType.Shield:
case ItemType.Emblem:
case ItemType.Belt:
return Math.Max(1, Info.RequiredAmount / 2 + 5);
/* case ItemType.Helmet:
return Math.Max(1, (Info.RequiredAmount - 30) / 6);
Expand Down Expand Up @@ -743,6 +749,7 @@ public int FragmentCount()
case ItemType.Emblem:
return 10;
case ItemType.Shoes:
case ItemType.Belt:
return 3;
default:
return 0;
Expand Down

0 comments on commit 44b48cb

Please sign in to comment.