diff --git a/utils/items/consumables.simba b/utils/items/consumables.simba index 568a7ae1..c4df8a0d 100644 --- a/utils/items/consumables.simba +++ b/utils/items/consumables.simba @@ -31,26 +31,26 @@ ERSConsumable is a enumerator that contains all types of consumable. *) ERSConsumable = (FOOD, PRAYER, ENERGY, POISON, VENOM, ANTI_FIRE, BOOST, STRENGTH_BOOST, ATTACK_BOOST, DEFENCE_BOOST, RANGING_BOOST, MAGIC_BOOST); -const +var (* -## const CONSUMABLE_ARRAYS +## var CONSUMABLE_ARRAYS ```pascal -const -FOOD_ARRAY: TRSItemArray = ['Shrimps', 'Cooked chicken', 'Cooked meat', 'Sardine', 'Bread', 'Herring', 'Mackerel', 'Choc-ice', 'Trout', 'Cod', 'Pike', 'Roast beast meat', 'Pineapple punch', 'Salmon', 'Tuna', 'Jug of wine', 'Rainbow fish', 'Stew', 'Banana stew', 'Cake(1..3)', 'Meat pie(1..2)', 'Bass', 'Plain pizza(1..2)', 'Lobster', 'Swordfish', 'Potato with butter', 'Apple pie(1..2)', 'Chocolate cake(1..3)', 'Tangled toad' 's legs', 'Chocolate bomb', 'Potato with cheese', 'Meat pizza(1..2)', 'Admiral pie(1..2)', 'Monkfish', 'Anchovy pizza(1..2)', 'Cooked karambwan', 'Curry', 'Ugthanki kebab', 'Guthix rest(1..4)', 'Dragonfruit pie(1..2)', 'Mushroom potato', 'Shark', 'Sea turtle', 'Pineapple pizza(1..2)', 'Summer pie(1..2)', 'Wild pie(1..2)', 'Manta ray', 'Tuna potato', 'Dark crab', 'Anglerfish', 'Saradomin brew(1..4)']; -PRAYER_ARRAY: TRSItemArray = ['Zamorak brew(1..4)', 'Sanfew serum(1..4)', 'Super restore(1..4)', 'Prayer potion(1..4)', 'Jangerberries']; -ENERGY_ARRAY: TRSItemArray = ['White tree fruit', 'Winter sq' 'irkjuice', 'Spring sq' 'irkjuice', 'Autumn sq' 'irkjuice', 'Summer sq' 'irkjuice', 'Bandages', 'Guthix rest(1..4)', 'Papaya fruit', 'Energy potion(1..4)', 'Purple sweets', 'Summer pie(1..2)', 'Super energy(1..4)', 'Stamina potion(1..4)', 'Strange fruit', 'Mint cake', 'Gout tuber']; -ANTI_POISON_ARRAY: TRSItemArray = ['Sanfew serum(1..4)', 'Anti-venom+(1..4)', 'Anti-venom(1..4)', 'Antidote++(1..4)', 'Antidote+(1..4)', 'Superantipoison(1..4)', 'Antipoison(1..4)']; -ANTI_VENOM_ARRAY: TRSItemArray = ['Anti-venom+(1..4)', 'Anti-venom(1..4)']; -ANTI_FIRE_ARRAY: TRSItemArray = ['Antifire potion(1..4)', 'Super antifire potion(1..4)', 'Extended antifire(1..4)', 'Extended super antifire(1..4)']; -BOOST_ARRAY: TRSItemArray = ['Divine super combat potion(1..4)', 'Super combat potion(1..4)', 'Divine bastion potion(1..4)', 'Bastion potion(1..4)', 'Divine battlemage potion(1..4)', 'Battlemage potion(1..4)']; -STRENGTH_BOOST_ARRAY: TRSItemArray = ['Divine super strength potion(1..4)', 'Super strength(1..4)', 'Strength potion(1..4)']; -ATTACK_BOOST_ARRAY: TRSItemArray = ['Divine super attack potion(1..4)', 'Super attack(1..4)', 'Attack potion(1..4)']; -DEFENCE_BOOST_ARRAY: TRSItemArray = ['Divine super defence potion(1..4)', 'Super defence(1..4)', 'Defence potion(1..4)']; -RANGING_BOOST_ARRAY: TRSItemArray = ['Divine ranging potion(1..4)', 'Ranging potion(1..4)']; -MAGIC_BOOST_ARRAY: TRSItemArray = ['Divine magic potion(1..4)', 'Magic potion(1..4)']; -TRASH_ARRAY: TRSItemArray = ['Cocktail glass', 'Jug', 'Bowl', 'Pie dish', 'Vial', 'Beer glass', 'Empty cup']; +var + FOOD_ARRAY: TRSItemArray = ['Shrimps', 'Cooked chicken', 'Cooked meat', 'Sardine', 'Bread', 'Herring', 'Mackerel', 'Choc-ice', 'Trout', 'Cod', 'Pike', 'Roast beast meat', 'Pineapple punch', 'Salmon', 'Tuna', 'Jug of wine', 'Rainbow fish', 'Stew', 'Banana stew', 'Cake(1..3)', 'Meat pie(1..2)', 'Bass', 'Plain pizza(1..2)', 'Lobster', 'Swordfish', 'Potato with butter', 'Apple pie(1..2)', 'Chocolate cake(1..3)', 'Tangled toad' 's legs', 'Chocolate bomb', 'Potato with cheese', 'Meat pizza(1..2)', 'Admiral pie(1..2)', 'Monkfish', 'Anchovy pizza(1..2)', 'Cooked karambwan', 'Curry', 'Ugthanki kebab', 'Guthix rest(1..4)', 'Dragonfruit pie(1..2)', 'Mushroom potato', 'Shark', 'Sea turtle', 'Pineapple pizza(1..2)', 'Summer pie(1..2)', 'Wild pie(1..2)', 'Manta ray', 'Tuna potato', 'Dark crab', 'Anglerfish', 'Saradomin brew(1..4)']; + PRAYER_ARRAY: TRSItemArray = ['Zamorak brew(1..4)', 'Sanfew serum(1..4)', 'Super restore(1..4)', 'Prayer potion(1..4)', 'Jangerberries']; + ENERGY_ARRAY: TRSItemArray = ['White tree fruit', 'Winter sq' 'irkjuice', 'Spring sq' 'irkjuice', 'Autumn sq' 'irkjuice', 'Summer sq' 'irkjuice', 'Bandages', 'Guthix rest(1..4)', 'Papaya fruit', 'Energy potion(1..4)', 'Purple sweets', 'Summer pie(1..2)', 'Super energy(1..4)', 'Stamina potion(1..4)', 'Strange fruit', 'Mint cake', 'Gout tuber']; + ANTI_POISON_ARRAY: TRSItemArray = ['Sanfew serum(1..4)', 'Anti-venom+(1..4)', 'Anti-venom(1..4)', 'Antidote++(1..4)', 'Antidote+(1..4)', 'Superantipoison(1..4)', 'Antipoison(1..4)']; + ANTI_VENOM_ARRAY: TRSItemArray = ['Anti-venom+(1..4)', 'Anti-venom(1..4)']; + ANTI_FIRE_ARRAY: TRSItemArray = ['Antifire potion(1..4)', 'Super antifire potion(1..4)', 'Extended antifire(1..4)', 'Extended super antifire(1..4)']; + BOOST_ARRAY: TRSItemArray = ['Divine super combat potion(1..4)', 'Super combat potion(1..4)', 'Divine bastion potion(1..4)', 'Bastion potion(1..4)', 'Divine battlemage potion(1..4)', 'Battlemage potion(1..4)']; + STRENGTH_BOOST_ARRAY: TRSItemArray = ['Divine super strength potion(1..4)', 'Super strength(1..4)', 'Strength potion(1..4)']; + ATTACK_BOOST_ARRAY: TRSItemArray = ['Divine super attack potion(1..4)', 'Super attack(1..4)', 'Attack potion(1..4)']; + DEFENCE_BOOST_ARRAY: TRSItemArray = ['Divine super defence potion(1..4)', 'Super defence(1..4)', 'Defence potion(1..4)']; + RANGING_BOOST_ARRAY: TRSItemArray = ['Divine ranging potion(1..4)', 'Ranging potion(1..4)']; + MAGIC_BOOST_ARRAY: TRSItemArray = ['Divine magic potion(1..4)', 'Magic potion(1..4)']; + TRASH_ARRAY: TRSItemArray = ['Cocktail glass', 'Jug', 'Bowl', 'Pie dish', 'Vial', 'Beer glass', 'Empty cup']; -CONSUMABLE_ARRAYS: array [ERSConsumable] of TRSItemArray = [FOOD_ARRAY, PRAYER_ARRAY, ENERGY_ARRAY, ANTI_POISON_ARRAY, ANTI_VENOM_ARRAY, ANTI_FIRE_ARRAY, BOOST_ARRAY, STRENGTH_BOOST_ARRAY, ATTACK_BOOST_ARRAY, DEFENCE_BOOST_ARRAY, RANGING_BOOST_ARRAY, MAGIC_BOOST_ARRAY]; + CONSUMABLE_ARRAYS: array [ERSConsumable] of TRSItemArray = [FOOD_ARRAY, PRAYER_ARRAY, ENERGY_ARRAY, ANTI_POISON_ARRAY, ANTI_VENOM_ARRAY, ANTI_FIRE_ARRAY, BOOST_ARRAY, STRENGTH_BOOST_ARRAY, ATTACK_BOOST_ARRAY, DEFENCE_BOOST_ARRAY, RANGING_BOOST_ARRAY, MAGIC_BOOST_ARRAY]; ``` Global consumable arrays variables. These arrays holds all types of consumable for each respective purpose with the exception of TRASH_ARRAY which are possible left over items from consumables. @@ -61,7 +61,7 @@ They are in UPPERCASE because they are intended to be treated as constants but a WriteLn CONSUMABLE_ARRAYS[ERSConsumable.ENERGY]; ``` *) - FOOD_ARRAY: TRSItemArray = ['Shrimps', 'Cooked chicken', 'Cooked meat', 'Sardine', 'Bread', 'Herring', 'Mackerel', 'Choc-ice', 'Trout', 'Cod', 'Pike', 'Cooked wild kebbit', 'Sunlight moth mix (1..2)', 'Sunlight moth', 'Roast beast meat', 'Pineapple punch', 'Salmon', 'Tuna', 'Jug of wine', 'Rainbow fish', 'Cooked larupia', 'Stew', 'Banana stew', 'Cake(1..3)', 'Meat pie(1..2)', 'Bass', 'Plain pizza(1..2)', 'Lobster', 'Cooked barb-tailed kebbit', 'Swordfish', 'Cooked graahk', 'Potato with butter', 'Apple pie(1..2)', 'Chocolate cake(1..3)', 'Tangled toad' 's legs', 'Chocolate bomb', 'Potato with cheese', 'Meat pizza(1..2)', 'Admiral pie(1..2)', 'Monkfish', 'Cooked kyatt', 'Anchovy pizza(1..2)', 'Cooked karambwan', 'Curry', 'Ugthanki kebab', 'Guthix rest(1..4)', 'Dragonfruit pie(1..2)', 'Mushroom potato', 'Shark', 'Cooked pyre fox', 'Sea turtle', 'Cooked sunlight antelope', 'Pineapple pizza(1..2)', 'Summer pie(1..2)', 'Wild pie(1..2)', 'Manta ray', 'Cooked dashing kebbit', 'Tuna potato', 'Dark crab', 'Anglerfish', 'Cooked moonlight antelope', 'Saradomin brew(1..4)', 'Cooked bream']; + FOOD_ARRAY: TRSItemArray = ['Shrimps', 'Cooked chicken', 'Cooked meat', 'Sardine', 'Bread', 'Herring', 'Mackerel', 'Choc-ice', 'Trout', 'Cod', 'Pike', 'Cooked wild kebbit', 'Sunlight moth mix (1..2)', 'Sunlight moth', 'Roast beast meat', 'Pineapple punch', 'Salmon', 'Tuna', 'Jug of wine', 'Rainbow fish', 'Cooked larupia', 'Stew', 'Banana stew', 'Cake(1..3)', 'Meat pie(1..2)', 'Bass', 'Plain pizza(1..2)', 'Lobster', 'Cooked barb-tailed kebbit', 'Swordfish', 'Cooked graahk', 'Potato with butter', 'Apple pie(1..2)', 'Chocolate cake(1..3)', 'Tangled toad' 's legs', 'Chocolate bomb', 'Potato with cheese', 'Egg potato', 'Meat pizza(1..2)', 'Admiral pie(1..2)', 'Monkfish', 'Cooked kyatt', 'Anchovy pizza(1..2)', 'Cooked karambwan', 'Curry', 'Ugthanki kebab', 'Guthix rest(1..4)', 'Dragonfruit pie(1..2)', 'Mushroom potato', 'Shark', 'Cooked pyre fox', 'Sea turtle', 'Cooked sunlight antelope', 'Pineapple pizza(1..2)', 'Summer pie(1..2)', 'Wild pie(1..2)', 'Manta ray', 'Cooked dashing kebbit', 'Tuna potato', 'Dark crab', 'Anglerfish', 'Cooked moonlight antelope', 'Saradomin brew(1..4)', 'Cooked bream']; PRAYER_ARRAY: TRSItemArray = ['Zamorak brew(1..4)', 'Sanfew serum(1..4)', 'Super restore(1..4)', 'Prayer potion(1..4)', 'Moonlight moth mix (1..2)', 'Moonlight moth', 'Jangerberries']; ENERGY_ARRAY: TRSItemArray = ['White tree fruit', 'Winter sq' 'irkjuice', 'Spring sq' 'irkjuice', 'Autumn sq' 'irkjuice', 'Summer sq' 'irkjuice', 'Bandages', 'Guthix rest(1..4)', 'Papaya fruit', 'Energy potion(1..4)', 'Purple sweets', 'Summer pie(1..2)', 'Super energy(1..4)', 'Stamina potion(1..4)', 'Strange fruit', 'Mint cake', 'Gout tuber']; ANTI_POISON_ARRAY: TRSItemArray = ['Sanfew serum(1..4)', 'Anti-venom+(1..4)', 'Anti-venom(1..4)', 'Antidote++(1..4)', 'Antidote+(1..4)', 'Superantipoison(1..4)', 'Antipoison(1..4)']; @@ -75,24 +75,23 @@ WriteLn CONSUMABLE_ARRAYS[ERSConsumable.ENERGY]; MAGIC_BOOST_ARRAY: TRSItemArray = ['Divine magic potion(1..4)', 'Magic potion(1..4)']; TRASH_ARRAY: TRSItemArray = ['Cocktail glass', 'Jug', 'Bowl', 'Pie dish', 'Vial', 'Beer glass', 'Empty cup']; - CONSUMABLE_ARRAYS: array [ERSConsumable] of TRSItemArray = [FOOD_ARRAY, PRAYER_ARRAY, ENERGY_ARRAY, ANTI_POISON_ARRAY, ANTI_VENOM_ARRAY, ANTI_FIRE_ARRAY, BOOST_ARRAY, STRENGTH_BOOST_ARRAY, ATTACK_BOOST_ARRAY, DEFENCE_BOOST_ARRAY, RANGING_BOOST_ARRAY, MAGIC_BOOST_ARRAY]; + CONSUMABLE_ARRAYS: array [ERSConsumable] of TRSItemArray := [FOOD_ARRAY, PRAYER_ARRAY, ENERGY_ARRAY, ANTI_POISON_ARRAY, ANTI_VENOM_ARRAY, ANTI_FIRE_ARRAY, BOOST_ARRAY, STRENGTH_BOOST_ARRAY, ATTACK_BOOST_ARRAY, DEFENCE_BOOST_ARRAY, RANGING_BOOST_ARRAY, MAGIC_BOOST_ARRAY]; type - (* +(TRSConsumable)= ## type TRSConsumable ```pascal TRSConsumable = record -Item: TRSItem; -Points: UInt32; -Timer: UInt32; -BankTab: Int32; -Cost: Int32; -IsSetup: Boolean; + Item: TRSItem; + Points: UInt32; + Timer: UInt32; + BankTab: Int32; + Cost: Int32; + IsSetup: Boolean; end; TRSConsumableArray = array of TRSConsumable; ``` - TRSConsumable is the record used in all consumables. It contains base properties all consumables have. *) TRSConsumable = record @@ -106,23 +105,23 @@ TRSConsumable is the record used in all consumables. It contains base properties TRSConsumableArray = array of TRSConsumable; (* +(TRSConsumableType)= ## type TRSConsumableType ```pascal type -TRSFood = type TRSConsumable; -TRSFoodArray = array of TRSFood; -TRSPrayerPotion = type TRSConsumable; -TRSPrayerPotionArray = array of TRSPrayerPotion; -TRSEnergyBoost = type TRSConsumable; -TRSEnergyBoostArray = array of TRSEnergyBoost; -TRSBoost = record(TRSConsumable) -Skills: array of ERSSkill; -LevelsBoost: TIntegerArray; -Countdown: TCountdown; -end; -TRSBoosArray = array of TRSBoost; + TRSFood = type TRSConsumable; + TRSFoodArray = array of TRSFood; + TRSPrayerPotion = type TRSConsumable; + TRSPrayerPotionArray = array of TRSPrayerPotion; + TRSEnergyBoost = type TRSConsumable; + TRSEnergyBoostArray = array of TRSEnergyBoost; + TRSBoost = record(TRSConsumable) + Skills: array of ERSSkill; + LevelsBoost: TIntegerArray; + Countdown: TCountdown; + end; + TRSBoosArray = array of TRSBoost; ``` - Types used in all consumables for each respective purpose. This includes food and certain potions. TRSBoost type of consumable has a timer to keep track when it lost it's effect after being eaten/drank. *) @@ -172,8 +171,7 @@ procedure TRSConsumable.SetupFood(); var HPLevel: Int32; begin - if Self.IsSetup then - Exit; + if Self.IsSetup then Exit; case Self.Item of 'Shrimps', 'Cooked chicken', 'Cooked meat': Self.Points := 3; 'Sardine', 'Cake(1..3)', 'Edible seaweed': Self.Points := 4; @@ -188,7 +186,7 @@ begin 'Bass': Self.Points := 13; 'Swordfish', 'Potato with butter', 'Cooked graahk': Self.Points := 14; 'Tangled toad' 's legs', 'Chocolate bomb': Self.Points := 15; - 'Potato with cheese', 'Monkfish': Self.Points := 16; + 'Potato with cheese', 'Egg potato', 'Monkfish': Self.Points := 16; 'Cooked kyatt': Self.Points := 17; 'Cooked karambwan': Self.Points := 18; 'Cooked pyre fox': Self.Points := 19;