mirror of
https://github.com/swarm-game/swarm.git
synced 2025-01-08 09:20:30 +03:00
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:
parent
a94ab9d97c
commit
778ba71079
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user