Skip to content

Commit

Permalink
Revert "fix stats"
Browse files Browse the repository at this point in the history
This reverts commit 7ea7f83.
  • Loading branch information
notV4l committed Jun 10, 2024
1 parent 9e40974 commit 4166501
Show file tree
Hide file tree
Showing 30 changed files with 697 additions and 3,743 deletions.
24 changes: 6 additions & 18 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 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"

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.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_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 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,7 +57,6 @@ 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 @@ -70,8 +69,8 @@ private_key = "0x18055e629284db77daa8d60e4ca767d65807c3f1690785006e46d6e63a13d54

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

[profile.ryosepolia.tool.dojo.env]
# world_address= "0x45d3b72e3c6c85c38d43798b9751817f14fac4b14c3645480683f8fae1c6464"
Expand All @@ -86,26 +85,15 @@ 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://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/"
website = "https://rollyourown.preview.cartridge.gg/"
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
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: 9 - 2,
defense_base: 16 - 4,
attack_step: 8 - 2,
defense_base: 16 - 2,
defense_step: 9 - 2,
speed_base: 6,
speed_step: 9 - 2,
speed_base: 6 - 2,
speed_step: 8 - 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: 12 - 2,
defense_base: 7 - 4,
attack_step: 11 - 2,
defense_base: 7,
defense_step: 8 - 2,
speed_base: 2,
speed_step: 9 - 2,
speed_step: 8 - 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: 9,
attack_step: 8,
defense_base: 16,
defense_step: 9,
speed_base: 6,
speed_step: 9,
speed_step: 8,
}
);

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

Expand All @@ -107,14 +107,14 @@ fn initialize_encounter_stats_config(s: IStoreLibraryDispatcher) {
EncounterStatsConfig {
encounter: Encounters::Cops,
encounters_mode: EncountersMode::UltraViolence,
health_base: 12 + 3,
health_base: 12 + 2,
health_step: 8 + 2,
attack_base: 14 + 3,
attack_step: 9 + 2,
defense_base: 16 + 3,
attack_base: 14 + 2,
attack_step: 8 + 2,
defense_base: 16 + 2,
defense_step: 9 + 2,
speed_base: 6 + 3,
speed_step: 9 + 2,
speed_base: 6 + 2,
speed_step: 8 + 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 + 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,
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,
}
);
}
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 / 15 + 1 },
EncountersOddsMode::Hard => { reputation / 10 + 1 },
EncountersOddsMode::Normal => { reputation / 16 + 1 },
EncountersOddsMode::Hard => { reputation / 12 + 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 / 3;
(self.level.into() * 2 + (turn_modifer.into() * turn_modifer.into())) * 900
let turn_modifer = game_store.player.turn / 5;
(self.level.into() * 3 + (turn_modifer.into() * turn_modifer.into())) * 1_000
}
}

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_900,
cost: 2_600,
}
);
set!(
Expand All @@ -354,7 +354,7 @@ fn initialize_weapons_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Weapon.into(),
tier: 4,
stat: 48,
cost: 16_900,
cost: 12_000,
}
);
set!(
Expand All @@ -364,7 +364,7 @@ fn initialize_weapons_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Weapon.into(),
tier: 5,
stat: 60,
cost: 79_900,
cost: 75_000,
}
);
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_900,
cost: 2_800,
}
);
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_900,
cost: 11_000,
}
);
set!(
Expand All @@ -423,7 +423,7 @@ fn initialize_clothes_tiers_config(world: IWorldDispatcher) {
slot_id: ItemSlot::Clothes.into(),
tier: 5,
stat: 60,
cost: 66_900,
cost: 65_000,
}
);
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: 10, cost: 300,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 2, stat: 12, cost: 300,
}
);
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 3, stat: 20, cost: 1_800,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 3, stat: 25, cost: 1_600,
}
);
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 4, stat: 32, cost: 16_900,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 4, stat: 40, cost: 9_600,
}
);
set!(
world,
HustlerItemTiersConfig {
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 5, stat: 45, cost: 89_900,
slot: ItemSlot::Feet, slot_id: ItemSlot::Feet.into(), tier: 5, stat: 55, cost: 58_000,
}
);
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_900,
cost: 59_500,
}
);
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: 3,
rep_jailed: 5,
rep_hospitalized: 4,
rep_jailed: 6,
}
}

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/packing/game_store.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl GameStoreImpl of GameStoreTrait {
return false;
}

if self.player.turn >= self.game_config().max_turns {
if self.player.turn == self.game_config().max_turns {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/systems/devtools.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod devtools {
let season_manager = SeasonManagerTrait::new(self.s());
let season_version = season_manager.get_current_version();

let mut randomizer = RandomImpl::new(array!['devtools', game_id.into()].span());
let mut randomizer = RandomImpl::new('devtools');
let rand_score: u32 = if final_score > 0 {
final_score
} else {
Expand Down Expand Up @@ -100,7 +100,7 @@ mod devtools {
ryo_config.season_version += 1;
self.s().save_ryo_config(ryo_config);

let mut randomizer = RandomImpl::new(array!['devtools', ryo_config.season_version.into()].span());
let mut randomizer = RandomImpl::new('devtools');
let season_manager = SeasonManagerTrait::new(self.s());
season_manager.new_season(ref randomizer, ryo_config.season_version);
}
Expand Down
4 changes: 2 additions & 2 deletions src/systems/game.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ mod game {
let mut actions = actions;
self.execute_actions(ref game_store, ref actions);

let mut randomizer = RandomImpl::new( array!['travel', game_id.into(), game_store.player.turn.into()].span());
let mut randomizer = RandomImpl::new('travel');
let mut season_settings = self.s().season_settings(game_store.game.season_version);
// save next_location
game_store.player.next_location = next_location;
Expand Down Expand Up @@ -279,7 +279,7 @@ mod game {
// check player status
assert(game_store.player.can_decide(), 'player cannot decide');

let mut randomizer = RandomImpl::new(array!['decide', game_id.into(), game_store.player.turn.into()].span());
let mut randomizer = RandomImpl::new('decide');
let mut season_settings = self.s().season_settings(game_store.game.season_version);

// // resolve decision
Expand Down
2 changes: 1 addition & 1 deletion src/systems/helpers/game_loop.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn on_turn_end(
game_store.player.next_location = Locations::Home;

// update turn
game_store.player.turn = game_store.player.turn.add_capped(1, game_store.game_config().max_turns);
game_store.player.turn += 1;

// increase reputation by rep_carry_drugs if carrying drugs, 1 otherwise
let mut game_config = game_store.game_config();
Expand Down
Loading

0 comments on commit 4166501

Please sign in to comment.