Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc 1 #1851

Merged
merged 375 commits into from
Nov 4, 2024
Merged

Rc 1 #1851

Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
375 commits
Select commit Hold shift + click to select a range
7ed275b
merge
ponderingdemocritus Oct 23, 2024
d4b459c
Enh/merge troops capacity check (#1873)
bob0005 Oct 23, 2024
fd88f3c
[config + contract] battle time limit (#1900)
credence0x Oct 23, 2024
3586373
contracts: fix test
credence0x Oct 24, 2024
aa55533
fix scripts for linux, add torii config for erc indexing
RedBeardEth Oct 24, 2024
57688d2
add realm and season mint functions to sdk
RedBeardEth Oct 24, 2024
37f544c
various landing components for mint realm
RedBeardEth Oct 24, 2024
02461f5
Merge branch 'feat/landing' of https://github.com/BibliothecaDAO/eter…
ponderingdemocritus Oct 24, 2024
dfaf38c
codegen
ponderingdemocritus Oct 24, 2024
8b5d625
exports
ponderingdemocritus Oct 24, 2024
d67ca2d
fix overwrite
ponderingdemocritus Oct 24, 2024
30555a9
delete remove data
ponderingdemocritus Oct 24, 2024
8c3dafc
basic realm minting
RedBeardEth Oct 24, 2024
b03ef6f
working realm selection
RedBeardEth Oct 24, 2024
26a81c9
add season pass mint functionality
RedBeardEth Oct 24, 2024
341574f
[client] improve entity details show/hide (#1898)
aymericdelab Oct 24, 2024
b15ac4c
add more LP stats (#1895)
aymericdelab Oct 24, 2024
0decb19
contracts: allow season pass mint to any address (#1901)
credence0x Oct 24, 2024
16fef7f
strip unusued dojo components
RedBeardEth Oct 24, 2024
434956a
bump dojo
ponderingdemocritus Oct 24, 2024
9e6aba5
deployments scripts and setup
ponderingdemocritus Oct 25, 2024
9f4fce9
Merge branch 'rc-1' into feat/landing
ponderingdemocritus Oct 25, 2024
7951044
fix
ponderingdemocritus Oct 25, 2024
78e365c
update dojo
ponderingdemocritus Oct 25, 2024
2a25fc8
add season pass mint dialog
RedBeardEth Oct 25, 2024
f1f875d
fix torii issue
ponderingdemocritus Oct 25, 2024
23be36d
Merge branch 'feat/landing' of https://github.com/BibliothecaDAO/eter…
ponderingdemocritus Oct 25, 2024
1d429c4
prettier
ponderingdemocritus Oct 25, 2024
680539a
new donkey event + improve event stream (#1904)
aymericdelab Oct 25, 2024
ecae590
feat: simulate raid (#1905)
edisontim Oct 25, 2024
2310a62
Add deposit all button + new transfer after previous one
edisontim Oct 25, 2024
dab5e2b
Merge pull request #1910 from BibliothecaDAO/feat/deposit-all
ponderingdemocritus Oct 26, 2024
1b2960b
deplouyment work
ponderingdemocritus Oct 27, 2024
4f4c1a0
merge
ponderingdemocritus Oct 27, 2024
003ac93
pwa work
ponderingdemocritus Oct 27, 2024
aa87c34
fix season pass mint, various ux
RedBeardEth Oct 28, 2024
f32cc95
[client] show more context in the market modal (#1909)
aymericdelab Oct 28, 2024
e30fdc1
contracts: split combat contracts
credence0x Oct 29, 2024
c6f15ba
Revert "contracts: split combat contracts"
credence0x Oct 29, 2024
a34984b
Fix/contract compilation size issue (#1914)
credence0x Oct 29, 2024
e138a98
balancing
ponderingdemocritus Oct 29, 2024
db9998c
Merge branch 'feat/landing' of https://github.com/BibliothecaDAO/eter…
ponderingdemocritus Oct 29, 2024
8baa182
[client] graphics update (#1912)
r0man1337 Oct 29, 2024
8309a9b
feat: add battle simulation window (#1911)
edisontim Oct 29, 2024
c1e4d12
fix fps drop (#1918)
edisontim Oct 30, 2024
276aa0a
personal event stream (#1921)
aymericdelab Oct 30, 2024
c5a873f
[client] default hex (#1922)
aymericdelab Oct 30, 2024
55b5807
[client] left navigation menu issue on small screens (#1923)
aymericdelab Oct 30, 2024
003d70f
add cartridge
RedBeardEth Oct 31, 2024
ada1944
better realm minting experience
RedBeardEth Oct 31, 2024
359e1c8
fix season pass minted logic and build errors
RedBeardEth Oct 31, 2024
0472626
add landing build script
RedBeardEth Oct 31, 2024
ac1ee24
add top level await plugin
RedBeardEth Oct 31, 2024
63d8757
change from burner to controller
RedBeardEth Oct 31, 2024
b86500b
add mkcert, update starknet provider rpc
RedBeardEth Oct 31, 2024
c81f5e1
revert tsconfig downgrade
RedBeardEth Oct 31, 2024
757dea6
client
ponderingdemocritus Oct 31, 2024
6fa946b
Merge branch 'feat/landing' of https://github.com/BibliothecaDAO/eter…
ponderingdemocritus Oct 31, 2024
f260a49
fix cartridge connector
RedBeardEth Oct 31, 2024
a702529
Merge branch 'feat/landing' of https://github.com/BibliothecaDAO/eter…
ponderingdemocritus Oct 31, 2024
9d52288
controller
ponderingdemocritus Oct 31, 2024
023c067
[client] display new weight type for troops in documentation (#1925)
aymericdelab Oct 31, 2024
b85a25f
feat: new models, bug fixes
r0man1337 Oct 31, 2024
406b8a3
feat: animated instanced models support
r0man1337 Oct 31, 2024
8cbdb57
fix: biomes models
r0man1337 Oct 31, 2024
d3fb7ec
contracts: migration wip
credence0x Oct 31, 2024
e3ff5d7
contracts: migration wip
credence0x Oct 31, 2024
e470d21
[client] make UI mobile friendly
aymericdelab Oct 31, 2024
cd75fda
contracts: migration wip
credence0x Oct 31, 2024
c13cd08
contracts: migration wip
credence0x Oct 31, 2024
e9cb7a9
contracts: migration wip
credence0x Oct 31, 2024
f3ef035
contracts: migration: add historical label to events
credence0x Oct 31, 2024
2486827
contracts: migration: update config and client
credence0x Oct 31, 2024
a2d9695
contracts: migration: bug fix and scarb fmt
credence0x Oct 31, 2024
8ec19e7
contracts: migration: update manifests
credence0x Oct 31, 2024
c667dec
contracts: migration: update manifests
credence0x Oct 31, 2024
b453596
contracts: migration: update manifests
credence0x Oct 31, 2024
932c950
add login flow to season pass mint
RedBeardEth Nov 1, 2024
928b171
Merge pull request #1930 from BibliothecaDAO/dojo-1.0.0-rc.0
ponderingdemocritus Nov 1, 2024
ba0494b
merge
ponderingdemocritus Nov 1, 2024
eb2b859
merge
ponderingdemocritus Nov 1, 2024
e31afc0
merge'
ponderingdemocritus Nov 1, 2024
59cddd4
Merge pull request #1879 from BibliothecaDAO/feat/landing
ponderingdemocritus Nov 1, 2024
963476d
merge issue
ponderingdemocritus Nov 1, 2024
fb1e3db
deployments
ponderingdemocritus Nov 1, 2024
4c7f964
fix real contracts
ponderingdemocritus Nov 1, 2024
6de7390
add back torii config for ERC indexing
RedBeardEth Nov 1, 2024
5dc3bc0
config: update .env.production
credence0x Nov 1, 2024
9dbc41f
config: update deploy.sh
credence0x Nov 1, 2024
95f5490
feat: add sounds (#1926)
edisontim Nov 1, 2024
22449f4
pwa
ponderingdemocritus Nov 1, 2024
7833d38
fix account
ponderingdemocritus Nov 1, 2024
d005d7d
continue mobile UI
aymericdelab Nov 1, 2024
0cc2229
icons
ponderingdemocritus Nov 1, 2024
8248678
Refactor left navigation menu and storehouse tooltip in TopLeftNaviga…
aymericdelab Nov 1, 2024
0e1332b
Refactor WorldmapScene to conditionally create and show/hide the mini…
aymericdelab Nov 1, 2024
074124e
improve mobile xp
aymericdelab Nov 1, 2024
5f6a2c0
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
aymericdelab Nov 1, 2024
e8a568d
build issue
aymericdelab Nov 1, 2024
822ad1f
prettier
aymericdelab Nov 1, 2024
1ba99ae
prettier
aymericdelab Nov 1, 2024
325b8be
knip ignore
aymericdelab Nov 1, 2024
6f632ba
Merge pull request #1931 from BibliothecaDAO/raschel/issue1929
ponderingdemocritus Nov 1, 2024
dfd5c5f
Impl. production buildings list
bob0005 Nov 2, 2024
2c80369
Merge branch 'rc-1' into enh/buildings-list
bob0005 Nov 2, 2024
df7697d
fix account issue on movement
ponderingdemocritus Nov 2, 2024
dca104d
Fix tests dojov1.0.0-rc.0 (#1936)
credence0x Nov 2, 2024
6685c57
fix account
ponderingdemocritus Nov 3, 2024
51a1802
account
ponderingdemocritus Nov 3, 2024
57edcbf
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 3, 2024
1e94beb
feat: new bank model, types refactor
r0man1337 Nov 3, 2024
a6d95ec
polishing
ponderingdemocritus Nov 3, 2024
71d3639
feat: new models
r0man1337 Nov 3, 2024
ef27bff
fix: git attributes hdr
r0man1337 Nov 3, 2024
b11dec3
feat: new environment, lights
r0man1337 Nov 3, 2024
60bbf41
Merge pull request #1935 from BibliothecaDAO/enh/buildings-list
ponderingdemocritus Nov 3, 2024
75b16fe
feat: rotation fixes
r0man1337 Nov 3, 2024
205b141
fix: ground mesh metalness
r0man1337 Nov 3, 2024
a7b5c14
fix: hdr texture optimization
r0man1337 Nov 3, 2024
018d7f8
feat: forge resources colors
r0man1337 Nov 3, 2024
e9f0700
cleanups
ponderingdemocritus Nov 3, 2024
716f745
account
ponderingdemocritus Nov 3, 2024
2834f08
account context
ponderingdemocritus Nov 3, 2024
7b451f5
log
ponderingdemocritus Nov 3, 2024
3327118
feat: models
r0man1337 Nov 3, 2024
1fcc5de
Merge branch 'rc-1' into feat/leet
r0man1337 Nov 3, 2024
5872a6e
contracts: add stamina refill config
credence0x Nov 3, 2024
6f771ef
contracts: remove warning during season pass compilation
credence0x Nov 3, 2024
dcfb369
contracts: update manifest
credence0x Nov 3, 2024
3f1549f
contracts: fix sub overflow in pillage
credence0x Nov 3, 2024
366dc55
fix loading
ponderingdemocritus Nov 3, 2024
77490fa
lint
ponderingdemocritus Nov 3, 2024
b49927b
fix dojo_dev.toml
credence0x Nov 3, 2024
8fd2093
contracts: scarb fmt
credence0x Nov 3, 2024
61f98f2
🏆 Integrate controller achievements (#1933)
bal7hazar Nov 3, 2024
e526ce5
Remove test
ponderingdemocritus Nov 3, 2024
8ac82fb
Merge pull request #1943 from BibliothecaDAO/feat/leet
ponderingdemocritus Nov 3, 2024
d87355e
fix local deploy issues
aymericdelab Nov 3, 2024
c654835
Merge pull request #1948 from BibliothecaDAO/fix-local
ponderingdemocritus Nov 3, 2024
9f6db40
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
82e89c5
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
17403a0
account owrk
ponderingdemocritus Nov 3, 2024
e6c9b45
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 3, 2024
0c78279
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
258e8c9
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
d5ed29f
fix
ponderingdemocritus Nov 3, 2024
009e1ea
Bob/dev (#1927)
bob0005 Nov 3, 2024
3893817
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
83ad711
bump version (#1949)
bob0005 Nov 3, 2024
2fd4dce
accounts
ponderingdemocritus Nov 3, 2024
83c4c02
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 3, 2024
7bd5b26
prettier
credence0x Nov 3, 2024
81c777e
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
23b011a
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
63ca259
contracts: fix tests
credence0x Nov 3, 2024
8e48a21
contracts: fix resource bridge tests (#1950)
credence0x Nov 3, 2024
662ed39
client: fix knip
credence0x Nov 3, 2024
c95a216
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
e41a1d2
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
8cede70
client: revert fix knip
credence0x Nov 3, 2024
e0c6189
client: revert fix knip
credence0x Nov 3, 2024
1904495
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
2f40afc
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
d527a64
contracts: register new events in test
credence0x Nov 3, 2024
d63d298
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
5109861
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
credence0x Nov 3, 2024
ee9e868
change guild into tribe
aymericdelab Nov 3, 2024
523bb99
Merge pull request #1944 from BibliothecaDAO/fix-pillage
ponderingdemocritus Nov 3, 2024
2b2cfcc
Merge pull request #1945 from BibliothecaDAO/stamina-config
ponderingdemocritus Nov 3, 2024
c40fd9d
deployment work
ponderingdemocritus Nov 3, 2024
5a4272b
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 3, 2024
a505a7c
new audio army select
aymericdelab Nov 4, 2024
80b1a2b
format text action info
aymericdelab Nov 4, 2024
78b962f
fix key down propagation
aymericdelab Nov 4, 2024
8abf12d
fix build
aymericdelab Nov 4, 2024
6016c5a
deployment update
ponderingdemocritus Nov 4, 2024
a3501e4
policies
ponderingdemocritus Nov 4, 2024
91ec567
fix
ponderingdemocritus Nov 4, 2024
bd0fefd
revert config
ponderingdemocritus Nov 4, 2024
a2f561a
make stamina 2
ponderingdemocritus Nov 4, 2024
4074074
improve loading flow
ponderingdemocritus Nov 4, 2024
284dfbb
guilds
ponderingdemocritus Nov 4, 2024
3dd4130
market
ponderingdemocritus Nov 4, 2024
1c08457
feat: fragment mine color
r0man1337 Nov 4, 2024
ba6a127
fix path
ponderingdemocritus Nov 4, 2024
d2882c9
add ui and graphql for realm mints
RedBeardEth Nov 4, 2024
a770f1b
Merge pull request #1954 from BibliothecaDAO/army-sound
ponderingdemocritus Nov 4, 2024
17e94db
merge
ponderingdemocritus Nov 4, 2024
78db91e
Merge pull request #1953 from BibliothecaDAO/fix/tribe
ponderingdemocritus Nov 4, 2024
e27460a
fix: error when open fragment mine hexception
r0man1337 Nov 4, 2024
ab4fbaf
prettier
ponderingdemocritus Nov 4, 2024
91425f7
fix: fragment mine hexception model
r0man1337 Nov 4, 2024
e4c3327
fix: #1887
r0man1337 Nov 4, 2024
773908d
introduce hook
ponderingdemocritus Nov 4, 2024
c0527f7
feat: reflect castle level on map
r0man1337 Nov 4, 2024
f2ff3c4
diff
ponderingdemocritus Nov 4, 2024
dbcb4b0
realm settle
ponderingdemocritus Nov 4, 2024
086721e
scarb
ponderingdemocritus Nov 4, 2024
051bc65
knip
ponderingdemocritus Nov 4, 2024
d1f00ca
fix: prettier
r0man1337 Nov 4, 2024
7d527a2
comment out for knip not sure why @tedison
ponderingdemocritus Nov 4, 2024
4da1f66
battle blah blah
ponderingdemocritus Nov 4, 2024
4d7fdf7
tests
ponderingdemocritus Nov 4, 2024
8a2cc87
fix: refactor minimap
r0man1337 Nov 4, 2024
6660583
Merge pull request #1962 from BibliothecaDAO/feat/realm-select
ponderingdemocritus Nov 4, 2024
cd391e2
feat: zoom to cursor
r0man1337 Nov 4, 2024
74454f1
Merge pull request #1964 from BibliothecaDAO/leet/dev
ponderingdemocritus Nov 4, 2024
bf0f35d
feat: new stable model
r0man1337 Nov 4, 2024
add877d
fix: stable rotation
r0man1337 Nov 4, 2024
d005dc2
increase realms limit
ponderingdemocritus Nov 4, 2024
523c2ae
🐛 Fix strategist achievement order
bal7hazar Nov 4, 2024
38e703e
fix broken paths
ponderingdemocritus Nov 4, 2024
79afdf2
feat: expandable minimap
r0man1337 Nov 4, 2024
8f1160b
feat: minimap labels
r0man1337 Nov 4, 2024
76e9fb3
feat: battles for minimap
r0man1337 Nov 4, 2024
f3656b9
feat: minimap battles
r0man1337 Nov 4, 2024
05b0d80
fix: removed minimap legend
r0man1337 Nov 4, 2024
a3254b6
fix: prettier
r0man1337 Nov 4, 2024
a15c3ca
remove soldier scream sound
aymericdelab Nov 4, 2024
d7f9eb9
Fix icons + styling
bob0005 Nov 4, 2024
4ee6227
lint
bob0005 Nov 4, 2024
5310fc9
resource chip
ponderingdemocritus Nov 4, 2024
c40b852
Merge pull request #1965 from bal7hazar/fix(trophies)/strategist
ponderingdemocritus Nov 4, 2024
b892b31
Merge pull request #1967 from BibliothecaDAO/leet/dev2
ponderingdemocritus Nov 4, 2024
859802c
formatting
ponderingdemocritus Nov 4, 2024
5665eb0
Merge pull request #1969 from BibliothecaDAO/loaf/edit
ponderingdemocritus Nov 4, 2024
8c37e8a
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 4, 2024
3a98461
remove comment + typing
bob0005 Nov 4, 2024
891e09a
Merge pull request #1968 from BibliothecaDAO/fix/social
ponderingdemocritus Nov 4, 2024
446933f
onboarding
ponderingdemocritus Nov 4, 2024
0845541
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 4, 2024
579efe7
resource chip optimisation
ponderingdemocritus Nov 4, 2024
80376c5
Enable social before finishing quests
bob0005 Nov 4, 2024
b8803f5
Merge pull request #1970 from BibliothecaDAO/fix/allow-social
ponderingdemocritus Nov 4, 2024
957c5f2
contracts: update tool-versions
credence0x Nov 4, 2024
4f92f84
contracts: fix guild events
credence0x Nov 4, 2024
2f8dda6
add loading entitie
ponderingdemocritus Nov 4, 2024
7212a73
Merge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into…
ponderingdemocritus Nov 4, 2024
3ddbf7f
Fix quest update on optimitic build
bob0005 Nov 4, 2024
6f6c17a
Merge pull request #1971 from BibliothecaDAO/fix/quest-update
ponderingdemocritus Nov 4, 2024
cd9b9d2
fix resource arrivals
aymericdelab Nov 4, 2024
c88ee86
deploy
ponderingdemocritus Nov 4, 2024
c115ba7
erge branch 'rc-1' of https://github.com/BibliothecaDAO/eternum into …
ponderingdemocritus Nov 4, 2024
2cf90eb
policies
ponderingdemocritus Nov 4, 2024
e4fe14f
merge
ponderingdemocritus Nov 4, 2024
ff15188
click hex selection
aymericdelab Nov 4, 2024
841183d
prettier
ponderingdemocritus Nov 4, 2024
405a1d9
fix army sound
aymericdelab Nov 4, 2024
8314257
onboarding
ponderingdemocritus Nov 4, 2024
0683274
Merge pull request #1972 from BibliothecaDAO/raschel/dev
ponderingdemocritus Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion balancing/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ResourceTable } from "./components/modules/resource-table";
function App() {
return (
<>
<div className="bg-black text-white">
<div className="bg-brown text-white">
<Tabs defaultValue="account">
<TabsList>
<TabsTrigger value="resources">Production</TabsTrigger>
Expand Down
2 changes: 1 addition & 1 deletion client/src/assets/icons/Coins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/assets/icons/Crown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/assets/icons/Scroll.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/assets/icons/Sparkles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/assets/icons/Swap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 2 additions & 9 deletions client/src/dojo/modelManager/BattleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export enum ClaimStatus {
Claimable = "Claim",
NoSelectedArmy = "No selected army",
BattleOngoing = "Battle ongoing",
DefenderPresent = "An army's defending the structure",
NoStructureToClaim = "No structure to claim",
StructureIsMine = "Can't claim your own structure",
SelectedArmyIsDead = "Selected army is dead",
Expand All @@ -65,7 +66,6 @@ export class BattleManager {
battleEntityId: ID;
dojo: DojoResult;
battleType: BattleType | undefined;
private battleIsClaimable: ClaimStatus | undefined;

constructor(battleEntityId: ID, dojo: DojoResult) {
this.battleEntityId = battleEntityId;
Expand Down Expand Up @@ -253,36 +253,30 @@ export class BattleManager {
defender: ArmyInfo | undefined,
): ClaimStatus {
if (!selectedArmy) return ClaimStatus.NoSelectedArmy;
if (this.battleIsClaimable) return this.battleIsClaimable;

if (this.isBattleOngoing(currentTimestamp)) {
return ClaimStatus.BattleOngoing;
}

if (!structure) {
this.battleIsClaimable = ClaimStatus.NoStructureToClaim;
return ClaimStatus.NoStructureToClaim;
}

if (this.getBattleType(structure) !== BattleType.Structure) {
this.battleIsClaimable = ClaimStatus.NoStructureToClaim;
return ClaimStatus.NoStructureToClaim;
}

if (defender === undefined) {
this.battleIsClaimable = ClaimStatus.Claimable;
return ClaimStatus.Claimable;
}

const updatedBattle = this.getUpdatedBattle(currentTimestamp);
if (updatedBattle && updatedBattle.defence_army_health.current > 0n) {
this.battleIsClaimable = ClaimStatus.BattleOngoing;
return ClaimStatus.BattleOngoing;
}

if (defender.health.current > 0n) {
this.battleIsClaimable = ClaimStatus.BattleOngoing;
return ClaimStatus.BattleOngoing;
return ClaimStatus.DefenderPresent;
}

if (structure.isMine) {
Expand All @@ -293,7 +287,6 @@ export class BattleManager {
return ClaimStatus.SelectedArmyIsDead;
}

this.battleIsClaimable = ClaimStatus.Claimable;
return ClaimStatus.Claimable;
}

Expand Down
4 changes: 2 additions & 2 deletions client/src/dojo/modelManager/__tests__/BattleManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ describe("isClaimable", () => {

const isClaimable = battleManager.isClaimable(CURRENT_TIMESTAMP, army, structure, defender);

expect(isClaimable).toBe(ClaimStatus.BattleOngoing);
expect(isClaimable).toBe(ClaimStatus.DefenderPresent);
});

it("should return false if structure protector has health", () => {
Expand All @@ -652,7 +652,7 @@ describe("isClaimable", () => {

const isClaimable = battleManager.isClaimable(CURRENT_TIMESTAMP, army, structure, defender);

expect(isClaimable).toBe(ClaimStatus.BattleOngoing);
expect(isClaimable).toBe(ClaimStatus.DefenderPresent);
});

it("should return false if the structure is mine", () => {
Expand Down
54 changes: 1 addition & 53 deletions client/src/hooks/helpers/useEntities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ import {
type ID,
} from "@bibliothecadao/eternum";
import { useEntityQuery } from "@dojoengine/react";
import {
Has,
HasValue,
getComponentValue,
runQuery,
type Component,
type ComponentValue,
type Entity,
} from "@dojoengine/recs";
import { Has, getComponentValue, type Component, type ComponentValue, type Entity } from "@dojoengine/recs";
import { useMemo } from "react";
import { shortString } from "starknet";
import { useDojo } from "../context/DojoContext";
Expand Down Expand Up @@ -179,22 +171,6 @@ export const useEntities = () => {
};
};

export const getPlayerStructures = () => {
const {
setup: {
components: { Structure, Owner, Realm, Position },
},
} = useDojo();
const { getEntityName } = useEntitiesUtils();

const getStructures = (playerAddress: ContractAddress) => {
const playerStructures = runQuery([Has(Structure), HasValue(Owner, { address: playerAddress })]);
return formatStructures(Array.from(playerStructures), Structure, Realm, Position, getEntityName);
};

return getStructures;
};

export const useEntitiesUtils = () => {
const {
account: { account },
Expand Down Expand Up @@ -330,31 +306,3 @@ export const getAddressNameFromEntityIds = (
owner !== undefined,
);
};

const formatStructures = (
structures: Entity[],
Structure: Component<ClientComponents["Structure"]["schema"]>,
Realm: Component<ClientComponents["Realm"]["schema"]>,
Position: Component<ClientComponents["Position"]["schema"]>,
getEntityName: (entityId: ID) => string | undefined,
) => {
return structures
.map((id) => {
const structure = getComponentValue(Structure, id);
if (!structure) return;

const realm = getComponentValue(Realm, id);
const position = getComponentValue(Position, id);

const structureName = getEntityName(structure.entity_id);

const name = realm
? getRealmNameById(realm.realm_id)
: structureName
? `${structure?.category} ${structureName}`
: structure.category || "";
return { ...structure, position: position!, name };
})
.filter((structure): structure is PlayerStructure => structure !== undefined)
.sort((a, b) => (b.category || "").localeCompare(a.category || ""));
};
6 changes: 3 additions & 3 deletions client/src/hooks/helpers/useGetAllPlayers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContractAddress } from "@bibliothecadao/eternum";
import { ContractAddress, Player } from "@bibliothecadao/eternum";
import { Has, NotValue, runQuery } from "@dojoengine/recs";
import { useDojo } from "../context/DojoContext";
import { getAddressNameFromEntityIds, useEntitiesUtils } from "./useEntities";
Expand All @@ -14,7 +14,7 @@ export const useGetAllPlayers = () => {

const playersEntityIds = runQuery([Has(Owner), Has(Realm)]);

const getPlayers = () => {
const getPlayers = (): Player[] => {
const players = getAddressNameFromEntityIds(Array.from(playersEntityIds), Owner, getAddressNameFromEntity);

const uniquePlayers = Array.from(new Map(players.map((player) => [player.address, player])).values());
Expand All @@ -40,7 +40,7 @@ export const useGetOtherPlayers = () => {
NotValue(Owner, { address: ContractAddress(account.address) }),
]);

const getPlayers = () => {
const getPlayers = (): Player[] => {
const players = getAddressNameFromEntityIds(Array.from(playersEntityIds), Owner, getAddressNameFromEntity);

const uniquePlayers = Array.from(new Map(players.map((player) => [player.address, player])).values());
Expand Down
Loading
Loading