diff --git a/src/config/encounters.cairo b/src/config/encounters.cairo index a8cbd829..1bda192e 100644 --- a/src/config/encounters.cairo +++ b/src/config/encounters.cairo @@ -116,7 +116,7 @@ impl EncounterSpawnerImpl of EncounterSpawnerTrait { let encounter = get!(world, (id), (EncounterConfig)); - if rep >= encounter.min_rep && rep < encounter.max_rep { + if rep >= encounter.min_rep && rep <= encounter.max_rep { encounters_ids.append(encounter.id); }; @@ -142,7 +142,7 @@ impl EncounterSpawnerImpl of EncounterSpawnerTrait { encounter.demand_pct = EncounterSpawnerImpl::get_random_demand_pct(ref game_store); // set scaling payout - encounter.payout = (encounter.level.into() * encounter.level.into() * 4_000) + (game_store.player.turn.into() * 1_000); + encounter.payout = (encounter.level.into() * encounter.level.into() * 3_000) + (game_store.player.turn.into() * 1_000); encounter } diff --git a/src/packing/player.cairo b/src/packing/player.cairo index 9b85f7f3..8d176c37 100644 --- a/src/packing/player.cairo +++ b/src/packing/player.cairo @@ -202,7 +202,7 @@ impl PlayerImpl of PlayerTrait { // level down if self.drug_level > drug_level { // check if not carrying drug to be disabled - if drugs.quantity > 0 && drugs.drug.into() > drug_level + 4 { + if drugs.quantity > 0 && drugs.drug.into() >= drug_level + 4 { return; } } diff --git a/src/systems/traveling.cairo b/src/systems/traveling.cairo index f734ec7e..a54d971e 100644 --- a/src/systems/traveling.cairo +++ b/src/systems/traveling.cairo @@ -112,7 +112,7 @@ fn on_travel(ref game_store: GameStore, ref randomizer: Random) -> (bool, bool) encounter_id: encounter.id, demand_pct: encounter.demand_pct, payout: encounter.payout, - } + } ))); (game_store.player.is_dead(), true) @@ -444,11 +444,11 @@ impl ResolutionImpl of ResolutionTrait { } fn encounter_attack(ref game_store: GameStore, ref encounter: EncounterConfig, ref randomizer: Random) -> AttackResult { - let encounter_attack = encounter.attack; + let encounter_attack = encounter.attack / 3; let hustler_defense = game_store.items.defense(); let dmg_shield = encounter_attack.pct(hustler_defense.into()); - let dmg_dealt = (encounter_attack - dmg_shield) / 3; // TODO: config *** + let dmg_dealt = encounter_attack - dmg_shield; // TODO: config *** // player lose HP game_store.player.health_loss(dmg_dealt); @@ -462,11 +462,11 @@ impl ResolutionImpl of ResolutionTrait { } fn encounter_race_win(ref game_store: GameStore, ref encounter: EncounterConfig, ref randomizer: Random, ref drug_unpacked: DrugsUnpacked) -> EncounterRaceWinResult { - let encounter_attack = encounter.attack; + let encounter_attack = encounter.attack / 5; let hustler_defense = game_store.items.defense(); let dmg_shield = encounter_attack.pct(hustler_defense.into()); - let dmg_dealt = (encounter_attack - dmg_shield) / 5; // TODO: config *** + let dmg_dealt = encounter_attack - dmg_shield; // TODO: config *** // player lose HP game_store.player.health_loss(dmg_dealt); diff --git a/web/src/components/icons/items/Reputation.tsx b/web/src/components/icons/items/Reputation.tsx new file mode 100644 index 00000000..e08c87f6 --- /dev/null +++ b/web/src/components/icons/items/Reputation.tsx @@ -0,0 +1,12 @@ +import { Icon, IconProps } from ".."; + +export const Reputation = (props: IconProps) => { + return ( + + + + ); +}; diff --git a/web/src/components/icons/items/Shoes2.tsx b/web/src/components/icons/items/Shoes2.tsx new file mode 100644 index 00000000..cfc39648 --- /dev/null +++ b/web/src/components/icons/items/Shoes2.tsx @@ -0,0 +1,14 @@ +import { Icon, IconProps } from ".."; + +export const Shoes2 = (props: IconProps) => { + return ( + + <> + + + + ); +}; diff --git a/web/src/components/layout/MobileMenu.tsx b/web/src/components/layout/MobileMenu.tsx index 7c963b2c..be5a2692 100644 --- a/web/src/components/layout/MobileMenu.tsx +++ b/web/src/components/layout/MobileMenu.tsx @@ -1,5 +1,4 @@ import { useDojoContext, useRouterContext } from "@/dojo/hooks"; -import { Sounds, playSound } from "@/hooks/sound"; import { Menu, MenuItem, Popover, PopoverBody, PopoverContent, PopoverTrigger, StyleProps } from "@chakra-ui/react"; import { Cigarette, Dots, Home } from "../icons"; import { ProfileLinkMobile } from "../pages/profile/Profile"; @@ -40,8 +39,7 @@ export const MobileMenu = ({ ...props }: StyleProps) => { { - playSound(Sounds.Ooo); - //uiStore.openQuitGame(); + uiStore.openRefreshGame(); }} > IM LOST diff --git a/web/src/components/layout/RefreshGameModal.tsx b/web/src/components/layout/RefreshGameModal.tsx new file mode 100644 index 00000000..e22fee37 --- /dev/null +++ b/web/src/components/layout/RefreshGameModal.tsx @@ -0,0 +1,46 @@ +import { useDojoContext, useRouterContext } from "@/dojo/hooks"; +import { + Button, + HStack, + Modal, + ModalBody, + ModalContent, + ModalHeader, + ModalOverlay, + VStack +} from "@chakra-ui/react"; +import { observer } from "mobx-react-lite"; + +export const RefreshGameModal = observer(() => { + const { router, gameId } = useRouterContext(); + const { uiStore } = useDojoContext(); + + return ( + {}}> + + + Im lost + + + + + + + + + + + ); +}); diff --git a/web/src/components/map/WantedMarkers.tsx b/web/src/components/map/WantedMarkers.tsx index 79048ce8..04c50e87 100644 --- a/web/src/components/map/WantedMarkers.tsx +++ b/web/src/components/map/WantedMarkers.tsx @@ -1,5 +1,6 @@ import { useConfigStore, useGameStore } from "@/dojo/hooks"; import { Locations } from "@/dojo/types"; +import { IsMobile } from "@/utils/ui"; import { Box } from "@chakra-ui/react"; import { useEffect, useState } from "react"; import { Alert } from "../icons"; @@ -8,9 +9,12 @@ import { coordinatePercent } from "./Map"; export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; current?: Locations }) => { const { game } = useGameStore(); const configStore = useConfigStore(); + const { config } = configStore; const [wanted, setWanted] = useState>(); - const minWanted = 69; + const minWanted = (config?.config.game_config.max_wanted_shopping * 100n) / 8n; + + const isMobile = IsMobile(); useEffect(() => { const locations = configStore.config?.location!; @@ -33,6 +37,8 @@ export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; cur position="absolute" left={`${coordinatePercent[Locations.Queens].x - 2}%`} top={`${coordinatePercent[Locations.Queens].y - 1}%`} + width={isMobile ? "20px" : "24px"} + height={isMobile ? "20px" : "24px"} /> )} {/* Jersey */} @@ -41,6 +47,8 @@ export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; cur position="absolute" left={`${coordinatePercent[Locations.Jersey].x - 2}%`} top={`${coordinatePercent[Locations.Jersey].y - 1}%`} + width={isMobile ? "20px" : "24px"} + height={isMobile ? "20px" : "24px"} /> )} {/* Bronx */} @@ -49,6 +57,8 @@ export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; cur position="absolute" left={`${coordinatePercent[Locations.Bronx].x - 2}%`} top={`${coordinatePercent[Locations.Bronx].y - 1}%`} + width={isMobile ? "20px" : "24px"} + height={isMobile ? "20px" : "24px"} /> )} {/* Central */} @@ -57,6 +67,8 @@ export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; cur position="absolute" left={`${coordinatePercent[Locations.Central].x - 2}%`} top={`${coordinatePercent[Locations.Central].y - 1}%`} + width={isMobile ? "20px" : "24px"} + height={isMobile ? "20px" : "24px"} /> )} {/* Coney */} @@ -65,6 +77,8 @@ export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; cur position="absolute" left={`${coordinatePercent[Locations.Coney].x - 2}%`} top={`${coordinatePercent[Locations.Coney].y - 1}%`} + width={isMobile ? "20px" : "24px"} + height={isMobile ? "20px" : "24px"} /> )} {/* Brooklyn */} @@ -73,6 +87,8 @@ export const WantedMarkers = ({ targetId, current }: { targetId?: Locations; cur position="absolute" left={`${coordinatePercent[Locations.Brooklyn].x - 2}%`} top={`${coordinatePercent[Locations.Brooklyn].y - 1}%`} + width={isMobile ? "20px" : "24px"} + height={isMobile ? "20px" : "24px"} /> )} diff --git a/web/src/components/pages/profile/HustlerProfile.tsx b/web/src/components/pages/profile/HustlerProfile.tsx index f006303f..c220dd15 100644 --- a/web/src/components/pages/profile/HustlerProfile.tsx +++ b/web/src/components/pages/profile/HustlerProfile.tsx @@ -9,7 +9,7 @@ import { useEffect, useState } from "react"; import ShareButton from "./ShareButton"; export const HustlerProfile = observer(() => { - const { gameId} = useRouterContext() + const { gameId } = useRouterContext(); const { game, gameInfos } = useGameStore(); const configStore = useConfigStore(); const [hustlerStats, setHustlerStats] = useState(); @@ -90,7 +90,11 @@ export const HustlerProfile = observer(() => { - + {/* + + */} + +