Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Jun 25, 2024
2 parents 224908c + c8dae00 commit c07c2d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/combat/src/combat.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl ImplCombat of ICombat {
/// @return The calculated random level.
fn get_random_level(adventurer_level: u8, entropy: u128) -> u16 {
// Calculate the base random level using entropy and the adventurer's level
let level = 1 + (entropy % (adventurer_level.into() * 2)).try_into().unwrap();
let level = 1 + (entropy % (adventurer_level.into() * 3)).try_into().unwrap();

// Adjust the level upward based on the adventurer's current level
if (adventurer_level >= 50) {
Expand All @@ -377,7 +377,7 @@ impl ImplCombat of ICombat {
/// @return The calculated starting health for the enemy.
fn get_enemy_starting_health(adventurer_level: u8, entropy: u128) -> u16 {
// Calculate the base enemy health using entropy and the adventurer's level
let health = 1 + (entropy % (adventurer_level.into() * 15)).try_into().unwrap();
let health = 1 + (entropy % (adventurer_level.into() * 20)).try_into().unwrap();

// Adjust the enemy's health upward based on the adventurer's current level
if (adventurer_level >= 50) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/katana/katana_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo '' > /katana/.env
source ~/.bashrc

# Start katana in the background
/root/.dojo/bin/katana --disable-fee --allowed-origins "*" --dev --block-time 5000 --seed 0x6c6f6f747375727669766f72 --accounts 10 --json-log --db-dir /katana/db > ~/katana.log 2>&1 &
/root/.dojo/bin/katana --disable-fee --allowed-origins "*" --block-time 10000 --seed 0x6c6f6f747375727669766f72 --accounts 10 --json-log --db-dir /katana/db > ~/katana.log 2>&1 &

# Give katana a few seconds to initialize and log seed accounts
sleep 3
Expand Down
2 changes: 1 addition & 1 deletion scripts/katana_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ source $ENV_FILE
cd /workspaces/loot-survivor/contracts/
scarb build

katana --disable-fee --dev --block-time 3000 --seed 0x6c6f6f747375727669766f72 --accounts 1 --json-log > ~/katana.log 2>&1 & echo $! > ~/katana_pid.txt
katana --disable-fee --block-time 30000 --seed 0x6c6f6f747375727669766f72 --accounts 1 --json-log > ~/katana.log 2>&1 & echo $! > ~/katana_pid.txt
sleep 3
output=$(head -n 1 ~/katana.log | jq -r '.fields.message | fromjson | .accounts[0] | .[0], .[-1].private_key')
account_address_decimal=$(echo "$output" | head -n 1)
Expand Down

0 comments on commit c07c2d3

Please sign in to comment.