Bring back class system

This commit is contained in:
Joseph Ferano 2022-02-22 00:35:02 +07:00
parent a45152970d
commit 34b24c29aa
3 changed files with 17 additions and 10 deletions

View File

@ -56,9 +56,8 @@ let checkPlayerHasShieldSlotsAvailable (shield : Item) player =
Error $"You are only allowed two shields at a time. Wait {cooldown} to add another shield" Error $"You are only allowed two shields at a time. Wait {cooldown} to add another shield"
| false -> Ok updatedPlayer | false -> Ok updatedPlayer
// TODO H: Need to update the new hacker game mechanics
let calculateDamage (hack : Item) (shield : Item) = let calculateDamage (hack : Item) (shield : Item) =
if hack.Power < shield.Power if hack.Class = shield.Class
then Weak then Weak
else Strong else Strong

View File

@ -6,6 +6,7 @@
"Price": 0, "Price": 0,
"Power": 10, "Power": 10,
"Cooldown": 2, "Cooldown": 2,
"Class": 0,
"Attributes": { "Attributes": {
"Sell": false, "Sell": false,
"Buy": false, "Buy": false,
@ -20,6 +21,7 @@
"Price": 500, "Price": 500,
"Power": 50, "Power": 50,
"Cooldown": 2, "Cooldown": 2,
"Class": 1,
"Attributes": { "Attributes": {
"Sell": true, "Sell": true,
"Buy": true, "Buy": true,
@ -34,6 +36,7 @@
"Price": 5000, "Price": 5000,
"Power": 80, "Power": 80,
"Cooldown": 2, "Cooldown": 2,
"Class": 2,
"Attributes": { "Attributes": {
"Sell": true, "Sell": true,
"Buy": true, "Buy": true,
@ -47,6 +50,7 @@
"Type": 1, "Type": 1,
"Price": 0, "Price": 0,
"Power": 10, "Power": 10,
"Class": 0,
"Cooldown": 600, "Cooldown": 600,
"Attributes": { "Attributes": {
"Sell": false, "Sell": false,
@ -56,11 +60,12 @@
} }
}, },
{ {
"Id": 8, "Id": 7,
"Name": "Cypher", "Name": "Encryption",
"Type": 1, "Type": 1,
"Price": 500, "Price": 5000,
"Power": 50, "Power": 80,
"Class": 1,
"Cooldown": 600, "Cooldown": 600,
"Attributes": { "Attributes": {
"Sell": true, "Sell": true,
@ -70,11 +75,12 @@
} }
}, },
{ {
"Id": 7, "Id": 8,
"Name": "Encryption", "Name": "Cypher",
"Type": 1, "Type": 1,
"Price": 5000, "Price": 500,
"Power": 80, "Power": 50,
"Class": 2,
"Cooldown": 600, "Cooldown": 600,
"Attributes": { "Attributes": {
"Sell": true, "Sell": true,

View File

@ -65,6 +65,7 @@ module Types =
Price : int<GBT> Price : int<GBT>
Type : ItemType Type : ItemType
Power : int Power : int
Class : int
Cooldown : int<mins> Cooldown : int<mins>
Attributes : ItemAttributes Attributes : ItemAttributes
} }
@ -74,6 +75,7 @@ module Types =
Price = 0<GBT> Price = 0<GBT>
Type = ItemType.Hack Type = ItemType.Hack
Power = 0 Power = 0
Class = -1
Cooldown = 0<mins> Cooldown = 0<mins>
Attributes = ItemAttributes.empty } Attributes = ItemAttributes.empty }