From 347b6525e596ca59e825476c94945691b14d5cfb Mon Sep 17 00:00:00 2001 From: Eila Attwood Date: Fri, 7 Feb 2020 09:41:48 +0200 Subject: [PATCH 1/5] Converting multi-cooker to another item when filled with dish. To prevent other crafting processes to touch it when it is cooking. --- data/json/items/tool/cooking.json | 9 +++++++++ src/iuse.cpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/data/json/items/tool/cooking.json b/data/json/items/tool/cooking.json index 72f6b8aceab42..6322d118886e8 100644 --- a/data/json/items/tool/cooking.json +++ b/data/json/items/tool/cooking.json @@ -663,6 +663,15 @@ ], "magazine_well": 2 }, + { + "id": "multi_cooker_filled", + "type": "TOOL", + "copy-from": "multi_cooker", + "name": { "str": "multi cooker - cooking" }, + "description": "A professional-grade multi-cooker, with a battery slot for camping trips or tailgating. There is a dish in it.", + "//": "Don't know how to force it to lose qualities. Specifying empty array here seems not to work.", + "qualities": [ ] + }, { "id": "oil_cooker", "type": "TOOL", diff --git a/src/iuse.cpp b/src/iuse.cpp index d9bfb3f1e4a54..714fc32afccaa 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -8682,7 +8682,7 @@ int iuse::multicooker( player *p, item *it, bool t, const tripoint &pos ) it->contents.erase( dish_it ); it->erase_var( "RECIPE" ); - + it->convert( "multi_cooker" ); if( is_delicious ) { p->add_msg_if_player( m_good, _( "You got the dish from the multi-cooker. The %s smells delicious." ), @@ -8764,7 +8764,7 @@ int iuse::multicooker( player *p, item *it, bool t, const tripoint &pos ) p->add_msg_if_player( m_good, _( "The screen flashes blue symbols and scales as the multi-cooker begins to shake." ) ); - it->active = true; + it->convert( "multi_cooker_filled" ).active = true; it->ammo_consume( charges_to_start, pos ); p->practice( skill_cooking, meal->difficulty * 3 ); //little bonus From 8b3db71c0ad526ff81a79126491b01492684eb17 Mon Sep 17 00:00:00 2001 From: Eila Attwood Date: Fri, 7 Feb 2020 09:51:46 +0200 Subject: [PATCH 2/5] lint json --- data/json/items/tool/cooking.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/tool/cooking.json b/data/json/items/tool/cooking.json index 6322d118886e8..7d0fb9c8cacbb 100644 --- a/data/json/items/tool/cooking.json +++ b/data/json/items/tool/cooking.json @@ -670,7 +670,7 @@ "name": { "str": "multi cooker - cooking" }, "description": "A professional-grade multi-cooker, with a battery slot for camping trips or tailgating. There is a dish in it.", "//": "Don't know how to force it to lose qualities. Specifying empty array here seems not to work.", - "qualities": [ ] + "qualities": [ ] }, { "id": "oil_cooker", From 1f46385d9615be1e1502a92413c4baa51fcd7edc Mon Sep 17 00:00:00 2001 From: Eila Attwood Date: Fri, 7 Feb 2020 15:15:31 +0200 Subject: [PATCH 3/5] Replaced copy-from with full definition. --- data/json/items/tool/cooking.json | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/data/json/items/tool/cooking.json b/data/json/items/tool/cooking.json index 7d0fb9c8cacbb..904a8da70aba3 100644 --- a/data/json/items/tool/cooking.json +++ b/data/json/items/tool/cooking.json @@ -666,11 +666,26 @@ { "id": "multi_cooker_filled", "type": "TOOL", - "copy-from": "multi_cooker", "name": { "str": "multi cooker - cooking" }, "description": "A professional-grade multi-cooker, with a battery slot for camping trips or tailgating. There is a dish in it.", - "//": "Don't know how to force it to lose qualities. Specifying empty array here seems not to work.", - "qualities": [ ] + "weight": "11339 g", + "volume": "3750 ml", + "price": 20000, + "to_hit": -3, + "material": [ "steel", "plastic" ], + "symbol": ";", + "color": "red", + "ammo": "battery", + "power_draw": 1500000, + "use_action": "MULTICOOKER", + "magazines": [ + [ + "battery", + [ "medium_battery_cell", "medium_plus_battery_cell", "medium_atomic_battery_cell", "medium_disposable_cell" ] + ] + ], + "magazine_well": 2, + "flags": [ "TRADER_AVOID" ] }, { "id": "oil_cooker", From 54cec83319bfeb39820ed9dee09f4da2ea009cb6 Mon Sep 17 00:00:00 2001 From: ZhilkinSerg Date: Sat, 22 Feb 2020 11:00:34 +0300 Subject: [PATCH 4/5] Use `delete` for item qualities --- data/json/items/tool/cooking.json | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/data/json/items/tool/cooking.json b/data/json/items/tool/cooking.json index 904a8da70aba3..720be84ba0d8f 100644 --- a/data/json/items/tool/cooking.json +++ b/data/json/items/tool/cooking.json @@ -666,26 +666,10 @@ { "id": "multi_cooker_filled", "type": "TOOL", + "copy-from": "multi_cooker", "name": { "str": "multi cooker - cooking" }, "description": "A professional-grade multi-cooker, with a battery slot for camping trips or tailgating. There is a dish in it.", - "weight": "11339 g", - "volume": "3750 ml", - "price": 20000, - "to_hit": -3, - "material": [ "steel", "plastic" ], - "symbol": ";", - "color": "red", - "ammo": "battery", - "power_draw": 1500000, - "use_action": "MULTICOOKER", - "magazines": [ - [ - "battery", - [ "medium_battery_cell", "medium_plus_battery_cell", "medium_atomic_battery_cell", "medium_disposable_cell" ] - ] - ], - "magazine_well": 2, - "flags": [ "TRADER_AVOID" ] + "delete": { "qualities": [ [ "CONTAIN", 1 ] ] } }, { "id": "oil_cooker", From 33a239670d902a583a2102c2915b4629cbb08381 Mon Sep 17 00:00:00 2001 From: ZhilkinSerg Date: Mon, 24 Feb 2020 10:04:20 +0300 Subject: [PATCH 5/5] Update cooking.json --- data/json/items/tool/cooking.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/tool/cooking.json b/data/json/items/tool/cooking.json index 720be84ba0d8f..bb56d41acebf5 100644 --- a/data/json/items/tool/cooking.json +++ b/data/json/items/tool/cooking.json @@ -668,7 +668,7 @@ "type": "TOOL", "copy-from": "multi_cooker", "name": { "str": "multi cooker - cooking" }, - "description": "A professional-grade multi-cooker, with a battery slot for camping trips or tailgating. There is a dish in it.", + "description": "A professional-grade multi-cooker, with a battery slot for camping trips or tailgating. There is a dish in it.", "delete": { "qualities": [ [ "CONTAIN", 1 ] ] } }, {