Skip to content

Commit

Permalink
The basic models for a battle are added
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandoDrRobot committed Aug 19, 2024
1 parent 8c4cf0f commit 923ea57
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 45 deletions.
6 changes: 3 additions & 3 deletions manifests/dev/base/abis/models/bytebeasts-Beast-27809d20.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@
},
{
"name": "beast_name",
"type": "core::integer::u32"
"type": "core::felt252"
},
{
"name": "beast_type",
"type": "core::integer::u32"
},
{
"name": "beast_description",
"type": "core::integer::u32"
"type": "core::felt252"
},
{
"name": "player_id",
Expand Down Expand Up @@ -427,7 +427,7 @@
"type": "core::integer::u32"
},
{
"name": "experience_to_nex_level",
"name": "experience_to_next_level",
"type": "core::integer::u64"
}
]
Expand Down
4 changes: 2 additions & 2 deletions manifests/dev/base/contracts/bytebeasts-actions-648ac931.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0xb5372e1739d610fe27521a9203c77c7ff3fea6040627bee239502bdfcce147"
original_class_hash = "0xb5372e1739d610fe27521a9203c77c7ff3fea6040627bee239502bdfcce147"
class_hash = "0x4b192794775dc6ff0267fd1a9ed531908e7a661e73fe596707af46c8719b587"
original_class_hash = "0x4b192794775dc6ff0267fd1a9ed531908e7a661e73fe596707af46c8719b587"
base_class_hash = "0x0"
abi = "manifests/dev/base/abis/contracts/bytebeasts-actions-648ac931.json"
reads = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0x153d3b6c19c130e1f6028634213cdc5f9f9236db13f9d03afe371c4163bbbd6"
original_class_hash = "0x153d3b6c19c130e1f6028634213cdc5f9f9236db13f9d03afe371c4163bbbd6"
class_hash = "0x56093b60a0b0aa8902f1dd09a888754a910967e4029bb70d8983ee846d4f488"
original_class_hash = "0x56093b60a0b0aa8902f1dd09a888754a910967e4029bb70d8983ee846d4f488"
base_class_hash = "0x0"
abi = "manifests/dev/base/abis/contracts/bytebeasts-battle_system-461868ac.json"
reads = []
Expand Down
10 changes: 5 additions & 5 deletions manifests/dev/base/models/bytebeasts-Beast-27809d20.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoModel"
class_hash = "0x2edfc0419e5dc0630fe45e0d983b8273119c14ac89e544926c34f48c6f5605e"
original_class_hash = "0x2edfc0419e5dc0630fe45e0d983b8273119c14ac89e544926c34f48c6f5605e"
class_hash = "0x1ae435e73e2ccb909d2fc7ea7ac0def65e0e2df5cb9496caa4e08d54f2c428c"
original_class_hash = "0x1ae435e73e2ccb909d2fc7ea7ac0def65e0e2df5cb9496caa4e08d54f2c428c"
abi = "manifests/dev/base/abis/models/bytebeasts-Beast-27809d20.json"
tag = "bytebeasts-Beast"
manifest_name = "bytebeasts-Beast-27809d20"
Expand All @@ -12,7 +12,7 @@ key = true

[[members]]
name = "beast_name"
type = "u32"
type = "felt252"
key = false

[[members]]
Expand All @@ -22,7 +22,7 @@ key = false

[[members]]
name = "beast_description"
type = "u32"
type = "felt252"
key = false

[[members]]
Expand Down Expand Up @@ -76,6 +76,6 @@ type = "u32"
key = false

[[members]]
name = "experience_to_nex_level"
name = "experience_to_next_level"
type = "u64"
key = false
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@
},
{
"name": "beast_name",
"type": "core::integer::u32"
"type": "core::felt252"
},
{
"name": "beast_type",
"type": "core::integer::u32"
},
{
"name": "beast_description",
"type": "core::integer::u32"
"type": "core::felt252"
},
{
"name": "player_id",
Expand Down Expand Up @@ -427,7 +427,7 @@
"type": "core::integer::u32"
},
{
"name": "experience_to_nex_level",
"name": "experience_to_next_level",
"type": "core::integer::u64"
}
]
Expand Down
29 changes: 16 additions & 13 deletions manifests/dev/deployment/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1251,8 +1251,8 @@
{
"kind": "DojoContract",
"address": "0x4854bb6cc04b51e5adaed76afc0664091182fe44a9e5e68dc4f8f5f59ffd464",
"class_hash": "0xb5372e1739d610fe27521a9203c77c7ff3fea6040627bee239502bdfcce147",
"original_class_hash": "0xb5372e1739d610fe27521a9203c77c7ff3fea6040627bee239502bdfcce147",
"class_hash": "0x4b192794775dc6ff0267fd1a9ed531908e7a661e73fe596707af46c8719b587",
"original_class_hash": "0x4b192794775dc6ff0267fd1a9ed531908e7a661e73fe596707af46c8719b587",
"base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2",
"abi": [
{
Expand Down Expand Up @@ -1480,7 +1480,10 @@
],
"reads": [],
"writes": [
"bytebeasts-Beast"
"bytebeasts-Beast",
"bytebeasts-Mt",
"bytebeasts-Player",
"bytebeasts-Potion"
],
"init_calldata": [],
"tag": "bytebeasts-actions",
Expand All @@ -1489,8 +1492,8 @@
{
"kind": "DojoContract",
"address": "0x612b684f6b34356ad9a07ac3e1924f9dfa54235d0a513095b0d12695ace8b68",
"class_hash": "0x153d3b6c19c130e1f6028634213cdc5f9f9236db13f9d03afe371c4163bbbd6",
"original_class_hash": "0x153d3b6c19c130e1f6028634213cdc5f9f9236db13f9d03afe371c4163bbbd6",
"class_hash": "0x56093b60a0b0aa8902f1dd09a888754a910967e4029bb70d8983ee846d4f488",
"original_class_hash": "0x56093b60a0b0aa8902f1dd09a888754a910967e4029bb70d8983ee846d4f488",
"base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2",
"abi": [
{
Expand Down Expand Up @@ -1743,7 +1746,7 @@
},
{
"name": "beast_name",
"type": "u32",
"type": "felt252",
"key": false
},
{
Expand All @@ -1753,7 +1756,7 @@
},
{
"name": "beast_description",
"type": "u32",
"type": "felt252",
"key": false
},
{
Expand Down Expand Up @@ -1807,13 +1810,13 @@
"key": false
},
{
"name": "experience_to_nex_level",
"name": "experience_to_next_level",
"type": "u64",
"key": false
}
],
"class_hash": "0x2edfc0419e5dc0630fe45e0d983b8273119c14ac89e544926c34f48c6f5605e",
"original_class_hash": "0x2edfc0419e5dc0630fe45e0d983b8273119c14ac89e544926c34f48c6f5605e",
"class_hash": "0x1ae435e73e2ccb909d2fc7ea7ac0def65e0e2df5cb9496caa4e08d54f2c428c",
"original_class_hash": "0x1ae435e73e2ccb909d2fc7ea7ac0def65e0e2df5cb9496caa4e08d54f2c428c",
"abi": [
{
"type": "impl",
Expand Down Expand Up @@ -2192,15 +2195,15 @@
},
{
"name": "beast_name",
"type": "core::integer::u32"
"type": "core::felt252"
},
{
"name": "beast_type",
"type": "core::integer::u32"
},
{
"name": "beast_description",
"type": "core::integer::u32"
"type": "core::felt252"
},
{
"name": "player_id",
Expand Down Expand Up @@ -2243,7 +2246,7 @@
"type": "core::integer::u32"
},
{
"name": "experience_to_nex_level",
"name": "experience_to_next_level",
"type": "core::integer::u64"
}
]
Expand Down
25 changes: 15 additions & 10 deletions manifests/dev/deployment/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,26 @@ manifest_name = "dojo-base"
[[contracts]]
kind = "DojoContract"
address = "0x4854bb6cc04b51e5adaed76afc0664091182fe44a9e5e68dc4f8f5f59ffd464"
class_hash = "0xb5372e1739d610fe27521a9203c77c7ff3fea6040627bee239502bdfcce147"
original_class_hash = "0xb5372e1739d610fe27521a9203c77c7ff3fea6040627bee239502bdfcce147"
class_hash = "0x4b192794775dc6ff0267fd1a9ed531908e7a661e73fe596707af46c8719b587"
original_class_hash = "0x4b192794775dc6ff0267fd1a9ed531908e7a661e73fe596707af46c8719b587"
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2"
abi = "manifests/dev/deployment/abis/contracts/bytebeasts-actions-648ac931.json"
reads = []
writes = ["bytebeasts-Beast"]
writes = [
"bytebeasts-Beast",
"bytebeasts-Mt",
"bytebeasts-Player",
"bytebeasts-Potion",
]
init_calldata = []
tag = "bytebeasts-actions"
manifest_name = "bytebeasts-actions-648ac931"

[[contracts]]
kind = "DojoContract"
address = "0x612b684f6b34356ad9a07ac3e1924f9dfa54235d0a513095b0d12695ace8b68"
class_hash = "0x153d3b6c19c130e1f6028634213cdc5f9f9236db13f9d03afe371c4163bbbd6"
original_class_hash = "0x153d3b6c19c130e1f6028634213cdc5f9f9236db13f9d03afe371c4163bbbd6"
class_hash = "0x56093b60a0b0aa8902f1dd09a888754a910967e4029bb70d8983ee846d4f488"
original_class_hash = "0x56093b60a0b0aa8902f1dd09a888754a910967e4029bb70d8983ee846d4f488"
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2"
abi = "manifests/dev/deployment/abis/contracts/bytebeasts-battle_system-461868ac.json"
reads = []
Expand All @@ -49,8 +54,8 @@ manifest_name = "bytebeasts-battle_system-461868ac"

[[models]]
kind = "DojoModel"
class_hash = "0x2edfc0419e5dc0630fe45e0d983b8273119c14ac89e544926c34f48c6f5605e"
original_class_hash = "0x2edfc0419e5dc0630fe45e0d983b8273119c14ac89e544926c34f48c6f5605e"
class_hash = "0x1ae435e73e2ccb909d2fc7ea7ac0def65e0e2df5cb9496caa4e08d54f2c428c"
original_class_hash = "0x1ae435e73e2ccb909d2fc7ea7ac0def65e0e2df5cb9496caa4e08d54f2c428c"
abi = "manifests/dev/deployment/abis/models/bytebeasts-Beast-27809d20.json"
tag = "bytebeasts-Beast"
manifest_name = "bytebeasts-Beast-27809d20"
Expand All @@ -62,7 +67,7 @@ key = true

[[models.members]]
name = "beast_name"
type = "u32"
type = "felt252"
key = false

[[models.members]]
Expand All @@ -72,7 +77,7 @@ key = false

[[models.members]]
name = "beast_description"
type = "u32"
type = "felt252"
key = false

[[models.members]]
Expand Down Expand Up @@ -126,7 +131,7 @@ type = "u32"
key = false

[[models.members]]
name = "experience_to_nex_level"
name = "experience_to_next_level"
type = "u64"
key = false

Expand Down
2 changes: 1 addition & 1 deletion overlays/dev/actions.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tag = "bytebeasts-actions"
writes = [ "bytebeasts-Beast"]
writes = [ "bytebeasts-Beast", "bytebeasts-Mt", "bytebeasts-Player", "bytebeasts-Potion"]
6 changes: 3 additions & 3 deletions src/models.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use starknet::ContractAddress;
pub struct Beast {
#[key]
pub beast_id: u32,
pub beast_name: u32,
pub beast_name: felt252,
pub beast_type: u32,
pub beast_description: u32,
pub beast_description: felt252,
pub player_id: u32,
pub hp: u32,
pub current_hp: u32,
Expand All @@ -18,7 +18,7 @@ pub struct Beast {
pub mt3: u32,
pub mt4: u32,
pub level: u32,
pub experience_to_nex_level: u64,
pub experience_to_next_level: u64,
}

#[derive(Copy, Drop, Serde)]
Expand Down
Loading

0 comments on commit 923ea57

Please sign in to comment.