Grant achievement for crafting a bitcoin (#1688)

Grant `CraftedBitcoin` achievement when using the `make` command to craft a `bitcoin`,  not in creative mode, and not a system robot.

Towards #1435 .
This commit is contained in:
Brent Yorgey 2024-01-13 16:43:52 -06:00 committed by GitHub
parent a94ab9d97c
commit 778ba71079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -382,6 +382,7 @@ execConst runChildProg c vs s k = do
[VText name] -> do [VText name] -> do
inv <- use robotInventory inv <- use robotInventory
ins <- use equippedDevices ins <- use equippedDevices
sys <- use systemRobot
em <- use $ landscape . entityMap em <- use $ landscape . entityMap
e <- e <-
lookupEntityName name em lookupEntityName name em
@ -423,6 +424,9 @@ execConst runChildProg c vs s k = do
-- take recipe inputs from inventory and add outputs after recipeTime -- take recipe inputs from inventory and add outputs after recipeTime
robotInventory .= invTaken robotInventory .= invTaken
traverse_ (updateDiscoveredEntities . snd) (recipe ^. recipeOutputs) traverse_ (updateDiscoveredEntities . snd) (recipe ^. recipeOutputs)
-- Grant CraftedBitcoin achievement
when (name == "bitcoin" && not creative && not sys) $ grantAchievement CraftedBitcoin
finishCookingRecipe recipe VUnit [] (map (uncurry AddEntity) changeInv) finishCookingRecipe recipe VUnit [] (map (uncurry AddEntity) changeInv)
_ -> badConst _ -> badConst
Has -> case vs of Has -> case vs of