Skip to content

Commit

Permalink
feat: combat revamp (#1140)
Browse files Browse the repository at this point in the history
* Beginning of changes to UI/UX for battles

* Heavily modify battle systems

* Build and prettier

* Create util function to get percentage of remaining troops in battle

* Rename resources function

* Limit army (#1141)

* contract: limit armies and enable deletion

* contracts: delete army if merging kills troop

* contracts: bug fixes from v1 branch

* update test

* remove tooltip library

* Add function to delete armies and limit number of armies in UI

* prettier + remove unused imports

* address PR comments

* Fix "ennemy" typo

* Remove biome and add hintmodal in entity details panel

* Remove bigint casts

* Change sdk values back

* Fix small bugs in battleview + fix deposit of resources on structure in battle + small optimizations

* prettier

* Changes to army limit contracts/UI + way of selecting army in entity details

* Change ArmyQuantityTracker to AttackingArmyQuantityTracker

---------

Co-authored-by: Credence <[email protected]>
  • Loading branch information
edisontim and credence0x authored Jul 29, 2024
1 parent 14fdf9f commit 371b02f
Show file tree
Hide file tree
Showing 106 changed files with 5,161 additions and 3,232 deletions.
1 change: 1 addition & 0 deletions client/src/assets/icons/common/bagpack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/icons/common/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/icons/common/trashcan.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: 8 additions & 3 deletions client/src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ export function createSystemCalls({ provider }: SetupNetworkResult) {
await provider.create_army(props);
};

const delete_army = async (props: SystemProps.ArmyDeleteProps) => {
await provider.delete_army(props);
};

const army_buy_troops = async (props: SystemProps.ArmyBuyTroopsProps) => {
await provider.army_buy_troops(props);
};
Expand Down Expand Up @@ -240,8 +244,8 @@ export function createSystemCalls({ provider }: SetupNetworkResult) {
await provider.battle_claim_and_leave(props);
};

const battle_leave_and_raid = async (props: SystemProps.BattleLeaveAndRaidProps) => {
await provider.battle_leave_and_raid(props);
const battle_leave_and_pillage = async (props: SystemProps.BattleLeaveAndRaidProps) => {
await provider.battle_leave_and_pillage(props);
};

const battle_claim = async (props: SystemProps.BattleClaimProps) => {
Expand Down Expand Up @@ -288,6 +292,7 @@ export function createSystemCalls({ provider }: SetupNetworkResult) {
destroy_building,
create_building,
create_army,
delete_army,
uuid,
create_hyperstructure,
contribute_to_construction,
Expand All @@ -313,7 +318,7 @@ export function createSystemCalls({ provider }: SetupNetworkResult) {
battle_claim,
battle_pillage,
battle_leave_and_claim,
battle_leave_and_raid,
battle_leave_and_pillage,
};

// TODO: Fix Type
Expand Down
Loading

0 comments on commit 371b02f

Please sign in to comment.