diff --git a/items/rpg_demo/branch_bundle.png b/items/rpg_demo/branch_bundle.png new file mode 100644 index 0000000..e9682ef Binary files /dev/null and b/items/rpg_demo/branch_bundle.png differ diff --git a/items/rpg_demo/forest_mushroom.png b/items/rpg_demo/forest_mushroom.png new file mode 100644 index 0000000..1ee16ea Binary files /dev/null and b/items/rpg_demo/forest_mushroom.png differ diff --git a/items/rpg_demo/healing_elixir.png b/items/rpg_demo/healing_elixir.png new file mode 100644 index 0000000..a24a1c3 Binary files /dev/null and b/items/rpg_demo/healing_elixir.png differ diff --git a/items/rpg_demo/items.json b/items/rpg_demo/items.json new file mode 100644 index 0000000..9772d14 --- /dev/null +++ b/items/rpg_demo/items.json @@ -0,0 +1,44 @@ +{ + "Kind": "item", + "Items": [ + { + "Id": "rpg_demo/branches", + "Name": "rpg_demo/item/branches/name", + "Description": "rpg_demo/item/branches/desc", + "Cost": 1, + "Sprite": "rpg_demo/branch_bundle", + "ItemType": "Resource", + "ItemAction": "null" + }, + { + "Id": "rpg_demo/stones", + "Name": "rpg_demo/item/stones/name", + "Description": "rpg_demo/item/stones/desc", + "Cost": 2, + "Sprite": "rpg_demo/stone_pile", + "ItemType": "Resource", + "ItemAction": "null" + }, + { + "Id": "rpg_demo/mushroom", + "Name": "rpg_demo/item/mushroom/name", + "Description": "rpg_demo/item/mushroom/desc", + "Cost": 2, + "Sprite": "rpg_demo/forest_mushroom", + "ItemType": "Food,TargetUsed", + "ItemAction": "action/heal", + "heal": 5, + "verb": "ui/inventory/verb_eat" + }, + { + "Id": "rpg_demo/elixir", + "Name": "rpg_demo/item/elixir/name", + "Description": "rpg_demo/item/elixir/desc", + "Cost": 10, + "Sprite": "rpg_demo/healing_elixir", + "ItemType": "TargetUsed", + "ItemAction": "action/heal", + "heal": 20 + } + ] +} diff --git a/items/rpg_demo/stone_pile.png b/items/rpg_demo/stone_pile.png new file mode 100644 index 0000000..913edb0 Binary files /dev/null and b/items/rpg_demo/stone_pile.png differ diff --git a/locale/en.properties b/locale/en.properties index 34ce4d0..b8dce53 100644 --- a/locale/en.properties +++ b/locale/en.properties @@ -6,3 +6,12 @@ rpg_demo/map/forest = Grey Forest rpg_demo/character/hero = Hero rpg_demo/character/slime = Slime rpg_demo/character/wolf = Wolf +rpg_demo/item/branches/name = Brushwood +rpg_demo/item/branches/desc = Dry branches from the Grey Forest. Junk, but the merchant pays a coin per armful. +rpg_demo/item/stones/name = Stones +rpg_demo/item/stones/desc = Smooth forest stones. For some reason the merchant buys them at two coins each. +rpg_demo/item/mushroom/name = Forest mushroom +rpg_demo/item/mushroom/desc = An edible mushroom. Restores 5 health. +rpg_demo/item/elixir/name = Elixir +rpg_demo/item/elixir/desc = A red healing elixir from the village shop. Restores 20 health. +rpg_demo/shop/village_merchant = Merchant's shop diff --git a/locale/ru.properties b/locale/ru.properties index 18c7567..5104602 100644 --- a/locale/ru.properties +++ b/locale/ru.properties @@ -6,3 +6,12 @@ rpg_demo/map/forest = Серый лес rpg_demo/character/hero = Герой rpg_demo/character/slime = Слизень rpg_demo/character/wolf = Волк +rpg_demo/item/branches/name = Хворост +rpg_demo/item/branches/desc = Сухие ветки из Серого леса. Хлам, но торговец платит монету за охапку. +rpg_demo/item/stones/name = Камни +rpg_demo/item/stones/desc = Гладкие лесные камни. Торговец почему-то покупает их по две монеты. +rpg_demo/item/mushroom/name = Лесной гриб +rpg_demo/item/mushroom/desc = Съедобный гриб. Восстанавливает 5 ед. здоровья. +rpg_demo/item/elixir/name = Эликсир +rpg_demo/item/elixir/desc = Красный целебный эликсир из деревенской лавки. Восстанавливает 20 ед. здоровья. +rpg_demo/shop/village_merchant = Лавка торговца diff --git a/locale/scenarios_en.properties b/locale/scenarios_en.properties index b132815..c7ea077 100644 --- a/locale/scenarios_en.properties +++ b/locale/scenarios_en.properties @@ -4,9 +4,9 @@ rpg_demo/elder/quest_2 = "Go east, past the pond, along the path. Drive it off, rpg_demo/elder/thanks_1 = "The wolf is gone? Well, well. I did not believe in you, and you went and ruined it." rpg_demo/elder/thanks_2 = "Off you go. Now you may sleep till noon. Not a minute longer." rpg_demo/chest/forest = A chest in the forest. Inside: dried mushrooms and someone's lost hope. You take the mushrooms. -rpg_demo/chest/house = In the chest: old socks and a note saying "Don't touch". Too late. +rpg_demo/chest/house = In the chest: old socks and a note saying "Don't touch". Too late. Under the socks: three coins. rpg_demo/door/locked = Locked. Behind the door someone is trying very hard to pretend nobody is home. -rpg_demo/merchant/line1 = "The shop is closed. Out of goods, out of conscience. Come back when they bring both." +rpg_demo/merchant/line1 = "Oh, a customer! Elixirs, fresh, hardly any sediment. And bring me the junk from the forest, I take everything. Well, almost." rpg_demo/slime/line1 = A slime blocks the path and gurgles defiantly. rpg_demo/sign/village = "East: the Grey Forest. West: also a forest, but we don't go there." rpg_demo/villager/line1 = "They say there are slimes in the forest. Small ones, but it's insulting when they crawl into your boot." @@ -17,3 +17,6 @@ rpg_demo/forest/enter = The Grey Forest. It is quiet the way it is only quiet wh rpg_demo/intro/title = The Village by the Grey Forest rpg_demo/intro/line1 = Morning. The roosters went hoarse before dawn, and the elder has already sent the boy for you three times. rpg_demo/intro/controls = Walk with WASD or the arrows. Talk, open and read with E or F. +rpg_demo/pickup/branches = An armful of dry brushwood. The merchant in the village will take it, he takes everything. +rpg_demo/pickup/stones = A couple of smooth stones. Useless, which means they are for sale. +rpg_demo/pickup/mushroom = A firm forest mushroom. Eat it and you will feel better. diff --git a/locale/scenarios_ru.properties b/locale/scenarios_ru.properties index 30ef3d1..566eefc 100644 --- a/locale/scenarios_ru.properties +++ b/locale/scenarios_ru.properties @@ -4,9 +4,9 @@ rpg_demo/elder/quest_2 = — Иди на восток, мимо пруда, по rpg_demo/elder/thanks_1 = — Волка нет? Ну надо же. Я в тебя не верил, а ты взял и всё испортил. rpg_demo/elder/thanks_2 = — Ступай. Теперь можешь спать до полудня. Не дольше. rpg_demo/chest/forest = Сундук в лесу. Внутри — сухие грибы и чья-то потерянная надежда. Грибы ты берёшь. -rpg_demo/chest/house = В сундуке — старые носки и записка: «Не трогай». Поздно. +rpg_demo/chest/house = В сундуке — старые носки и записка: «Не трогай». Поздно. Под носками — три монеты. rpg_demo/door/locked = Заперто. За дверью кто-то очень старательно делает вид, что его нет. -rpg_demo/merchant/line1 = — Лавка закрыта. Товар закончился, совесть тоже. Приходи, когда привезут и то, и другое. +rpg_demo/merchant/line1 = — О, покупатель! Эликсиры — свежие, почти без осадка. А хлам из леса — неси, всё возьму. Ну, почти всё. rpg_demo/slime/line1 = Слизень перегородил тропу и булькает с вызовом. rpg_demo/sign/village = «На восток — Серый лес. На запад — тоже лес, но мы туда не ходим». rpg_demo/villager/line1 = — Говорят, в лесу слизни. Мелкие, а обидно, когда в сапог заползают. @@ -17,3 +17,6 @@ rpg_demo/forest/enter = Серый лес. Здесь тихо так, как б rpg_demo/intro/title = Деревня у Серого леса rpg_demo/intro/line1 = Утро. Петухи охрипли ещё до рассвета, а староста уже трижды присылал за тобой мальчишку. rpg_demo/intro/controls = Ходить — WASD или стрелки. Говорить, открывать, читать — E или F. +rpg_demo/pickup/branches = Охапка сухого хвороста. Торговцу в деревне сгодится — он всё берёт. +rpg_demo/pickup/stones = Пара гладких камней. Бесполезных, а значит — на продажу. +rpg_demo/pickup/mushroom = Крепкий лесной гриб. Съешь — и полегчает. diff --git a/manifest.json b/manifest.json index e48a6fc..0a22c77 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "RPG Demo", "version": "1.0.0", "author": "ct", - "description": "Content of the RPG demo (collection rpg_demo): a village, the elder's house and a forest with a wolf at the cave, made of rpg_map files over the village_pack tileset. Shows teleports, talking NPCs, events that change with story flags, chests, a map monster with a win flag and random encounters in the forest. Only data and scenarios, no C#.", + "description": "Content of the RPG demo (collection rpg_demo): a village, the elder's house and a forest with a wolf at the cave, made of rpg_map files over the village_pack tileset. Shows teleports, talking NPCs, events that change with story flags, chests, things to gather in the forest (brushwood, stones, mushrooms that heal), a merchant who sells elixirs and buys the junk, a map monster with a win flag and random encounters in the forest. Only data and scenarios, no C#.", "category": "story", - "depends": ["rpg>=1", "village_pack>=1", "characters_base>=1", "dialog_base>=1"] + "depends": ["rpg>=1", "village_pack>=1", "characters_base>=1", "dialog_base>=1", "items_base>=1", "trading>=1"] } diff --git a/maps/rpg_forest.json b/maps/rpg_forest.json index 2a519cf..37a9f7f 100644 --- a/maps/rpg_forest.json +++ b/maps/rpg_forest.json @@ -140,6 +140,216 @@ "Sprite": "village/slime", "Scenario": "rpg_demo/events/slime", "Condition": "rpg_path_slime != 1" + }, + { + "Id": "pick_branches_1", + "X": 6, + "Y": 5, + "Tile": 32, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_branches", + "Commands": [ + "flag rpg_pick_branches_1 1", + "end" + ], + "Condition": "rpg_pick_branches_1 != 1" + }, + { + "Id": "pick_branches_2", + "X": 9, + "Y": 2, + "Tile": 32, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_branches", + "Commands": [ + "flag rpg_pick_branches_2 1", + "end" + ], + "Condition": "rpg_pick_branches_2 != 1" + }, + { + "Id": "pick_branches_3", + "X": 20, + "Y": 6, + "Tile": 32, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_branches", + "Commands": [ + "flag rpg_pick_branches_3 1", + "end" + ], + "Condition": "rpg_pick_branches_3 != 1" + }, + { + "Id": "pick_branches_4", + "X": 12, + "Y": 12, + "Tile": 32, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_branches", + "Commands": [ + "flag rpg_pick_branches_4 1", + "end" + ], + "Condition": "rpg_pick_branches_4 != 1" + }, + { + "Id": "pick_branches_5", + "X": 23, + "Y": 14, + "Tile": 32, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_branches", + "Commands": [ + "flag rpg_pick_branches_5 1", + "end" + ], + "Condition": "rpg_pick_branches_5 != 1" + }, + { + "Id": "pick_stones_1", + "X": 11, + "Y": 3, + "Tile": 33, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_stones", + "Commands": [ + "flag rpg_pick_stones_1 1", + "end" + ], + "Condition": "rpg_pick_stones_1 != 1" + }, + { + "Id": "pick_stones_2", + "X": 21, + "Y": 7, + "Tile": 33, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_stones", + "Commands": [ + "flag rpg_pick_stones_2 1", + "end" + ], + "Condition": "rpg_pick_stones_2 != 1" + }, + { + "Id": "pick_stones_3", + "X": 24, + "Y": 12, + "Tile": 33, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_stones", + "Commands": [ + "flag rpg_pick_stones_3 1", + "end" + ], + "Condition": "rpg_pick_stones_3 != 1" + }, + { + "Id": "pick_stones_4", + "X": 26, + "Y": 15, + "Tile": 33, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_stones", + "Commands": [ + "flag rpg_pick_stones_4 1", + "end" + ], + "Condition": "rpg_pick_stones_4 != 1" + }, + { + "Id": "pick_stones_5", + "X": 14, + "Y": 9, + "Tile": 33, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_stones", + "Commands": [ + "flag rpg_pick_stones_5 1", + "end" + ], + "Condition": "rpg_pick_stones_5 != 1" + }, + { + "Id": "pick_mushroom_1", + "X": 10, + "Y": 3, + "Tile": 34, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_mushroom", + "Commands": [ + "flag rpg_pick_mushroom_1 1", + "end" + ], + "Condition": "rpg_pick_mushroom_1 != 1" + }, + { + "Id": "pick_mushroom_2", + "X": 23, + "Y": 7, + "Tile": 34, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_mushroom", + "Commands": [ + "flag rpg_pick_mushroom_2 1", + "end" + ], + "Condition": "rpg_pick_mushroom_2 != 1" + }, + { + "Id": "pick_mushroom_3", + "X": 21, + "Y": 14, + "Tile": 34, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_mushroom", + "Commands": [ + "flag rpg_pick_mushroom_3 1", + "end" + ], + "Condition": "rpg_pick_mushroom_3 != 1" + }, + { + "Id": "pick_mushroom_4", + "X": 2, + "Y": 13, + "Tile": 34, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_mushroom", + "Commands": [ + "flag rpg_pick_mushroom_4 1", + "end" + ], + "Condition": "rpg_pick_mushroom_4 != 1" + }, + { + "Id": "pick_mushroom_5", + "X": 20, + "Y": 5, + "Tile": 34, + "Trigger": "Touch", + "Solid": false, + "Scenario": "rpg_demo/events/pick_mushroom", + "Commands": [ + "flag rpg_pick_mushroom_5 1", + "end" + ], + "Condition": "rpg_pick_mushroom_5 != 1" } ], "Encounters": { diff --git a/mod.jpg b/mod.jpg new file mode 100644 index 0000000..1cd6368 Binary files /dev/null and b/mod.jpg differ diff --git a/mod.png b/mod.png deleted file mode 100644 index 335c077..0000000 Binary files a/mod.png and /dev/null differ diff --git a/scenarios/rpg_demo/events/forest_chest.scenario b/scenarios/rpg_demo/events/forest_chest.scenario index 4b57866..00bb66f 100644 --- a/scenarios/rpg_demo/events/forest_chest.scenario +++ b/scenarios/rpg_demo/events/forest_chest.scenario @@ -1,3 +1,4 @@ ptext "Сундук в лесу. Внутри — сухие грибы и чья-то потерянная надежда. Грибы ты берёшь." key=rpg_demo/chest/forest +action item.add id=rpg_demo/mushroom count=3 flag rpg_forest_chest 1 end diff --git a/scenarios/rpg_demo/events/house_chest.scenario b/scenarios/rpg_demo/events/house_chest.scenario index c046447..76b9787 100644 --- a/scenarios/rpg_demo/events/house_chest.scenario +++ b/scenarios/rpg_demo/events/house_chest.scenario @@ -1,3 +1,4 @@ -ptext "В сундуке — старые носки и записка: «Не трогай». Поздно." key=rpg_demo/chest/house +ptext "В сундуке — старые носки и записка: «Не трогай». Поздно. Под носками — три монеты." key=rpg_demo/chest/house +action item.add id=money/coin count=3 flag rpg_house_chest 1 end diff --git a/scenarios/rpg_demo/events/merchant.scenario b/scenarios/rpg_demo/events/merchant.scenario index eccfec4..e66fb13 100644 --- a/scenarios/rpg_demo/events/merchant.scenario +++ b/scenarios/rpg_demo/events/merchant.scenario @@ -1,2 +1,3 @@ -text "— Лавка закрыта. Товар закончился, совесть тоже. Приходи, когда привезут и то, и другое." key=rpg_demo/merchant/line1 +text "— О, покупатель! Эликсиры — свежие, почти без осадка. А хлам из леса — неси, всё возьму. Ну, почти всё." key=rpg_demo/merchant/line1 +action trade.open shop=rpg_demo/village_merchant end diff --git a/scenarios/rpg_demo/events/pick_branches.scenario b/scenarios/rpg_demo/events/pick_branches.scenario new file mode 100644 index 0000000..6acf2ca --- /dev/null +++ b/scenarios/rpg_demo/events/pick_branches.scenario @@ -0,0 +1,2 @@ +ptext "Охапка сухого хвороста. Торговцу в деревне сгодится — он всё берёт." key=rpg_demo/pickup/branches +action item.add id=rpg_demo/branches count=2 diff --git a/scenarios/rpg_demo/events/pick_mushroom.scenario b/scenarios/rpg_demo/events/pick_mushroom.scenario new file mode 100644 index 0000000..5da2e7b --- /dev/null +++ b/scenarios/rpg_demo/events/pick_mushroom.scenario @@ -0,0 +1,2 @@ +ptext "Крепкий лесной гриб. Съешь — и полегчает." key=rpg_demo/pickup/mushroom +action item.add id=rpg_demo/mushroom diff --git a/scenarios/rpg_demo/events/pick_stones.scenario b/scenarios/rpg_demo/events/pick_stones.scenario new file mode 100644 index 0000000..6c3d40d --- /dev/null +++ b/scenarios/rpg_demo/events/pick_stones.scenario @@ -0,0 +1,2 @@ +ptext "Пара гладких камней. Бесполезных, а значит — на продажу." key=rpg_demo/pickup/stones +action item.add id=rpg_demo/stones count=2 diff --git a/shops/village_merchant.json b/shops/village_merchant.json new file mode 100644 index 0000000..805efe1 --- /dev/null +++ b/shops/village_merchant.json @@ -0,0 +1,16 @@ +{ + "Kind": "shop", + "Items": [ + { + "Id": "rpg_demo/village_merchant", + "Name": "rpg_demo/shop/village_merchant", + "Sells": [ + { "Item": "rpg_demo/elixir", "Price": 10 } + ], + "Buys": [ + { "Item": "rpg_demo/branches", "Price": 1 }, + { "Item": "rpg_demo/stones", "Price": 2 } + ] + } + ] +}