Skip to content

Commit

Permalink
fix & tune settings for next tests
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed Jun 10, 2024
1 parent 0b91be7 commit 9e40974
Show file tree
Hide file tree
Showing 16 changed files with 3,582 additions and 611 deletions.
24 changes: 18 additions & 6 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ auth = "./scripts/default_auth.sh"
# migrate && scarb run gendojo $PROFILE
migrate = "PROFILE=dev && sozo -P $PROFILE build && sozo -P $PROFILE migrate apply && scarb run copy_manifest $PROFILE && scarb run gendojo $PROFILE && scarb run auth $PROFILE"
migrate_ryo420 = "PROFILE=ryo420 && sozo -P $PROFILE build && sozo -P $PROFILE migrate apply && scarb run copy_manifest $PROFILE && scarb run auth $PROFILE"
migrate_ryo421 = "PROFILE=ryo421 && sozo -P $PROFILE build && sozo -P $PROFILE migrate apply && scarb run copy_manifest $PROFILE && scarb run gendojo $PROFILE && scarb run auth $PROFILE"
migrate_ryo421 = "PROFILE=ryo421 && sozo -P $PROFILE build && sozo -P $PROFILE migrate apply && scarb run copy_manifest $PROFILE && scarb run auth $PROFILE"

migrateplan_sepolia = "PROFILE=ryosepolia && sozo -P $PROFILE build && sozo -P $PROFILE migrate plan --name ryo000"
migrate_sepolia = "PROFILE=ryosepolia && sozo -P $PROFILE build && sozo -P $PROFILE migrate apply --name ryo000 --fee-estimate-multiplier 5 && scarb run copy_manifest $PROFILE"
Expand All @@ -39,8 +39,8 @@ slot_ryo420_katana = "slot d create ryo420 katana --version v0.7.0-alpha.5 -a 4
slot_ryo420_torii = "slot d create ryo420 torii --rpc https://api.cartridge.gg/x/ryo420/katana -s 0 --index-pending true --version v0.7.0-alpha.5 --world 0x78fcdfcc137fa18770f660ba2e8a3cf263907df38dfd462dc4dda048979c011"

# slot ryo421
slot_ryo421_katana = "slot d create ryo421 katana --seed 421 --version v0.7.0-alpha.3 --chain-id KATANA_SLOT_421 -b 1000 --disable-fee true --invoke-max-steps 2000000"
slot_ryo421_torii = "slot d create ryo421 torii --rpc https://api.cartridge.gg/x/ryo421/katana -s 0 --index-pending true --version v0.7.0-alpha.3 --world 0x45780a1a9786ee6bcd2e347d43d717a385dbd72e8282676d891835e0a278d14"
slot_ryo421_katana = "slot d create ryo421 katana --seed 421 --version v0.7.0-alpha.5 -a 4 -b 5000 --disable-fee true --invoke-max-steps 1000000"
slot_ryo421_torii = "slot d create ryo421 torii --rpc https://api.cartridge.gg/x/ryo421/katana -s 0 --index-pending true --version v0.7.0-alpha.5 --world 0x78fcdfcc137fa18770f660ba2e8a3cf263907df38dfd462dc4dda048979c011"

# slot ryo_sepolia
slot_ryosepolia_torii = "slot d create ryosepolia torii --rpc https://api.cartridge.gg/rpc/starknet-sepolia -s 63200 --version v0.7.0-alpha.1 --world 0x45d3b72e3c6c85c38d43798b9751817f14fac4b14c3645480683f8fae1c6464"
Expand All @@ -57,6 +57,7 @@ build-external-contracts = [
"token::components::token::erc20::erc20_burnable::erc_20_burnable_model",
]


[tool.dojo.env]
rpc_url = "http://localhost:5050"
account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03"
Expand All @@ -69,8 +70,8 @@ private_key = "0x18055e629284db77daa8d60e4ca767d65807c3f1690785006e46d6e63a13d54

[profile.ryo421.tool.dojo.env]
rpc_url = "https://api.cartridge.gg/x/ryo421/katana"
account_address = "0x7d806fc9478c73c60fac37c27888771bdb3092c21eb93452277e7673954d034"
private_key = "0x784b1dd14d761c414c6394fccca3ca1d1b0cac187e88122e4b06378f9e8c515"
account_address = "0x41aba7a917019ec5e3f72fe6e082330251137fc155b74d5dde8dcc86ba791b6"
private_key = "0x46ad0fc36a495c00768b40d2832c84519f539cf28bc477c5e06af9f8baf96c4"

[profile.ryosepolia.tool.dojo.env]
# world_address= "0x45d3b72e3c6c85c38d43798b9751817f14fac4b14c3645480683f8fae1c6464"
Expand All @@ -85,15 +86,26 @@ keystore_path = "/Users/boo/sozo_acc"
# account_address = "0x795abc2a2d5866f75c58025741329973db20966d1add5dd2a9fbdf0bb8a0266"
# private_key = "0x2e8ac99614186737cefc47effe03134f5a19c6dc2443c16510d3384769f9c78"


[tool.dojo.world]
name = "Dope Wars"
description = "Dope Wars is an onchain adaptation of the classic arbitrage game Drug Wars, built by Cartridge in partnership with Dope DAO."
website = "https://rollyourown.preview.cartridge.gg/"
website = "https://dopewars.game/"
icon_uri = "file://assets/icon.png"
cover_uri = "file://assets/cover.png"
socials.x = "https://x.com/TheDopeWars"


[profile.ryo421.tool.dojo.world]
name = "Dope Wars"
description = "Dope Wars is an onchain adaptation of the classic arbitrage game Drug Wars, built by Cartridge in partnership with Dope DAO."
website = "https://dopewars.game/"
icon_uri = "file://assets/icon.png"
cover_uri = "file://assets/cover.png"
socials.x = "https://x.com/TheDopeWars"



# alpha.3
# create game : Steps: 272281 | Bitwise: 194 | Ec Op Builtin: 3 | L 1 Blob Gas Usage: 0 | L1 Gas: 10176 | Pedersen: 50 | Poseidon Builtin: 60 | Range Checks: 42093
# buy & travel : Steps: 420350 | Bitwise: 296 | Ec Op Builtin: 3 | L 1 Blob Gas Usage: 0 | L1 Gas: 3550 | Pedersen: 56 | Poseidon Builtin: 37 | Range Checks: 77213
Expand Down
2 changes: 1 addition & 1 deletion src/_mocks/paper_mock.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ mod paper_mock {
Errors::CALLER_IS_NOT_OWNER
);

self.erc20_metadata.initialize('fPAPER', 'fPAPER', 18);
self.erc20_metadata.initialize("fPAPER", "fPAPER", 18);
self.erc20_mintable.mint(get_caller_address(), 10_000);

self.initializable.initialize();
Expand Down
58 changes: 29 additions & 29 deletions src/config/encounters.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
health_base: 12 - 2,
health_step: 8 - 2,
attack_base: 14 - 2,
attack_step: 8 - 2,
defense_base: 16 - 2,
attack_step: 9 - 2,
defense_base: 16 - 4,
defense_step: 9 - 2,
speed_base: 6 - 2,
speed_step: 8 - 2,
speed_base: 6,
speed_step: 9 - 2,
}
);

Expand All @@ -58,11 +58,11 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
health_base: 1,
health_step: 11 - 2,
attack_base: 5,
attack_step: 11 - 2,
defense_base: 7,
attack_step: 12 - 2,
defense_base: 7 - 4,
defense_step: 8 - 2,
speed_base: 2,
speed_step: 8 - 2,
speed_step: 9 - 2,
}
);

Expand All @@ -76,11 +76,11 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
health_base: 12,
health_step: 8,
attack_base: 14,
attack_step: 8,
attack_step: 9,
defense_base: 16,
defense_step: 9,
speed_base: 6,
speed_step: 8,
speed_step: 9,
}
);

Expand All @@ -92,11 +92,11 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
health_base: 1,
health_step: 11,
attack_base: 5,
attack_step: 11,
attack_step: 12,
defense_base: 7,
defense_step: 8,
speed_base: 2,
speed_step: 8,
speed_step: 9,
}
);

Expand All @@ -107,14 +107,14 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
EncounterStatsConfig {
encounter: Encounters::Cops,
encounters_mode: EncountersMode::UltraViolence,
health_base: 12 + 2,
health_base: 12 + 3,
health_step: 8 + 2,
attack_base: 14 + 2,
attack_step: 8 + 2,
defense_base: 16 + 2,
attack_base: 14 + 3,
attack_step: 9 + 2,
defense_base: 16 + 3,
defense_step: 9 + 2,
speed_base: 6 + 2,
speed_step: 8 + 2,
speed_base: 6 + 3,
speed_step: 9 + 2,
}
);

Expand All @@ -123,14 +123,14 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
EncounterStatsConfig {
encounter: Encounters::Gang,
encounters_mode: EncountersMode::UltraViolence,
health_base: 1 + 3,
health_step: 11 + 3,
attack_base: 5 + 3,
attack_step: 11 + 3,
defense_base: 7 + 3,
defense_step: 8 + 3,
speed_base: 2 + 3,
speed_step: 8 + 3,
health_base: 1 + 4,
health_step: 11 + 4,
attack_base: 5 + 4,
attack_step: 12 + 4,
defense_base: 7 + 4,
defense_step: 8 + 4,
speed_base: 2 + 4,
speed_step: 9 + 4,
}
);
}
Expand Down Expand Up @@ -194,8 +194,8 @@ impl EncounterSpawnerImpl of EncounterSpawnerTrait {
fn get_encounter_level(ref season_settings: SeasonSettings, reputation: u8) -> u8 {
let level = match season_settings.encounters_odds_mode {
EncountersOddsMode::Easy => { reputation / 20 + 1 },
EncountersOddsMode::Normal => { reputation / 16 + 1 },
EncountersOddsMode::Hard => { reputation / 12 + 1 },
EncountersOddsMode::Normal => { reputation / 15 + 1 },
EncountersOddsMode::Hard => { reputation / 10 + 1 },
};

MathImplU8::min(6, level)
Expand Down Expand Up @@ -287,8 +287,8 @@ impl EncounterImpl of EncounterTrait {
}

fn get_payout(self: EncounterConfig, ref game_store: GameStore) -> u32 {
let turn_modifer = game_store.player.turn / 5;
(self.level.into() * 3 + (turn_modifer.into() * turn_modifer.into())) * 1_000
let turn_modifer = game_store.player.turn / 3;
(self.level.into() * 2 + (turn_modifer.into() * turn_modifer.into())) * 900
}
}

22 changes: 11 additions & 11 deletions src/config/hustlers.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ fn initialize_weapons_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Weapon.into(),
tier: 3,
stat: 36,
cost: 2_600,
cost: 2_900,
}
);
set!(
Expand All @@ -354,7 +354,7 @@ fn initialize_weapons_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Weapon.into(),
tier: 4,
stat: 48,
cost: 12_000,
cost: 16_900,
}
);
set!(
Expand All @@ -364,7 +364,7 @@ fn initialize_weapons_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Weapon.into(),
tier: 5,
stat: 60,
cost: 75_000,
cost: 79_900,
}
);
set!(
Expand Down Expand Up @@ -403,7 +403,7 @@ fn initialize_clothes_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Clothes.into(),
tier: 3,
stat: 36,
cost: 2_800,
cost: 2_900,
}
);
set!(
Expand All @@ -413,7 +413,7 @@ fn initialize_clothes_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Clothes.into(),
tier: 4,
stat: 48,
cost: 11_000,
cost: 11_900,
}
);
set!(
Expand All @@ -423,7 +423,7 @@ fn initialize_clothes_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Clothes.into(),
tier: 5,
stat: 60,
cost: 65_000,
cost: 66_900,
}
);
set!(
Expand All @@ -448,25 +448,25 @@ fn initialize_feet_tiers_config(world: IWorldDispatcher) {
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 2, stat: 12, cost: 300,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 2, stat: 10, cost: 300,
}
);
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 3, stat: 25, cost: 1_600,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 3, stat: 20, cost: 1_800,
}
);
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 4, stat: 40, cost: 9_600,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 4, stat: 32, cost: 16_900,
}
);
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 5, stat: 55, cost: 58_000,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 5, stat: 45, cost: 89_900,
}
);
set!(
Expand Down Expand Up @@ -505,7 +505,7 @@ fn initialize_transport_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Transport.into(),
tier: 3,
stat: 3000,
cost: 59_500,
cost: 59_900,
}
);
set!(
Expand Down
10 changes: 5 additions & 5 deletions src/config/settings.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ impl SeasonSettingsImpl of SeasonSettingsTrait {
rep_drug_step: 20,
rep_buy_item: 2,
rep_carry_drugs: 2,
rep_hospitalized: 4,
rep_jailed: 6,
rep_hospitalized: 3,
rep_jailed: 5,
}
}

Expand All @@ -125,9 +125,9 @@ impl SeasonSettingsImpl of SeasonSettingsTrait {

fn get_max_turns(self: SeasonSettings) -> u8 {
match self.turns_mode {
TurnsMode::OnSpeed => { 24 },
TurnsMode::OnWeed => { 30 },
TurnsMode::OnMush => { 36 },
TurnsMode::OnSpeed => { 20 },
TurnsMode::OnWeed => { 24 },
TurnsMode::OnMush => { 28 },
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/systems/helpers/traveling.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl ResolutionImpl of ResolutionTrait {
fn hustler_attack(ref game_store: GameStore, ref encounter: EncounterConfig, ref randomizer: Random) -> AttackResult {
let hustler_attack:u8 = Self::plus_or_less_random_pct(
game_store.items.attack(),
20,
30,
ref randomizer
);

Expand All @@ -465,7 +465,7 @@ impl ResolutionImpl of ResolutionTrait {
fn encounter_attack(ref game_store: GameStore, ref encounter: EncounterConfig, ref randomizer: Random) -> AttackResult {
let mut encounter_attack = Self::plus_or_less_random_pct(
encounter.attack,
20,
30,
ref randomizer
);

Expand All @@ -489,7 +489,7 @@ impl ResolutionImpl of ResolutionTrait {
fn encounter_race_win(ref game_store: GameStore, ref encounter: EncounterConfig, ref randomizer: Random, ref drug_unpacked: DrugsUnpacked) -> EncounterRaceWinResult {
let mut encounter_attack = Self::plus_or_less_random_pct(
encounter.attack,
20,
30,
ref randomizer
);

Expand All @@ -502,9 +502,9 @@ impl ResolutionImpl of ResolutionTrait {
// player lose HP
game_store.player.health_loss(dmg_dealt);

// loss a 2 or 1% drug each round xd
let loss_pct = drug_unpacked.quantity.pct(1);
let possible_drug_loss = MathImpl::max(loss_pct, 2);
// loss a flat 3 or 5% drug each round xd
let loss_pct = drug_unpacked.quantity.pct(3);
let possible_drug_loss = MathImpl::max(loss_pct, 5);
let mut drug_loss = 0;

if possible_drug_loss <= drug_unpacked.quantity{
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/pages/home/SeasonDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const SeasonDetailsModal = observer(() => {
<ModalOverlay />
<ModalContent bg="bg.dark">
<ModalHeader textAlign="center" pb={0}>
Season Information
Season {seasonVersion} Information
</ModalHeader>
<ModalBody py={6} minH={"420px"}>
<Tabs variant="unstyled" w="full">
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/pages/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export const ProfileLinkDrawer = () => {
if (!account || !gameInfos || !gameEvents) return null;

return (
<HStack borderRadius={0} onClick={onClick} /*justifyContent="center"*/>
<HStack w="full" borderRadius={0} onClick={onClick} /*justifyContent="center"*/>
<HustlerIcon hustler={gameInfos.hustler_id as Hustlers} />
<Text ml="4px">{shortString.decodeShortString(gameInfos.player_name?.value)}</Text>
<Text ml="4px" textTransform="uppercase">{shortString.decodeShortString(gameInfos.player_name?.value)}</Text>
</HStack>
);
};
6 changes: 3 additions & 3 deletions web/src/components/pages/profile/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const getShareText = (game: GameClass, gameInfos: Game): string => {
return encodeURIComponent(
`I have reached Day ${game.player.turn} with ${formatCash(
game.player.cash,
)} $paper. Think you can out hustle them? #dopewars.\n\n${window.location.origin}`,
)} $paper. Think you can out hustle me? #dopewars.\n\n${window.location.origin}`,
);
} else {
return encodeURIComponent(
`${playerName} got dropped on Day ${game.player.turn} but pocketed ${formatCash(
`I got dropped on Day ${game.player.turn} but pocketed ${formatCash(
game.player.cash,
)} $paper before checking out. Think you can out hustle them? #dopewars.\n\n${window.location.origin}`,
)} $paper before checking out. Think you can out hustle me? #dopewars.\n\n${window.location.origin}`,
);
}
};
Expand Down
Loading

0 comments on commit 9e40974

Please sign in to comment.