From bd1da23cf18960b36f8683c09899044d64b4bd83 Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 21 May 2020 12:25:36 +0200 Subject: made Talk its own component/system instead of part of interact --- content/encyclopediae/default_encyclopedia.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content') diff --git a/content/encyclopediae/default_encyclopedia.json b/content/encyclopediae/default_encyclopedia.json index 18cf967..fdaa42f 100644 --- a/content/encyclopediae/default_encyclopedia.json +++ b/content/encyclopediae/default_encyclopedia.json @@ -22,7 +22,7 @@ "arguments": [["health", "int", 100]], "components": [ ["Health", {"health": ["arg", "health"], "maxhealth": 100}], - ["Loot", {"loot": ["list", [{"type": "stone"}]]}] + ["Loot", {"loot": ["list", [["list", [{"type": "stone"}, 1.0]]]]}] ], "sprite": "builtwall", "height": 2, @@ -87,7 +87,7 @@ "height": 1, "flags": ["Occupied"], "components": [ - ["Interactable", {"action": ["interaction", ["say", "Good morning there, World"]]}] + ["Talkable", {"text": "Good morning there, World"}] ] }, "quarry": { -- cgit From f47034bdf86e7ddc831ecb8f50689b9b07a0f6ca Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 21 May 2020 12:45:44 +0200 Subject: actually added talk system and removed reply interaction --- content/encyclopediae/npcs.json | 2 +- content/maps/room.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'content') diff --git a/content/encyclopediae/npcs.json b/content/encyclopediae/npcs.json index bfaa6fe..4b8fd39 100644 --- a/content/encyclopediae/npcs.json +++ b/content/encyclopediae/npcs.json @@ -79,7 +79,7 @@ "height": 1.5, "flags": ["Occupied"], "components": [ - ["Interactable", {"action": ["interaction", ["reply", "did you say '{}'?"]]}] + ["Talkable", {"text": "Hey there, welcome to Asciifarm"}] ] }, "trader": { diff --git a/content/maps/room.json b/content/maps/room.json index 74cfcc0..173f79e 100644 --- a/content/maps/room.json +++ b/content/maps/room.json @@ -13,7 +13,7 @@ " ~~,,,,.,,,,,,,,,,,~~~,,,,,,,,,,,,,,,,,,,,X", " X,,,,,.,,,,,,,,,,,~~~~,,,,,,T,,,,,,,,,,,,X", " X,,,,,.,,,,,,,,,,,,~~~,,,,,,,,,,,,,,,,,,,X", - " X,,,,,.,,,,,,,,,,,,~~~,,,,,T,,,,######,,,X", + " X,,,,,.,u,,,,,,,,,,~~~,,,,,T,,,,######,,,X", " X,,,,,.,,,,,,,,,,,,bbb,,,,,,,,,,#++++#,,,X", " X,,,t..............bbb..........D++++#,,,X", " X,,,,,.,,,,,,,,,,,,bbb,,,,,,,,,,#++++#,,,X", @@ -52,7 +52,6 @@ "u": ["ground", "dude"], "t": ["ground", "trader"], "P": ["ground", "pickaxe"], - "u": ["ground", "radishes"], "Q": "quarry", " ": [] } -- cgit From 1899b27b791734a6b72e28cfb1420536c6035ee4 Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 21 May 2020 15:26:12 +0200 Subject: added exchanger as seperate component/system; refactored other interactions; parameter parsing returns result instead of option --- content/encyclopediae/npcs.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'content') diff --git a/content/encyclopediae/npcs.json b/content/encyclopediae/npcs.json index 4b8fd39..78dda29 100644 --- a/content/encyclopediae/npcs.json +++ b/content/encyclopediae/npcs.json @@ -86,11 +86,14 @@ "sprite": "human", "height": 1.5, "components": [ - ["Interactable", {"action": ["interaction", ["exchange", ["buy ", { - "pebble": [["radish", "radish"], ["pebble"]], - "radishseed": [["radish"], ["radishseed", "radishseed"]], - "carrotseed": [["radish"], ["carrotseed"]] - }]]]}] + ["Exchanger", { + "prefix": "buy", + "exchanges": ["list", [ + ["list", ["pebble", ["list", ["radish", "radish"]], ["list", ["pebble"]]]], + ["list", ["radishseed", ["list", ["radish"]], ["list", ["radishseed", "radishseed"]]]], + ["list", ["carrotseed", ["list", ["radish"]], ["list", ["carrotseed"]]]] + ]] + }] ] } } -- cgit From 5eda37efbd1b34851364923069c0c3effdc32ca8 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 20 Sep 2020 23:33:13 +0200 Subject: create interactions from parameter instead of json --- content/encyclopediae/crops.json | 4 ++-- content/encyclopediae/default_encyclopedia.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'content') diff --git a/content/encyclopediae/crops.json b/content/encyclopediae/crops.json index 2d2b5ce..29901d9 100644 --- a/content/encyclopediae/crops.json +++ b/content/encyclopediae/crops.json @@ -5,7 +5,7 @@ "name": "radishplant", "height": 0.5, "components": [ - ["Interactable", {"action": ["interaction", ["trigger", "die"]]}], + ["Interactable", {"typ": "trigger", "arg": "die"}], ["Loot", {"loot": ["list", [ ["list", [{"type": "radishseed"}, 0.92]], ["list", [{"type": "radishseed"}, 0.20]], @@ -136,7 +136,7 @@ "name": "carrotplant", "height": 1.0, "components": [ - ["Interactable", {"action": ["interaction", ["trigger", "die"]]}], + ["Interactable", {"typ": "trigger", "arg": "die"}], ["Loot", {"loot": ["list", [ ["list", [{"type": "carrotseed"}, 1.0]], ["list", [{"type": "carrot"}, 1.0]] diff --git a/content/encyclopediae/default_encyclopedia.json b/content/encyclopediae/default_encyclopedia.json index fdaa42f..9a9b526 100644 --- a/content/encyclopediae/default_encyclopedia.json +++ b/content/encyclopediae/default_encyclopedia.json @@ -12,7 +12,7 @@ "extract": {"allowed": ["Whitelist", "allowed"], "dedup_priority": ["Dedup", "priority"]}, "components": [ ["RoomExit", {"destination": "_home+{player}", "dest_pos": ""}], - ["Interactable", {"action": ["interaction", ["visit", "_home+{player}"]]}], + ["Interactable", {"typ": "visit", "arg": "_home+{player}"}], ["Whitelist", {"allowed": ["arg", "allowed"]}], ["Dedup", {"id": ["arg", "dedup_id"], "priority": ["arg", "dedup_priority"]}] ], @@ -69,7 +69,7 @@ "height": 2, "flags": ["Blocking"], "components": [ - ["Interactable", {"action": ["interaction", ["trigger", "change"]]}], + ["Interactable", {"typ": "trigger", "arg": "change"}], ["Build", {"obj": {"type": "opendoor", "save": false}}] ] }, @@ -78,7 +78,7 @@ "height": 0.8, "flags": ["Occupied"], "components": [ - ["Interactable", {"action": ["interaction", ["trigger", "change"]]}], + ["Interactable", {"typ": "trigger", "arg": "change"}], ["Build", {"obj": {"type": "closeddoor", "save": false}}] ] }, @@ -94,7 +94,7 @@ "sprite": "quarry", "height": 2, "components": [ - ["Interactable", {"action": ["interaction", ["mine", "mining"]]}], + ["Interactable", {"typ": "mine", "arg": "mining"}], ["Minable", {"total": 20, "trigger": "loot"}], ["Loot", {"loot": ["list", [ ["list", [{"type": "stone"}, 1.0]] -- cgit From 92e437e50498f7705e33a556535ba39a2b918f9d Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 21 Sep 2020 00:59:38 +0200 Subject: made talk and reply a form of interact again --- content/encyclopediae/default_encyclopedia.json | 2 +- content/encyclopediae/npcs.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'content') diff --git a/content/encyclopediae/default_encyclopedia.json b/content/encyclopediae/default_encyclopedia.json index 9a9b526..d4f7094 100644 --- a/content/encyclopediae/default_encyclopedia.json +++ b/content/encyclopediae/default_encyclopedia.json @@ -87,7 +87,7 @@ "height": 1, "flags": ["Occupied"], "components": [ - ["Talkable", {"text": "Good morning there, World"}] + ["Interactable", {"typ": "say", "arg": "Good morning there, World"}] ] }, "quarry": { diff --git a/content/encyclopediae/npcs.json b/content/encyclopediae/npcs.json index 78dda29..661c80d 100644 --- a/content/encyclopediae/npcs.json +++ b/content/encyclopediae/npcs.json @@ -79,7 +79,7 @@ "height": 1.5, "flags": ["Occupied"], "components": [ - ["Talkable", {"text": "Hey there, welcome to Asciifarm"}] + ["Interactable", {"typ": "say", "arg": "Hey there, welcome to Asciifarm"}] ] }, "trader": { -- cgit From e2281d8c6293b311ccc187e3503093a1120e6215 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 21 Sep 2020 02:32:22 +0200 Subject: exchange is now an interaction again --- content/encyclopediae/npcs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'content') diff --git a/content/encyclopediae/npcs.json b/content/encyclopediae/npcs.json index 661c80d..00c45d6 100644 --- a/content/encyclopediae/npcs.json +++ b/content/encyclopediae/npcs.json @@ -86,14 +86,14 @@ "sprite": "human", "height": 1.5, "components": [ - ["Exchanger", { - "prefix": "buy", - "exchanges": ["list", [ + ["Interactable", {"typ": "exchange", "arg": ["list", [ + "buy ", + ["list", [ ["list", ["pebble", ["list", ["radish", "radish"]], ["list", ["pebble"]]]], ["list", ["radishseed", ["list", ["radish"]], ["list", ["radishseed", "radishseed"]]]], ["list", ["carrotseed", ["list", ["radish"]], ["list", ["carrotseed"]]]] ]] - }] + ]]}] ] } } -- cgit