mirror of
https://github.com/swarm-game/swarm.git
synced 2025-01-07 16:55:59 +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
|
||||
inv <- use robotInventory
|
||||
ins <- use equippedDevices
|
||||
sys <- use systemRobot
|
||||
em <- use $ landscape . entityMap
|
||||
e <-
|
||||
lookupEntityName name em
|
||||
@ -423,6 +424,9 @@ execConst runChildProg c vs s k = do
|
||||
-- take recipe inputs from inventory and add outputs after recipeTime
|
||||
robotInventory .= invTaken
|
||||
traverse_ (updateDiscoveredEntities . snd) (recipe ^. recipeOutputs)
|
||||
-- Grant CraftedBitcoin achievement
|
||||
when (name == "bitcoin" && not creative && not sys) $ grantAchievement CraftedBitcoin
|
||||
|
||||
finishCookingRecipe recipe VUnit [] (map (uncurry AddEntity) changeInv)
|
||||
_ -> badConst
|
||||
Has -> case vs of
|
||||
|
Loading…
Reference in New Issue
Block a user